Browse Source

Merge remote-tracking branch 'origin/dev_5big_coverage' into dev_5big_coverage

feature/teamB_zz_wgh
sunyuchao 3 years ago
parent
commit
5b6bd91227
  1. 1
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java
  2. 27
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  3. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcCityManagementDao.java
  4. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcDangerousChemicalsDao.java
  5. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcHouseDao.java
  6. 32
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/heart/IcCommunitySelfOrganizationDao.java
  7. 76
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/IcCityManagementEntity.java
  8. 91
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/IcDangerousChemicalsEntity.java
  9. 120
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/IcHouseEntity.java
  10. 115
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/heart/IcCommunitySelfOrganizationEntity.java
  11. 43
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgCoverageService.java
  12. 72
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgCoverageServiceImpl.java
  13. 23
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/heart/HeartService.java
  14. 50
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/heart/impl/HeartServiceImpl.java
  15. 78
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java
  16. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
  17. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcCityManagementDao.xml
  18. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcDangerousChemicalsDao.xml
  19. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcHouseDao.xml
  20. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/heart/IcCommunitySelfOrganizationDao.xml

1
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java

@ -37,4 +37,5 @@ public interface DataSourceConstant {
String EPMET_T_DUCK = "epmettduck";
String EPMETTDUCK="epmettduck";
String EPMET_HEART="heart";
}

27
epmet-module/data-aggregator/data-aggregator-server/pom.xml

@ -242,6 +242,13 @@
<datasource.druid.epmettduck.username>epmet_tduck_user</datasource.druid.epmettduck.username>
<datasource.druid.epmettduck.password>EpmEt-db-UsEr</datasource.druid.epmettduck.password>
<!--heart-->
<datasource.druid.heart.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_heart?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.heart.url>
<datasource.druid.heart.username>epmet_heart_user</datasource.druid.heart.username>
<datasource.druid.heart.password>EpmEt-db-UsEr</datasource.druid.heart.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.140</spring.redis.host>
@ -367,6 +374,12 @@
<datasource.druid.epmettduck.username>epmet_tduck_user</datasource.druid.epmettduck.username>
<datasource.druid.epmettduck.password>EpmEt-db-UsEr</datasource.druid.epmettduck.password>
<datasource.druid.heart.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_heart?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.heart.url>
<datasource.druid.heart.username>epmet_heart_user</datasource.druid.heart.username>
<datasource.druid.heart.password>EpmEt-db-UsEr</datasource.druid.heart.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.140</spring.redis.host>
@ -492,6 +505,13 @@
<datasource.druid.epmettduck.username>epmet</datasource.druid.epmettduck.username>
<datasource.druid.epmettduck.password>elink@833066</datasource.druid.epmettduck.password>
<!--heart-->
<datasource.druid.heart.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_heart?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.heart.url>
<datasource.druid.heart.username>epmet</datasource.druid.heart.username>
<datasource.druid.heart.password>elink@833066</datasource.druid.heart.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.10.150</spring.redis.host>
@ -617,6 +637,13 @@
<datasource.druid.epmettduck.username>epmet_tduck</datasource.druid.epmettduck.username>
<datasource.druid.epmettduck.password>EpmEt-db-UsEr</datasource.druid.epmettduck.password>
<!--heart-->
<datasource.druid.heart.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_heart?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.heart.url>
<datasource.druid.heart.username>epmet_heart_user</datasource.druid.heart.username>
<datasource.druid.heart.password>EpmEt-db-UsEr</datasource.druid.heart.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host>

17
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcCityManagementDao.java

@ -0,0 +1,17 @@
package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.entity.govorg.IcCityManagementEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 城市管理图层
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-16
*/
@Mapper
public interface IcCityManagementDao extends BaseDao<IcCityManagementEntity> {
}

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcDangerousChemicalsDao.java

@ -0,0 +1,15 @@
package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.entity.govorg.IcDangerousChemicalsEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 重点危化品企业
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-16
*/
@Mapper
public interface IcDangerousChemicalsDao extends BaseDao<IcDangerousChemicalsEntity> {
}

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/IcHouseDao.java

@ -0,0 +1,15 @@
package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.entity.govorg.IcHouseEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 房屋信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Mapper
public interface IcHouseDao extends BaseDao<IcHouseEntity> {
}

32
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/heart/IcCommunitySelfOrganizationDao.java

@ -0,0 +1,32 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dao.heart;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.entity.heart.IcCommunitySelfOrganizationEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 社区自组织表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-18
*/
@Mapper
public interface IcCommunitySelfOrganizationDao extends BaseDao<IcCommunitySelfOrganizationEntity> {
}

76
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/IcCityManagementEntity.java

@ -0,0 +1,76 @@
package com.epmet.dataaggre.entity.govorg;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 城市管理图层
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_city_management")
public class IcCityManagementEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 所属组织机构Id
*/
private String agencyId;
/**
* agencyId的所有上级包含自己
*/
private String agencyIdPath;
/**
* 来源新增:add 导入:import
*/
private String sourceType;
/**
* 场所名称
*/
private String name;
/**
* 场所分类字典表ic_coverage_category_dict key:city_management
*/
private String category;
/**
* 占地面积单位平方公里
*/
private String areaCovered;
/**
* 容纳人数
*/
private Integer capacity;
/**
* 地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
}

91
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/IcDangerousChemicalsEntity.java

@ -0,0 +1,91 @@
package com.epmet.dataaggre.entity.govorg;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 重点危化品企业
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_dangerous_chemicals")
public class IcDangerousChemicalsEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 所属组织机构Id
*/
private String agencyId;
/**
* agencyId的所有上级包含自己
*/
private String agencyIdPath;
/**
* 来源新增:add 导入:import
*/
private String sourceType;
/**
* 企业名称
*/
private String name;
/**
* 企业类型字典表ic_coverage_category_dict key:dangerous_chemicals
*/
private String category;
/**
* 周边安全距离单位公里
*/
private String safeDistance;
/**
* 危化品种类字典表 ic_danger_type
*/
private String dangerType;
/**
* 负责人姓名
*/
private String principalName;
/**
* 负责人电话
*/
private String principalMobile;
/**
* 经营地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 备注
*/
private String remark;
}

120
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/IcHouseEntity.java

@ -0,0 +1,120 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.entity.govorg;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 房屋信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_house")
public class IcHouseEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 小区id
*/
private String neighborHoodId;
/**
* 片区idneighbor_hood_part.id,可为空
*/
private String partId;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 所属单元id
*/
private String buildingUnitId;
/**
* 房屋名字后台插入时生成
*/
private String houseName;
/**
* 门牌号
*/
private String doorName;
/**
* 房屋类型这里存储字典value就可以
*/
private String houseType;
/**
* 存储字典value
*/
private String purpose;
/**
* 1出租 0自住 2闲置 3未出售
*/
private Integer rentFlag;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房主身份证号
*/
private String ownerIdCard;
/**
* 排序
*/
private BigDecimal sort;
/**
* 备注
*/
private String remark;
/**
* 房屋编码
*/
private String houseCode;
private String houseQrcodeUrl;
}

115
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/heart/IcCommunitySelfOrganizationEntity.java

@ -0,0 +1,115 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.entity.heart;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 社区自组织表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-18
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_community_self_organization")
public class IcCommunitySelfOrganizationEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String orgId;
/**
* 组织类型agency组织grid网格
*/
private String orgType;
/**
* 组织ID的父级
*/
private String pid;
/**
* org_id的所有上级
*/
private String pids;
/**
* 组织名称
*/
private String organizationName;
/**
* 分类来源于字典表dictType=self_org_category;
*/
private String categoryCode;
/**
* 组织人数
*/
private Integer organizationPersonCount;
/**
* 负责人姓名
*/
private String principalName;
/**
* 负责人电话
*/
private String principalPhone;
/**
* 服务事项
*/
private String serviceItem;
/**
* 社区自组织创建时间
*/
private Date organizationCreatedTime;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 备注
*/
private String remark;
}

43
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgCoverageService.java

@ -1,5 +1,9 @@
package com.epmet.dataaggre.service.govorg;
import com.epmet.dataaggre.entity.govorg.IcCityManagementEntity;
import com.epmet.dataaggre.entity.govorg.IcDangerousChemicalsEntity;
import com.epmet.dataaggre.entity.govorg.IcHouseEntity;
import com.epmet.dataaggre.entity.heart.IcCommunitySelfOrganizationEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -35,4 +39,43 @@ public interface GovOrgCoverageService {
* @return
*/
Map<String, List<CategoryCoverageMapping>> getMappingRelationByCoverageType(List<String> coverageTypes);
/**
* 搜索城市资源
* @param customerId
* @param agencyIdPath 查询人所属的组织ID路径包含他本身所在的组织
* @param search 关键词名称
* @param isPage
* @param pageNo
* @param pageSize
* @return
*/
List<IcCityManagementEntity> searchCityResourceEntities(String customerId, String agencyIdPath, String search, Boolean isPage,
Integer pageNo, Integer pageSize);
/**
* 搜索危化企业列表
* @param customerId
* @param agencyIdPath 查询人所属的组织ID路径包含他本身所在的组织
* @param search 关键词名称
* @param isPage
* @param pageNo
* @param pageSize
* @return
*/
List<IcDangerousChemicalsEntity> searchDangerousChemicalEntities(String customerId, String agencyIdPath, String search, Boolean isPage,
Integer pageNo, Integer pageSize);
/**
* 搜索群租房列表
* @param customerId
* @param agencyIdPath 查询人所属的组织ID路径包含他本身所在的组织
* @param search
* @param isPage
* @param pageNo
* @param pageSize
* @return
*/
List<IcHouseEntity> searchGroupRentHouseEntities(String customerId, String agencyIdPath, String search, Boolean isPage,
Integer pageNo, Integer pageSize);
}

72
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgCoverageServiceImpl.java

@ -3,9 +3,17 @@ package com.epmet.dataaggre.service.govorg.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.govorg.IcCityManagementDao;
import com.epmet.dataaggre.dao.govorg.IcCoverageCategoryDictDao;
import com.epmet.dataaggre.dao.govorg.IcDangerousChemicalsDao;
import com.epmet.dataaggre.dao.govorg.IcHouseDao;
import com.epmet.dataaggre.entity.govorg.IcCityManagementEntity;
import com.epmet.dataaggre.entity.govorg.IcCoverageCategoryDictEntity;
import com.epmet.dataaggre.entity.govorg.IcDangerousChemicalsEntity;
import com.epmet.dataaggre.entity.govorg.IcHouseEntity;
import com.epmet.dataaggre.service.govorg.GovOrgCoverageService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -21,6 +29,15 @@ public class GovOrgCoverageServiceImpl implements GovOrgCoverageService {
@Autowired
private IcCoverageCategoryDictDao coverageCategoryDictDao;
@Autowired
private IcCityManagementDao cityManagementDao;
@Autowired
private IcDangerousChemicalsDao dangerousChemicalsDao;
@Autowired
private IcHouseDao icHouseDao;
/**
* 根据categoryKeys分类key列表查询他们和图层时间的关系映射为一个map
* @param categoryKeys
@ -63,4 +80,59 @@ public class GovOrgCoverageServiceImpl implements GovOrgCoverageService {
}
return mapping;
}
/**
* 搜索城市资源
* @param customerId
* @param agencyIdPath 查询人所属的组织ID路径包含他本身所在的组织
* @param search 关键词名称
* @param isPage
* @param pageNo
* @param pageSize
* @return
*/
@Override
public List<IcCityManagementEntity> searchCityResourceEntities(String customerId, String agencyIdPath, String search, Boolean isPage, Integer pageNo, Integer pageSize) {
LambdaQueryWrapper<IcCityManagementEntity> query = new LambdaQueryWrapper<>();
query.eq(IcCityManagementEntity::getCustomerId, customerId);
query.likeRight(IcCityManagementEntity::getAgencyIdPath, agencyIdPath);
if (StringUtils.isNotBlank(search)) {
query.like(IcCityManagementEntity::getName, search);
}
if (isPage) {
PageHelper.startPage(pageNo ,pageSize);
}
return cityManagementDao.selectList(query);
}
/**
* 搜索危化企业列表
* @param customerId
* @param agencyIdPath 查询人所属的组织ID路径包含他本身所在的组织
* @param search 关键词名称
* @param isPage
* @param pageNo
* @param pageSize
* @return
*/
@Override
public List<IcDangerousChemicalsEntity> searchDangerousChemicalEntities(String customerId, String agencyIdPath, String search, Boolean isPage, Integer pageNo, Integer pageSize) {
LambdaQueryWrapper<IcDangerousChemicalsEntity> query = new LambdaQueryWrapper<>();
query.eq(IcDangerousChemicalsEntity::getCustomerId, customerId);
query.likeRight(IcDangerousChemicalsEntity::getAgencyIdPath, agencyIdPath);
if (StringUtils.isNotBlank(search)) {
query.like(IcDangerousChemicalsEntity::getName, search);
}
if (isPage) {
PageHelper.startPage(pageNo ,pageSize);
}
return dangerousChemicalsDao.selectList(query);
}
@Override
public List<IcHouseEntity> searchGroupRentHouseEntities(String customerId, String agencyIdPath, String search, Boolean isPage, Integer pageNo, Integer pageSize) {
return null;
}
}

23
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/heart/HeartService.java

@ -0,0 +1,23 @@
package com.epmet.dataaggre.service.heart;
import com.epmet.dataaggre.entity.heart.IcCommunitySelfOrganizationEntity;
import java.util.List;
/**
* heart service
*/
public interface HeartService {
/**
* 搜索社区自组织列表
* @param customerId 客户ID
* @param agencyId 当前查询人员所属组织ID
* @param agencyPids 当前查询人员所属组织的所有上级id path
* @param search 搜索条件
* @param isPage
* @param pageNo
* @param pageSize
* @return
*/
List<IcCommunitySelfOrganizationEntity> searchCommunityOrgEntities(String customerId, String agencyId, String agencyPids, String search, Boolean isPage, Integer pageNo, Integer pageSize);
}

50
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/heart/impl/HeartServiceImpl.java

@ -0,0 +1,50 @@
package com.epmet.dataaggre.service.heart.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.heart.IcCommunitySelfOrganizationDao;
import com.epmet.dataaggre.entity.heart.IcCommunitySelfOrganizationEntity;
import com.epmet.dataaggre.service.heart.HeartService;
import com.epmet.dto.result.PartyMemberUserIdsResultDTO;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@DataSource(value = DataSourceConstant.EPMET_HEART)
@Service
public class HeartServiceImpl implements HeartService {
@Autowired
private IcCommunitySelfOrganizationDao communitySelfOrganizationDao;
/**
* 搜索社区自组织列表
* @param customerId 客户ID
* @param agencyId 当前查询人员所属组织ID
* @param agencyPids 当前查询人员所属组织的所有上级id path
* @param search 搜索条件
* @return 社区自组织列表
*/
@Override
public List<IcCommunitySelfOrganizationEntity> searchCommunityOrgEntities(
String customerId, String agencyId, String agencyPids, String search,
Boolean isPage, Integer pageNo, Integer pageSize) {
LambdaQueryWrapper<IcCommunitySelfOrganizationEntity> query = new LambdaQueryWrapper<>();
query.eq(IcCommunitySelfOrganizationEntity::getCustomerId, customerId);
query.like(IcCommunitySelfOrganizationEntity::getOrganizationName, search);
query.or(q -> q.eq(IcCommunitySelfOrganizationEntity::getOrgId, agencyId).likeRight(IcCommunitySelfOrganizationEntity::getPids, agencyPids));
if (StringUtils.isNotBlank(search)) {
query.like(IcCommunitySelfOrganizationEntity::getOrganizationName, search);
}
if (isPage) {
PageHelper.startPage(pageNo, pageSize);
}
return communitySelfOrganizationDao.selectList(query);
}
}

78
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/CoverageServiceImpl.java

