Browse Source

Merge remote-tracking branch 'origin/dev_ic_diaodong' into develop

dev
zxc 4 years ago
parent
commit
e6274f4a92
  1. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  2. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java
  3. 18
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/customize/IcResiCategoryConfigDTO.java
  4. 32
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IcUserCategoryAnalysisDailyFormDTO.java
  5. 12
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/OrgIcUserTotalDTO.java
  6. 26
      epmet-module/data-statistical/data-statistical-server/pom.xml
  7. 76
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IcController.java
  8. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/customize/IcResiCategoryStatsConfigDao.java
  9. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIcuserCategoryAnalysisDailyDao.java
  10. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  11. 74
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java
  12. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/IcResiCategoryStatsConfigService.java
  13. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/impl/IcResiCategoryStatsConfigServiceImpl.java
  14. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  15. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  16. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIcuserCategoryAnalysisDailyService.java
  17. 198
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java
  18. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  19. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  20. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  21. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/customize/IcResiCategoryStatsConfigDao.xml
  22. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIcuserCategoryAnalysisDailyDao.xml
  23. 82
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
  24. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  25. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java
  26. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  27. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  28. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  29. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java
  30. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  31. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  32. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  33. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -637,7 +637,7 @@ public class RedisKeys {
return rootPrefix.concat("org:temp:orgtree").concat(agencyId);
}
public static String getHouseInfoCacheKey(String houseId){
return rootPrefix.concat("house:").concat(houseId);
public static String getHouseInfoCacheKey(String houseId,String customerId){
return rootPrefix.concat("house:").concat(customerId).concat(":").concat(houseId);
}
}

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

@ -15,4 +15,5 @@ public interface DataSourceConstant {
String PARTY_MEMBER = "partyMember";
String EPMET_HEART="epmetHeart";
String EPMET_POINT = "epmetPoint";
String OPER_CUSTOMIZE="operCustomize";
}

18
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/customize/IcResiCategoryConfigDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.customize;
import lombok.Data;
import java.io.Serializable;
@Data
public class IcResiCategoryConfigDTO implements Serializable {
private String configId;
/**
* 列名
*/
private String columnName;
private String itemLabel;
}

32
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IcUserCategoryAnalysisDailyFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
/**
* 数字社区-人员类别分析按天计算入参
* 以下参数都可以为空
*/
@Data
public class IcUserCategoryAnalysisDailyFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
private String customerId;
@Length(max = 8, message = "日期格式:yyyyMMdd", groups = AddUserInternalGroup.class)
private String dateId;
/**
* 开始时间
*/
@Length(max = 8, message = "开始日期日期格式:yyyyMMdd", groups = AddUserInternalGroup.class)
private String startDate;
/**
* 结束时间
*/
@Length(max = 8, message = "截止日期格式:yyyyMMdd", groups = AddUserInternalGroup.class)
private String endDate;
}

12
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/OrgIcUserTotalDTO.java

@ -0,0 +1,12 @@
package com.epmet.dto.user.result;
import lombok.Data;
import java.io.Serializable;
@Data
public class OrgIcUserTotalDTO implements Serializable {
private String orgId;
private Integer total;
private String columnName;
}

26
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -260,6 +260,13 @@
<datasource.druid.epmetPoint.username>epmet_point_user</datasource.druid.epmetPoint.username>
<datasource.druid.epmetPoint.password>EpmEt-db-UsEr</datasource.druid.epmetPoint.password>
<!-- oper_customize-->
<datasource.druid.operCustomize.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.operCustomize.url>
<datasource.druid.operCustomize.username>epmet_oper_customize_user</datasource.druid.operCustomize.username>
<datasource.druid.operCustomize.password>EpmEt-db-UsEr</datasource.druid.operCustomize.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.140</spring.redis.host>
@ -382,6 +389,13 @@
<datasource.druid.epmetPoint.username>epmet_point_user</datasource.druid.epmetPoint.username>
<datasource.druid.epmetPoint.password>EpmEt-db-UsEr</datasource.druid.epmetPoint.password>
<!-- oper_customize-->
<datasource.druid.operCustomize.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.operCustomize.url>
<datasource.druid.operCustomize.username>epmet_oper_customize_user</datasource.druid.operCustomize.username>
<datasource.druid.operCustomize.password>EpmEt-db-UsEr</datasource.druid.operCustomize.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.140</spring.redis.host>
@ -504,6 +518,12 @@
<datasource.druid.epmetPoint.username>epmet</datasource.druid.epmetPoint.username>
<datasource.druid.epmetPoint.password>elink@833066</datasource.druid.epmetPoint.password>
<datasource.druid.operCustomize.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.operCustomize.url>
<datasource.druid.operCustomize.username>epmet</datasource.druid.operCustomize.username>
<datasource.druid.operCustomize.password>elink@833066</datasource.druid.operCustomize.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
@ -622,6 +642,12 @@
<datasource.druid.epmetPoint.username>epmet_point_user</datasource.druid.epmetPoint.username>
<datasource.druid.epmetPoint.password>EpmEt-db-UsEr</datasource.druid.epmetPoint.password>
<datasource.druid.operCustomize.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.operCustomize.url>
<datasource.druid.operCustomize.username>epmet_oper_customize_user</datasource.druid.operCustomize.username>
<datasource.druid.operCustomize.password>EpmEt-db-UsEr</datasource.druid.operCustomize.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host>

76
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IcController.java

@ -0,0 +1,76 @@
package com.epmet.controller;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.IcUserCategoryAnalysisDailyFormDTO;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.service.stats.FactIcuserCategoryAnalysisDailyService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 数字社区相关统计任务可以放这目前只有人员类别分析
* @Author yinzuomei
* @Date 2022/01/17
* @Version 1.0
*/
@RestController
@RequestMapping("ic")
public class IcController {
@Autowired
private FactIcuserCategoryAnalysisDailyService userCategoryAnalysisDailyService;
@Autowired
private DimCustomerService dimCustomerService;
/**
* 数字社区-基础信息-人员类别分析-每个类别的人员总数较上月迁入迁出人数
* 说明安调统计截止到当前dateId的党员总数+30迁入党员+之前的居民在本月内变更为党员身份的-10在本月丢失党员身份的人+迁出的人
* @return
*/
@PostMapping("/user/category-analysis-daily")
public Result statUserCategoryDaily(@RequestBody IcUserCategoryAnalysisDailyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcUserCategoryAnalysisDailyFormDTO.AddUserInternalGroup.class);
List<String> customerIds = new ArrayList<>();
if (StringUtils.isNotBlank(formDTO.getCustomerId())) {
customerIds.add(formDTO.getCustomerId());
} else {
//未指定客户,则查询dim_customer表
customerIds = dimCustomerService.selectCustomerIdPage(NumConstant.ONE, NumConstant.ONE_THOUSAND);
}
if (CollectionUtils.isNotEmpty(customerIds)) {
customerIds.forEach(customerId -> {
if (StringUtils.isNotBlank(formDTO.getStartDate()) && StringUtils.isNotBlank(formDTO.getEndDate())) {
//[a,b]yyyyMMdd
List<String> daysBetween = DateUtils.getDaysBetween(formDTO.getStartDate(), formDTO.getEndDate());
daysBetween.forEach(dateId -> {
//计算网格维度的数据
userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, dateId);
});
} else if (StringUtils.isNotBlank(formDTO.getDateId())) {
//计算网格维度的数据
userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, formDTO.getDateId());
} else {
//计算网格维度的数据
//当前时间的前一天yyyyMMdd
String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", "");
userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, dateId);
}
});
}
return new Result();
}
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/customize/IcResiCategoryStatsConfigDao.java

@ -0,0 +1,14 @@
package com.epmet.dao.customize;
import com.epmet.dto.customize.IcResiCategoryConfigDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface IcResiCategoryStatsConfigDao {
List<IcResiCategoryConfigDTO> queryDataColumn(String customerId);
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIcuserCategoryAnalysisDailyDao.java

@ -0,0 +1,20 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 人员类别分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Mapper
public interface FactIcuserCategoryAnalysisDailyDao extends BaseDao<FactIcuserCategoryAnalysisDailyEntity> {
int limitDelete(@Param("customerId")String customerId,
@Param("dateId")String dateId,
@Param("orgType")String orgType);
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java

@ -269,5 +269,19 @@ public interface UserDao {
List<String> filterUserIds(@Param("userIds") List<String> userIds, @Param("roleKey") String roleKey);
List<PatrolRoutineWorkResult> selectRoutineWorkListByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId);
List<OrgIcUserTotalDTO> selectCountForGrid(@Param("customerId") String customerId,
@Param("columnName") String columnName);
OrgIcUserTotalDTO selectCountForAgency(@Param("customerId") String customerId,
@Param("columnName") String columnName,
@Param("agencyId") String agencyId);
List<OrgIcUserTotalDTO> selectGridIcUserCategoryTotal(@Param("customerId")String customerId, @Param("dateId")String dateId);
List<OrgIcUserTotalDTO> selectGridIcUserCategoryIncr(@Param("customerId")String customerId,
@Param("startDate")String startDate,
@Param("endDate")String endDate,
@Param("type")String type);
}

74
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java

@ -0,0 +1,74 @@
package com.epmet.entity.stats;
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-01-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_icuser_category_analysis_daily")
public class FactIcuserCategoryAnalysisDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 预警配置ID
*/
private String configId;
/**
* 类别列名对个数据太麻烦了在这个表存一下
*/
private String columnName;
/**
* 当前数据是截止到XXX的yyyyMMdd
*/
private String dateId;
/**
* 网格id或者组织id
*/
private String orgId;
/**
* grid或者agency
*/
private String orgType;
/**
* orgid的上级
*/
private String pid;
/**
* orgid的所有上级
*/
private String pids;
/**
* 当前类别总人数
*/
private Integer total;
/**
* 较上月迁出
*/
private Integer qcIncr;
/**
* 较上月迁入
*/
private Integer qrIncr;
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/IcResiCategoryStatsConfigService.java

@ -0,0 +1,22 @@
package com.epmet.service.customize;
import com.epmet.dto.customize.IcResiCategoryConfigDTO;
import java.util.List;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
public interface IcResiCategoryStatsConfigService {
/**
* 返回用于数据分析的列名+居民类别配置表的id
* @param customerId
* @return
*/
List<IcResiCategoryConfigDTO> queryDataColumn(String customerId);
}

40
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/impl/IcResiCategoryStatsConfigServiceImpl.java

@ -0,0 +1,40 @@
package com.epmet.service.customize.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.customize.IcResiCategoryStatsConfigDao;
import com.epmet.dto.customize.IcResiCategoryConfigDTO;
import com.epmet.service.customize.IcResiCategoryStatsConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Slf4j
@DataSource(DataSourceConstant.OPER_CUSTOMIZE)
@Service
public class IcResiCategoryStatsConfigServiceImpl implements IcResiCategoryStatsConfigService{
@Autowired
private IcResiCategoryStatsConfigDao baseDao;
/**
* 返回用于数据分析的列名+居民类别配置表的id
*
* @param customerId
* @return
*/
@Override
public List<IcResiCategoryConfigDTO> queryDataColumn(String customerId) {
return baseDao.queryDataColumn(customerId);
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java

@ -136,4 +136,6 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
* @return
*/
Date getLastSyncEndTime();
List<ScreenCustomerGridEntity> getByCustomerId(String customerId);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java

@ -290,4 +290,11 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
public Date getLastSyncEndTime() {
return dimLastSyncRecordDao.getDimLastSyncEndTime("grid");
}
@Override
public List<ScreenCustomerGridEntity> getByCustomerId(String customerId) {
LambdaQueryWrapper<ScreenCustomerGridEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ScreenCustomerGridEntity::getCustomerId, customerId);
return baseDao.selectList(wrapper);
}
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIcuserCategoryAnalysisDailyService.java

@ -0,0 +1,20 @@
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity;
/**
* 人员类别分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
public interface FactIcuserCategoryAnalysisDailyService extends BaseService<FactIcuserCategoryAnalysisDailyEntity> {
/**
* 数字社区-基础信息-人员类别分析-每个类别的人员总数较上月迁入迁出人数
* 网格
* @param customerId
* @param dateId
*/
void statUserCategoryGridDaily(String customerId, String dateId);
}

198
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java

@ -0,0 +1,198 @@
package com.epmet.service.stats.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.stats.FactIcuserCategoryAnalysisDailyDao;
import com.epmet.dto.customize.IcResiCategoryConfigDTO;
import com.epmet.dto.user.result.OrgIcUserTotalDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity;
import com.epmet.service.customize.IcResiCategoryStatsConfigService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
import com.epmet.service.stats.FactIcuserCategoryAnalysisDailyService;
import com.epmet.service.user.UserService;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 人员类别分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.STATS)
public class FactIcuserCategoryAnalysisDailyServiceImpl extends BaseServiceImpl<FactIcuserCategoryAnalysisDailyDao, FactIcuserCategoryAnalysisDailyEntity> implements FactIcuserCategoryAnalysisDailyService {
@Autowired
private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService;
@Autowired
private ScreenCustomerAgencyService agencyService;
@Autowired
private ScreenCustomerGridService gridService;
@Autowired
private UserService userService;
/**
* 数字社区-基础信息-人员类别分析-每个类别的人员总数较上月迁入迁出人数
*
* @param customerId
* @param dateId
*/
@Override
public void statUserCategoryGridDaily(String customerId, String dateId) {
//查询出所有用语数据分析的类别column_name,没有则不计算
List<IcResiCategoryConfigDTO> columnList = icResiCategoryStatsConfigService.queryDataColumn(customerId);
if (CollectionUtils.isEmpty(columnList)) {
return;
}
//所有网格查询出来
List<ScreenCustomerGridEntity> gridDTOList = gridService.getByCustomerId(customerId);
if (CollectionUtils.isEmpty(gridDTOList)) {
return;
}
//网格维度、组织维度初始好数据
List<FactIcuserCategoryAnalysisDailyEntity> initList = constructInitValue(customerId, dateId, gridDTOList, columnList);
if (CollectionUtils.isEmpty(initList)) {
return;
}
//当这3个数都为0的时候不插入数据库了
List<FactIcuserCategoryAnalysisDailyEntity> insertList = initList.stream().filter(entity -> (null != entity.getTotal() && entity.getTotal() > 0)
|| (null != entity.getQcIncr() && entity.getQcIncr() > 0)
|| (null != entity.getQrIncr() && entity.getQrIncr() > 0)).collect(Collectors.toList());
//删除旧数据
clearOldDatas(customerId, dateId, OrgTypeEnum.GRID.getCode());
// 批量插入数据
Lists.partition(insertList, NumConstant.ONE_HUNDRED).forEach(list -> {
insertBatch(list);
});
}
/**
* 删除旧数据
*
* @param customerId
* @param dateId
* @param orgType gridagency
*/
private void clearOldDatas(String customerId, String dateId, String orgType) {
int deleteNum;
do {
//每次删除1000条
deleteNum = baseDao.limitDelete(customerId, dateId, orgType);
} while (deleteNum != NumConstant.ZERO);
}
/**
* @param customerId
* @param dateId yyyyMMdd
* @param gridDTOList 当前客户下所有的网格
* @param columnList 所有需要分析的类别对应的ic_resi_user的列名目前只有18类
* @return
*/
private List<FactIcuserCategoryAnalysisDailyEntity> constructInitValue(String customerId, String dateId, List<ScreenCustomerGridEntity> gridDTOList, List<IcResiCategoryConfigDTO> columnList) {
List<FactIcuserCategoryAnalysisDailyEntity> list = new ArrayList<>();
//1、total
// 查询明细ic_user_change_detailed变更明细表,各个网格的各个分类的总人数
Map<String, List<OrgIcUserTotalDTO>> totalMapList = userService.calGridIcUserTotal(customerId, dateId);
String monthId = dateId.substring(NumConstant.ZERO, NumConstant.SIX);
String startDate = monthId.concat("01");
String endDate = dateId;
//2、迁入+30:eg:dateId:20211226, [20211201,20211226],类别sum值=1的
Map<String, List<OrgIcUserTotalDTO>> qrList = userService.calGridIcUserIncr(customerId, startDate, endDate, "qr");
//3、迁出 -10 :eg:dateId:20211226, [20211201,20211226],类别sum值 !=1的
Map<String, List<OrgIcUserTotalDTO>> qcList = userService.calGridIcUserIncr(customerId, startDate, endDate, "qc");
for (IcResiCategoryConfigDTO config : columnList) {
gridDTOList.forEach(grid -> {
FactIcuserCategoryAnalysisDailyEntity gridData = new FactIcuserCategoryAnalysisDailyEntity();
gridData.setCustomerId(customerId);
gridData.setConfigId(config.getConfigId());
gridData.setColumnName(config.getColumnName());
gridData.setDateId(dateId);
gridData.setOrgId(grid.getGridId());
gridData.setOrgType(OrgTypeEnum.GRID.getCode());
gridData.setPid(StringUtils.isNotBlank(grid.getParentAgencyId()) ? grid.getParentAgencyId() : NumConstant.ZERO_STR);
gridData.setPids(grid.getAllParentIds());
//截止到目前累计值
boolean totalZeroFlag = true;
if (MapUtils.isNotEmpty(totalMapList) && totalMapList.containsKey(grid.getGridId())) {
//当前网格下,有的类别
List<OrgIcUserTotalDTO> crrentGrid = totalMapList.get(grid.getGridId());
if (CollectionUtils.isNotEmpty(crrentGrid)) {
//各个类别对应的数
Map<String, Integer> categoryTotalMap = crrentGrid.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2));
if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) {
totalZeroFlag = false;
gridData.setTotal(categoryTotalMap.get(config.getColumnName()));
}
}
}
if (totalZeroFlag) {
gridData.setTotal(NumConstant.ZERO);
}
//较上月迁入
boolean incrZeroFlag = true;
if (MapUtils.isNotEmpty(qrList) && qrList.containsKey(grid.getGridId())) {
//当前网格下,有的类别
List<OrgIcUserTotalDTO> crrentGrid = qrList.get(grid.getGridId());
if (CollectionUtils.isNotEmpty(crrentGrid)) {
//各个类别对应的数
Map<String, Integer> categoryTotalMap = crrentGrid.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2));
if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) {
incrZeroFlag = false;
gridData.setQrIncr(categoryTotalMap.get(config.getColumnName()));
}
}
}
if (incrZeroFlag) {
gridData.setQrIncr(NumConstant.ZERO);
}
// 较上月迁出:
boolean qcZeroFlag = true;
if (MapUtils.isNotEmpty(qcList) && qcList.containsKey(grid.getGridId())) {
//当前网格下,有的类别
List<OrgIcUserTotalDTO> crrentGridQc = qcList.get(grid.getGridId());
if (CollectionUtils.isNotEmpty(crrentGridQc)) {
//各个类别对应的数
Map<String, Integer> categoryTotalMap = crrentGridQc.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2));
if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) {
qcZeroFlag = false;
gridData.setQcIncr(categoryTotalMap.get(config.getColumnName()));
}
}
}
if (qcZeroFlag) {
gridData.setQcIncr(NumConstant.ZERO);
}
list.add(gridData);
});
}
return list;
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java

