|  |  | @ -1,5 +1,6 @@ | 
			
		
	
		
			
				
					|  |  |  | package com.epmet.service.impl; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
			
		
	
		
			
				
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
			
		
	
		
			
				
					|  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
			
		
	
	
		
			
				
					|  |  | @ -18,6 +19,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.Result; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dao.IcMoveInRecordDao; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.ChangeWelfareDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.IcBirthRecordDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.IcMoveInRecordDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.IcMoveInAddEditFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.IcMoveInListFormDTO; | 
			
		
	
	
		
			
				
					|  |  | @ -25,6 +27,7 @@ import com.epmet.dto.form.IcResiUserTransferFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.HouseInfoDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.IcMoveInListResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.SyncResiResDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.entity.IcBirthRecordEntity; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.entity.IcMoveInRecordEntity; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.entity.IcResiUserEntity; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.feign.EpmetAdminOpenFeignClient; | 
			
		
	
	
		
			
				
					|  |  | @ -78,19 +81,17 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl<IcMoveInRecordDao | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public IcMoveInListResultDTO list(IcMoveInListFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  |         IcMoveInListResultDTO resultDTO = new IcMoveInListResultDTO(); | 
			
		
	
		
			
				
					|  |  |  |     public PageData<IcMoveInListResultDTO> list(IcMoveInListFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  |         //列表/导出查询
 | 
			
		
	
		
			
				
					|  |  |  |         PageInfo<IcMoveInListResultDTO.IcMoveInList> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) | 
			
		
	
		
			
				
					|  |  |  |                 .doSelectPageInfo(() -> baseDao.selectMoveInList(formDTO)); | 
			
		
	
		
			
				
					|  |  |  |         resultDTO.setTotal((int) data.getTotal()); | 
			
		
	
		
			
				
					|  |  |  |         resultDTO.setList(data.getList()); | 
			
		
	
		
			
				
					|  |  |  |         PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); | 
			
		
	
		
			
				
					|  |  |  |         List<IcMoveInListResultDTO> list = baseDao.selectMoveInList(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         PageInfo<IcMoveInListResultDTO> pageInfo = new PageInfo<>(list); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         //查询封装房屋信息
 | 
			
		
	
		
			
				
					|  |  |  |         if (!CollectionUtils.isEmpty(resultDTO.getList())) { | 
			
		
	
		
			
				
					|  |  |  |         if (!CollectionUtils.isEmpty(list)) { | 
			
		
	
		
			
				
					|  |  |  |             Map<String, String> map = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |             //查询房屋信息
 | 
			
		
	
		
			
				
					|  |  |  |             Set<String> houseIds = resultDTO.getList().stream().filter(l -> StringUtils.isNotBlank(l.getHomeId())).map(m -> m.getHomeId()).collect(Collectors.toSet()); | 
			
		
	
		
			
				
					|  |  |  |             Set<String> houseIds = list.stream().filter(l -> StringUtils.isNotBlank(l.getHomeId())).map(m -> m.getHomeId()).collect(Collectors.toSet()); | 
			
		
	
		
			
				
					|  |  |  |             Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |             List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |             Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); | 
			
		
	
	
		
			
				
					|  |  | @ -99,7 +100,7 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl<IcMoveInRecordDao | 
			
		
	
		
			
				
					|  |  |  |             Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             //封装数据
 | 
			
		
	
		
			
				
					|  |  |  |             for (IcMoveInListResultDTO.IcMoveInList v : resultDTO.getList()) { | 
			
		
	
		
			
				
					|  |  |  |             for (IcMoveInListResultDTO v : list) { | 
			
		
	
		
			
				
					|  |  |  |                 if (!map.containsKey(v.getGridId())) { | 
			
		
	
		
			
				
					|  |  |  |                     //获取网格缓存信息
 | 
			
		
	
		
			
				
					|  |  |  |                     GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(v.getGridId()); | 
			
		
	
	
		
			
				
					|  |  | @ -119,7 +120,7 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl<IcMoveInRecordDao | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         return resultDTO; | 
			
		
	
		
			
				
					|  |  |  |         return new PageData<>(list, pageInfo.getTotal()); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     private QueryWrapper<IcMoveInRecordEntity> getWrapper(Map<String, Object> params){ | 
			
		
	
	
		
			
				
					|  |  | @ -265,10 +266,10 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl<IcMoveInRecordDao | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public IcMoveInListResultDTO.IcMoveInList detail(IcMoveInListFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  |         IcMoveInListResultDTO.IcMoveInList resultDTO = new IcMoveInListResultDTO.IcMoveInList(); | 
			
		
	
		
			
				
					|  |  |  |     public IcMoveInListResultDTO detail(IcMoveInListFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  |         IcMoveInListResultDTO resultDTO = new IcMoveInListResultDTO(); | 
			
		
	
		
			
				
					|  |  |  |         //1.查询迁入记录信息
 | 
			
		
	
		
			
				
					|  |  |  |         List<IcMoveInListResultDTO.IcMoveInList> list = baseDao.selectMoveInList(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         List<IcMoveInListResultDTO> list = baseDao.selectMoveInList(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         //2.查询网格房屋信息
 | 
			
		
	
		
			
				
					|  |  |  |         if (!CollectionUtils.isEmpty(list)) { | 
			
		
	
		
			
				
					|  |  |  |             resultDTO = list.get(NumConstant.ZERO); | 
			
		
	
	
		
			
				
					|  |  | @ -290,6 +291,12 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl<IcMoveInRecordDao | 
			
		
	
		
			
				
					|  |  |  |             if (null != gridInfo) { | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setGridName(gridInfo.getGridName()); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             //与户主关系字典表数据
 | 
			
		
	
		
			
				
					|  |  |  |             if(StringUtils.isNotBlank(resultDTO.getHouseholderRelation())){ | 
			
		
	
		
			
				
					|  |  |  |                 Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); | 
			
		
	
		
			
				
					|  |  |  |                 Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |                 resultDTO.setHouseholderRelationName(statusMap.get(resultDTO.getHouseholderRelation())); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         return resultDTO; | 
			
		
	
	
		
			
				
					|  |  | 
 |