From 5bb9dd4b725f686de897ade945cd27b5865798b9 Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Sat, 25 Nov 2023 14:36:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A5=E4=BA=BA=E6=89=BE?= =?UTF-8?q?=E6=88=BF=EF=BC=8C=E4=BB=A5=E6=88=BF=E6=89=BE=E4=BA=BA=20=20--r?= =?UTF-8?q?enpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PopulationServiceImpl.java | 50 +------------------ 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java b/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java index b8a3da2..96c042b 100644 --- a/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java +++ b/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java @@ -462,8 +462,6 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio } } - // 一次性获取所有的人口信息 - List populationInfoDTOs = populationInfoService.getBatch(populationInfoIds); // 一次性获取所有的房屋信息 List houseDTOs = houseService.getBatch(houseIds); @@ -493,14 +491,8 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio e.printStackTrace(); } - Map populationInfoMap = null; Map houseMap = null; Map baseMap = null; - if (!CollectionUtils.isEmpty(populationInfoDTOs)) { - populationInfoMap = populationInfoDTOs.stream() - .collect(Collectors.toMap(PopulationInfoDTO::getPopulationInfoId, - populationInfoDTO -> populationInfoDTO)); - } if (!CollectionUtils.isEmpty(houseDTOs)) { houseMap = houseDTOs.stream() @@ -523,7 +515,7 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio } else { populationInfoBaseDTO = setPopulationBaseInfo(populationDTO); } - // populationInfoService.getTuoMin(populationInfoBaseDTO); + populationInfoService.getTuoMin(populationInfoBaseDTO); populationDTO.setPopulationInfoBaseDTO(populationInfoBaseDTO); } else { PopulationInfoBaseDTO populationInfoBaseDTO = setPopulationBaseInfo(populationDTO); @@ -536,28 +528,6 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio } } - // 获取人口详情 - /*for (PopulationDTO populationDTO : overList) { - if (StringUtils.isNotEmpty(populationDTO.getPopulationInfoId())) { - PopulationInfoDTO populationInfoDTO = populationInfoService.get(populationDTO.getPopulationInfoId()); - PopulationInfoHouseDTO populationInfoHouseDTO = new PopulationInfoHouseDTO(); - BeanUtils.copyProperties(populationInfoDTO, populationInfoHouseDTO); - - // 获取人员 - PopulationInfoBaseDTO base = populationInfoService.getBase(populationDTO.getPopulationInfoId()); - // populationInfoService.getTuoMin(base); - populationInfoHouseDTO.setPopulationInfoBaseDTO(base); - - populationDTO.setPopulationInfoHouseDTO(populationInfoHouseDTO); - } - - // 获取房屋详情 - HouseDTO houseDTO = houseService.get(populationDTO.getHouseId()); - if (null != houseDTO) { - populationDTO.setHouseDTO(houseDTO); - } - }*/ - PageInfo pageInfo = new PageInfo<>(overList); return new SuccessResultList<>(overList, pageInfo.getPageNum(), pageInfo.getTotal()); } @@ -582,22 +552,4 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio return new SuccessResultList<>(populationDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); } - public class getBase implements Runnable { - private List dataList; - private List baseDTOList; - - public getBase(List dataList, List baseDTOList) { - this.dataList = dataList; - this.baseDTOList = baseDTOList; - } - - @Override - public void run() { - for (String s : dataList) { - PopulationInfoBaseDTO base = populationInfoService.getBase(s); - baseDTOList.add(base); - } - } - } - } \ No newline at end of file