| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -58,6 +58,10 @@ import com.epmet.dto.result.demand.IcResiDemandDictDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.excel.support.ExportResiUserItemDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.opendata.dto.form.CaResidentDetailsFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.opendata.dto.form.GetResidentDetailByIdCardFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.opendata.feign.GuardarDatosFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.Page; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -137,6 +141,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcPartyMemberDao icPartyMemberDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcVolunteerDao icVolunteerDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private GuardarDatosFeignClient feignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -188,7 +194,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (str.length() > NumConstant.ZERO ) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (str.length() > NumConstant.ZERO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String errorMsg = String.format("新增居民信息,必要字段值为空,%s值为空", str); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -202,7 +208,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String name = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        LinkedHashMap<String, String> map = new LinkedHashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, List<LinkedHashMap<String,String>>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, List<LinkedHashMap<String, String>>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        boolean isDyzxh = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //判断是否是党员中心户
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (formMap.containsKey("ic_party_member")) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -330,7 +336,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //3.变更记录表和变更记录明细表新增数据
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        saveUserChangeRecord(tokenDto,map,resiUserId,name); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        saveUserChangeRecord(tokenDto, map, resiUserId, name); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return resiUserId; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -418,7 +424,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String resiUserId = ""; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        LinkedHashMap<String, String> map = new LinkedHashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, List<LinkedHashMap<String,String>>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, List<LinkedHashMap<String, String>>> formMap = formDTO.stream().collect(Collectors.toMap(IcResiUserFormDTO::getTableName, IcResiUserFormDTO::getList)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        boolean isDyzxh = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //判断是否是党员中心户
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (formMap.containsKey("ic_party_member")) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -738,20 +744,20 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        tables.addAll(resultColumnTables); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //最终关联的子表对应的sql:
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> finalSubTables =new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> finalSubTables = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //groupBy用到的表
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Set<String> groupByTables=new HashSet<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        subTables.forEach(subTable->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(tables.contains(subTable.getTableName())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Set<String> groupByTables = new HashSet<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        subTables.forEach(subTable -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (tables.contains(subTable.getTableName())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                finalSubTables.add(subTable.getJoinTableSql()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if(subTable.getSupportAdd()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (subTable.getSupportAdd()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    groupByTables.add(subTable.getTableName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        PageInfo<Map<String, Object>> pageInfo=new PageInfo<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (null == formDTO.getIsPage()||formDTO.getIsPage()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (null == formDTO.getIsPage() || formDTO.getIsPage()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //分页
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            String finalStaffOrgPath = staffOrgPath; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            pageInfo = PageHelper.startPage(formDTO.getPageNo(), | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -760,19 +766,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    formDTO.getConditions(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    resultColumns, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    finalSubTables, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    staffInfoCacheResult.getAgencyId(), finalStaffOrgPath,null, formDTO.getKeyword(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    staffInfoCacheResult.getAgencyId(), finalStaffOrgPath, null, formDTO.getKeyword(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    groupByTables)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }else{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<Map<String,Object>> list=baseDao.selectListResiMap(formDTO.getCustomerId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<Map<String, Object>> list = baseDao.selectListResiMap(formDTO.getCustomerId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    formDTO.getFormCode(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    formDTO.getConditions(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    resultColumns, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    finalSubTables, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    staffInfoCacheResult.getAgencyId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    staffOrgPath,null, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    staffOrgPath, null, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    formDTO.getKeyword(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    groupByTables); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            pageInfo.setTotal(CollectionUtils.isEmpty(list)?NumConstant.ZERO:list.size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            pageInfo.setTotal(CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            pageInfo.setList(list); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -869,8 +875,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isEmpty(demandCodePath)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return StrConstant.EPMETY_STR; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Set<String> nameList=new HashSet<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for(String codePath:demandCodePath){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Set<String> nameList = new HashSet<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (String codePath : demandCodePath) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (StringUtils.isNotBlank(codePath) && codePath.contains(StrConstant.COMMA)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String[] codeAtt = codePath.split(StrConstant.COMMA); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String code = codeAtt[codeAtt.length - 1]; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -932,51 +938,52 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @return | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public List<Map<String,Object>> dynamicQuery(String customerId, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public List<Map<String, Object>> dynamicQuery(String customerId, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                                  String formCode, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                                  String resultTableName, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                                  List<ResiUserQueryValueDTO> conditions, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                                  String currentStaffAgencyId, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                                 String staffOrgPath){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                                  String staffOrgPath) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // List<String> finalSubTables = getFinalSubables(customerId, formCode, resultTableName, conditions);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String,List<String>> map=getFinalSubables(customerId, formCode, resultTableName, conditions, null); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return baseDao.dynamicQuery(customerId,resultTableName,conditions,map.get("finalSubTables"), null, currentStaffAgencyId,staffOrgPath,map.get("groupByTables")); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, List<String>> map = getFinalSubables(customerId, formCode, resultTableName, conditions, null); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return baseDao.dynamicQuery(customerId, resultTableName, conditions, map.get("finalSubTables"), null, currentStaffAgencyId, staffOrgPath, map.get("groupByTables")); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @NotNull | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public Map<String,List<String>> getFinalSubables(String customerId, String formCode, String resultTableName, List<ResiUserQueryValueDTO> conditions, List<String> exportNeedTableList) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String,List<String>> map=new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CustomerFormQueryDTO queryDTO=new CustomerFormQueryDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public Map<String, List<String>> getFinalSubables(String customerId, String formCode, String resultTableName, List<ResiUserQueryValueDTO> conditions, List<String> exportNeedTableList) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, List<String>> map = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        queryDTO.setCustomerId(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        queryDTO.setFormCode(formCode); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //所有的子表
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result<List<SubTableJoinDTO>> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result<List<SubTableJoinDTO>> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<SubTableJoinDTO> subTables =subTablesRes.getData(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<SubTableJoinDTO> subTables = subTablesRes.getData(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true));
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //关联哪些子表:查询条件用到的表名+查询的列对应的表  并集去重
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Set<String> tables = conditions.stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        tables.add(resultTableName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isNotEmpty(exportNeedTableList)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isNotEmpty(exportNeedTableList)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            tables.addAll(exportNeedTableList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //最终关联的子表对应的sql:
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> finalSubTables =new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> finalSubTables = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //groupBy用到的表
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Set<String> groupByTables=new HashSet<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        subTables.forEach(subTable->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(tables.contains(subTable.getTableName())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Set<String> groupByTables = new HashSet<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        subTables.forEach(subTable -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (tables.contains(subTable.getTableName())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                finalSubTables.add(subTable.getJoinTableSql()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if(subTable.getSupportAdd()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (subTable.getSupportAdd()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    groupByTables.add(subTable.getTableName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        map.put("finalSubTables",finalSubTables); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        map.put("finalSubTables", finalSubTables); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        map.put("groupByTables", new ArrayList<>(groupByTables)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return map; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param formDTO | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @Description 查询个人数据 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1064,6 +1071,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return personData; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param formDTO | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @Description 根据名字搜索 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1083,7 +1091,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                formDTO.getLevel(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                formDTO.getId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                staffInfo.getAgencyId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                no,formDTO.getCustomerId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                no, formDTO.getCustomerId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<SearchByNameResultDTO> result = pageInfo.getList(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isEmpty(result)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return new PageData<>(new ArrayList<>(), pageInfo.getTotal()); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1538,13 +1546,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            list = baseDao.vaccineList(formDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Set<String> homeIds = list.stream().filter(m -> StringUtils.isNotBlank(m.getIdCard())).map(m -> m.getHomeId()).distinct().collect(Collectors.toSet()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isNotEmpty(homeIds)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isNotEmpty(homeIds)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(homeIds, formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!houseInfoRes.success()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!houseInfoRes.success()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                throw new EpmetException("查询居民所属房屋失败..."); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (CollectionUtils.isNotEmpty(houseInfoRes.getData())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                list.forEach(l -> houseInfoRes.getData().stream().filter( h -> h.getHomeId().equals(l.getHomeId())).forEach(h -> l.setHouseName(h.getAllName()))); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (CollectionUtils.isNotEmpty(houseInfoRes.getData())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                list.forEach(l -> houseInfoRes.getData().stream().filter(h -> h.getHomeId().equals(l.getHomeId())).forEach(h -> l.setHouseName(h.getAllName()))); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        PageInfo<EpidemicPreventionResultDTO> pageInfo = new PageInfo<>(list); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1731,7 +1739,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return new PageData<>(list, pageInfo.getTotal()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<PartyMemberAgeResultDTO> list = baseDao.getPartyMemberAgeList(formDTO.getOrgType(), formDTO.getOrgId(), formDTO.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new PageData<>(list, null == list?NumConstant.ZERO:list.size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new PageData<>(list, null == list ? NumConstant.ZERO : list.size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1806,7 +1814,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new PageData<>(list, null == list?NumConstant.ZERO:list.size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new PageData<>(list, null == list ? NumConstant.ZERO : list.size()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1969,7 +1977,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        LambdaQueryWrapper<IcResiUserEntity> lqw = new LambdaQueryWrapper<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        lqw.eq(IcResiUserEntity::getCustomerId, customerId) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .eq(IcResiUserEntity::getHomeId, homeId) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .eq(IcResiUserEntity::getYhzgx,RelationshipEnum.SELF.getCode()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .select( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        IcResiUserEntity::getId, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        IcResiUserEntity::getName | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -2020,17 +2028,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public List<HouseIcResiUserResultDTO> getResiUserGroupHomeId(RentTenantDataFormDTO formDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //如果是组织 且非顶级组织 则利用pids 查询 本级及下级
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isNotBlank(formDTO.getAgencyId())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isNotBlank(formDTO.getAgencyId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (agencyInfo == null){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.warn("getResiUserGroupHomeId agencyId:{} is not exist",formDTO.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (agencyInfo == null) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.warn("getResiUserGroupHomeId agencyId:{} is not exist", formDTO.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!NumConstant.ZERO_STR.equals(agencyInfo.getPid())) { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -2040,35 +2044,35 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Page<HouseIcResiUserResultDTO> listPage = PageHelper | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .startPage(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getIsPage()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .doSelectPage(()->baseDao.getResiUserGroupHomeId(formDTO)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .doSelectPage(() -> baseDao.getResiUserGroupHomeId(formDTO)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> dictTypeList = Arrays.asList(DictTypeEnum.EDUCATION.getCode(), DictTypeEnum.RELATIONSHIP.getCode(), DictTypeEnum.NATION.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String,Map<String, String>> dictResult = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        dictTypeList.forEach(dict->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Map<String, String>> dictResult = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        dictTypeList.forEach(dict -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Result<Map<String, String>> mapResult = epmetAdminOpenFeignClient.dictMap(dict); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (mapResult!=null && mapResult.success()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                dictResult.put(dict,mapResult.getData()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (mapResult != null && mapResult.success()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                dictResult.put(dict, mapResult.getData()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //婚姻状况
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> hyzkMap = getOptionMap(formDTO.getCustomerId(),"HYZK"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> hyzkMap = getOptionMap(formDTO.getCustomerId(), "HYZK"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //遍历数据 转换为中文
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        listPage.getResult().forEach(e->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.getHouseMemberList().parallelStream().forEach(o->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (StringUtils.isNotBlank(o.getIsParty())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    o.setIsParty(NumConstant.ZERO_STR.equals(o.getIsParty())?StrConstant.NO:StrConstant.YES); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        listPage.getResult().forEach(e -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.getHouseMemberList().parallelStream().forEach(o -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (StringUtils.isNotBlank(o.getIsParty())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    o.setIsParty(NumConstant.ZERO_STR.equals(o.getIsParty()) ? StrConstant.NO : StrConstant.YES); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (StringUtils.isNotBlank(o.getGender())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (StringUtils.isNotBlank(o.getGender())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    o.setGender(GenderEnum.getName(o.getGender())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (StringUtils.isNotBlank(o.getIsTenant())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    o.setIsTenant(NumConstant.ZERO_STR.equals(o.getIsTenant())?StrConstant.NO:StrConstant.YES); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (StringUtils.isNotBlank(o.getIsTenant())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    o.setIsTenant(NumConstant.ZERO_STR.equals(o.getIsTenant()) ? StrConstant.NO : StrConstant.YES); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (StringUtils.isNotBlank(o.getIsFloating())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    o.setIsFloating(NumConstant.ZERO_STR.equals(o.getIsFloating())?StrConstant.NO:StrConstant.YES); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (StringUtils.isNotBlank(o.getIsFloating())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    o.setIsFloating(NumConstant.ZERO_STR.equals(o.getIsFloating()) ? StrConstant.NO : StrConstant.YES); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Map<String, String> mzMap = dictResult.get(DictTypeEnum.NATION.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Map<String, String> whcdMap = dictResult.get(DictTypeEnum.EDUCATION.getCode()); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -2094,8 +2098,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public List<String> changeIcResiUserBelongTo(TokenDto tokenDto, IcUserBelongToChangedFormDTO formDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(),formDTO.getSourceGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isEmpty(resiUserIdList)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(), formDTO.getSourceGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (CollectionUtils.isEmpty(resiUserIdList)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IcResiUserFormDTO> icResiUserFormDTOS = new ArrayList<>(); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -2109,9 +2113,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        e.setList(list); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        icResiUserFormDTOS.add(e); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        resiUserIdList.forEach(userId->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        resiUserIdList.forEach(userId -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            map.put(FieldConstant.ID, userId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            this.edit(tokenDto,icResiUserFormDTOS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            this.edit(tokenDto, icResiUserFormDTOS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return resiUserIdList; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -2134,7 +2138,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //获取居民信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            IcResiUserEntity user = baseDao.selectById(formDTO.getIcResiUser()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //居民信息不存在时返回
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(null == user) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (null == user) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return dto; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!user.getIdCard().equals(dto.getIdCard())) { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -2143,7 +2147,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                wrapper.eq(IcResiUserEntity::getIdCard, formDTO.getIdCard()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                user = baseDao.selectOne(wrapper); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if(null == user) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (null == user) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    return dto; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -2169,7 +2173,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            IcResiUserEntity user = baseDao.selectOne(wrapper); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //居民信息不存在时返回
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(null == user) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (null == user) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return dto; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dto.setIcResiUser(user.getId()); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -2261,20 +2265,76 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public void bindHome(BindHomeFormDTO form) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 根据idCard获取ca_redident表的数据
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isBlank(form.getIdCard())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("身份证号不能为空"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        GetResidentDetailByIdCardFormDTO dto = new GetResidentDetailByIdCardFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        dto.setIdCard(form.getIdCard()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result<ResidentByIdCardResultDTO> result = feignClient.getResidentDetailByIdCard(dto); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ResidentByIdCardResultDTO residentDetailByIdCard = result.getData(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (org.springframework.util.StringUtils.isEmpty(residentDetailByIdCard)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("获取不到人的信息"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 根据房屋id获取房屋信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isBlank(form.getHomeId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("房屋id不能为空"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(form.getCustomerId(), form.getHomeId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (org.springframework.util.StringUtils.isEmpty(houseInfo)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("获取不到房屋信息"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 将人的信息放入ic_resi_user对象中
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcResiUserEntity entity = new IcResiUserEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        entity.setCustomerId(form.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isBlank(residentDetailByIdCard.getIdCard()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(residentDetailByIdCard.getResidentName()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(residentDetailByIdCard.getTelephone()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(residentDetailByIdCard.getBirthday().toString())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setIdCard(residentDetailByIdCard.getIdCard()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setName(residentDetailByIdCard.getResidentName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setMobile(residentDetailByIdCard.getTelephone()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setBirthday(residentDetailByIdCard.getBirthday().toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("人信息不全"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 将房屋的信息放入ic_resi_user对象中
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isBlank(houseInfo.getHomeId()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(houseInfo.getNeighborHoodId()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(houseInfo.getBuildingId()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(houseInfo.getBuildingUnitId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setHomeId(houseInfo.getHomeId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setVillageId(houseInfo.getNeighborHoodId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setBuildId(houseInfo.getBuildingId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setUnitId(houseInfo.getBuildingUnitId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("房屋信息不全"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (baseDao.selectCountByIdCard(form.getIdCard(), form.getCustomerId()) > 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            baseDao.updateByIdCard(entity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            baseDao.insert(entity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * desc:根据字段值获取 options | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param customerId | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param columnName | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @return | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private Map<String, String> getOptionMap(String customerId,String columnName) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private Map<String, String> getOptionMap(String customerId, String columnName) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        optionsForm.setCustomerId(customerId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        optionsForm.setColumnName(columnName); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result<List<IcFormItemOptionsDTO>> listResult = operCustomizeOpenFeignClient.listOptionsByItemConditions(optionsForm); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!listResult.success()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取item失败,"+listResult.getInternalMsg()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!listResult.success()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取item失败," + listResult.getInternalMsg()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return listResult.getData().stream() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .collect(Collectors.toMap(IcFormItemOptionsDTO::getOptionValue, IcFormItemOptionsDTO::getOptionLabel, (o1, o2) -> o1)); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |