| 
						
						
							
								
							
						
						
					 | 
					@ -31,7 +31,9 @@ import com.epmet.commons.tools.enums.HouseTypeEnum; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.enums.RelationshipEnum; | 
					 | 
					 | 
					import com.epmet.commons.tools.enums.RelationshipEnum; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.exception.RenException; | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.page.PageData; | 
					 | 
					 | 
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.commons.tools.redis.common.CustomerOrgRedis; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
					 | 
					 | 
					import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.commons.tools.redis.common.bean.GridInfoCache; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.security.dto.TokenDto; | 
					 | 
					 | 
					import com.epmet.commons.tools.security.dto.TokenDto; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.utils.ConvertUtils; | 
					 | 
					 | 
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.utils.Result; | 
					 | 
					 | 
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -496,12 +498,33 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // 志愿者处理
 | 
					 | 
					 | 
					        // 志愿者处理
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (personData.getIsVolunteer().equals(NumConstant.ONE_STR)){ | 
					 | 
					 | 
					        if (personData.getIsVolunteer().equals(NumConstant.ONE_STR)){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            List<String> volunteers = baseDao.selectVolunteerByUserId(formDTO.getUserId()); | 
					 | 
					 | 
					            List<String> volunteerList = baseDao.selectVolunteerByUserId(formDTO.getUserId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            volunteers.forEach(v -> { | 
					 | 
					 | 
					            if (!CollectionUtils.isEmpty(volunteerList)){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					
 | 
					 | 
					 | 
					                List<String> volunteers = new ArrayList<>(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            }); | 
					 | 
					 | 
					                List<String> finalVolunteers = volunteers; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                volunteerList.forEach(v -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    List<String> collect = Arrays.stream(v.split(",")).collect(Collectors.toList()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    finalVolunteers.addAll(collect); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                volunteers = volunteers.stream().distinct().collect(Collectors.toList()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                // 去customize 查询志愿者类别
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                Result<List<String>> volunteerResult = operCustomizeOpenFeignClient.volunteerLabelByValues(volunteers, personData.getCustomerId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                if (!volunteerResult.success()){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    throw new RenException("查询志愿者类别失败..."); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                personData.setVolunteerCategory(volunteerResult.getData()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        // TODO
 | 
					 | 
					 | 
					        // 网格名
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(personData.getGridId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (null != gridInfo){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            personData.setGridName(gridInfo.getGridNamePath()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					         * 人员类别 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					         * 先查询customize配置的 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					         * 再根据配置去查询字段 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					         */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return personData; | 
					 | 
					 | 
					        return personData; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -534,7 +557,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * desc:条件导出 | 
					 | 
					 | 
					     * desc:条件导出 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * | 
					 | 
					 | 
					     * | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * | 
					 | 
					 | 
					     * | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					     * @param formItemMap | 
					 | 
					 | 
					     * @param formItemMap key 表名 value formItem | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param resiMainList | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param customerId | 
					 | 
					 | 
					     * @param customerId | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param formCode | 
					 | 
					 | 
					     * @param formCode | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param baseTableName | 
					 | 
					 | 
					     * @param baseTableName | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -542,11 +566,21 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @return | 
					 | 
					 | 
					     * @return | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     */ | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    public Map<String, Map<String, Object>> getDataForExport(Map<String, FormItem> formItemMap, String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions) { | 
					 | 
					 | 
					    public Map<String, Map<String, Object>> getDataForExport(Map<String, FormItem> formItemMap, Map<String, Map<String, Object>> resiMainList, String customerId, String formCode, String baseTableName, List<ResiUserQueryValueDTO> conditions) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        List<Map<String, Object>> mapList = this.dynamicQuery(customerId, formCode, baseTableName, conditions); | 
					 | 
					 | 
					        List<Map<String, Object>> mapList = this.dynamicQuery(customerId, formCode, baseTableName, conditions); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        Map<String, Map<String, Object>> result = new LinkedHashMap<>(); | 
					 | 
					 | 
					        Map<String, Map<String, Object>> result = new LinkedHashMap<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        mapList.stream().filter(Objects::nonNull).forEach(map -> { | 
					 | 
					 | 
					        mapList.stream().filter(Objects::nonNull).forEach(map -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            String resiId = (String) map.getOrDefault(UserConstant.IC_RESI_USER, ""); | 
					 | 
					 | 
					            String resiId = (String) map.getOrDefault(UserConstant.IC_RESI_USER, ""); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if ("ic_resi_user".equals(baseTableName)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                resiId = (String) map.get("ID"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (StringUtils.isBlank(resiId)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                log.error("getDataForExport error,resiId:{}",resiId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            result.put(resiId, map); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            for (Map.Entry<String, FormItem> e : formItemMap.entrySet()) { | 
					 | 
					 | 
					            for (Map.Entry<String, FormItem> e : formItemMap.entrySet()) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                String k = e.getKey(); | 
					 | 
					 | 
					                String k = e.getKey(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                FormItem v = e.getValue(); | 
					 | 
					 | 
					                FormItem v = e.getValue(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -554,8 +588,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (temp != null) { | 
					 | 
					 | 
					                if (temp != null) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    if (v.getOptionSourceType().equals("remote")) { | 
					 | 
					 | 
					                    if (v.getOptionSourceType().equals("remote")) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        try { | 
					 | 
					 | 
					                        try { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            Map<String, IcResiUserImportServiceImpl.ColumnWrapper> columnWrappers = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            if(v.getItemId().equals("1078")){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                Map<String, Object> userMap = resiMainList.get(map.get(UserConstant.IC_RESI_USER)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                Object gridId = userMap.get(UserConstant.GRID_ID); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                IcResiUserImportServiceImpl.ColumnWrapper value = new IcResiUserImportServiceImpl.ColumnWrapper(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                value.setColValue(gridId.toString()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                columnWrappers.put("1001", value); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            //todo 获取 options
 | 
					 | 
					 | 
					                            //todo 获取 options
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                            Map<String, String> stringMap = icResiUserImportService.listRemoteOptions(new HashMap<>(), v.getOptionSourceValue(), null); | 
					 | 
					 | 
					                            Map<String, String> stringMap = icResiUserImportService.listRemoteOptions(columnWrappers, v.getOptionSourceValue(), null); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                            if ("checkbox".equals(v.getItemType())) { | 
					 | 
					 | 
					                            if ("checkbox".equals(v.getItemType())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                                stringMap.forEach((label, value) -> map.put(value, temp.toString().contains(value) ? "是" : "否")); | 
					 | 
					 | 
					                                stringMap.forEach((label, value) -> map.put(value, temp.toString().contains(value) ? "是" : "否")); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            } else if ("select".equals(v.getItemType())) { | 
					 | 
					 | 
					                            } else if ("select".equals(v.getItemType())) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -590,15 +632,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if ("ic_resi_user".equals(baseTableName)) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                resiId = (String) map.get("ID"); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (StringUtils.isBlank(resiId)){ | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                log.error("getDataForExport error,resiId:{}",resiId); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                return; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            result.put(resiId, map); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (!"ic_resi_user".equals(baseTableName)) { | 
					 | 
					 | 
					            if (!"ic_resi_user".equals(baseTableName)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                map.putAll(resiMainList.get(resiId)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                return; | 
					 | 
					 | 
					                return; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            Object gridId = map.get(UserConstant.GRID_ID); | 
					 | 
					 | 
					            Object gridId = map.get(UserConstant.GRID_ID); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -607,7 +642,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                formDTO.setGridId(gridId.toString()); | 
					 | 
					 | 
					                formDTO.setGridId(gridId.toString()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                Result<CustomerGridDTO> gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(formDTO); | 
					 | 
					 | 
					                Result<CustomerGridDTO> gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(formDTO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (gridInfoRes != null && gridInfoRes.success() && gridInfoRes.getData() != null) { | 
					 | 
					 | 
					                if (gridInfoRes != null && gridInfoRes.success() && gridInfoRes.getData() != null) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    map.put(UserConstant.GRID_ID, gridInfoRes.getData().getGridName()); | 
					 | 
					 | 
					                    map.put(UserConstant.GRID_NAME, gridInfoRes.getData().getGridName()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            Object homeId = map.get(UserConstant.HOME_ID); | 
					 | 
					 | 
					            Object homeId = map.get(UserConstant.HOME_ID); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |