|
|
@ -4000,13 +4000,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
ResiPortrayalResult result = new ResiPortrayalResult(); |
|
|
|
if (null != redisUtils.get(RedisKeys.getAgeDistribute()) && StringUtils.isBlank(orgId) && StringUtils.isBlank(orgType)) { |
|
|
|
result = (ResiPortrayalResult) redisUtils.get(RedisKeys.getAgeDistribute()); |
|
|
|
} else if (null != redisUtils.get(RedisKeys.getAgeDistribute()) && "1535072605630230530".equals(orgId) && "agency".equals(orgType)) { |
|
|
|
result = (ResiPortrayalResult) redisUtils.get(RedisKeys.getAgeDistribute()); |
|
|
|
} else { |
|
|
|
result = queryage(customerId, staffId, orgId, orgType, result); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
private ResiPortrayalResult queryage(String customerId, String staffId, String orgId, String orgType, ResiPortrayalResult result) { |
|
|
|
if (StringUtils.isBlank(orgId)) { |
|
|
|
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId(); |
|
|
|
orgType = OrgTypeEnum.AGENCY.getCode(); |
|
|
@ -4015,6 +4011,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
if (OrgTypeEnum.AGENCY.getCode().equals(orgType)) { |
|
|
|
orgIdPath = CustomerOrgRedis.getOrgIdPath(orgId, orgType); |
|
|
|
} |
|
|
|
result = queryage(customerId, orgIdPath, orgId, orgType, result); |
|
|
|
|
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
private ResiPortrayalResult queryage(String customerId, String orgIdPath, String orgId, String orgType, ResiPortrayalResult result) { |
|
|
|
|
|
|
|
List<ResiPortrayalResultDTO> resultList = getDefaultAgeDistribute(); |
|
|
|
List<ResiPortrayalResultDTO> list = baseDao.selectAgeAgeDistribute(customerId, orgId, orgType, orgIdPath); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
@ -4081,17 +4085,24 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
ResiPortrayalResult result = new ResiPortrayalResult(); |
|
|
|
if (null != redisUtils.get(RedisKeys.getEducationDistribute()) && StringUtils.isBlank(orgId) && StringUtils.isBlank(orgType)) { |
|
|
|
result = (ResiPortrayalResult) redisUtils.get(RedisKeys.getEducationDistribute()); |
|
|
|
} else if (null != redisUtils.get(RedisKeys.getAgeDistribute()) && "1535072605630230530".equals(orgId) && "agency".equals(orgType)) { |
|
|
|
result = (ResiPortrayalResult) redisUtils.get(RedisKeys.getEducationDistribute()); |
|
|
|
} else { |
|
|
|
result = queryEdu(customerId, staffId, orgId, orgType, result); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
private ResiPortrayalResult queryEdu(String customerId, String staffId, String orgId, String orgType, ResiPortrayalResult result) { |
|
|
|
if (StringUtils.isBlank(orgId)) { |
|
|
|
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); |
|
|
|
} |
|
|
|
result = queryEdu(customerId, orgIdPath, orgId, orgType, result); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
private ResiPortrayalResult queryEdu(String customerId, String orgIdPath, String orgId, String orgType, ResiPortrayalResult result) { |
|
|
|
|
|
|
|
// 获取文化程度字典
|
|
|
|
DictListFormDTO dictFormDTO = new DictListFormDTO(); |
|
|
|
dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode()); |
|
|
@ -4099,10 +4110,7 @@ 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, orgIdPath); |
|
|
|
Map<String, Integer> map = totalList.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode, ResiPortrayalResultDTO::getTotalResi)); |
|
|
@ -4372,13 +4380,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void updateUserDistribute() { |
|
|
|
ResiPortrayalResult result = new ResiPortrayalResult(); |
|
|
|
ResiPortrayalResult resiPortrayalResult = queryage("1535072605621841922", "1535072605630230530", "", "", result); |
|
|
|
ResiPortrayalResult resiPortrayalResult = queryage("1535072605621841922", "1535072605630230530", "", "agency", result); |
|
|
|
redisUtils.set(RedisKeys.getAgeDistribute(), resiPortrayalResult, RedisUtils.DEFAULT_EXPIRE); |
|
|
|
ResiPortrayalResult portrayalResult = new ResiPortrayalResult(); |
|
|
|
ResiPortrayalResult resiEducationResult = queryEdu("1535072605621841922", "1535072605630230530", "", "", portrayalResult); |
|
|
|
ResiPortrayalResult resiEducationResult = queryEdu("1535072605621841922", "1535072605630230530", "", "agency", portrayalResult); |
|
|
|
redisUtils.set(RedisKeys.getEducationDistribute(), resiEducationResult, RedisUtils.DEFAULT_EXPIRE); |
|
|
|
} |
|
|
|
|
|
|
|