Procházet zdrojové kódy

第三方导出增加图层表头处理

欧阳劲驰 před 1 měsícem
rodič
revize
1a84c48ec6

+ 3 - 3
src/main/java/com/shkpr/service/alambizplugin/commtools/ThirdImportTemplateUtils.java

@@ -1,7 +1,7 @@
 package com.shkpr.service.alambizplugin.commtools;
 
 import com.shkpr.service.alambizplugin.constants.GisMetadataDefine;
-import com.shkpr.service.alambizplugin.constants.GisSurveyImportDefine;
+import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
 import com.shkpr.service.alambizplugin.dto.GisMetadataLayerTemplate;
 import com.shkpr.service.alambizplugin.dto.GisMetadataPropertyTemplate;
 import org.apache.commons.lang3.StringUtils;
@@ -104,9 +104,9 @@ public class ThirdImportTemplateUtils {
         //图层文件key
         String layKey = null;
         if (Objects.equals(kind, GisMetadataDefine.TYPE_KINE.POINT))
-            layKey = GisSurveyImportDefine.FILE.POINT_LAYER;
+            layKey = GisSurveyExcelDefine.FILE.POINT_LAYER;
         if (Objects.equals(kind, GisMetadataDefine.TYPE_KINE.LINE))
-            layKey = GisSurveyImportDefine.FILE.LINE_LAYER;
+            layKey = GisSurveyExcelDefine.FILE.LINE_LAYER;
         if (layKey == null) return null;
 
         //过滤对应模版

+ 57 - 31
src/main/java/com/shkpr/service/alambizplugin/components/GisSurveyThirdExporter.java

@@ -9,6 +9,7 @@ import com.shkpr.service.alambizplugin.commtools.ShapeUtils;
 import com.shkpr.service.alambizplugin.constants.CommAsyncStatusEnum;
 import com.shkpr.service.alambizplugin.constants.ExcelEnum;
 import com.shkpr.service.alambizplugin.constants.GisMetadataDefine;
+import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dbdao.services.intef.GisMetadataLayerTemplateService;
 import com.shkpr.service.alambizplugin.dbdao.services.intef.GisSurveyLayerApplyService;
@@ -99,7 +100,7 @@ public class GisSurveyThirdExporter {
             Map<String, Map<String, String>> excelHeader = buildExcelHeader(pointLayerTemplates, lineLayerTemplates);
 
             //构建excel数据
-            Map<String, List<Map<String, Object>>> excelData = buildExcelData(points, lines);
+            Map<String, List<Map<String, Object>>> excelData = buildExcelData(points, lines, pointLayerTemplates, lineLayerTemplates);
             //构建shape数据
             Map<String, List<Geometry>> shapeData = buildShapeData(points, lines);
 
@@ -161,7 +162,7 @@ public class GisSurveyThirdExporter {
     }
 
     /**
-     * 构建excel头
+     * 构建excel
      *
      * @param pointLayerTemplates 点图层模版
      * @param lineLayerTemplates  线图层模版
@@ -169,18 +170,31 @@ public class GisSurveyThirdExporter {
      */
     private Map<String, Map<String, String>> buildExcelHeader(List<GisMetadataLayerTemplate> pointLayerTemplates
             , List<GisMetadataLayerTemplate> lineLayerTemplates) {
-        //点excel头
-        Map<String, String> pointExcelHeader = pointLayerTemplates.stream()
+        //点excel表头
+        Map<String, String> pointExcelHeader = new LinkedHashMap<>();
+        //线excel表头
+        Map<String, String> lineExcelHeader = new LinkedHashMap<>();
+
+        //点模版表头
+        Map<String, String> pointTemplateHeader = pointLayerTemplates.stream()
                 .flatMap(it -> it.getPropertyTemplates().stream())
                 .sorted(Comparator.comparing(GisMetadataPropertyTemplate::getOrdering))
                 .collect(Collectors.toMap(GisMetadataPropertyTemplate::getKey, GisMetadataPropertyTemplate::getName
                         , (it1, it2) -> it1, LinkedHashMap::new));
-        //线excel头
-        Map<String, String> lineExcelHeader = lineLayerTemplates.stream()
+        //线模版表
+        Map<String, String> lineTemplateHeader = lineLayerTemplates.stream()
                 .flatMap(it -> it.getPropertyTemplates().stream())
                 .collect(Collectors.toMap(GisMetadataPropertyTemplate::getKey, GisMetadataPropertyTemplate::getName
                         , (it1, it2) -> it1, LinkedHashMap::new));
-        //excel头
+
+        //加入图层表头
+        pointExcelHeader.put(GisSurveyExcelDefine.TEMPLATE.LAYER, GisSurveyExcelDefine.FILE.POINT_LAYER);
+        lineExcelHeader.put(GisSurveyExcelDefine.TEMPLATE.LAYER, GisSurveyExcelDefine.FILE.LINE_LAYER);
+        //加入模版表头
+        pointExcelHeader.putAll(pointTemplateHeader);
+        lineExcelHeader.putAll(lineTemplateHeader);
+
+        //excel表头
         Map<String, Map<String, String>> excelHeader = new HashMap<>();
         excelHeader.put(GisMetadataDefine.TYPE_KINE.POINT, pointExcelHeader);
         excelHeader.put(GisMetadataDefine.TYPE_KINE.LINE, lineExcelHeader);
@@ -191,37 +205,21 @@ public class GisSurveyThirdExporter {
     /**
      * 构建excel数据
      *
-     * @param points 点元素
-     * @param lines  线元素
+     * @param points              点元素
+     * @param lines               线元素
+     * @param pointLayerTemplates 点图层模版
+     * @param lineLayerTemplates  线图层模版
      * @return excel数据
      */
-    private Map<String, List<Map<String, Object>>> buildExcelData(List<GisSurveyLayerApply> points, List<GisSurveyLayerApply> lines) {
+    private Map<String, List<Map<String, Object>>> buildExcelData(List<GisSurveyLayerApply> points, List<GisSurveyLayerApply> lines
+            , List<GisMetadataLayerTemplate> pointLayerTemplates, List<GisMetadataLayerTemplate> lineLayerTemplates) {
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName, "开始构建excel数据   ======>");
         long begin = System.currentTimeMillis();
 
-        //点excel数据
-        List<Map<String, Object>> pointExcelData = points.parallelStream().map(it ->
-                it.getPropertyValues().stream()
-                        .filter(it1 -> !StringUtils.isAnyBlank(it1.getProperty(), it1.getValue()))
-                        .collect(Collectors.toMap(
-                                GisSurveyPropertyValue::getProperty,
-                                gisSurveyPropertyValue -> (Object) gisSurveyPropertyValue.getValue()
-                        ))
-        ).collect(Collectors.toList());
-        //线excel数据
-        List<Map<String, Object>> lineExcelData = lines.parallelStream().map(it ->
-                it.getPropertyValues().stream()
-                        .filter(it1 -> !StringUtils.isAnyBlank(it1.getProperty(), it1.getValue()))
-                        .collect(Collectors.toMap(
-                                GisSurveyPropertyValue::getProperty,
-                                gisSurveyPropertyValue -> (Object) gisSurveyPropertyValue.getValue()
-                        ))
-        ).collect(Collectors.toList());
-
         //excel数据
         Map<String, List<Map<String, Object>>> excelData = new HashMap<>();
-        excelData.put(GisMetadataDefine.TYPE_KINE.POINT, pointExcelData);
-        excelData.put(GisMetadataDefine.TYPE_KINE.LINE, lineExcelData);
+        excelData.put(GisMetadataDefine.TYPE_KINE.POINT, buildExcelSheetData(points, pointLayerTemplates));
+        excelData.put(GisMetadataDefine.TYPE_KINE.LINE, buildExcelSheetData(lines, lineLayerTemplates));
 
         long end = System.currentTimeMillis();
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
@@ -234,6 +232,34 @@ public class GisSurveyThirdExporter {
     }
 
     /**
+     * 构建excel页数据
+     *
+     * @param layerApplies   采集元素集合
+     * @param layerTemplates 图层模版
+     * @return excel数据
+     */
+    private List<Map<String, Object>> buildExcelSheetData(List<GisSurveyLayerApply> layerApplies, List<GisMetadataLayerTemplate> layerTemplates) {
+        return layerApplies.parallelStream()
+                .map(it -> {
+                    //处理模版数据
+                    Map<String, Object> rowData = it.getPropertyValues().stream()
+                            .filter(it1 -> !StringUtils.isAnyBlank(it1.getProperty(), it1.getValue()))
+                            .collect(Collectors.toMap(GisSurveyPropertyValue::getProperty, GisSurveyPropertyValue::getValue));
+                    //处理图层数据
+                    if (StringUtils.isNotBlank(it.getLayer())) {
+                        //获取模版
+                        GisMetadataLayerTemplate gisMetadataLayerTemplate = layerTemplates.stream()
+                                .filter(it1 -> Objects.equals(it1.getKey(), it.getLayer()))
+                                .findFirst().orElse(null);
+                        //存入图层
+                        if (gisMetadataLayerTemplate != null)
+                            rowData.put(GisSurveyExcelDefine.TEMPLATE.LAYER, gisMetadataLayerTemplate.getName());
+                    }
+                    return rowData;
+                }).collect(Collectors.toList());
+    }
+
+    /**
      * 构建shape数据
      *
      * @param points 点元素

+ 23 - 23
src/main/java/com/shkpr/service/alambizplugin/components/GisSurveyThirdImporter.java

@@ -12,7 +12,7 @@ import com.shkpr.service.alambizplugin.components.checker.InvalidPropertiesFinde
 import com.shkpr.service.alambizplugin.constants.ExcelEnum;
 import com.shkpr.service.alambizplugin.constants.GisMetadataDefine;
 import com.shkpr.service.alambizplugin.constants.GisSurveyCheckStatusEnum;
-import com.shkpr.service.alambizplugin.constants.GisSurveyImportDefine;
+import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
 import com.shkpr.service.alambizplugin.constants.GisSurveyImportStatusEnum;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dbdao.services.intef.GisMetadataLayerTemplateService;
@@ -119,8 +119,8 @@ public class GisSurveyThirdImporter {
             parseExcel(inputStreams, points, lines);
 
             //提取图层名
-            List<String> pointLayerNames = getLayerNames(points, GisSurveyImportDefine.FILE.POINT_LAYER);
-            List<String> lineLayerNames = getLayerNames(lines, GisSurveyImportDefine.FILE.LINE_LAYER);
+            List<String> pointLayerNames = getLayerNames(points, GisSurveyExcelDefine.FILE.POINT_LAYER);
+            List<String> lineLayerNames = getLayerNames(lines, GisSurveyExcelDefine.FILE.LINE_LAYER);
             //图层模版
             List<GisMetadataLayerTemplate> pointLayerTemplates = layerTemplateService.findByNatureAndNameIn(params.getNature(), pointLayerNames);
             List<GisMetadataLayerTemplate> lineLayerTemplates = layerTemplateService.findByNatureAndNameIn(params.getNature(), lineLayerNames);
@@ -140,10 +140,10 @@ public class GisSurveyThirdImporter {
             //等待结果
             GisSurveyThirdImportResultDetail<Map<String, List<GisSurveyThirdImportElement>>> invalidPropertiesResult = invalidPropertiesFuture.get();
             //存入无效属性结果
-            result.setInvalidLayersResult(untarInvalidProperties(invalidPropertiesResult, GisSurveyImportDefine.RESULT.INVALID_LAYERS));
-            result.setMissingRequirementsResult(untarInvalidProperties(invalidPropertiesResult, GisSurveyImportDefine.RESULT.MISSING_REQUIREMENTS));
-            result.setInvalidTypesResult(untarInvalidProperties(invalidPropertiesResult, GisSurveyImportDefine.RESULT.INVALID_TYPES));
-            result.setOutRangesResult(untarInvalidProperties(invalidPropertiesResult, GisSurveyImportDefine.RESULT.OUT_RANGES));
+            result.setInvalidLayersResult(untarInvalidProperties(invalidPropertiesResult, GisSurveyExcelDefine.RESULT.INVALID_LAYERS));
+            result.setMissingRequirementsResult(untarInvalidProperties(invalidPropertiesResult, GisSurveyExcelDefine.RESULT.MISSING_REQUIREMENTS));
+            result.setInvalidTypesResult(untarInvalidProperties(invalidPropertiesResult, GisSurveyExcelDefine.RESULT.INVALID_TYPES));
+            result.setOutRangesResult(untarInvalidProperties(invalidPropertiesResult, GisSurveyExcelDefine.RESULT.OUT_RANGES));
             //存入重复点结果
             result.setDuplicatePointsResult(duplicatePointsFuture.get());
             //存入无效线结果
@@ -344,7 +344,7 @@ public class GisSurveyThirdImporter {
         //格式化点
         for (Map<String, String> point : points) {
             //获取模版
-            GisMetadataLayerTemplate layerTemplate = poineTemplateMap.get(point.get(GisSurveyImportDefine.FILE.POINT_LAYER));
+            GisMetadataLayerTemplate layerTemplate = poineTemplateMap.get(point.get(GisSurveyExcelDefine.FILE.POINT_LAYER));
             //解码点对象
             GisSurveyLayerApplyThirdCopy layerApply = decodePointToLayerApply(point, layerTemplate, params);
             //存入点号
@@ -355,7 +355,7 @@ public class GisSurveyThirdImporter {
         //格式化线
         for (Map<String, String> line : lines) {
             //获取模版
-            GisMetadataLayerTemplate layerTemplate = lineTemplateMap.get(line.get(GisSurveyImportDefine.FILE.LINE_LAYER));
+            GisMetadataLayerTemplate layerTemplate = lineTemplateMap.get(line.get(GisSurveyExcelDefine.FILE.LINE_LAYER));
             //解码对象
             GisSurveyLayerApplyThirdCopy layerApply = decodeLineToLayerApply(line, layerTemplate, params, pointNoMapping);
 
@@ -388,24 +388,24 @@ public class GisSurveyThirdImporter {
         layerApply.setLayer(layerTemplate.getKey());
         layerApply.setKind(GisMetadataDefine.TYPE_KINE.POINT);
         //解析坐标
-        String lngStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyImportDefine.TEMPLATE.LNG);
-        String latStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyImportDefine.TEMPLATE.LAT);
+        String lngStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.LNG);
+        String latStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.LAT);
         if (NumberUtils.isParsable(lngStr) && NumberUtils.isParsable(latStr)) {
             Point geometry = geometryFactory.createPoint(new Coordinate(Double.parseDouble(lngStr), Double.parseDouble(latStr)));
             layerApply.setGis(geometry);
         }
         //默认值
-        layerApply.setApply(GisSurveyImportDefine.DEFAULT_VALUE.APPLY);
-        layerApply.setSource(GisSurveyImportDefine.DEFAULT_VALUE.SOURCE);
+        layerApply.setApply(GisSurveyExcelDefine.DEFAULT_VALUE.APPLY);
+        layerApply.setSource(GisSurveyExcelDefine.DEFAULT_VALUE.SOURCE);
         //高程和埋深
-        String elevationStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyImportDefine.TEMPLATE.ELEVATION);
+        String elevationStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.ELEVATION);
         if (NumberUtils.isParsable(elevationStr))
             layerApply.setElevation(Double.parseDouble(elevationStr));
-        String depthStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyImportDefine.TEMPLATE.DEPTH);
+        String depthStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.DEPTH);
         if (NumberUtils.isParsable(depthStr))
             layerApply.setDepth(Double.parseDouble(depthStr));
         //点号(长度64截断)
-        String noStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyImportDefine.TEMPLATE.NO);
+        String noStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.NO);
         if (StringUtils.isNotBlank(noStr))
             layerApply.setNo(StringUtils.substring(noStr, 0, 64));
         //遍历属性模版
@@ -438,14 +438,14 @@ public class GisSurveyThirdImporter {
         layerApply.setLayer(layerTemplate.getKey());
         layerApply.setKind(GisMetadataDefine.TYPE_KINE.LINE);
         //默认值
-        layerApply.setApply(GisSurveyImportDefine.DEFAULT_VALUE.APPLY);
-        layerApply.setSource(GisSurveyImportDefine.DEFAULT_VALUE.SOURCE);
+        layerApply.setApply(GisSurveyExcelDefine.DEFAULT_VALUE.APPLY);
+        layerApply.setSource(GisSurveyExcelDefine.DEFAULT_VALUE.SOURCE);
         //上下游节点
-        String upNoStr = ThirdImportTemplateUtils.getValue(line, layerTemplate, GisSurveyImportDefine.TEMPLATE.UP_NO);
+        String upNoStr = ThirdImportTemplateUtils.getValue(line, layerTemplate, GisSurveyExcelDefine.TEMPLATE.UP_NO);
         if (StringUtils.isNotBlank(upNoStr)) {
             layerApply.setUpNode(pointNoMapping.get(upNoStr));
         }
-        String downNoStr = ThirdImportTemplateUtils.getValue(line, layerTemplate, GisSurveyImportDefine.TEMPLATE.DOWN_NO);
+        String downNoStr = ThirdImportTemplateUtils.getValue(line, layerTemplate, GisSurveyExcelDefine.TEMPLATE.DOWN_NO);
         if (StringUtils.isNotBlank(downNoStr)) {
             layerApply.setDownNode(pointNoMapping.get(downNoStr));
         }
@@ -473,13 +473,13 @@ public class GisSurveyThirdImporter {
     private GisSurveyPropertyValueThirdCopy decodeDataToPropertyValue(Map<String, String> data, GisSurveyLayerApplyThirdCopy layerApply
             , GisMetadataPropertyTemplate propertyTemplate, GisSurveyThirdImportParams params) {
         //点号直接返回点号属性
-        if (Objects.equals(GisSurveyImportDefine.TEMPLATE.CODE, propertyTemplate.getKey()))
+        if (Objects.equals(GisSurveyExcelDefine.TEMPLATE.CODE, propertyTemplate.getKey()))
             return new GisSurveyPropertyValueThirdCopy(params.getJobId(), layerApply.getCode()
                     , propertyTemplate.getKey(), layerApply.getCode());
-        if (Objects.equals(GisSurveyImportDefine.TEMPLATE.UP_NODE, propertyTemplate.getKey()))
+        if (Objects.equals(GisSurveyExcelDefine.TEMPLATE.UP_NODE, propertyTemplate.getKey()))
             return new GisSurveyPropertyValueThirdCopy(params.getJobId(), layerApply.getCode()
                     , propertyTemplate.getKey(), layerApply.getUpNode());
-        if (Objects.equals(GisSurveyImportDefine.TEMPLATE.DOWN_NODE, propertyTemplate.getKey()))
+        if (Objects.equals(GisSurveyExcelDefine.TEMPLATE.DOWN_NODE, propertyTemplate.getKey()))
             return new GisSurveyPropertyValueThirdCopy(params.getJobId(), layerApply.getCode()
                     , propertyTemplate.getKey(), layerApply.getUpNode());
 

+ 2 - 2
src/main/java/com/shkpr/service/alambizplugin/components/checker/DuplicatePointsFinder.java

@@ -6,7 +6,7 @@ import com.shkpr.service.alambizplugin.commtools.BeanUtil;
 import com.shkpr.service.alambizplugin.commtools.ThirdImportTemplateUtils;
 import com.shkpr.service.alambizplugin.components.GisSurveySystemCheckResultManager;
 import com.shkpr.service.alambizplugin.constants.GisMetadataDefine;
-import com.shkpr.service.alambizplugin.constants.GisSurveyImportDefine;
+import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
 import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckResultPath;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dto.GisMetadataLayerTemplate;
@@ -84,7 +84,7 @@ public class DuplicatePointsFinder {
                                         ThirdImportTemplateUtils.getValue(
                                                 point, pointLayerTemplates,
                                                 GisMetadataDefine.TYPE_KINE.POINT,
-                                                GisSurveyImportDefine.TEMPLATE.NO
+                                                GisSurveyExcelDefine.TEMPLATE.NO
                                         ),
                                         ""
                                 ),

+ 8 - 8
src/main/java/com/shkpr/service/alambizplugin/components/checker/InvalidLinesFinder.java

@@ -5,7 +5,7 @@ import com.global.base.log.LogPrintMgr;
 import com.google.common.collect.Lists;
 import com.shkpr.service.alambizplugin.commtools.ThirdImportTemplateUtils;
 import com.shkpr.service.alambizplugin.constants.GisMetadataDefine;
-import com.shkpr.service.alambizplugin.constants.GisSurveyImportDefine;
+import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dto.GisMetadataLayerTemplate;
 import com.shkpr.service.alambizplugin.dto.GisMetadataPropertyTemplate;
@@ -74,9 +74,9 @@ public class InvalidLinesFinder {
                             .map(line -> {
                                 //获取模版
                                 GisMetadataPropertyTemplate upNoTemplate = ThirdImportTemplateUtils.getPropertyTemplate(line, pointLayerTemplates,
-                                        GisMetadataDefine.TYPE_KINE.LINE, GisSurveyImportDefine.TEMPLATE.UP_NO);
+                                        GisMetadataDefine.TYPE_KINE.LINE, GisSurveyExcelDefine.TEMPLATE.UP_NO);
                                 GisMetadataPropertyTemplate downNoTemplate = ThirdImportTemplateUtils.getPropertyTemplate(line, pointLayerTemplates,
-                                        GisMetadataDefine.TYPE_KINE.LINE, GisSurveyImportDefine.TEMPLATE.DOWN_NO);
+                                        GisMetadataDefine.TYPE_KINE.LINE, GisSurveyExcelDefine.TEMPLATE.DOWN_NO);
                                 //构造表头
                                 List<String> propertyNames = new ArrayList<>();
                                 if (upNoTemplate != null) {
@@ -88,7 +88,7 @@ public class InvalidLinesFinder {
                                 return new GisSurveyThirdImportElement(GisMetadataDefine.TYPE_KINE.LINE,
                                         ThirdImportTemplateUtils.getValue(line, upNoTemplate),
                                         ThirdImportTemplateUtils.getValue(line, downNoTemplate),
-                                        line.get(GisSurveyImportDefine.FILE.LINE_LAYER), String.join(",", propertyNames));
+                                        line.get(GisSurveyExcelDefine.FILE.LINE_LAYER), String.join(",", propertyNames));
                             })
                             .collect(Collectors.toList())
             ));
@@ -112,7 +112,7 @@ public class InvalidLinesFinder {
                 .map(point -> ThirdImportTemplateUtils.getValue(
                         point, pointLayerTemplates,
                         GisMetadataDefine.TYPE_KINE.POINT,
-                        GisSurveyImportDefine.TEMPLATE.NO)
+                        GisSurveyExcelDefine.TEMPLATE.NO)
                 )
                 .filter(Objects::nonNull)
                 .collect(Collectors.toSet());
@@ -123,9 +123,9 @@ public class InvalidLinesFinder {
             if (Thread.interrupted()) throw new InterruptedException();
             //上下节点模版
             GisMetadataPropertyTemplate upNoTemplate = ThirdImportTemplateUtils.getPropertyTemplate(line, lineLayerTemplates,
-                    GisMetadataDefine.TYPE_KINE.LINE, GisSurveyImportDefine.TEMPLATE.UP_NO);
+                    GisMetadataDefine.TYPE_KINE.LINE, GisSurveyExcelDefine.TEMPLATE.UP_NO);
             GisMetadataPropertyTemplate downNoTemplate = ThirdImportTemplateUtils.getPropertyTemplate(line, lineLayerTemplates,
-                    GisMetadataDefine.TYPE_KINE.LINE, GisSurveyImportDefine.TEMPLATE.DOWN_NO);
+                    GisMetadataDefine.TYPE_KINE.LINE, GisSurveyExcelDefine.TEMPLATE.DOWN_NO);
             //判断是否包含上下节点
             String upNo = ThirdImportTemplateUtils.getValue(line, upNoTemplate);
             boolean notContainsUp = StringUtils.isBlank(upNo) || !nos.contains(upNo);
@@ -143,7 +143,7 @@ public class InvalidLinesFinder {
                 }
                 //存入结果
                 results.add(new GisSurveyThirdImportElement(GisMetadataDefine.TYPE_KINE.LINE, upNo, downNo,
-                        line.get(GisSurveyImportDefine.FILE.LINE_LAYER), String.join(",", propertyNames)));
+                        line.get(GisSurveyExcelDefine.FILE.LINE_LAYER), String.join(",", propertyNames)));
             }
         }
 

+ 15 - 15
src/main/java/com/shkpr/service/alambizplugin/components/checker/InvalidPropertiesFinder.java

@@ -5,7 +5,7 @@ import com.global.base.log.LogPrintMgr;
 import com.shkpr.service.alambizplugin.commtools.GeomUtil;
 import com.shkpr.service.alambizplugin.commtools.ThirdImportTemplateUtils;
 import com.shkpr.service.alambizplugin.constants.GisMetadataDefine;
-import com.shkpr.service.alambizplugin.constants.GisSurveyImportDefine;
+import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dto.GisMetadataLayerTemplate;
 import com.shkpr.service.alambizplugin.dto.GisMetadataPropertyTemplate;
@@ -86,7 +86,7 @@ public class InvalidPropertiesFinder {
                 invalidLayersResult.add(new GisSurveyThirdImportElement(
                         GisMetadataDefine.TYPE_KINE.POINT,
                         null,
-                        point.get(GisSurveyImportDefine.FILE.POINT_LAYER),
+                        point.get(GisSurveyExcelDefine.FILE.POINT_LAYER),
                         null
                 ));
             else
@@ -97,7 +97,7 @@ public class InvalidPropertiesFinder {
                 outRangesResult.add(
                         new GisSurveyThirdImportElement(
                                 GisMetadataDefine.TYPE_KINE.POINT,
-                                ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyImportDefine.TEMPLATE.NO),
+                                ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.NO),
                                 layerTemplate != null ? layerTemplate.getName() : null,
                                 null
                         )
@@ -116,7 +116,7 @@ public class InvalidPropertiesFinder {
                         GisMetadataDefine.TYPE_KINE.LINE,
                         null,
                         null,
-                        line.get(GisSurveyImportDefine.FILE.LINE_LAYER),
+                        line.get(GisSurveyExcelDefine.FILE.LINE_LAYER),
                         null
                 ));
             else
@@ -134,10 +134,10 @@ public class InvalidPropertiesFinder {
 
         //构建结果
         Map<String, List<GisSurveyThirdImportElement>> result = new HashMap<>();
-        result.put(GisSurveyImportDefine.RESULT.INVALID_LAYERS, invalidLayersResult);
-        result.put(GisSurveyImportDefine.RESULT.MISSING_REQUIREMENTS, missingRequirementsResult);
-        result.put(GisSurveyImportDefine.RESULT.INVALID_TYPES, invalidTypesResult);
-        result.put(GisSurveyImportDefine.RESULT.OUT_RANGES, outRangesResult);
+        result.put(GisSurveyExcelDefine.RESULT.INVALID_LAYERS, invalidLayersResult);
+        result.put(GisSurveyExcelDefine.RESULT.MISSING_REQUIREMENTS, missingRequirementsResult);
+        result.put(GisSurveyExcelDefine.RESULT.INVALID_TYPES, invalidTypesResult);
+        result.put(GisSurveyExcelDefine.RESULT.OUT_RANGES, outRangesResult);
         return new AsyncResult<>(new GisSurveyThirdImportResultDetail<>(true, result));
     }
 
@@ -149,8 +149,8 @@ public class InvalidPropertiesFinder {
      */
     public Boolean checkOutRanges(Map<String, String> point, GisMetadataLayerTemplate layerTemplate) {
         //获取经纬度字段
-        String latStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyImportDefine.TEMPLATE.LAT);
-        String lngStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyImportDefine.TEMPLATE.LNG);
+        String latStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.LAT);
+        String lngStr = ThirdImportTemplateUtils.getValue(point, layerTemplate, GisSurveyExcelDefine.TEMPLATE.LNG);
         //检查是否字符串
         if (StringUtils.isBlank(latStr) || StringUtils.isBlank(lngStr)) return true;
         //检查是否可解析
@@ -179,9 +179,9 @@ public class InvalidPropertiesFinder {
             if (propertyTemplate.getRequired() != 1 || propertyTemplate.getStatus() != 1)
                 continue;
             //排除编码
-            if (Objects.equals(GisSurveyImportDefine.TEMPLATE.CODE, propertyTemplate.getKey())
-                    || Objects.equals(GisSurveyImportDefine.TEMPLATE.UP_NODE, propertyTemplate.getKey())
-                    || Objects.equals(GisSurveyImportDefine.TEMPLATE.DOWN_NODE, propertyTemplate.getKey()))
+            if (Objects.equals(GisSurveyExcelDefine.TEMPLATE.CODE, propertyTemplate.getKey())
+                    || Objects.equals(GisSurveyExcelDefine.TEMPLATE.UP_NODE, propertyTemplate.getKey())
+                    || Objects.equals(GisSurveyExcelDefine.TEMPLATE.DOWN_NODE, propertyTemplate.getKey()))
                 continue;
             //模版名称
             String templateName = propertyTemplate.getName();
@@ -192,8 +192,8 @@ public class InvalidPropertiesFinder {
                         propertyTemplate.getName()
                 );
                 missingRequirementsResult.add(gisSurveyThirdImportElement);
-            } else if ((GisSurveyImportDefine.DATA_TYPE.INT.equals(propertyTemplate.getType()) ||
-                    GisSurveyImportDefine.DATA_TYPE.FLOAT.equals(propertyTemplate.getType()))
+            } else if ((GisSurveyExcelDefine.DATA_TYPE.INT.equals(propertyTemplate.getType()) ||
+                    GisSurveyExcelDefine.DATA_TYPE.FLOAT.equals(propertyTemplate.getType()))
                     && !NumberUtils.isParsable(data.get(templateName)))
                 //存在且类型为数字,则判断数字类型
                 invalidTypesResult.add(GisSurveyThirdImportElement.create(data,

+ 3 - 2
src/main/java/com/shkpr/service/alambizplugin/constants/GisSurveyImportDefine.java

@@ -1,12 +1,12 @@
 package com.shkpr.service.alambizplugin.constants;
 
 /**
- * 第三方导入字典
+ * excel字典
  *
  * @author 欧阳劲驰
  * @since 1.0.0
  */
-public interface GisSurveyImportDefine {
+public interface GisSurveyExcelDefine {
     /**
      * 文件映射
      */
@@ -19,6 +19,7 @@ public interface GisSurveyImportDefine {
      * 数据库模版映射
      */
     interface TEMPLATE {
+        String LAYER = "layer";
         String CODE = "code";
         String NO = "no";
         String UP_NO = "up_no";

+ 3 - 3
src/main/java/com/shkpr/service/alambizplugin/dbdao/services/GisSurveyLayerApplyServiceImpl.java

@@ -2,7 +2,7 @@ package com.shkpr.service.alambizplugin.dbdao.services;
 
 import com.global.base.log.LogLevelFlag;
 import com.global.base.log.LogPrintMgr;
-import com.shkpr.service.alambizplugin.constants.GisSurveyImportDefine;
+import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dbdao.mapper.GisSurveyJobInfoMapper;
 import com.shkpr.service.alambizplugin.dbdao.mapper.GisSurveyJobStatusTrackMapper;
@@ -349,11 +349,11 @@ public class GisSurveyLayerApplyServiceImpl implements GisSurveyLayerApplyServic
                 long timestamp = System.currentTimeMillis();
                 int projectUpdated = projectInfoMapper.updateRefreshTimeByUid(jobId, timestamp);
                 int jobUpdated = jobInfoMapper.updateRefreshTimeActionStatusByUid(jobId, timestamp,
-                        GisSurveyImportDefine.DEFAULT_VALUE.ACTION, GisSurveyImportDefine.DEFAULT_VALUE.STATUS);
+                        GisSurveyExcelDefine.DEFAULT_VALUE.ACTION, GisSurveyExcelDefine.DEFAULT_VALUE.STATUS);
                 //写入任务状态
                 int jobStatusTrackSave = jobStatusTrackMapper.save(new GisSurveyJobStatusTrack(
                         jobId, operator,
-                        GisSurveyImportDefine.DEFAULT_VALUE.ACTION, GisSurveyImportDefine.DEFAULT_VALUE.STATUS,
+                        GisSurveyExcelDefine.DEFAULT_VALUE.ACTION, GisSurveyExcelDefine.DEFAULT_VALUE.STATUS,
                         operator, timestamp));
                 //检查更新和写入
                 if (projectUpdated <= 0 || jobUpdated <= 0 || jobStatusTrackSave <= 0) {

+ 4 - 4
src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveyThirdImportElement.java

@@ -2,7 +2,7 @@ package com.shkpr.service.alambizplugin.dto;
 
 import com.shkpr.service.alambizplugin.commtools.ThirdImportTemplateUtils;
 import com.shkpr.service.alambizplugin.constants.GisMetadataDefine;
-import com.shkpr.service.alambizplugin.constants.GisSurveyImportDefine;
+import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
 import lombok.Data;
 
 import java.util.Map;
@@ -59,15 +59,15 @@ public class GisSurveyThirdImportElement {
     public static GisSurveyThirdImportElement create(Map<String, String> data, GisMetadataLayerTemplate layerTemplate, String propertyName) {
         if (Objects.equals(GisMetadataDefine.TYPE_KINE.POINT, layerTemplate.getKind())) {
             return new GisSurveyThirdImportElement(GisMetadataDefine.TYPE_KINE.POINT,
-                    ThirdImportTemplateUtils.getValue(data, layerTemplate, GisSurveyImportDefine.TEMPLATE.NO),
+                    ThirdImportTemplateUtils.getValue(data, layerTemplate, GisSurveyExcelDefine.TEMPLATE.NO),
                     layerTemplate.getName(),
                     propertyName
             );
         }
         if (Objects.equals(GisMetadataDefine.TYPE_KINE.LINE, layerTemplate.getKind())) {
             return new GisSurveyThirdImportElement(GisMetadataDefine.TYPE_KINE.LINE,
-                    ThirdImportTemplateUtils.getValue(data, layerTemplate, GisSurveyImportDefine.TEMPLATE.UP_NO),
-                    ThirdImportTemplateUtils.getValue(data, layerTemplate, GisSurveyImportDefine.TEMPLATE.DOWN_NO),
+                    ThirdImportTemplateUtils.getValue(data, layerTemplate, GisSurveyExcelDefine.TEMPLATE.UP_NO),
+                    ThirdImportTemplateUtils.getValue(data, layerTemplate, GisSurveyExcelDefine.TEMPLATE.DOWN_NO),
                     layerTemplate.getName(),
                     propertyName
             );