@ -157,4 +157,33 @@ public interface UserService {
* @return
*/
List<PatrolRoutineWorkResult> selectRoutineWorkListByDateId(String customerId, String dateId);
Map<String,Integer> selectCountForGrid(String customerId, String columnName);
/**
*
* @param customerId
* @param columnName
* @param agencyIds
* @return
*/
Map<String, Integer> selectCountForGrid(String customerId, String columnName, List<String> agencyIds);
/**
*
* @param customerId
* @param dateId 截止到这一天的各个网格下每个分类的总人数
* @return
*/
Map<String, List<OrgIcUserTotalDTO>> calGridIcUserTotal(String customerId, String dateId);
/**
*
* @param customerId
* @param startDate 变动时间在此范围内的 yyyyMMdd
* @param endDate :yyyyMMdd
* @param type:qr:迁入qc:迁出
* @return
*/
Map<String, List<OrgIcUserTotalDTO>> calGridIcUserIncr(String customerId, String startDate, String endDate, String type);
}

101
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -1126,4 +1126,105 @@ public class UserServiceImpl implements UserService {
public List<PatrolRoutineWorkResult> selectRoutineWorkListByDateId(String customerId, String dateId) {
return userDao.selectRoutineWorkListByDateId(customerId, dateId);
}
/**
*
* @param customerId
* @param columnName
* @return 截止到目前每个网格内某个分类的总人数
*/
@Override
public Map<String, Integer> selectCountForGrid(String customerId, String columnName) {
Map<String, Integer> map = new HashMap<>();
List<OrgIcUserTotalDTO> list = userDao.selectCountForGrid(customerId, columnName);
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) {
map = list.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getOrgId, OrgIcUserTotalDTO::getTotal));
}
return map;
}
/**
* @param customerId
* @param columnName
* @param agencyIds
* @return 截止到目前各个组织内某个分类的总人数
*/
@Override
public Map<String, Integer> selectCountForGrid(String customerId, String columnName, List<String> agencyIds) {
Map<String, Integer> map = new HashMap<>();
if (CollectionUtils.isEmpty(agencyIds)) {
return map;
}
List<OrgIcUserTotalDTO> list = new ArrayList<>();
for (String agencyId:agencyIds) {
OrgIcUserTotalDTO dto=new OrgIcUserTotalDTO();
dto.setOrgId(agencyId);
OrgIcUserTotalDTO totalDto=userDao.selectCountForAgency(customerId,columnName,agencyId);
dto.setTotal(null!=totalDto?totalDto.getTotal():NumConstant.ZERO);
list.add(dto);
}
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) {
map = list.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getOrgId, OrgIcUserTotalDTO::getTotal));
}
return map;
}
/**
* @param customerId
* @param dateId 截止到这一天的各个网格下每个分类的总人数
* @return
*/
@Override
public Map<String, List<OrgIcUserTotalDTO>> calGridIcUserTotal(String customerId, String dateId) {
Map<String, List<OrgIcUserTotalDTO>> resultMap=new HashMap<>();
List<OrgIcUserTotalDTO> list=userDao.selectGridIcUserCategoryTotal(customerId,dateId);
if(CollectionUtils.isEmpty(list)){
return resultMap;
}
// list 数据
// gridId columnName total
// 1001 IS_DBH 1
// 1001 IS_PARTY 1
// 1002 IS_DBH 1
// 1002 IS_ENSURE_HOUSE 1
// 1003 IS_VETERANS 1
// 1004 IS_PARTY 1
for(OrgIcUserTotalDTO dto:list){
if(resultMap.containsKey(dto.getOrgId())){
resultMap.get(dto.getOrgId()).add(dto);
continue;
}
List<OrgIcUserTotalDTO> newList=new ArrayList<>();
newList.add(dto);
resultMap.put(dto.getOrgId(),newList);
}
return resultMap;
}
/**
* @param customerId
* @param startDate 变动时间在此范围内的 yyyyMMdd
* @param endDate :yyyyMMdd
* @param type :qr:迁入qc:迁出
* @return
*/
@Override
public Map<String, List<OrgIcUserTotalDTO>> calGridIcUserIncr(String customerId, String startDate, String endDate, String type) {
Map<String, List<OrgIcUserTotalDTO>> resultMap=new HashMap<>();
List<OrgIcUserTotalDTO> list=userDao.selectGridIcUserCategoryIncr(customerId,startDate,endDate,type);
if(CollectionUtils.isEmpty(list)){
return resultMap;
}
for(OrgIcUserTotalDTO dto:list){
if(resultMap.containsKey(dto.getOrgId())){
resultMap.get(dto.getOrgId()).add(dto);
continue;
}
List<OrgIcUserTotalDTO> newList=new ArrayList<>();
newList.add(dto);
resultMap.put(dto.getOrgId(),newList);
}
return resultMap;
}
}

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

@ -188,6 +188,11 @@ dynamic:
url: @datasource.druid.epmetPoint.url@
username: @datasource.druid.epmetPoint.username@
password: @datasource.druid.epmetPoint.password@
operCustomize:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.operCustomize.url@
username: @datasource.druid.operCustomize.username@
password: @datasource.druid.operCustomize.password@
thread:
# 线程池配置

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/customize/IcResiCategoryStatsConfigDao.xml

@ -0,0 +1,23 @@
<?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.dao.customize.IcResiCategoryStatsConfigDao">
<select id="queryDataColumn" parameterType="java.lang.String" resultType="com.epmet.dto.customize.IcResiCategoryConfigDTO">
SELECT
m.COLUMN_NAME as columnName,
c.id as configId,
m.LABEL as itemLabel
FROM
ic_form_item m
INNER JOIN ic_resi_category_stats_config c ON ( m.CUSTOMER_ID = c.CUSTOMER_ID AND m.COLUMN_NAME = c.COLUMN_NAME AND c.DEL_FLAG = '0' )
WHERE
m.DEL_FLAG = '0'
AND m.DATA_ANALYSE = '1'
AND m.CUSTOMER_ID = #{customerId}
ORDER BY
m.SORT ASC
</select>
</mapper>

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIcuserCategoryAnalysisDailyDao.xml

@ -0,0 +1,13 @@
<?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.dao.stats.FactIcuserCategoryAnalysisDailyDao">
<delete id="limitDelete" parameterType="map">
delete from fact_icuser_category_analysis_daily
where CUSTOMER_ID = #{customerId}
and date_id=#{dateId}
and org_type=#{orgType}
limit 1000
</delete>
</mapper>

82
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

@ -1074,4 +1074,86 @@
</select>
<select id="selectCountForGrid" parameterType="map" resultType="com.epmet.dto.user.result.OrgIcUserTotalDTO">
SELECT
m.grid_id as orgId
count(*) AS total,
#{columnName} as columnName
FROM
ic_resi_user m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND concat('m.',${columnName}) = '1'
AND m.GRID_ID=#{gridId}
group by m.grid_id
</select>
<select id="selectCountForAgency" parameterType="map" resultType="com.epmet.dto.user.result.OrgIcUserTotalDTO">
SELECT
#{agencyId} as orgId,
count(*) AS total,
#{columnName} as columnName
FROM
ic_resi_user m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND concat('m.',${columnName}) = '1'
AND ( m.AGENCY_ID = #{agencyId} OR M.PIDS LIKE CONCAT( '%', #{agencyId}, '%' ) )
</select>
<select id="selectGridIcUserCategoryTotal" parameterType="map" resultType="com.epmet.dto.user.result.OrgIcUserTotalDTO">
select
temp.orgId,
temp.FIELD_NAME as columnName,
count(temp.IC_USER_ID) as total
from (
SELECT
d.GRID_ID as orgId,
d.IC_USER_ID,
d.FIELD_NAME,
sum(d.`VALUE`)as result
FROM
ic_user_change_detailed d
WHERE
d.DEL_FLAG = '0'
AND d.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( d.CREATED_TIME, '%Y%m%d' ) &lt;= #{dateId}
group by d.GRID_ID,d.IC_USER_ID,d.FIELD_NAME
)temp
where temp.result=1
group by temp.orgId,temp.FIELD_NAME
</select>
<select id="selectGridIcUserCategoryIncr" parameterType="map" resultType="com.epmet.dto.user.result.OrgIcUserTotalDTO">
select
temp.orgId,
temp.FIELD_NAME as columnName,
count(temp.IC_USER_ID) as total
from (
SELECT
d.GRID_ID as orgId,
d.IC_USER_ID,
d.FIELD_NAME,
sum(d.`VALUE`)as result
FROM
ic_user_change_detailed d
WHERE
d.DEL_FLAG = '0'
AND d.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( d.CREATED_TIME, '%Y%m%d' ) &gt;= #{startDate}
AND DATE_FORMAT( d.CREATED_TIME, '%Y%m%d' ) &lt;= #{endDate}
group by d.GRID_ID,d.IC_USER_ID,d.FIELD_NAME
)temp
where 1=1
<if test="type != null and type == 'qr'">
and temp.result=1
</if>
<if test="type != null and type == 'qc'">
and temp.result !=1
</if>
group by temp.orgId,temp.FIELD_NAME
</select>
</mapper>

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -154,7 +154,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
// 查询需求人的居住地址
Set<String> houseIds=new HashSet<>();
houseIds.add(updateEntity.getDemandUserHouseId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,dto.getCustomerId());
if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes));
}
@ -223,7 +223,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
// 查询需求人的居住地址
Set<String> houseIds=new HashSet<>();
houseIds.add(insertEntity.getDemandUserHouseId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds, fromDTO.getCustomerId());
if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes));
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java

@ -76,4 +76,6 @@ public class HouseInfoDTO implements Serializable {
* 小区名+楼栋名+单元名+房屋名
*/
private String allName;
private String customerId;
}

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -460,7 +460,7 @@ public interface GovOrgOpenFeignClient {
Result<CustomerGridDTO> getGridBaseInfoByGridId(CustomerGridFormDTO customerGridFormDTO);
@PostMapping(value = "/gov/org/house/queryListHouseInfo",consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds);
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds, @RequestParam("customerId") String customerId);

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -276,8 +276,8 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
}
@Override
public Result<List<HouseInfoDTO>> queryListHouseInfo(Set<String> houseIds) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListHouseInfo", houseIds);
public Result<List<HouseInfoDTO>> queryListHouseInfo(Set<String> houseIds ,String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryListHouseInfo", houseIds, customerId);
}
@Override

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -229,7 +229,7 @@ public class HouseController implements ResultDataResolver {
}
@PostMapping( "queryListHouseInfo")
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds){
return new Result<List<HouseInfoDTO>>().ok(houseService.queryListHouseInfo(houseIds));
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds, @RequestParam("customerId") String customerId){
return new Result<List<HouseInfoDTO>>().ok(houseService.queryListHouseInfo(houseIds,customerId));
}
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java

@ -62,20 +62,20 @@ public class IcHouseRedis {
* @author zxc
* @date 2022/1/18 3:55 下午
*/
public void setHouseInfo(String houseId, Map<String, Object> map){
String key = RedisKeys.getHouseInfoCacheKey(houseId);
public void setHouseInfo(String houseId, Map<String, Object> map,String customerId){
String key = RedisKeys.getHouseInfoCacheKey(houseId,customerId);
redisUtils.hMSet(key, map);
}
public HouseInfoDTO getHouseInfo(String houseId){
String key = RedisKeys.getHouseInfoCacheKey(houseId);
public HouseInfoDTO getHouseInfo(String houseId,String customerId){
String key = RedisKeys.getHouseInfoCacheKey(houseId,customerId);
Map<String, Object> map = redisUtils.hGetAll(key);
if (!CollectionUtils.isEmpty(map)){
return ConvertUtils.mapToEntity(map,HouseInfoDTO.class);
}
HouseInfoDTO houseInfo = icHouseDao.queryHouseInfoByHouseId(houseId);
Map<String, Object> result = BeanUtil.beanToMap(houseInfo, false, true);
setHouseInfo(houseId,result);
setHouseInfo(houseId,result,houseInfo.getCustomerId());
return houseInfo;
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -61,5 +61,5 @@ public interface HouseService {
void exportBuildinginfo(ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception;
List<HouseInfoDTO> queryListHouseInfo(Set<String> houseIds);
List<HouseInfoDTO> queryListHouseInfo(Set<String> houseIds, String customerId);
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -313,13 +313,13 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
}*/
@Override
public List<HouseInfoDTO> queryListHouseInfo(Set<String> houseIdList) {
public List<HouseInfoDTO> queryListHouseInfo(Set<String> houseIdList, String customerId) {
if(org.apache.commons.collections4.CollectionUtils.isEmpty(houseIdList)){
return new ArrayList<>();
}
List<HouseInfoDTO> result = new ArrayList<>();
houseIdList.forEach(h -> {
result.add(icHouseRedis.getHouseInfo(h));
result.add(icHouseRedis.getHouseInfo(h,customerId));
});
return result;
}

1
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -315,6 +315,7 @@
IFNULL(ih.HOUSE_NAME,'') as HOUSE_NAME,
IFNULL(ib.LONGITUDE,'') as buildingLongitude,
IFNULL(ib.LATITUDE,'') as buildingLatitude,
ih.CUSTOMER_ID AS customerId,
concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.HOUSE_NAME,'')) AS allName
FROM ic_house ih
left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id )

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -526,7 +526,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
Map<String, AllGridsByUserIdResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity()));
//查询房子名称
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,formDTO.getCustomerId());
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>();
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
for (Map<String, Object> resultMap : list) {
@ -1119,7 +1119,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal())));
List<PersonWarnRightListResultDTO.PersonWarnRightList> userList = disposeCategory(list, configList);
Result<List<HouseInfoDTO>> houseInfosResult = govOrgOpenFeignClient.queryListHouseInfo(userList.stream().distinct().map(m -> m.getHomeId()).collect(Collectors.toSet()));
Result<List<HouseInfoDTO>> houseInfosResult = govOrgOpenFeignClient.queryListHouseInfo(userList.stream().distinct().map(m -> m.getHomeId()).collect(Collectors.toSet()),tokenDto.getCustomerId());
if (!houseInfosResult.success()){
throw new EpmetException("查询房屋信息失败...");
}

Loading…
Cancel
Save