فهرست منبع

无效线增加表头提示

欧阳劲驰 2 ماه پیش
والد
کامیت
1a0226694c

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

@@ -95,8 +95,17 @@ public class InvalidLinesFinder {
             //响应中断
             if (Thread.interrupted()) throw new InterruptedException();
             //不包含上节点或下节点,则收集
-            if (!nos.contains(line.get(UP_NO)) || !nos.contains(line.get(DOWN_NO)))
-                results.add(GisSurveyThirdImportElement.create(line, GisSurveyImportDefine.LayerType.LINE));
+            boolean notContainsUp = !nos.contains(line.get(UP_NO));
+            boolean notContainsDown = !nos.contains(line.get(DOWN_NO));
+            if (notContainsUp || notContainsDown) {
+                //根据条件构造表头
+                String propertyName;
+                if (notContainsUp && notContainsDown) propertyName = UP_NO + "," + DOWN_NO;
+                else if (notContainsUp) propertyName = UP_NO;
+                else propertyName = DOWN_NO;
+                //存入结果
+                results.add(GisSurveyThirdImportElement.create(line, propertyName, GisSurveyImportDefine.LayerType.LINE));
+            }
         }
 
         long end = System.currentTimeMillis();

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

@@ -88,7 +88,10 @@ public class InvalidPropertiesFinder {
             }
             //过滤图层
             GisMetadataLayerTemplate layerTemplate = pointLayerTemplates.stream()
-                    .filter(template -> Objects.equals(point.get(GisSurveyImportDefine.POINT.LAYER), template.getName()))
+                    .filter(template ->
+                            StringUtils.isNotBlank(template.getName()) &&
+                                    Objects.equals(point.get(GisSurveyImportDefine.POINT.LAYER), template.getName())
+                    )
                     .findFirst().orElse(null);
             //图层不存在则加入无效图层结果
             if (layerTemplate == null)