|  |  | @ -37,6 +37,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.page.PageData; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.security.dto.TokenDto; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.security.user.LoginUserUtil; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.Result; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.UserConstant; | 
			
		
	
	
		
			
				
					|  |  | @ -91,7 +92,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private EpmetAdminOpenFeignClient adminOpenFeignClient; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |      | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private LoginUserUtil loginUserUtil; | 
			
		
	
		
			
				
					|  |  |  |      | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public PageData<IcResiUserDTO> page(Map<String, Object> params) { | 
			
		
	
		
			
				
					|  |  |  |         IPage<IcResiUserEntity> page = baseDao.selectPage( | 
			
		
	
	
		
			
				
					|  |  | @ -431,7 +435,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public Object importIcResiInfoFromExcel(String currUserAgencyId) { | 
			
		
	
		
			
				
					|  |  |  |         return importIcResiInfoFromExcel(0, 3, currUserAgencyId); | 
			
		
	
		
			
				
					|  |  |  |         CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(currUserAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null); | 
			
		
	
		
			
				
					|  |  |  |         String loginUserId = loginUserUtil.getLoginUserId(); | 
			
		
	
		
			
				
					|  |  |  |         return importIcResiInfoFromExcel(0, 3, currUserAgencyId, agencyInfo.getPids(), loginUserId); | 
			
		
	
		
			
				
					|  |  |  | //        imporExcel(1, 1);
 | 
			
		
	
		
			
				
					|  |  |  | //        imporExcel(2, 1);
 | 
			
		
	
		
			
				
					|  |  |  | //        imporExcel(3, 1);
 | 
			
		
	
	
		
			
				
					|  |  | @ -442,7 +448,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
			
		
	
		
			
				
					|  |  |  | //        imporExcel(8, 1);
 | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     private Object importIcResiInfoFromExcel(int sheetNo, int headRowNumber, String currUserAgencyId) { | 
			
		
	
		
			
				
					|  |  |  |     private Object importIcResiInfoFromExcel(int sheetNo, int headRowNumber, String currUserAgencyId, String currUserAgencyPids, String currentUserId) { | 
			
		
	
		
			
				
					|  |  |  |         DynamicEasyExcelListener readListener = new DynamicEasyExcelListener(); | 
			
		
	
		
			
				
					|  |  |  |         EasyExcelFactory.read(new File("/opt/test/基础信息表/resi_info.xls")).registerReadListener(readListener).headRowNumber(3).sheet(sheetNo).doRead(); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -478,7 +484,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
			
		
	
		
			
				
					|  |  |  |         Map<String, ColumnWrapper> headerColumnWrapper = integrate(formItemMap, combinedHeaders, dataList, abandonedHeaders); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         // 持久化
 | 
			
		
	
		
			
				
					|  |  |  |         persist(headerColumnWrapper, dataList, currUserAgencyId, abandonedHeaders, customerItems.get(0).getTableName()); | 
			
		
	
		
			
				
					|  |  |  |         persist(headerColumnWrapper, dataList, currUserAgencyId, abandonedHeaders, customerItems.get(0).getTableName(), currUserAgencyPids, currentUserId); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         return headerColumnWrapper; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
	
		
			
				
					|  |  | @ -490,15 +496,17 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
			
		
	
		
			
				
					|  |  |  |      * @param currUserAgencyId 当前用户的组织id | 
			
		
	
		
			
				
					|  |  |  |      * @param checkBoxOptionColumnIdxAndLabel 复选框的列号&label中文 | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     private void persist(Map<String, ColumnWrapper> headerColumnWrapper, List<Map<Integer, String>> dataRows, | 
			
		
	
		
			
				
					|  |  |  |                          String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, String tableName) { | 
			
		
	
		
			
				
					|  |  |  |     private void persist(Map<String, ColumnWrapper> headerColumnWrapper, List<Map<Integer, String>> dataRows,  | 
			
		
	
		
			
				
					|  |  |  |                          String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, String tableName, | 
			
		
	
		
			
				
					|  |  |  |                          String currUserAgencyPids, String currentUserId) { | 
			
		
	
		
			
				
					|  |  |  |         for (Map<Integer, String> row : dataRows) { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |              | 
			
		
	
		
			
				
					|  |  |  |             // 当前行的列们
 | 
			
		
	
		
			
				
					|  |  |  | //            List<ColumnWrapper> columnsOfCurrRow = new ArrayList<>();
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             List<String> columnNames = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |             List<String> columnValues = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |             LinkedHashMap<String, String> columnAndValues = new LinkedHashMap<>(); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             for (Map.Entry<String, ColumnWrapper> columnWrapperEntry : headerColumnWrapper.entrySet()) { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -537,7 +545,32 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
			
		
	
		
			
				
					|  |  |  |                     String checkBoxColValue = getCheckBoxColValue(columnWrapper, row, checkBoxOptionColumnIdxAndLabel); | 
			
		
	
		
			
				
					|  |  |  |                     columnWrapper.setColValue(checkBoxColValue); | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |                 columnAndValues.put(columnWrapper.columnName, columnWrapper.colValue); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("IS_ENSURE_HOUSE", "0"); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("IS_OLD_PEOPLE", "0"); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("IS_PARTY", "0"); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("IS_SPECIAL", "0"); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("IS_UNEMPLOYED", "0"); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("IS_UNITED_FRONT", "0"); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("IS_VETERANS", "0"); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("IS_VOLUNTEER", "0"); | 
			
		
	
		
			
				
					|  |  |  |              | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("AGENCY_ID", currUserAgencyId); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("PIDS", currUserAgencyPids); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("CUSTOMER_ID", loginUserUtil.getCurrentCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("CREATED_BY", currentUserId); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("UPDATED_BY", currentUserId); | 
			
		
	
		
			
				
					|  |  |  |             columnAndValues.put("ID", UUID.randomUUID().toString().replace("-", "")); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | //            rowColumnWrappers.forEach(c -> {
 | 
			
		
	
		
			
				
					|  |  |  | //                System.out.println(c.columnName + "\t" + c.getColValue());
 | 
			
		
	
		
			
				
					|  |  |  | //            });
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | //            System.out.println("-------------------");
 | 
			
		
	
		
			
				
					|  |  |  |              | 
			
		
	
		
			
				
					|  |  |  |             baseDao.add(tableName, columnAndValues); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |