|  |  | @ -4,35 +4,44 @@ import com.alibaba.excel.EasyExcel; | 
			
		
	
		
			
				
					|  |  |  | import com.alibaba.excel.ExcelWriter; | 
			
		
	
		
			
				
					|  |  |  | import com.alibaba.excel.write.metadata.WriteSheet; | 
			
		
	
		
			
				
					|  |  |  | import com.alibaba.fastjson.JSON; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.constant.Constant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.constant.NumConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.constant.StrConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.enums.FormItemTypeEnum; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.enums.IcFormCodeEnum; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.exception.EpmetErrorCode; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.exception.EpmetException; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.security.user.LoginUserUtil; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.ExcelUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.Result; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.SpringContextUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.poi.excel.FreezeAndFilter; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.IcResiUserConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.IcExportTemplateQueryFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.IcResiUserPageFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.FormItemResult; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.IcCustomExportResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.OptionDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.excel.support.ExportResiUserItemDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.feign.OperCustomizeOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.IcResiUserExportService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.IcResiUserImportService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.IcResiUserService; | 
			
		
	
		
			
				
					|  |  |  | import com.github.pagehelper.Page; | 
			
		
	
		
			
				
					|  |  |  | import com.github.pagehelper.PageHelper; | 
			
		
	
		
			
				
					|  |  |  | import com.google.common.cache.Cache; | 
			
		
	
		
			
				
					|  |  |  | import com.google.common.cache.CacheBuilder; | 
			
		
	
		
			
				
					|  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.commons.lang3.StringUtils; | 
			
		
	
		
			
				
					|  |  |  | import org.jetbrains.annotations.Nullable; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import javax.servlet.http.HttpServletResponse; | 
			
		
	
		
			
				
					|  |  |  | import java.io.IOException; | 
			
		
	
		
			
				
					|  |  |  | import java.util.ArrayList; | 
			
		
	
		
			
				
					|  |  |  | import java.util.HashMap; | 
			
		
	
		
			
				
					|  |  |  | import java.util.List; | 
			
		
	
		
			
				
					|  |  |  | import java.util.Map; | 
			
		
	
		
			
				
					|  |  |  | import java.util.*; | 
			
		
	
		
			
				
					|  |  |  | import java.util.concurrent.ConcurrentHashMap; | 
			
		
	
		
			
				
					|  |  |  | import java.util.stream.Collectors; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | /** | 
			
		
	
	
		
			
				
					|  |  | @ -48,9 +57,9 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private LoginUserUtil loginUserUtil; | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private IcResiUserService icResiUserService; | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private IcResiUserImportService icResiUserImportService; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * desc: 根据条件查询居民信息并根据配置模板导出 | 
			
		
	
	
		
			
				
					|  |  | @ -65,22 +74,20 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { | 
			
		
	
		
			
				
					|  |  |  |     public void exportIcResiUser(IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) { | 
			
		
	
		
			
				
					|  |  |  |         ExcelWriter excelWriter = null; | 
			
		
	
		
			
				
					|  |  |  |         try { | 
			
		
	
		
			
				
					|  |  |  |             //获取模板条件
 | 
			
		
	
		
			
				
					|  |  |  |             IcExportTemplateQueryFormDTO param = new IcExportTemplateQueryFormDTO(); | 
			
		
	
		
			
				
					|  |  |  |             param.setCustomerId(loginUserUtil.getLoginUserCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |             param.setTempId(pageFormDTO.getTemplateId()); | 
			
		
	
		
			
				
					|  |  |  |             Result<IcCustomExportResultDTO> exportConfigResult = operCustomizeOpenFeignClient.getExcelHeaderAndSqlColumnForExport(param); | 
			
		
	
		
			
				
					|  |  |  |             if (!exportConfigResult.success() || exportConfigResult.getData() == null) { | 
			
		
	
		
			
				
					|  |  |  |                 log.error("获取模板失败"); | 
			
		
	
		
			
				
					|  |  |  |                 return; | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             //获取用户配置的导出条件
 | 
			
		
	
		
			
				
					|  |  |  |             Result<IcCustomExportResultDTO> exportConfigResult = getIcCustomExportConfig(pageFormDTO); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             Map<String, ExportResiUserItemDTO> itemOriginMap = getItemMap(pageFormDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |             IcCustomExportResultDTO exportConfigData = exportConfigResult.getData(); | 
			
		
	
		
			
				
					|  |  |  |             log.info("查询到的模板配置信息:{}", JSON.toJSONString(exportConfigData)); | 
			
		
	
		
			
				
					|  |  |  |             FreezeAndFilter writeHandler = new FreezeAndFilter(); | 
			
		
	
		
			
				
					|  |  |  |             excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("居民基本信息.xlsx", response)).registerWriteHandler(writeHandler).build(); | 
			
		
	
		
			
				
					|  |  |  |             WriteSheet writeSheet = EasyExcel.writerSheet().head(exportConfigData.getHeaders()).build(); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(loginUserUtil.getLoginUserCustomerId(), loginUserUtil.getLoginUserId()); | 
			
		
	
		
			
				
					|  |  |  |             CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(pageFormDTO.getCustomerId(), pageFormDTO.getStaffId()); | 
			
		
	
		
			
				
					|  |  |  |             if (staffInfoCacheResult == null){ | 
			
		
	
		
			
				
					|  |  |  |                 throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取工作人员信息失败"); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             String staffOrgPath = null; | 
			
		
	
		
			
				
					|  |  |  |             if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { | 
			
		
	
		
			
				
					|  |  |  |                 staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfoCacheResult.getAgencyId()); | 
			
		
	
	
		
			
				
					|  |  | @ -93,34 +100,54 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { | 
			
		
	
		
			
				
					|  |  |  |             do { | 
			
		
	
		
			
				
					|  |  |  |                 String finalStaffOrgPath = staffOrgPath; | 
			
		
	
		
			
				
					|  |  |  |                 mapListPage = PageHelper.startPage(pageFormDTO.getPageNo(), pageFormDTO.getPageSize(), pageFormDTO.getIsPage()).doSelectPage(() -> { | 
			
		
	
		
			
				
					|  |  |  |                     icResiUserService.dynamicQuery(loginUserUtil.getLoginUserCustomerId(), pageFormDTO.getFormCode(), IcResiUserConstant.IC_RESI_USER, allShowColumns, pageFormDTO.getConditions(), staffInfoCacheResult.getAgencyId(), finalStaffOrgPath); | 
			
		
	
		
			
				
					|  |  |  |                     icResiUserService.dynamicQuery(pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), IcResiUserConstant.IC_RESI_USER, allShowColumns, pageFormDTO.getConditions(), staffInfoCacheResult.getAgencyId(), finalStaffOrgPath); | 
			
		
	
		
			
				
					|  |  |  |                 }); | 
			
		
	
		
			
				
					|  |  |  |                 pageFormDTO.setPageNo(pageFormDTO.getPageNo() + NumConstant.ONE); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 List<Map<String, Object>> result = mapListPage.getResult(); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 List<List<Object>> resultData = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 result.forEach(o -> { | 
			
		
	
		
			
				
					|  |  |  |                     List<Object> singleResult = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |                     Map<String,Object> originalConditionMap = new ConcurrentHashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |                     o.forEach((key,value) -> { | 
			
		
	
		
			
				
					|  |  |  |                         List<IcCustomExportResultDTO.SqlColumn> showSqlColumns = exportConfigData.getShowSqlColumns(); | 
			
		
	
		
			
				
					|  |  |  |                         Map<String, IcCustomExportResultDTO.SqlColumn> itemMap = showSqlColumns.stream().collect(Collectors.toMap(IcCustomExportResultDTO.SqlColumn::getColumnName, item -> item)); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                         IcCustomExportResultDTO.SqlColumn columnDTO = itemMap.get(key); | 
			
		
	
		
			
				
					|  |  |  |                         if (singleResult.size() < showSqlColumns.size()) { | 
			
		
	
		
			
				
					|  |  |  |                             singleResult.add(value); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                             IcCustomExportResultDTO.SqlColumn sqlColumn = itemMap.get(key); | 
			
		
	
		
			
				
					|  |  |  |                             String tableName = sqlColumn.getTableName(); | 
			
		
	
		
			
				
					|  |  |  |                             String itemId = sqlColumn.getItemId(); | 
			
		
	
		
			
				
					|  |  |  |                             String columnName = columnDTO.getColumnName(); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                             String vauleStr = value == null ? StrConstant.EPMETY_STR : value.toString(); | 
			
		
	
		
			
				
					|  |  |  |                            /* if (Constant.OPITON_SOURCE_REMOTE.equals(sqlColumn.getOptionSourceType()) && StringUtils.isNotBlank(vauleStr)) { | 
			
		
	
		
			
				
					|  |  |  |                                 putRemoteValue(formItemMap.getRemoteItemConditionMap().get(e.getItemId()), currentStaffAgencyId, resiUser,originalConditionMap, e, columnName, vauleStr); | 
			
		
	
		
			
				
					|  |  |  |                             } else { | 
			
		
	
		
			
				
					|  |  |  |                                 putOptionValue(resiUser, e, columnName, vauleStr); | 
			
		
	
		
			
				
					|  |  |  |                             }*/ | 
			
		
	
		
			
				
					|  |  |  |                             //保留原始值 便于remote条件获取
 | 
			
		
	
		
			
				
					|  |  |  |                             originalConditionMap.putIfAbsent(columnName,vauleStr); | 
			
		
	
		
			
				
					|  |  |  |                             ExportResiUserItemDTO exportResiUserItemDTO = itemOriginMap.get(tableName); | 
			
		
	
		
			
				
					|  |  |  |                             FormItemResult formItemResult = exportResiUserItemDTO.getItemMap().get(columnName); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                             if (StringUtils.isBlank(vauleStr)){ | 
			
		
	
		
			
				
					|  |  |  |                                 return; | 
			
		
	
		
			
				
					|  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |                             String newValue = vauleStr; | 
			
		
	
		
			
				
					|  |  |  |                             if (Constant.OPITON_SOURCE_REMOTE.equals(sqlColumn.getOptionSourceType())) { | 
			
		
	
		
			
				
					|  |  |  |                                 putRemoteValue(exportResiUserItemDTO.getRemoteItemConditionMap().get(itemId), staffInfoCacheResult.getAgencyId(), o,originalConditionMap, formItemResult, columnName, vauleStr); | 
			
		
	
		
			
				
					|  |  |  |                             } else if (Constant.OPITON_SOURCE_LOCAL.equals(sqlColumn.getOptionSourceType())){ | 
			
		
	
		
			
				
					|  |  |  |                                 newValue = putOptionValue(formItemResult, vauleStr); | 
			
		
	
		
			
				
					|  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |                             singleResult.add(newValue); | 
			
		
	
		
			
				
					|  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |                     }); | 
			
		
	
		
			
				
					|  |  |  |                     resultData.add(singleResult); | 
			
		
	
		
			
				
					|  |  |  |                 }); | 
			
		
	
		
			
				
					|  |  |  |                 log.info("需要写入的data长度:{}", resultData.size()); | 
			
		
	
		
			
				
					|  |  |  |                 excelWriter.write(resultData, writeSheet); | 
			
		
	
		
			
				
					|  |  |  |                 //todo
 | 
			
		
	
		
			
				
					|  |  |  |                 break; | 
			
		
	
		
			
				
					|  |  |  |             } while (mapListPage.getResult().size() == pageFormDTO.getPageSize()); | 
			
		
	
		
			
				
					|  |  |  |         } catch (IOException e) { | 
			
		
	
		
			
				
					|  |  |  |             log.error("exportIcResiUser exception", e); | 
			
		
	
	
		
			
				
					|  |  | @ -131,20 +158,31 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Nullable | 
			
		
	
		
			
				
					|  |  |  |     public Result<IcCustomExportResultDTO> getIcCustomExportConfig(IcResiUserPageFormDTO pageFormDTO) { | 
			
		
	
		
			
				
					|  |  |  |         IcExportTemplateQueryFormDTO param = new IcExportTemplateQueryFormDTO(); | 
			
		
	
		
			
				
					|  |  |  |         param.setCustomerId(pageFormDTO.getCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |         param.setTempId(pageFormDTO.getTemplateId()); | 
			
		
	
		
			
				
					|  |  |  |         Result<IcCustomExportResultDTO> exportConfigResult = operCustomizeOpenFeignClient.getExcelHeaderAndSqlColumnForExport(param); | 
			
		
	
		
			
				
					|  |  |  |         if (!exportConfigResult.success() || exportConfigResult.getData() == null) { | 
			
		
	
		
			
				
					|  |  |  |             log.error("获取模板失败"); | 
			
		
	
		
			
				
					|  |  |  |             throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取模板失败"); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         return exportConfigResult; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * key:itemId,value: key:columnName,中文 | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     private static Map<String, Cache<String,String>> remoteOptionCacheMap = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |     /*private void putRemoteValue(Set<FormItemResult> conditionItemSet, String currentStaffAgencyId, Map<String, Object> map, Map<String, Object> originalConditionMap, FormItemResult e, String columnName, String vauleStr) { | 
			
		
	
		
			
				
					|  |  |  |     private void putRemoteValue(Set<FormItemResult> conditionItemSet, String currentStaffAgencyId, Map<String, Object> map, Map<String, Object> originalConditionMap, FormItemResult e, String columnName, String vauleStr) { | 
			
		
	
		
			
				
					|  |  |  |         try { | 
			
		
	
		
			
				
					|  |  |  |             Map<String, IcResiUserImportServiceImpl.ColumnWrapper> columnWrappers = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |             if (e.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)){ | 
			
		
	
		
			
				
					|  |  |  |                 for (FormItemResult o : conditionItemSet) { | 
			
		
	
		
			
				
					|  |  |  |                     String column = getColumnName(o); | 
			
		
	
		
			
				
					|  |  |  |                     Object conditionValue = originalConditionMap.getOrDefault(column, map.get(column)); | 
			
		
	
		
			
				
					|  |  |  |                     originalConditionMap.putIfAbsent(column,conditionValue.toString()); | 
			
		
	
		
			
				
					|  |  |  |                     Object conditionValue = originalConditionMap.getOrDefault(columnName, map.get(columnName)); | 
			
		
	
		
			
				
					|  |  |  |                     originalConditionMap.putIfAbsent(columnName,conditionValue.toString()); | 
			
		
	
		
			
				
					|  |  |  |                     IcResiUserImportServiceImpl.ColumnWrapper value = new IcResiUserImportServiceImpl.ColumnWrapper(); | 
			
		
	
		
			
				
					|  |  |  |                     value.setColValue(conditionValue.toString()); | 
			
		
	
		
			
				
					|  |  |  |                     columnWrappers.put(o.getItemId(), value); | 
			
		
	
	
		
			
				
					|  |  | @ -171,28 +209,67 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } catch (Exception ex) { | 
			
		
	
		
			
				
					|  |  |  |             log.error("listRemoteOptions url:{}", e.getOptionSourceValue()); | 
			
		
	
		
			
				
					|  |  |  |             log.error("listRemoteOptions url", ex); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     private void putOptionValue(Map<String, Object> map, FormItemResult e, String columnName, String vauleStr) { | 
			
		
	
		
			
				
					|  |  |  |     private String putOptionValue(FormItemResult e, String vauleStr) { | 
			
		
	
		
			
				
					|  |  |  |         FormItemTypeEnum itemTypeEnum = FormItemTypeEnum.getEnum(e.getItemType()); | 
			
		
	
		
			
				
					|  |  |  |         switch (itemTypeEnum) { | 
			
		
	
		
			
				
					|  |  |  |             case CHECKBOX: | 
			
		
	
		
			
				
					|  |  |  |                 e.getOptions().forEach(optionDTO -> { | 
			
		
	
		
			
				
					|  |  |  |                     map.put(optionDTO.getValue(), vauleStr.contains(optionDTO.getValue()) ? StrConstant.YES : StrConstant.NO); | 
			
		
	
		
			
				
					|  |  |  |                 }); | 
			
		
	
		
			
				
					|  |  |  |                 for (OptionDTO dto : e.getOptions()) { | 
			
		
	
		
			
				
					|  |  |  |                     return vauleStr.contains(dto.getValue()) ? StrConstant.YES : StrConstant.NO; | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |                 break; | 
			
		
	
		
			
				
					|  |  |  |             case SELECT: | 
			
		
	
		
			
				
					|  |  |  |             case RADIO: | 
			
		
	
		
			
				
					|  |  |  |                 e.getOptions().forEach(optionDTO -> { | 
			
		
	
		
			
				
					|  |  |  |                 for (OptionDTO optionDTO : e.getOptions()) { | 
			
		
	
		
			
				
					|  |  |  |                     if (optionDTO.getValue().equals(vauleStr)) { | 
			
		
	
		
			
				
					|  |  |  |                         map.put(columnName, optionDTO.getLabel()); | 
			
		
	
		
			
				
					|  |  |  |                         return optionDTO.getLabel(); | 
			
		
	
		
			
				
					|  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |                 }); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |                 break; | 
			
		
	
		
			
				
					|  |  |  |             default: | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |     }*/ | 
			
		
	
		
			
				
					|  |  |  |         return vauleStr; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * desc:获取表单配置 | 
			
		
	
		
			
				
					|  |  |  |      * @param customerId | 
			
		
	
		
			
				
					|  |  |  |      * @return map key:tableName ,value:ExportResiUserItemDTO | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     private Map<String, ExportResiUserItemDTO> getItemMap(String customerId){ | 
			
		
	
		
			
				
					|  |  |  |         //获取表单项
 | 
			
		
	
		
			
				
					|  |  |  |         IcResiUserService icResiUserService = SpringContextUtils.getBean(IcResiUserService.class); | 
			
		
	
		
			
				
					|  |  |  |         if (icResiUserService == null){ | 
			
		
	
		
			
				
					|  |  |  |             log.error("获取bean IcResiUserService 失败"); | 
			
		
	
		
			
				
					|  |  |  |             return null; | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         List<FormItemResult> resiFormAllItems = icResiUserService.listFormItems(customerId, IcFormCodeEnum.RESI_BASE_INFO.getCode()); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, FormItemResult> allItemMap = resiFormAllItems.stream().collect(Collectors.toMap(FormItemResult::getItemId, o -> o)); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, ExportResiUserItemDTO> map = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |         allItemMap.values().forEach(item->{ | 
			
		
	
		
			
				
					|  |  |  |             String tableName = item.getTableName(); | 
			
		
	
		
			
				
					|  |  |  |             ExportResiUserItemDTO exportItem = map.getOrDefault(tableName, new ExportResiUserItemDTO()); | 
			
		
	
		
			
				
					|  |  |  |             map.putIfAbsent(tableName,exportItem); | 
			
		
	
		
			
				
					|  |  |  |             String columnName = item.getColumnName().concat(item.getColumnNum() == NumConstant.ZERO ? StrConstant.EPMETY_STR : item.getColumnNum().toString()); | 
			
		
	
		
			
				
					|  |  |  |             exportItem.getItemMap().put(columnName,item); | 
			
		
	
		
			
				
					|  |  |  |             if (Constant.OPITON_SOURCE_REMOTE.equals(item.getOptionSourceType())&&item.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)){ | 
			
		
	
		
			
				
					|  |  |  |                 //多个参数
 | 
			
		
	
		
			
				
					|  |  |  |                 String[] paramArr = item.getOptionSourceValue().split(StrConstant.QUESTION_MARK_TRANSFER)[NumConstant.ONE].split(StrConstant.AND_MARK); | 
			
		
	
		
			
				
					|  |  |  |                 Arrays.stream(paramArr).forEach(o->{ | 
			
		
	
		
			
				
					|  |  |  |                     FormItemResult value = allItemMap.get(o); | 
			
		
	
		
			
				
					|  |  |  |                     if (value == null){ | 
			
		
	
		
			
				
					|  |  |  |                         return; | 
			
		
	
		
			
				
					|  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |                     Set<FormItemResult> conditionSet = exportItem.getRemoteItemConditionMap().getOrDefault(item.getItemId(),new HashSet<>()); | 
			
		
	
		
			
				
					|  |  |  |                     conditionSet.add(value); | 
			
		
	
		
			
				
					|  |  |  |                     exportItem.getRemoteItemConditionMap().putIfAbsent(item.getItemId(),conditionSet); | 
			
		
	
		
			
				
					|  |  |  |                 }); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |         return map; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
	
		
			
				
					|  |  | 
 |