@ -9,11 +9,16 @@ import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.dataaggre.dto.epmetuser.result.IcResiInfoResultDTO;
import com.epmet.dataaggre.dto.govorg.result.CoverageAnalisisDataListResultDTO;
import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity;
import com.epmet.dataaggre.entity.govorg.IcCityManagementEntity;
import com.epmet.dataaggre.entity.govorg.IcDangerousChemicalsEntity;
import com.epmet.dataaggre.entity.govorg.IcHouseEntity;
import com.epmet.dataaggre.entity.heart.IcCommunitySelfOrganizationEntity;
import com.epmet.dataaggre.service.CoverageService;
import com.epmet.dataaggre.service.epmetuser.IcResiService;
import com.epmet.dataaggre.service.epmetuser.impl.IcResiServiceImpl;
import com.epmet.dataaggre.service.govorg.GovOrgCoverageService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.heart.HeartService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -38,6 +43,9 @@ public class CoverageServiceImpl implements CoverageService {
@Autowired
private IcResiService icResiService;
@Autowired
private HeartService heartService;
/**
* 场所类型常量
*/
@ -52,9 +60,6 @@ public class CoverageServiceImpl implements CoverageService {
public static final String PLACE_TYPE_PUBLIC_SERVICE= "public_service";
public static final String PLACE_TYPE_SUPERIOR_RESOURCE= "superior_resource";
/** 优势资源 **/
public static final String PLACE_TYPE_YSZY= "yszy";
/**
* 图层大屏数据分析数据列表
* @param coverageTypes 图层列表
@ -124,37 +129,84 @@ public class CoverageServiceImpl implements CoverageService {
/**
* 执行数据查询
* @param categoryKey
* @param customerId
* @param agencyId 查询的工作人员所在组织id
* @param staffOrgIds 查询的工作人员所在组织的id path包含agencyId
* @param placeType 场所类型
* @param categoryKey 类别key
* @param search 关键词
* @return
*/
public List<CoverageAnalisisDataListResultDTO> doDataListSearch(String customerId, String agencyId, String agencyPids, String placeType, String categoryKey, String search,
public List<CoverageAnalisisDataListResultDTO> doDataListSearch(String customerId, String agencyId, String staffOrgIds, String placeType, String categoryKey, String search,
Integer pageNo, Integer pageSize,Boolean isPage) {
if (PLACE_TYPE_RESI.equals(placeType)) {
// 使用分类查询居民信息
List<IcResiUserEntity> resiEntities = icResiService.listResisByCategories4Coverage(customerId, agencyId, agencyPids, categoryKey, search, pageNo, pageSize, isPage);
List<IcResiUserEntity> resiEntities = icResiService.listResisByCategories4Coverage(customerId, agencyId, staffOrgIds, categoryKey, search, pageNo, pageSize, isPage);
return resiEntities.stream().map(re -> {
// 使用楼栋的坐标补充居民的坐标信息
BuildingInfoCache resiBuilding = getBuildingInfo(re.getId(), re.getBuildId());
return new CoverageAnalisisDataListResultDTO(re.getId(), categoryKey, placeType, re.getName(), resiBuilding.getLatitude(), resiBuilding.getLongitude());
String buildingLatitude = null;
String buildingLongitude = null;
if (resiBuilding != null) {
buildingLatitude = resiBuilding.getLatitude();
buildingLongitude = resiBuilding.getLongitude();
}
return new CoverageAnalisisDataListResultDTO(re.getId(), categoryKey, placeType, re.getName(), buildingLatitude, buildingLongitude);
}).collect(Collectors.toList());
} else if (PLACE_TYPE_SPECIAL_RESI.equals(placeType)) {
// 特殊人群
List<IcResiInfoResultDTO> resiInfos = icResiService.listSpecialResisBySpecialType(customerId, agencyId, agencyPids, categoryKey, search, pageNo, pageSize, isPage);
List<IcResiInfoResultDTO> resiInfos = icResiService.listSpecialResisBySpecialType(customerId, agencyId, staffOrgIds, categoryKey, search, pageNo, pageSize, isPage);
return resiInfos.stream().map(re -> {
BuildingInfoCache resiBuilding = getBuildingInfo(re.getId(), re.getBuildId());
return new CoverageAnalisisDataListResultDTO(re.getId(), categoryKey, placeType, re.getName(), resiBuilding.getLatitude(), resiBuilding.getLongitude());
String buildingLatitude = null;
String buildingLongitude = null;
if (resiBuilding != null) {
buildingLatitude = resiBuilding.getLatitude();
buildingLongitude = resiBuilding.getLongitude();
}
return new CoverageAnalisisDataListResultDTO(re.getId(), categoryKey, placeType, re.getName(), buildingLatitude, buildingLongitude);
}).collect(Collectors.toList());
} else if (PLACE_TYPE_EVENT.equals(placeType)) {
// 难点痛点
// 难点痛点 todo
} else if (PLACE_TYPE_CITY_MANAGEMENT.equals(placeType)) {
// 城市资源管理
List<IcCityManagementEntity> cityResources = orgCoverageService.searchCityResourceEntities(customerId, staffOrgIds, search, isPage, pageNo, pageSize);
cityResources.stream()
.map(resource -> new CoverageAnalisisDataListResultDTO(resource.getId(), categoryKey, placeType, resource.getName(), resource.getLatitude(), resource.getLongitude()))
.collect(Collectors.toList());
} else if (PLACE_TYPE_YSZY.equals(placeType)) {
} else if (PLACE_TYPE_COMUNITY_ORG.equals(placeType)) {
// 社区自组织
List<IcCommunitySelfOrganizationEntity> l = heartService.searchCommunityOrgEntities(customerId, agencyId, staffOrgIds, search, isPage, pageNo, pageSize);
return l.stream()
.map(org -> new CoverageAnalisisDataListResultDTO(org.getId(), categoryKey, placeType, org.getOrganizationName(), org.getLatitude(), org.getLongitude()))
.collect(Collectors.toList());
} else if (PLACE_TYPE_DANGEROUS_CHEMICALS.equals(placeType)) {
// 危化企业
List<IcDangerousChemicalsEntity> l = orgCoverageService.searchDangerousChemicalEntities(customerId, staffOrgIds, search, isPage, pageNo, pageSize);
return l.stream().map(dc -> new CoverageAnalisisDataListResultDTO(dc.getId(), categoryKey, placeType, dc.getName(), dc.getLatitude(), dc.getLongitude()))
.collect(Collectors.toList());
} else if (PLACE_TYPE_ENTERPRISE_PARTROL.equals(placeType)) {
// 企事业单位巡查 todo
}
} else if (PLACE_TYPE_GROUP_RENT.equals(placeType)) {
// 群租房。出租的房屋,住的人口超过5人属于群租房(是个规定)
List<IcHouseEntity> icHouseEntities = orgCoverageService.searchGroupRentHouseEntities(customerId, staffOrgIds, search, isPage, pageNo, pageSize);
//icHouseEntities
} else if (PLACE_TYPE_PUBLIC_SERVICE.equals(placeType)) {
// 公共服务
return null;
} else if (PLACE_TYPE_SUPERIOR_RESOURCE.equals(placeType)) {
// 优势资源
}
return new ArrayList<>();
}
/**

5
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml

@ -156,6 +156,11 @@ dynamic:
url: @datasource.druid.epmettduck.url@
username: @datasource.druid.epmettduck.username@
password: @datasource.druid.epmettduck.password@
heart:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.heart.url@
username: @datasource.druid.heart.username@
password: @datasource.druid.heart.password@
feign:
hystrix:
enabled: true

6
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcCityManagementDao.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.govorg.IcCityManagementDao">
</mapper>

6
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcDangerousChemicalsDao.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.govorg.IcDangerousChemicalsDao">
</mapper>

6
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/IcHouseDao.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.govorg.IcHouseDao">
</mapper>

5
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/heart/IcCommunitySelfOrganizationDao.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.heart.IcCommunitySelfOrganizationDao">
</mapper>
Loading…
Cancel
Save