Browse Source

补充

master
qushutong 2 years ago
parent
commit
50e40bbe39
  1. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  2. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  3. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  4. 46
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

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

@ -792,4 +792,16 @@ public class HouseController implements ResultDataResolver {
return new Result<PageData<HouseLangchaoListResultDTO>>().ok(houseService.houseListForLangchao(formDTO)); return new Result<PageData<HouseLangchaoListResultDTO>>().ok(houseService.houseListForLangchao(formDTO));
} }
/**
* @Author lichao
* @Description 人房房屋总数饼图 redis
**/
@GetMapping("ceshifangwu")
public Result ceshifangwu() {
icHouseService.updataHouseCount();
return new Result<>().ok("");
}
} }

15
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -1675,4 +1675,19 @@ public class IcResiUserController implements ResultDataResolver {
return new Result<PageData<ResiLangchaoListResultDTO>>().ok(icResiUserService.resiListForLangchao(formDTO)); return new Result<PageData<ResiLangchaoListResultDTO>>().ok(icResiUserService.resiListForLangchao(formDTO));
} }
/**
*
* @description: 测试人员图谱缓存
* @author qushutong
* @date 2023/11/3 14:58
* @param
* @return com.epmet.commons.tools.utils.Result
* @Version1.0
**/
@GetMapping("ceshirenhuancun")
public Result ceshihuancun() {
icResiUserService.updateUserDistribute();
return new Result<>();
}
} }

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -608,4 +608,6 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
PageData<ResiLangchaoListResultDTO> resiListForLangchao(ResiListLangchaoFormDTO formDTO); PageData<ResiLangchaoListResultDTO> resiListForLangchao(ResiListLangchaoFormDTO formDTO);
boolean userChartRedis(); boolean userChartRedis();
void updateUserDistribute();
} }

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

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

Loading…
Cancel
Save