| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -18,6 +18,7 @@ import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageHelper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageInfo; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.util.CollectionUtils; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -110,7 +111,89 @@ public class IcResiUserServiceImpl implements IcResiUserService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public PageData<Map<String,Object>> pageResiMap(IcResiUserPageFormDTO formDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 查询列表展示项,如果没有,直接返回
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IcFormResColumnDTO> resultColumns=customerFootBarService.queryConditions(formDTO.getCustomerId(),formDTO.getFormCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(CollectionUtils.isEmpty(resultColumns)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            log.warn("没有配置列表展示列"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return new PageData(new ArrayList(), NumConstant.ZERO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.warn("列表展示项:"+JSON.toJSONString(resultColumns)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 查询列表展示项需要用到哪些子表
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 拼接好的left join table_name on (ic_resi_user.ID=table_name.IC_RESI_USER AND table_name.del_flag='0')
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> subTables=customerFootBarService.querySubTables(formDTO.getCustomerId(),formDTO.getFormCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("子表:"+JSON.toJSONString(subTables)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        PageInfo<Map<String,Object>> pageInfo = PageHelper.startPage(formDTO.getPageNo(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                formDTO.getPageSize()).doSelectPageInfo(() -> icResiUserDao.selectListResiMap(formDTO.getCustomerId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                formDTO.getFormCode(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                formDTO.getConditions(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                resultColumns, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                subTables)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<Map<String, Object>> list = pageInfo.getList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //查询网格名称
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> gridIds=new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Set<String> houseIds=new HashSet<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for(Map<String,Object> map:list){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            log.warn(JSON.toJSONString(map)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(map.containsKey("GRID_ID")&& StringUtils.isNotBlank(map.get("GRID_ID").toString())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                gridIds.add(map.get("GRID_ID").toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(map.containsKey("HOME_ID")&& StringUtils.isNotBlank(map.get("HOME_ID").toString())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                houseIds.add(map.get("HOME_ID").toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.warn("gridIds:"+JSON.toJSONString(gridIds)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<GridsInfoListResultDTO> gridInfoList=govOrgService.gridListByIds(gridIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //log.warn(JSON.toJSONString(gridInfoList));
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, GridsInfoListResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(GridsInfoListResultDTO::getGridId, Function.identity())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //查询房子名称
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<HouseInfoDTO> houseInfoDTOList=govOrgService.queryHouseInfo(houseIds); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for(Map<String,Object> resultMap:list){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (null != gridInfoMap && gridInfoMap.containsKey(resultMap.get("GRID_ID").toString())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                resultMap.put("GRID_ID_VALUE",resultMap.get("GRID_ID").toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //GRID_NAME
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                resultMap.put("GRID_ID",gridInfoMap.get(resultMap.get("GRID_ID")).getGridName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(null !=houseInfoMap &&houseInfoMap.containsKey(resultMap.get("HOME_ID"))){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String buildName=houseInfoMap.get(resultMap.get("HOME_ID")).getBuildingName(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                resultMap.put("BUILD_NAME",buildName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String neighBorName=houseInfoMap.get(resultMap.get("HOME_ID")).getNeighborHoodName(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                resultMap.put("VILLAGE_NAME",neighBorName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String unitName=houseInfoMap.get(resultMap.get("HOME_ID")).getUnitName(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                resultMap.put("UNIT_NAME",unitName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String houseType=houseInfoMap.get(resultMap.get("HOME_ID")).getHouseType(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //房屋类型,1楼房,2平房,3别墅
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                resultMap.put("HOUSE_TYPE",""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if("1".equals(houseType)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    resultMap.put("HOUSE_TYPE","楼房"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }else if("2".equals(houseType)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    resultMap.put("HOUSE_TYPE","平房"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }else if("3".equals(houseType)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    resultMap.put("HOUSE_TYPE","别墅"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String doorName=houseInfoMap.get(resultMap.get("HOME_ID")).getDoorName(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                resultMap.put("DOOR_NAME",doorName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                resultMap.put("HOME_NAME",neighBorName.concat(buildName).concat(unitName).concat(doorName)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(resultMap.containsKey("GENDER")){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String genderValue=resultMap.get("GENDER").toString(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if("1".equals(genderValue)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    resultMap.put("GENDER","男"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }else if("2".equals(genderValue)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    resultMap.put("HOUSE_TYPE","女"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }else if("0".equals(genderValue)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    resultMap.put("HOUSE_TYPE","未知"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pageInfo.setList(list); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new PageData<>(pageInfo.getList(),pageInfo.getTotal()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 编辑页面,显示居民信息详情 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |