From f5b77a2f2d18236776a050b218578908f7f44934 Mon Sep 17 00:00:00 2001 From: qushutong <1976590620@qq.com> Date: Fri, 3 Nov 2023 14:16:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=94=BB=E5=83=8F=20?= =?UTF-8?q?=E6=88=BF=E5=B1=8B=E7=94=BB=E5=83=8F=E5=8A=A0=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 53 +++ .../com/epmet/controller/HouseController.java | 5 + .../com/epmet/service/IcHouseService.java | 11 + .../service/impl/IcHouseServiceImpl.java | 124 ++++-- .../service/impl/IcResiUserServiceImpl.java | 408 ++++++++++-------- 5 files changed, 372 insertions(+), 229 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 574f83aaa2..efa17e5e52 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -1100,4 +1100,57 @@ public class RedisKeys { public static String getSubUserHouseList(String orgType,String agencyId) { return rootPrefix.concat("govorg:house:subUserHouseList:".concat(orgType).concat(StrConstant.COLON).concat(agencyId)); } + + /** + * + * @description: 年龄人画像 + * @author qushutong + * @date 2023/11/2 18:08 + * @param + * @return java.lang.String + * @Version1.0 + **/ + public static String getAgeDistribute() { + return rootPrefix.concat("resi:icresiuser:agechart:".concat("age")); + } + + + /** + * + * @description: 年龄人画像 + * @author qushutong + * @date 2023/11/2 18:08 + * @param + * @return java.lang.String + * @Version1.0 + **/ + public static String getEducationDistribute() { + return rootPrefix.concat("resi:icresiuser:educhart:".concat("education")); + } + + /** + * + * @description: 房屋画像 房屋用途 + * @author qushutong + * @date 2023/11/3 9:33 + * @param + * @return java.lang.String + * @Version1.0 + **/ + public static String getHousePurposeCountKey() { + return rootPrefix.concat("resi:icresiuser:housechart:".concat("housepurpose")); + } + + /** + * + * @description: 房屋画像 房屋用途 + * @author qushutong + * @date 2023/11/3 9:33 + * @param + * @return java.lang.String + * @Version1.0 + **/ + public static String getHouseStatusCountKey() { + return rootPrefix.concat("resi:icresiuser:housechart:".concat("housestatus")); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index dee57ed8ea..5da3c3d834 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -57,6 +57,7 @@ import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.remote.EpmetUserRemoteService; import com.epmet.service.HouseService; +import com.epmet.service.IcHouseService; import com.epmet.util.ExcelPoiUtils; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; @@ -109,6 +110,9 @@ public class HouseController implements ResultDataResolver { @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private IcHouseService icHouseService; + @ReportRequest @PostMapping("houselist") @MaskResponse(fieldNames = {"ownerIdCard", "ownerPhone"}, @@ -397,6 +401,7 @@ public class HouseController implements ResultDataResolver { **/ @PostMapping("housechartRedis") public Result houseChartRedis() { + icHouseService.updataHouseCount(); return new Result<>().ok(houseService.houseChartRedis()); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java index 72fa7d2674..9730db6e68 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java @@ -146,4 +146,15 @@ public interface IcHouseService extends BaseService { HouseCountPictureResultDTO getHouseStatusCount(HouseCountPictureFormDTO dto); PageData getHousePictureList(HouseCountPictureFormDTO dto); + + /** + * + * @description: 缓存房屋画像 + * @author qushutong + * @date 2023/11/3 9:59 + * @param + * @return void + * @Version1.0 + **/ + void updataHouseCount(); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 0f81c75531..0ab38c3e96 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -45,6 +45,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.record.PageBreakRecord; +import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -259,7 +260,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl().ok(checkHomeInfoResultInfo); @@ -399,10 +401,10 @@ public class IcHouseServiceImpl extends BaseServiceImpl().ok(checkHomeInfoResultInfo); @@ -410,10 +412,10 @@ public class IcHouseServiceImpl extends BaseServiceImpl().ok(checkHomeInfoResultInfo); @@ -422,11 +424,11 @@ public class IcHouseServiceImpl extends BaseServiceImpl type = new HashMap<>(); + Map type = new HashMap<>(); resultDTO.setTotal(0); - if (dto.getOrgType().equals("community") || dto.getOrgType().equals("street") ||dto.getOrgType().equals("district") ||dto.getOrgType().equals("city")){ + if (dto.getOrgType().equals("community") || dto.getOrgType().equals("street") || dto.getOrgType().equals("district") || dto.getOrgType().equals("city")) { dto.setOrgType("agency"); } - List list = baseDao.getHousePurposeCount(dto.getOrgId(),dto.getOrgType(),dto.getTimeStart(),dto.getTimeEnd()); + List list = baseDao.getHousePurposeCount(dto.getOrgId(), dto.getOrgType(), dto.getTimeStart(), dto.getTimeEnd()); list.forEach( - result->{ - resultDTO.setTotal(resultDTO.getTotal()+result.getCount()); - type.put(result.getType(),result.getType()); + result -> { + resultDTO.setTotal(resultDTO.getTotal() + result.getCount()); + type.put(result.getType(), result.getType()); } ); HouseCountPictureListResultDTO houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); - if (type.get("1") == null){ + if (type.get("1") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("1"); houseCountPictureListResultDTO.setCount(0); list.add(houseCountPictureListResultDTO); } - if (type.get("2") == null){ + if (type.get("2") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("2"); houseCountPictureListResultDTO.setCount(0); list.add(houseCountPictureListResultDTO); } - if (type.get("3") == null){ + if (type.get("3") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("3"); houseCountPictureListResultDTO.setCount(0); list.add(houseCountPictureListResultDTO); } - if (type.get("4") == null){ + if (type.get("4") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("4"); houseCountPictureListResultDTO.setCount(0); list.add(houseCountPictureListResultDTO); } - if (type.get("5") == null){ + if (type.get("5") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("5"); houseCountPictureListResultDTO.setCount(0); list.add(houseCountPictureListResultDTO); } - if (type.get("6") == null){ + if (type.get("6") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("6"); houseCountPictureListResultDTO.setCount(0); list.add(houseCountPictureListResultDTO); } - if (type.get("7") == null){ + if (type.get("7") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("7"); houseCountPictureListResultDTO.setCount(0); @@ -504,54 +531,65 @@ public class IcHouseServiceImpl extends BaseServiceImpl type = new HashMap<>(); + Map type = new HashMap<>(); resultDTO.setTotal(0); - if (dto.getOrgType().equals("community") || dto.getOrgType().equals("street") ||dto.getOrgType().equals("district") ||dto.getOrgType().equals("city")){ + if (dto.getOrgType().equals("community") || dto.getOrgType().equals("street") || dto.getOrgType().equals("district") || dto.getOrgType().equals("city")) { dto.setOrgType("agency"); } - List list =baseDao.getHouseStatusCount(dto.getOrgId(),dto.getOrgType(),dto.getTimeStart(),dto.getTimeEnd()); + List list = baseDao.getHouseStatusCount(dto.getOrgId(), dto.getOrgType(), dto.getTimeStart(), dto.getTimeEnd()); list.forEach( - result->{ - type.put(result.getType(),result.getType()); - resultDTO.setTotal(resultDTO.getTotal()+result.getCount()); + result -> { + type.put(result.getType(), result.getType()); + resultDTO.setTotal(resultDTO.getTotal() + result.getCount()); } ); HouseCountPictureListResultDTO houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); - if (type.get("1") == null){ + if (type.get("1") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("1"); houseCountPictureListResultDTO.setCount(0); list.add(houseCountPictureListResultDTO); } - if (type.get("2") == null){ + if (type.get("2") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("2"); houseCountPictureListResultDTO.setCount(0); list.add(houseCountPictureListResultDTO); } - if (type.get("3") == null){ + if (type.get("3") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("3"); houseCountPictureListResultDTO.setCount(0); list.add(houseCountPictureListResultDTO); } - if (type.get("0") == null){ + if (type.get("0") == null) { houseCountPictureListResultDTO = new HouseCountPictureListResultDTO(); houseCountPictureListResultDTO.setType("0"); houseCountPictureListResultDTO.setCount(0); list.add(houseCountPictureListResultDTO); } resultDTO.setList(list); - return resultDTO; } @@ -560,22 +598,22 @@ public class IcHouseServiceImpl extends BaseServiceImpl list = baseDao.getHousePictureList(dto.getOrgId(),dto.getOrgType(),dto.getTimeStart(),dto.getTimeEnd(),dto.getPurpose(),dto.getRentFlag()); + List list = baseDao.getHousePictureList(dto.getOrgId(), dto.getOrgType(), dto.getTimeStart(), dto.getTimeEnd(), dto.getPurpose(), dto.getRentFlag()); - list.forEach(entity->{ + list.forEach(entity -> { String[] agencyIds = entity.getOrgIdPath().split(":"); - LambdaQueryWrapper queryWrapperAgency = new LambdaQueryWrapper().in(CustomerAgencyEntity::getId,agencyIds); + LambdaQueryWrapper queryWrapperAgency = new LambdaQueryWrapper().in(CustomerAgencyEntity::getId, agencyIds); List customerAgencyEntities = customerAgencyDao.selectList(queryWrapperAgency); - customerAgencyEntities.forEach(agency->{ - if (agency.getLevel().equals("district")){ + customerAgencyEntities.forEach(agency -> { + if (agency.getLevel().equals("district")) { entity.setDistrictName(agency.getOrganizationName()); - }else if (agency.getLevel().equals("street")){ + } else if (agency.getLevel().equals("street")) { entity.setStreetName(agency.getOrganizationName()); - }else if (agency.getLevel().equals("community")){ + } else if (agency.getLevel().equals("community")) { entity.setCommunityName(agency.getOrganizationName()); } }); @@ -583,6 +621,6 @@ public class IcHouseServiceImpl extends BaseServiceImpl pageInfo = new PageInfo<>(list); - return new PageData<>(list,pageInfo.getTotal()); + return new PageData<>(list, pageInfo.getTotal()); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index c085e94254..88d244be7c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -208,20 +208,20 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> subTableRes = operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO); if (subTableRes.success() && !CollectionUtils.isEmpty(subTableRes.getData())) { for (String subTalbeName : subTableRes.getData()) { - baseDao.updateSubTableToDel(subTalbeName, formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); + baseDao.updateSubTableToDel(subTalbeName, formDTO.getIcResiUserId(), formDTO.getCurrentStaffId()); } } //删除ic_user_transfer_record、ic_user_change_record、ic_user_change_detailed - icUserTransferRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); - icUserChangeRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); - icUserChangeDetailedService.deleteByIcResiUserId(formDTO.getIcResiUserId(),formDTO.getCurrentStaffId()); + icUserTransferRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(), formDTO.getCurrentStaffId()); + icUserChangeRecordService.deleteByIcResiUserId(formDTO.getIcResiUserId(), formDTO.getCurrentStaffId()); + icUserChangeDetailedService.deleteByIcResiUserId(formDTO.getIcResiUserId(), formDTO.getCurrentStaffId()); //如果是烟台客户,删除居民时,同时删除死亡数据data_sync_record_death、残疾记录data_sync_record_disability - if(CustomerIdConstant.YT_CUSTOMER_ID.equals(formDTO.getCustomerId())){ + if (CustomerIdConstant.YT_CUSTOMER_ID.equals(formDTO.getCustomerId())) { SpringContextUtils.getBean(DataSyncRecordDisabilityService.class).deleteByIcResiUserId(formDTO.getIcResiUserId()); SpringContextUtils.getBean(DataSyncRecordDeathService.class).deleteByIcResiUserId(formDTO.getIcResiUserId()); } @@ -230,30 +230,31 @@ public class IcResiUserServiceImpl extends BaseServiceImpl resiWrapper=new LambdaQueryWrapper<>(); - resiWrapper.eq(IcResiUserEntity::getAgencyId,formDTO.getAgencyId()); + public void deleteInternal(InternalDelIcResiUserFormDTO formDTO) { + if (StringUtils.isNotBlank(formDTO.getAgencyId())) { + LambdaQueryWrapper resiWrapper = new LambdaQueryWrapper<>(); + resiWrapper.eq(IcResiUserEntity::getAgencyId, formDTO.getAgencyId()); resiWrapper.select(IcResiUserEntity::getId); - List resiIds=icResiUserDao.selectList(resiWrapper); - for(IcResiUserEntity entity:resiIds){ - baseDao.updateToDel(entity.getId(),formDTO.getCurrentStaffId()); + List resiIds = icResiUserDao.selectList(resiWrapper); + for (IcResiUserEntity entity : resiIds) { + baseDao.updateToDel(entity.getId(), formDTO.getCurrentStaffId()); CustomerFormQueryDTO queryDTO = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class); Result> subTableRes = operCustomizeOpenFeignClient.queryIcResiSubTables(queryDTO); if (subTableRes.success() && !CollectionUtils.isEmpty(subTableRes.getData())) { for (String subTalbeName : subTableRes.getData()) { - baseDao.updateSubTableToDel(subTalbeName, entity.getId(),formDTO.getCurrentStaffId()); + baseDao.updateSubTableToDel(subTalbeName, entity.getId(), formDTO.getCurrentStaffId()); } } //删除ic_user_transfer_record、ic_user_change_record、ic_user_change_detailed - icUserTransferRecordService.deleteByIcResiUserId(entity.getId(),formDTO.getCurrentStaffId()); - icUserChangeRecordService.deleteByIcResiUserId(entity.getId(),formDTO.getCurrentStaffId()); - icUserChangeDetailedService.deleteByIcResiUserId(entity.getId(),formDTO.getCurrentStaffId()); + icUserTransferRecordService.deleteByIcResiUserId(entity.getId(), formDTO.getCurrentStaffId()); + icUserChangeRecordService.deleteByIcResiUserId(entity.getId(), formDTO.getCurrentStaffId()); + icUserChangeDetailedService.deleteByIcResiUserId(entity.getId(), formDTO.getCurrentStaffId()); } } } @@ -337,7 +338,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, map.get("HOME_ID")); wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) - .eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); + .eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); List entityList = baseDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(entityList)) { String errorMsg = "房屋下已存在户主"; @@ -354,7 +355,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, entity.getHomeId()); wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) - .eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); + .eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); List entityList = baseDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(entityList)) { String errorMsg = "房屋下已存在户主"; @@ -629,8 +631,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl map) { @@ -917,7 +919,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, homeId); - wrapper.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); + wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); wrapper.orderByAsc(IcResiUserEntity::getYhzgx); List list = baseDao.selectList(wrapper); @@ -966,13 +968,13 @@ public class IcResiUserServiceImpl extends BaseServiceImplIcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && ORG_FIELDS.contains(o.getColumnName())); + formDTO.getConditions().removeIf(o -> IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && ORG_FIELDS.contains(o.getColumnName())); //添加数据权限 List staffOrgPaths; List agencyIds = null; //如果查询条件中 没有有居民表的agencyId,则查询该工作人员所属组织的信息 - if (queryAgencyIdList.isEmpty() && queryGridIdList.isEmpty()){ + if (queryAgencyIdList.isEmpty() && queryGridIdList.isEmpty()) { CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); agencyIds = Arrays.asList(staffInfoCacheResult.getAgencyId()); @@ -990,7 +992,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> subTablesRes = operCustomizeOpenFeignClient.querySubTables(ConvertUtils.sourceToTarget(formDTO,CustomerFormQueryDTO.class)); + Result> subTablesRes = operCustomizeOpenFeignClient.querySubTables(ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class)); List subTables = subTablesRes.getData(); // log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true)); @@ -1058,10 +1060,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl gridInfoMap =getGridInfoMap(gridIds); + Map gridInfoMap = getGridInfoMap(gridIds); //查询房子名称 - Map houseInfoMap =getHouseInfoMap(houseIds,formDTO.getCustomerId()); - handleList(list,gridInfoMap,houseInfoMap,formDTO.getCustomerId()); + Map houseInfoMap = getHouseInfoMap(houseIds, formDTO.getCustomerId()); + handleList(list, gridInfoMap, houseInfoMap, formDTO.getCustomerId()); pageInfo.setList(list); if (formDTO.getIsPage()) { return new PageData<>(pageInfo.getList(), pageInfo.getTotal(), formDTO.getPageSize()); @@ -1071,19 +1073,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl queryResultColumns(IcResiUserPageFormDTO formDTO) { // 查询列表展示项,如果没有,直接返回 - CustomerFormQueryDTO queryDTO1 = ConvertUtils.sourceToTarget(formDTO,CustomerFormQueryDTO.class); + CustomerFormQueryDTO queryDTO1 = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class); Result> resultColumnRes = operCustomizeOpenFeignClient.queryConditions(queryDTO1); if (!resultColumnRes.success() || CollectionUtils.isEmpty(resultColumnRes.getData())) { - log.error(formDTO.getCustomerId()+"没有配置列表展示列"); + log.error(formDTO.getCustomerId() + "没有配置列表展示列"); // return new PageData(new ArrayList(), NumConstant.ZERO); - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"居民信息表单未配置列表展示项","居民信息表单未配置列表展示项"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民信息表单未配置列表展示项", "居民信息表单未配置列表展示项"); } List resultColumns = resultColumnRes.getData(); return resultColumns; } - private void handleList(List> list, Map gridInfoMap, Map houseInfoMap,String customerId) { - if(CollectionUtils.isEmpty(list)){ + private void handleList(List> list, Map gridInfoMap, Map houseInfoMap, String customerId) { + if (CollectionUtils.isEmpty(list)) { return; } //查询需求分类字典 @@ -1169,7 +1171,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getHouseInfoMap(Set houseIds,String customerId) { + private Map getHouseInfoMap(Set houseIds, String customerId) { //查询房子名称 Result> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, customerId); List houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>(); @@ -1265,7 +1267,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl finalSubTables = getFinalSubables(customerId, formCode, resultTableName, conditions); Map> map = getFinalSubables(customerId, formCode, resultTableName, conditions, null); return baseDao.dynamicQuery(customerId, resultTableName, conditions, map.get("finalSubTables"), null, - currentStaffAgencyId, Arrays.asList(staffOrgPath), null,map.get("groupByTables")); + currentStaffAgencyId, Arrays.asList(staffOrgPath), null, map.get("groupByTables")); } @NotNull @@ -1340,7 +1342,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl houseInfo = new ArrayList<>(); - if(null!=houseInfoRes.getData()&& !CollectionUtils.isEmpty(houseInfoRes.getData())){ + if (null != houseInfoRes.getData() && !CollectionUtils.isEmpty(houseInfoRes.getData())) { houseInfo.add(houseInfoRes.getData().get(0).getAllName()); } //2022.9.14 end @@ -1611,7 +1613,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId()); - wrapper.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); + wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); wrapper.orderByAsc(IcResiUserEntity::getYhzgx); List resiUserList = baseDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(resiUserList)) { @@ -1628,9 +1630,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl epidemicPreventionList(EpidemicPreventionFormDTO formDTO) { - if(StringUtils.isBlank(formDTO.getAgencyId())){ + if (StringUtils.isBlank(formDTO.getAgencyId())) { //没有指定查询某个组织时,默认查询当前用户所属组织及下级 CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); if (null != staffInfo) { @@ -1868,10 +1870,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl list = new ArrayList<>(); - if (formDTO.getIsPage()){ + if (formDTO.getIsPage()) { PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); list = baseDao.getEpidemicPreventionList(formDTO); - }else { + } else { list = baseDao.getEpidemicPreventionList(formDTO); } @@ -2213,13 +2215,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getDelAgencyGridIdList(formDTO.getOrgId()); if (!result.success()) { @@ -2262,7 +2264,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl lqw = new LambdaQueryWrapper<>(); lqw.eq(IcResiUserEntity::getCustomerId, customerId) .eq(IcResiUserEntity::getHomeId, houseId) - .eq(IcResiUserEntity::getStatus,"0") + .eq(IcResiUserEntity::getStatus, "0") .select( IcResiUserEntity::getId, IcResiUserEntity::getHomeId, @@ -2386,16 +2388,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl vaccineLog = user.getVaccineLog(); - if(vaccineLog != null && vaccineLog.size() > 0){ + if (vaccineLog != null && vaccineLog.size() > 0) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 根据身份证号,客户ID删除旧记录 - icVaccineDao.deleteByIdCard(user.getIdCard(),user.getCustomerId()); + icVaccineDao.deleteByIdCard(user.getIdCard(), user.getCustomerId()); // 删除疫苗接种记录关系表数据 - List delList = icVaccineDao.setDeleteByIdCard(user.getIdCard(),user.getCustomerId()); - if(delList != null && delList.size() > 0){ + List delList = icVaccineDao.setDeleteByIdCard(user.getIdCard(), user.getCustomerId()); + if (delList != null && delList.size() > 0) { icVaccineRelationDao.deleteByIdList(delList); } - for(VaccineLogDetailDTO vaccineLogDetailDTO : vaccineLog){ + for (VaccineLogDetailDTO vaccineLogDetailDTO : vaccineLog) { // 插入疫苗接种记录数据 IcVaccineEntity icVaccineEntity = new IcVaccineEntity(); icVaccineEntity.setCustomerId(user.getCustomerId()); @@ -2419,9 +2421,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl changeIcResiUserBelongTo(TokenDto tokenDto, IcUserBelongToChangedFormDTO formDTO) { List resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(), formDTO.getSourceGridId(), formDTO.getNeighborhoodId()); if (StringUtils.isBlank(formDTO.getCustomerId()) || StringUtils.isBlank(formDTO.getSourceGridId()) - ||StringUtils.isBlank(formDTO.getTargetGridId())){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误","参数错误"); + || StringUtils.isBlank(formDTO.getTargetGridId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "参数错误", "参数错误"); } IcResiUserEntity entity = new IcResiUserEntity(); entity.setGridId(formDTO.getTargetGridId()); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(IcResiUserEntity::getGridId,formDTO.getSourceGridId()) - .eq(IcResiUserEntity::getVillageId,formDTO.getNeighborhoodId()) - .eq(IcResiUserEntity::getCustomerId,formDTO.getCustomerId()); - baseDao.update(entity,wrapper); + wrapper.eq(IcResiUserEntity::getGridId, formDTO.getSourceGridId()) + .eq(IcResiUserEntity::getVillageId, formDTO.getNeighborhoodId()) + .eq(IcResiUserEntity::getCustomerId, formDTO.getCustomerId()); + baseDao.update(entity, wrapper); //不调用原来的更新居民了 太慢 /*List resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(), formDTO.getSourceGridId()); if (CollectionUtils.isEmpty(resiUserIdList)) { @@ -2784,7 +2786,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, dto.getHomeId()); wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) - .eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); + .eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); List entityList = baseDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(entityList)) { String errorMsg = "房屋下已存在户主"; throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); } } - return updateOldMemberInfo(tokenDto.getCustomerId(),dto); + return updateOldMemberInfo(tokenDto.getCustomerId(), dto); } else { String errorMsg = "您无权操作其他家庭的成员,如有问题请联系工作人员"; throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); @@ -2864,7 +2866,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, dto.getHomeId()); wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) - .eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); + .eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); List entityList = baseDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(entityList)) { String errorMsg = "房屋下已存在户主"; @@ -2883,7 +2885,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl userResult = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto); - if (!userResult.success()){ + if (!userResult.success()) { throw new EpmetException("查询用户信息失败..."); } changeRecordEntity.setOperatorName(userResult.getData().getRealName()); @@ -2915,7 +2917,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId()); wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) - .eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); + .eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); List entityList = baseDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(entityList)) { String errorMsg = "房屋下已存在户主"; @@ -2932,7 +2934,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, houseInfo.getHouseId()); wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) - .eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR); + .eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); List entityList = baseDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(entityList)) { String errorMsg = "房屋下已存在户主"; @@ -2971,7 +2973,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl queryVolunteerList(String customerId, String userId) { - CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(customerId,userId); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询当前登录用户信息异常"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询当前登录用户信息异常"); } LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getCustomerId, customerId); @@ -3154,11 +3157,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl baseDao.getResiUserCountGroupHomeId(customerId)); System.out.println(houseReisCountListPage.getResult().size()); List> result = houseReisCountListPage.getResult(); - Result effectRowResult = govOrgOpenFeignClient.updateIcHouseResiNumber(result); - if (effectRowResult == null || !effectRowResult.success()){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"调用org服务失败"); - } - log.debug("updateIcHouseResiNumber org effectRowResult:{}",JSON.toJSONString(effectRowResult)); + Result effectRowResult = govOrgOpenFeignClient.updateIcHouseResiNumber(result); + if (effectRowResult == null || !effectRowResult.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用org服务失败"); + } + log.debug("updateIcHouseResiNumber org effectRowResult:{}", JSON.toJSONString(effectRowResult)); } while (houseReisCountListPage.getResult().size() == pageSize); log.info("updateIcHouseResiNumber 执行完毕"); @@ -3167,12 +3170,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getListIcResiUserDTO(List icResiUserIdList) { - if(CollectionUtils.isEmpty(icResiUserIdList)){ + if (CollectionUtils.isEmpty(icResiUserIdList)) { return new ArrayList<>(); } return baseDao.getListIcResiUserDTO(icResiUserIdList); @@ -3189,12 +3193,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getIcUserCount(IcUserCountFormDTO formDTO) { - List list = baseDao.getIcUserCount(formDTO); + List list = baseDao.getIcUserCount(formDTO); list = list.stream().filter(item -> null != item.getId()).collect(Collectors.toList()); if (CollectionUtils.isEmpty(list)) { return Collections.emptyMap(); } - return list.stream().collect(Collectors.toMap(IcUserCountResultDTO::getId, IcUserCountResultDTO::getCount, (key1 , key2)-> key2)); + return list.stream().collect(Collectors.toMap(IcUserCountResultDTO::getId, IcUserCountResultDTO::getCount, (key1, key2) -> key2)); } /** @@ -3272,11 +3276,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl result = guardarDatosFeignClient.getResidentDetailByIdCard(dto); ResidentByIdCardResultDTO residentDetailByIdCard = result.getData(); - if(!result.success() || residentDetailByIdCard == null){ + if (!result.success() || residentDetailByIdCard == null) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息失败", "获取居民信息失败"); } HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(form.getCustomerId(), form.getHomeId()); - if(houseInfo == null){ + if (houseInfo == null) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败"); } // 变更记录 @@ -3287,7 +3291,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl 0) { - String id = baseDao.seletIdByIdCard(entity.getCustomerId(),entity.getIdCard()); - // 变更记录 - formDTO.setIcUserId(id); - icUserTransferRecordService.add(formDTO); + String id = baseDao.seletIdByIdCard(entity.getCustomerId(), entity.getIdCard()); + // 变更记录 + formDTO.setIcUserId(id); + icUserTransferRecordService.add(formDTO); - baseDao.updateIcResiUserByIdCard(entity); - saveForm.setIcResiUserId(id); + baseDao.updateIcResiUserByIdCard(entity); + saveForm.setIcResiUserId(id); } else { baseDao.insert(entity); - String id = baseDao.seletIdByIdCard(entity.getCustomerId(),entity.getIdCard()); + String id = baseDao.seletIdByIdCard(entity.getCustomerId(), entity.getIdCard()); saveForm.setIcResiUserId(id); formDTO.setIcUserId(id); @@ -3400,6 +3404,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getUserListByCommunityId(String communityId) { List userList = baseDao.getUserListByCommunityId(communityId); - List list = ConvertUtils.sourceToTarget(userList,SendPointNoticeFormDTO.UserListBean.class); + List list = ConvertUtils.sourceToTarget(userList, SendPointNoticeFormDTO.UserListBean.class); return list; } @@ -3429,7 +3434,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> listResiZhzl(IcResiUserPageFormDTO formDTO) { // 查询列表展示项,如果没有,直接返回 - CustomerFormQueryDTO queryDTO1 = ConvertUtils.sourceToTarget(formDTO,CustomerFormQueryDTO.class); + CustomerFormQueryDTO queryDTO1 = ConvertUtils.sourceToTarget(formDTO, CustomerFormQueryDTO.class); Result> resultColumnRes = operCustomizeOpenFeignClient.queryConditions(queryDTO1); if (!resultColumnRes.success() || CollectionUtils.isEmpty(resultColumnRes.getData())) { log.warn("没有配置列表展示列"); @@ -3460,13 +3465,13 @@ public class IcResiUserServiceImpl extends BaseServiceImplIcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && ORG_FIELDS.contains(o.getColumnName())); + formDTO.getConditions().removeIf(o -> IcResiUserConstant.IC_RESI_USER.equals(o.getTableName()) && ORG_FIELDS.contains(o.getColumnName())); //添加数据权限 List staffOrgPaths; List agencyIds = null; //如果查询条件中 没有有居民表的agencyId,则查询该工作人员所属组织的信息 - if (queryAgencyIdList.isEmpty() && queryGridIdList.isEmpty()){ + if (queryAgencyIdList.isEmpty() && queryGridIdList.isEmpty()) { CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); agencyIds = Arrays.asList(staffInfoCacheResult.getAgencyId()); @@ -3487,14 +3492,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO1); List subTables = subTablesRes.getData(); - log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true)); + log.info("1、所有的子表subTables:" + JSON.toJSONString(subTables, true)); //关联哪些子表:查询条件用到的表名+查询的列对应的表 并集去重 Set whereConditionTables = formDTO.getConditions().stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet()); Set tables = new HashSet<>(); tables.addAll(whereConditionTables); tables.addAll(resultColumnTables); - log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true)); + log.info("2、查询条件+查询列对应的tables并集去重:" + JSON.toJSONString(tables, true)); //最终关联的子表对应的sql: List finalSubTables = new ArrayList<>(); //groupBy用到的表 @@ -3602,22 +3607,22 @@ public class IcResiUserServiceImpl extends BaseServiceImpl zhzlCategoryName=new ArrayList<>(); + List zhzlCategoryName = new ArrayList<>(); // 如果是信访人员 - String isXfry = StringUtils.isNotBlank((String)resultMap.get("IS_XFRY")) ? resultMap.get("IS_XFRY").toString() : StrConstant.EPMETY_STR; - if(NumConstant.ONE_STR.equals(isXfry)){ + String isXfry = StringUtils.isNotBlank((String) resultMap.get("IS_XFRY")) ? resultMap.get("IS_XFRY").toString() : StrConstant.EPMETY_STR; + if (NumConstant.ONE_STR.equals(isXfry)) { zhzlCategoryName.add("信访人员"); } // 如果是特殊人群,且有特殊人群类别 - String isSpecial = StringUtils.isNotBlank((String)resultMap.get("IS_SPECIAL")) ? resultMap.get("IS_SPECIAL").toString() : StrConstant.EPMETY_STR; - String specialRqlb = StringUtils.isNotBlank((String)resultMap.get("SPECIAL_RQLB")) ? resultMap.get("SPECIAL_RQLB").toString() : StrConstant.EPMETY_STR; - if(NumConstant.ONE_STR.equals(isSpecial)&&StringUtils.isNotBlank(specialRqlb)){ - String[] att=specialRqlb.split(StrConstant.COMMA); - for(String categoryCode:att){ + String isSpecial = StringUtils.isNotBlank((String) resultMap.get("IS_SPECIAL")) ? resultMap.get("IS_SPECIAL").toString() : StrConstant.EPMETY_STR; + String specialRqlb = StringUtils.isNotBlank((String) resultMap.get("SPECIAL_RQLB")) ? resultMap.get("SPECIAL_RQLB").toString() : StrConstant.EPMETY_STR; + if (NumConstant.ONE_STR.equals(isSpecial) && StringUtils.isNotBlank(specialRqlb)) { + String[] att = specialRqlb.split(StrConstant.COMMA); + for (String categoryCode : att) { zhzlCategoryName.add(ZhzlResiCategoryEnum.getEnum(categoryCode).getName()); } } - resultMap.put("zhzlCategoryName",zhzlCategoryName.stream().collect(Collectors.joining(StrConstant.COMMA))); + resultMap.put("zhzlCategoryName", zhzlCategoryName.stream().collect(Collectors.joining(StrConstant.COMMA))); } pageInfo.setList(list); return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); @@ -3625,6 +3630,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl qw = new LambdaQueryWrapper<>(); - qw.eq(IcResiUserEntity::getCustomerId,customerInfo.getId()) - .eq(IcResiUserEntity::getIdCard,formDTO.getIdCard()); + qw.eq(IcResiUserEntity::getCustomerId, customerInfo.getId()) + .eq(IcResiUserEntity::getIdCard, formDTO.getIdCard()); IcResiUserEntity icResiUserEntity = baseDao.selectOne(qw); - if (null == icResiUserEntity){ + if (null == icResiUserEntity) { throw new EpmetException(EpmetErrorCode.NOT_MATCH_IC_USER_ERROR.getCode()); } IcUserMatchGridResultDTO result = new IcUserMatchGridResultDTO(); GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(icResiUserEntity.getGridId()); - if (null == gridInfo){ - throw new EpmetException("查询网格信息失败:"+icResiUserEntity.getGridId()); + if (null == gridInfo) { + throw new EpmetException("查询网格信息失败:" + icResiUserEntity.getGridId()); } result.setCustomerId(customerInfo.getId()); result.setGridId(icResiUserEntity.getGridId()); @@ -3705,7 +3711,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getDelAgencyGridIdList(formDTO.getOrgId()); if (!result.success()) { @@ -3751,7 +3757,6 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> value = operCustomizeOpenFeignClient.getYlfnValue(); - if(!value.success()) { + if (!value.success()) { throw new EpmetException(value.getCode(), value.getMsg()); } value.getData().forEach(item -> { @@ -3868,7 +3873,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); printWriter.write(JSON.toJSONString(result)); printWriter.close(); } catch (Exception e) { @@ -3906,45 +3911,45 @@ public class IcResiUserServiceImpl extends BaseServiceImpl userByRenHu = baseDao.getUserByRenHu(formDTO); RHZKStatisticsResultDTO r = new RHZKStatisticsResultDTO(); - if (CollectionUtils.isEmpty(userByRenHu)){ + if (CollectionUtils.isEmpty(userByRenHu)) { return r; } r.setOrgId(formDTO.getOrgId()); r.setUserTotal(userByRenHu.stream().collect(Collectors.summingInt(RHZKStatisticsResultDTO::getTotal))); userByRenHu.forEach(u -> { - switch (u.getRhzk()){ + switch (u.getRhzk()) { case UserConstant.R_H_Y_Z: r.setRhyzUserTotal(u.getTotal()); - r.setRhyzUserRatio(getRatio(r.getUserTotal(),u.getTotal())); + r.setRhyzUserRatio(getRatio(r.getUserTotal(), u.getTotal())); break; case UserConstant.R_Z_H_B_Z: r.setRzhbzUserTotal(u.getTotal()); - r.setRzhbzUserRatio(getRatio(r.getUserTotal(),u.getTotal())); + r.setRzhbzUserRatio(getRatio(r.getUserTotal(), u.getTotal())); break; case UserConstant.H_Z_R_B_Z: r.setHzrbzUserTotal(u.getTotal()); - r.setHzrbzUserRatio(getRatio(r.getUserTotal(),u.getTotal())); + r.setHzrbzUserRatio(getRatio(r.getUserTotal(), u.getTotal())); break; case UserConstant.Z_B_Q_C: r.setZbqcUserTotal(u.getTotal()); - r.setZbqcUserRatio(getRatio(r.getUserTotal(),u.getTotal())); + r.setZbqcUserRatio(getRatio(r.getUserTotal(), u.getTotal())); break; default: break; @@ -3955,7 +3960,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl renHuConditionList(RHZKStatisticsFormDTO formDTO) { - if (CollectionUtils.isEmpty(formDTO.getOrgIds())){ + if (CollectionUtils.isEmpty(formDTO.getOrgIds())) { return new ArrayList<>(); } List result = new ArrayList<>(); @@ -3967,13 +3972,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl resultList=getDefaultAgeDistribute(); - List list=baseDao.selectAgeAgeDistribute(customerId,orgId,orgType,orgIdPath); - if(CollectionUtils.isEmpty(list)){ + List resultList = getDefaultAgeDistribute(); + List list = baseDao.selectAgeAgeDistribute(customerId, orgId, orgType, orgIdPath); + if (CollectionUtils.isEmpty(list)) { result.setTotal(NumConstant.ZERO); result.setList(resultList); return result; } - Map resultMap = list.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode,ResiPortrayalResultDTO::getTotalResi)); - int total=NumConstant.ZERO; - for(ResiPortrayalResultDTO resultDto:resultList){ + Map resultMap = list.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode, ResiPortrayalResultDTO::getTotalResi)); + int total = NumConstant.ZERO; + for (ResiPortrayalResultDTO resultDto : resultList) { if (MapUtils.isNotEmpty(resultMap) && resultMap.containsKey(resultDto.getCode())) { resultDto.setTotalResi(resultMap.get(resultDto.getCode())); } - total+=resultDto.getTotalResi(); + total += resultDto.getTotalResi(); } result.setTotal(total); result.setList(resultList); return result; } + private List getDefaultAgeDistribute() { List list = new ArrayList<>(); for (int code = 0; code <= 4; code++) { @@ -4063,7 +4078,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl totalList = baseDao.queryEducationDistribute(customerId, orgId, orgType,orgIdPath); - Map map = totalList.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode,ResiPortrayalResultDTO::getTotalResi)); + List totalList = baseDao.queryEducationDistribute(customerId, orgId, orgType, orgIdPath); + Map map = totalList.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode, ResiPortrayalResultDTO::getTotalResi)); List resultDTOList = new ArrayList<>(); - int total=NumConstant.ZERO; + int total = NumConstant.ZERO; for (DictListResultDTO dict : dictResult.getData()) { ResiPortrayalResultDTO resultDTO = new ResiPortrayalResultDTO(); resultDTO.setCode(dict.getValue()); @@ -4111,7 +4135,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl list = baseDao.selectPortrayalResiList(customerId, orgId, orgType,orgIdPath,codeType, code); - if(CollectionUtils.isNotEmpty(list)){ - Set houseIds=list.stream().map(m -> m.getHomeId()).collect(Collectors.toSet()); + List list = baseDao.selectPortrayalResiList(customerId, orgId, orgType, orgIdPath, codeType, code); + if (CollectionUtils.isNotEmpty(list)) { + Set houseIds = list.stream().map(m -> m.getHomeId()).collect(Collectors.toSet()); //查询房子名称 Result> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, customerId); List houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>(); @@ -4177,10 +4201,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl queryPortrayalResiListForExport(String customerId, String staffId, - Integer pageNo, Integer pageSize, - String orgId, String orgType, - String codeType, - String code) { + Integer pageNo, Integer pageSize, + String orgId, String orgType, + String codeType, + String code) { // 获取文化程度字典 /* DictListFormDTO dictFormDTO = new DictListFormDTO(); dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode()); @@ -4194,12 +4218,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl list = baseDao.selectPortrayalResiList(customerId, orgId, orgType,orgIdPath,codeType, code); + List list = baseDao.selectPortrayalResiList(customerId, orgId, orgType, orgIdPath, codeType, code); // if(CollectionUtils.isNotEmpty(list)){ // list.forEach(resi -> { // // 学历名称 @@ -4211,13 +4235,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl agency = govOrgOpenFeignClient.getAgencyById(epmetUserRemoteService.getLoginUserDetails().getAgencyId()); - if (!agency.getData().getLevel().equals("community")){ + if (!agency.getData().getLevel().equals("community")) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "只有社区才可以导出", "只有社区才可以导出"); } Result agencyPid = govOrgOpenFeignClient.getAgencyById(agency.getData().getPid()); @@ -4262,7 +4286,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl agency = govOrgOpenFeignClient.getAgencyById(epmetUserRemoteService.getLoginUserDetails().getAgencyId()); - if (!agency.getData().getLevel().equals("community")){ + if (!agency.getData().getLevel().equals("community")) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "只有社区才可以导出", "只有社区才可以导出"); } Result agencyPid = govOrgOpenFeignClient.getAgencyById(agency.getData().getPid()); @@ -4285,7 +4309,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl list = icResiUserDao.searchResiForLangchao(formDTO); PageInfo pageData = new PageInfo<>(list); - return new PageData<>(list,pageData.getTotal()); + return new PageData<>(list, pageData.getTotal()); } @Override @@ -4306,7 +4330,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getDelAgencyGridIdList(formDTO.getOrgId()); if (!result.success()) { @@ -4338,12 +4362,24 @@ public class IcResiUserServiceImpl extends BaseServiceImpl