| 
						
						
							
								
							
						
						
					 | 
					@ -75,10 +75,17 @@ import java.util.stream.Collectors; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					@Service | 
					 | 
					 | 
					@Service | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					public class IcResiUserImportServiceImpl implements IcResiUserImportService, ResultDataResolver { | 
					 | 
					 | 
					public class IcResiUserImportServiceImpl implements IcResiUserImportService, ResultDataResolver { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public static final List<String> controlGroup1 = Arrays.asList("input", "textarea", "datepicker", "daterange"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public static final List<String> controlGroup2 = Arrays.asList("select", "radio"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * 身份证号列序号 | 
					 | 
					 | 
					     * 身份证号列序号 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     */ | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public static final Integer ID_CARD_COLUMN_NO = 9; | 
					 | 
					 | 
					    public static final Integer ID_CARD_COLUMN_NO = 9; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * 姓名列序号 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public static final Integer ID_NAME_COLUMN_NO = 6; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    // 错误和跳过excel行暂存
 | 
					 | 
					 | 
					    // 错误和跳过excel行暂存
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public static final ThreadLocal<Map<String, List<ErrorRow>>> errorRows = new ThreadLocal<>(); | 
					 | 
					 | 
					    public static final ThreadLocal<Map<String, List<ErrorRow>>> errorRows = new ThreadLocal<>(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -163,9 +170,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        private Integer required; | 
					 | 
					 | 
					        private Integer required; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        private List<Integer> colIndex; | 
					 | 
					 | 
					        private List<Integer> colIndex; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //private List<String> colContents;
 | 
					 | 
					 | 
					        //private List<String> colContents;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        // 单元格内容
 | 
					 | 
					 | 
					        // 单元格内容。多选框没有该列,因为多选框对应着excel的多列
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        private String cellContent; | 
					 | 
					 | 
					        private String cellContent; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        // 数据库中列的值
 | 
					 | 
					 | 
					        // 单元格内容对应的数据库中值
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        private String colValue; | 
					 | 
					 | 
					        private String colValue; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // key:label,value:value
 | 
					 | 
					 | 
					        // key:label,value:value
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -425,11 +432,10 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            try { | 
					 | 
					 | 
					            try { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                convertColumnWrappers2Map4Persist(itemIdAndColumnWrapper, row, currUserAgencyId, checkBoxOptionColumnIdxAndLabel, columnAndValues, true); | 
					 | 
					 | 
					                convertColumnWrappers2Map4Persist(itemIdAndColumnWrapper, row, currUserAgencyId, checkBoxOptionColumnIdxAndLabel, columnAndValues, true); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                String idCard = columnAndValues.get("ID_CARD"); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                // 执行指定的检查
 | 
					 | 
					 | 
					                // 执行指定的检查
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                specifiedCheck(columnAndValues); | 
					 | 
					 | 
					                specifiedCheck(columnAndValues); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                String idCard = columnAndValues.get("ID_CARD"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                Map<String, String> existingResiMap = icResiUserDao.selectResiInfoMap(idCard, null); | 
					 | 
					 | 
					                Map<String, String> existingResiMap = icResiUserDao.selectResiInfoMap(idCard, null); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (existingResiMap == null) { | 
					 | 
					 | 
					                if (existingResiMap == null) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -719,111 +725,179 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * 将当前行数据转化成LinkedHashMap,供后续插入 | 
					 | 
					 | 
					     * 将当前行数据转化成LinkedHashMap,供后续插入 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					     * @param itemIdAndColumnWrappers 当前行的ColumnWrapper,每一个ColumnWrapper元素都是当前行中的一个列,key:itemId | 
					 | 
					 | 
					     * @param dbMetadataItemIdAndColumnWrappers 当前行的ColumnWrapper,每一条都是数据库中的一个列的源数据,对应到excel中可能是多个列(多选)。每一个ColumnWrapper元素都是当前行中的一个列,key:itemId | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					     * @param row  当前行数据 | 
					 | 
					 | 
					     * @param row  当前行数据 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param currUserAgencyId 当前用户所属机构ID | 
					 | 
					 | 
					     * @param currUserAgencyId 当前用户所属机构ID | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param checkBoxOptionColumnIdxAndLabel 复选框options列表。key:列号,value:复选框中文 | 
					 | 
					 | 
					     * @param checkBoxOptionColumnIdxAndLabel 复选框options列表。key:列号,value:复选框中文 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					     * @param target 要将数据放到哪个对象中 | 
					 | 
					 | 
					     * @param target2Insert 要用来insert到db的数据 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					     * @param isPrimaryTable 是否是主表 | 
					 | 
					 | 
					     * @param isPrimaryTable 是否是主表 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     */ | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    private void convertColumnWrappers2Map4Persist(Map<String, ColumnWrapper> itemIdAndColumnWrappers, Map<Integer, String> row, | 
					 | 
					 | 
					    private void convertColumnWrappers2Map4Persist(Map<String, ColumnWrapper> dbMetadataItemIdAndColumnWrappers, Map<Integer, String> row, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                                                   String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, | 
					 | 
					 | 
					                                                   String currUserAgencyId, Map<Integer, String> checkBoxOptionColumnIdxAndLabel, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                                                   LinkedHashMap<String, String> target, boolean isPrimaryTable) { | 
					 | 
					 | 
					                                                   LinkedHashMap<String, String> target2Insert, boolean isPrimaryTable) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        boolean interupt = false; | 
					 | 
					 | 
					        boolean hasError = false; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<String> errorColumnNames = new LinkedList<>(); | 
					 | 
					 | 
					        String notFoundColumnNames = null; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        String emptyColumnNames = null; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        for (Map.Entry<String, ColumnWrapper> itemIdAndColumnWrapper : itemIdAndColumnWrappers.entrySet()) { | 
					 | 
					 | 
					        // 这两列要提前放进去,因为有的列未填写的话,会抛异常出去,需要用这两列来做描述
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        target2Insert.put("ID_CARD", row.get(ID_CARD_COLUMN_NO)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        target2Insert.put("NAME", row.get(ID_NAME_COLUMN_NO)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            String itemId = itemIdAndColumnWrapper.getKey(); | 
					 | 
					 | 
					        for (Map.Entry<String, ColumnWrapper> dbColumnMetadata : dbMetadataItemIdAndColumnWrappers.entrySet()) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					            ColumnWrapper columnWrapper = itemIdAndColumnWrapper.getValue(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            if ("input".equals(columnWrapper.getItemType()) | 
					 | 
					 | 
					            String currentItemId = dbColumnMetadata.getKey(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    || "textarea".equals(columnWrapper.getItemType()) | 
					 | 
					 | 
					            ColumnWrapper columnWrapper = dbColumnMetadata.getValue(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					                    || "datepicker".equals(columnWrapper.getItemType()) | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    || "daterange".equals(columnWrapper.getItemType()) | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            ) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            // "input", "textarea", "datepicker", "daterange"
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (controlGroup1.contains(columnWrapper.getItemType())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                // 输入的控件,不会横跨多个单元格,所以只取一列就可以了
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                String cellContent = row.get(columnWrapper.getColIndex().get(0)); | 
					 | 
					 | 
					                String cellContent = row.get(columnWrapper.getColIndex().get(0)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                columnWrapper.setCellContent(cellContent); | 
					 | 
					 | 
					                columnWrapper.setCellContent(cellContent); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                columnWrapper.setColValue(cellContent); | 
					 | 
					 | 
					                columnWrapper.setColValue(cellContent); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            } else if ("select".equals(columnWrapper.getItemType()) | 
					 | 
					 | 
					                // 必填检查
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    || "radio".equals(columnWrapper.getItemType())){ | 
					 | 
					 | 
					                if (hasError = requiredButEmptyCheck(isPrimaryTable, columnWrapper)) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    emptyColumnNames = columnWrapper.combinedLabel; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                // "select", "radio"
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } else if (controlGroup2.contains(columnWrapper.getItemType())){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                String optionSourceType = columnWrapper.getOptionSourceType(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                // 取单元格的内容
 | 
					 | 
					 | 
					                // 取单元格的内容
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                String cellContent = row.get(columnWrapper.getColIndex().get(0)); | 
					 | 
					 | 
					                String cellContent = row.get(columnWrapper.getColIndex().get(0)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                columnWrapper.setCellContent(cellContent); | 
					 | 
					 | 
					                columnWrapper.setCellContent(cellContent); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if ("local".equals(optionSourceType)) { | 
					 | 
					 | 
					                // 必填检查
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                if (hasError = requiredButEmptyCheck(isPrimaryTable, columnWrapper)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    emptyColumnNames = columnWrapper.combinedLabel; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    break; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                if ("local".equals(columnWrapper.getOptionSourceType())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    // 根据单元格内容,取到指定的option
 | 
					 | 
					 | 
					                    // 根据单元格内容,取到指定的option
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    Map<String, String> options = columnWrapper.getOptions(); | 
					 | 
					 | 
					                    Map<String, String> itemOptions = columnWrapper.getOptions(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    String colValue = options.get(cellContent); | 
					 | 
					 | 
					                    String colValue = itemOptions.get(cellContent); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    columnWrapper.setColValue(colValue); | 
					 | 
					 | 
					                    columnWrapper.setColValue(colValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } else { | 
					 | 
					 | 
					                } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    // remote类型。优先从缓存取
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    String fullUri = columnWrapper.getOptionSourceValue(); | 
					 | 
					 | 
					                    String fullUri = columnWrapper.getOptionSourceValue(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    String[] uriParts = splitOptionSourceUrl(fullUri); | 
					 | 
					 | 
					                    String[] uriParts = splitOptionSourceUrl(fullUri); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    String pureUri = uriParts[0]; | 
					 | 
					 | 
					                    String pureUri = uriParts[0]; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    String superItemId = uriParts[1]; | 
					 | 
					 | 
					                    String superItemId = uriParts[1]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    String superColumValue; | 
					 | 
					 | 
					                    String superColumnValue; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    // 获取父item的值
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    if (StringUtils.isNotBlank(superItemId)) { | 
					 | 
					 | 
					                    if (StringUtils.isNotBlank(superItemId)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        superColumValue = itemIdAndColumnWrappers.get(superItemId).getColValue(); | 
					 | 
					 | 
					                        superColumnValue = dbMetadataItemIdAndColumnWrappers.get(superItemId).getColValue(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    } else { | 
					 | 
					 | 
					                    } else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        superColumValue = "-"; | 
					 | 
					 | 
					                        superColumnValue = "-"; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    Map<String, Map<String, String>> superOptions = itemIdAndOptionsCache.getIfPresent(itemId); | 
					 | 
					 | 
					                    // 通过接口调用,计算出colValue,放到columnWrapper中
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    Map<String, Map<String, String>> superOptions = itemIdAndOptionsCache.getIfPresent(currentItemId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    if (superOptions != null && superOptions.size() > 0) { | 
					 | 
					 | 
					                    if (superOptions != null && superOptions.size() > 0) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        Map<String, String> options = superOptions.get(superColumValue); | 
					 | 
					 | 
					                        Map<String, String> options = superOptions.get(superColumnValue); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        if (options == null || options.size() == 0) { | 
					 | 
					 | 
					                        if (options == null || options.size() == 0) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                            options = listRemoteOptions(pureUri, superItemId, itemIdAndColumnWrappers, currUserAgencyId, "saveorupdate"); | 
					 | 
					 | 
					                            options = listRemoteOptions(pureUri, superItemId, dbMetadataItemIdAndColumnWrappers, currUserAgencyId, "saveorupdate"); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                            superOptions.put(superColumValue, options); | 
					 | 
					 | 
					                            superOptions.put(superColumnValue, options); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        } | 
					 | 
					 | 
					                        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        String colValue = options.get(cellContent); | 
					 | 
					 | 
					                        String colValue = options.get(cellContent); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        columnWrapper.setColValue(colValue); | 
					 | 
					 | 
					                        columnWrapper.setColValue(colValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } else { | 
					 | 
					 | 
					                    } else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        Map<String, String> options = listRemoteOptions(pureUri, superItemId, itemIdAndColumnWrappers, currUserAgencyId, "saveorupdate"); | 
					 | 
					 | 
					                        // 父item的options。例如当前遍历的是小区列,那查出来的就是网格下的小区
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        // 然后把 <currentItemId:<superItem:usperOptions>> 放到缓存里
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        Map<String, String> options = listRemoteOptions(pureUri, superItemId, dbMetadataItemIdAndColumnWrappers, currUserAgencyId, "saveorupdate"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        superOptions = new HashMap<>(); | 
					 | 
					 | 
					                        superOptions = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        superOptions.put(superColumValue, options); | 
					 | 
					 | 
					                        superOptions.put(superColumnValue, options); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        itemIdAndOptionsCache.put(itemId, superOptions); | 
					 | 
					 | 
					                        itemIdAndOptionsCache.put(currentItemId, superOptions); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        String colValue = options.get(cellContent); | 
					 | 
					 | 
					                        String colValue = options.get(cellContent); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        columnWrapper.setColValue(colValue); | 
					 | 
					 | 
					                        columnWrapper.setColValue(colValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } else if ("checkbox".equals(columnWrapper.getItemType())) { | 
					 | 
					 | 
					            } else if ("checkbox".equals(columnWrapper.getItemType())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                //多选框没有具体的cellContent,因为多选框对应着excel的多列
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                String checkBoxColValue = getCheckBoxColValue(columnWrapper, row, checkBoxOptionColumnIdxAndLabel); | 
					 | 
					 | 
					                String checkBoxColValue = getCheckBoxColValue(columnWrapper, row, checkBoxOptionColumnIdxAndLabel); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                columnWrapper.setColValue(checkBoxColValue); | 
					 | 
					 | 
					                columnWrapper.setColValue(checkBoxColValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            // 填了,但找不到对应数据的检查
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (hasError = notFoundCheck(isPrimaryTable, columnWrapper)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                notFoundColumnNames = columnWrapper.combinedLabel; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                break; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            target2Insert.put(columnWrapper.columnName, columnWrapper.colValue); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (!hasError) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            return; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        StringBuilder sb = new StringBuilder(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        // 组织报错信息
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (StringUtils.isNotBlank(emptyColumnNames)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            sb.append(emptyColumnNames).append("的值未填写"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (StringUtils.isNotBlank(notFoundColumnNames)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            sb.append(notFoundColumnNames).append("填写的值在系统中未找到"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        throw new EpmetException(sb.toString()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * 必填,但是用户没填的,放到list中 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param isPrimaryTable 是否是主表。true:是主表,false:从表 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param columnWrapper 数据库列包装对象 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public boolean requiredButEmptyCheck(Boolean isPrimaryTable, ColumnWrapper columnWrapper) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // requiredColumns中的值不在排除字段中 && 是必填 && 未填写
 | 
					 | 
					 | 
					        // requiredColumns中的值不在排除字段中 && 是必填 && 未填写
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (isPrimaryTable) { | 
					 | 
					 | 
					        if (isPrimaryTable) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            // 主表没有需要排除的列
 | 
					 | 
					 | 
					            // 主表没有需要排除的列
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (columnWrapper.getRequired() == 1 && StringUtils.isBlank(columnWrapper.colValue)) { | 
					 | 
					 | 
					            if (columnWrapper.getRequired() == 1 && StringUtils.isBlank(columnWrapper.cellContent)) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    interupt = true; | 
					 | 
					 | 
					                return true; | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					                    errorColumnNames.add(columnWrapper.combinedLabel); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } else { | 
					 | 
					 | 
					        } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            // 从表需要排除掉一些不必要校验的列
 | 
					 | 
					 | 
					            // 从表需要排除掉一些不必要校验的列
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (!subTableNeedlessColumns.contains(columnWrapper.columnName) | 
					 | 
					 | 
					            if (!subTableNeedlessColumns.contains(columnWrapper.columnName) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    && columnWrapper.getRequired() == 1 | 
					 | 
					 | 
					                    && columnWrapper.getRequired() == 1 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        && StringUtils.isBlank(columnWrapper.colValue)) { | 
					 | 
					 | 
					                    && StringUtils.isBlank(columnWrapper.cellContent)) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    interupt = true; | 
					 | 
					 | 
					                return true; | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					                    errorColumnNames.add(columnWrapper.combinedLabel); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            target.put(columnWrapper.columnName, columnWrapper.colValue); | 
					 | 
					 | 
					        return false; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (interupt) { | 
					 | 
					 | 
					    /** | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            throw new RenException(String.join(",", errorColumnNames) + "的值未填写,或者所填写信息在系统中未找到"); | 
					 | 
					 | 
					     * 必填,并且在系统中没找到值的,放到list中 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param isPrimaryTable 是否是主表。true:是主表,false:从表 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param columnWrapper 数据库列包装对象 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public boolean notFoundCheck(Boolean isPrimaryTable, ColumnWrapper columnWrapper) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        // requiredColumns中的值不在排除字段中 && 是必填 && 未填写
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (isPrimaryTable) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            // 主表没有需要排除的列
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (columnWrapper.getRequired() == 1 && StringUtils.isBlank(columnWrapper.colValue)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                return true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            // 从表需要排除掉一些不必要校验的列
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (!subTableNeedlessColumns.contains(columnWrapper.columnName) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    && columnWrapper.getRequired() == 1 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    && StringUtils.isBlank(columnWrapper.colValue)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                return true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return false; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |