Browse Source

居民画像orgIdPathlike

dev
yinzuomei 2 years ago
parent
commit
24fc1b1af5
  1. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  2. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  3. 6
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

7
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -464,11 +464,13 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
List<ResiPortrayalResultDTO> queryEducationDistribute(@Param("customerId") String customerId,
@Param("orgId") String orgId,
@Param("orgType") String orgType);
@Param("orgType") String orgType,
@Param("orgIdPath")String orgIdPath);
List<ResiPortrayalResultDTO> selectAgeAgeDistribute(@Param("customerId") String customerId,
@Param("orgId") String orgId,
@Param("orgType") String orgType);
@Param("orgType") String orgType,
@Param("orgIdPath")String orgIdPath);
/**
* @param customerId
@ -481,6 +483,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
List<ResiPortrayalDetailDTO> selectPortrayalResiList(@Param("customerId") String customerId,
@Param("orgId") String orgId,
@Param("orgType") String orgType,
@Param("orgIdPath") String orgIdPath,
@Param("codeType")String codeType,
@Param("code") String code);
}

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

@ -3919,8 +3919,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId();
orgType = OrgTypeEnum.AGENCY.getCode();
}
String orgIdPath=StrConstant.EPMETY_STR;
if(OrgTypeEnum.AGENCY.getCode().equals(orgType)){
orgIdPath=CustomerOrgRedis.getOrgIdPath(orgId,orgType);
}
List<ResiPortrayalResultDTO> resultList=getDefaultAgeDistribute();
List<ResiPortrayalResultDTO> list=baseDao.selectAgeAgeDistribute(customerId,orgId,orgType);
List<ResiPortrayalResultDTO> list=baseDao.selectAgeAgeDistribute(customerId,orgId,orgType,orgIdPath);
if(CollectionUtils.isEmpty(list)){
return resultList;
}
@ -3986,8 +3990,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (!dictResult.success() || CollectionUtils.isEmpty(dictResult.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "学历字典获取失败", "学历字典获取失败");
}
String orgIdPath=StrConstant.EPMETY_STR;
if(OrgTypeEnum.AGENCY.getCode().equals(orgType)){
orgIdPath=CustomerOrgRedis.getOrgIdPath(orgId,orgType);
}
//按照学历分组,查询居民数量
List<ResiPortrayalResultDTO> totalList = baseDao.queryEducationDistribute(customerId, orgId, orgType);
List<ResiPortrayalResultDTO> totalList = baseDao.queryEducationDistribute(customerId, orgId, orgType,orgIdPath);
Map<String,Integer> map = totalList.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode,ResiPortrayalResultDTO::getTotalResi));
List<ResiPortrayalResultDTO> resultDTOList = new ArrayList<>();
dictResult.getData().forEach(dict -> {
@ -4037,8 +4045,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId();
orgType = OrgTypeEnum.AGENCY.getCode();
}
String orgIdPath=StrConstant.EPMETY_STR;
if(OrgTypeEnum.AGENCY.getCode().equals(orgType)){
orgIdPath=CustomerOrgRedis.getOrgIdPath(orgId,orgType);
}
PageHelper.startPage(pageNo, pageSize);
List<ResiPortrayalDetailDTO> list = baseDao.selectPortrayalResiList(customerId, orgId, orgType,codeType, code);
List<ResiPortrayalDetailDTO> list = baseDao.selectPortrayalResiList(customerId, orgId, orgType,orgIdPath,codeType, code);
if(CollectionUtils.isNotEmpty(list)){
Set<String> houseIds=list.stream().map(m -> m.getHomeId()).collect(Collectors.toSet());
//查询房子名称

6
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -1606,7 +1606,7 @@
r.DEL_FLAG = '0'
AND r.CUSTOMER_ID = #{customerId}
<if test='orgType == "agency" '>
AND ( r.AGENCY_ID = #{orgId} OR r.PIDS LIKE concat('%',#{orgId},'%') )
and r.PIDS LIKE concat(#{orgIdPath},'%')
</if>
<if test='orgType == "grid" '>
and r.GRID_ID = #{orgId}
@ -1647,7 +1647,7 @@
and u.BIRTHDAY is not null
and u.BIRTHDAY !=''
<if test='orgType == "agency" '>
AND ( u.AGENCY_ID = #{orgId} OR u.PIDS LIKE concat('%',#{orgId},'%') )
and u.PIDS LIKE concat(#{orgIdPath},'%')
</if>
<if test='orgType == "grid" '>
and u.GRID_ID = #{orgId}
@ -1683,7 +1683,7 @@
AND u.CUSTOMER_ID = #{customerId}
AND u.`STATUS` = '0'
<if test='orgType == "agency" '>
AND ( u.AGENCY_ID = #{orgId} OR u.PIDS LIKE concat('%',#{orgId},'%') )
and u.PIDS LIKE concat(#{orgIdPath},'%')
</if>
<if test='orgType == "grid" '>
and u.GRID_ID = #{orgId}

Loading…
Cancel
Save