Selaa lähdekoodia

系统检查结果增加excel

欧阳劲驰 1 kuukausi sitten
vanhempi
commit
e008189e67

+ 42 - 0
src/main/java/com/shkpr/service/alambizplugin/commtools/ExcelUtils.java

@@ -41,6 +41,10 @@ public class ExcelUtils {
      */
     private static final String mStrClassName = "ExcelUtils";
     private static final String mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
+    /**
+     * 默认页名
+     */
+    private static final String DEFAULT_SHEET_NAME = "页1";
 
     /**
      * 解析excel文件
@@ -325,6 +329,44 @@ public class ExcelUtils {
     }
 
     /**
+     * 写入文件
+     *
+     * @param header       表头信息
+     * @param data         数据
+     * @param outputStream 输出流
+     * @param excelEnum    excel枚举
+     * @param headerRowNum 表头行
+     * @param dataRowNum   数据行
+     */
+    public static void writeFile(Map<String, String> header, List<Map<String, Object>> data
+            , OutputStream outputStream, ExcelEnum excelEnum, Integer headerRowNum, Integer dataRowNum) {
+        //创建表
+        try (Workbook workbook = excelEnum == ExcelEnum.XLSX ? new XSSFWorkbook() : new HSSFWorkbook()) {
+            //表头样式
+            CellStyle headerStyle = workbook.createCellStyle();
+            headerStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
+            headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+
+            Font headerFont = workbook.createFont();
+            headerFont.setBold(true);
+
+            headerStyle.setFont(headerFont);
+
+            //创建页
+            Sheet sheet = workbook.createSheet(DEFAULT_SHEET_NAME);
+            //写入页
+            writeSheet(header, data, sheet, headerStyle, headerRowNum, dataRowNum);
+            //写入文件
+            workbook.write(outputStream);
+        } catch (IOException e) {
+            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
+                    , String.format("excel文件写入失败 msg:%s", e.getMessage())
+            );
+        }
+
+    }
+
+    /**
      * 写入页
      *
      * @param header       表头

+ 49 - 0
src/main/java/com/shkpr/service/alambizplugin/components/GisSurveySystemCheckResultManager.java

@@ -4,6 +4,9 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.global.base.log.LogLevelFlag;
 import com.global.base.log.LogPrintMgr;
 import com.shkpr.service.alambizplugin.commproperties.GisSurveySystemCheckProperties;
+import com.shkpr.service.alambizplugin.commtools.ExcelUtils;
+import com.shkpr.service.alambizplugin.constants.ExcelEnum;
+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.GisSurveySystemCheckId;
@@ -20,6 +23,7 @@ import java.nio.channels.FileChannel;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -181,6 +185,51 @@ public class GisSurveySystemCheckResultManager {
         }
     }
 
+
+    /**
+     * 写入excel文件
+     *
+     * @param data          数据
+     * @param systemCheckId 系统检查id
+     * @param fileName      文件名
+     */
+    public void writeExcel(Map<String, String> head, List<Map<String, Object>> data, GisSurveySystemCheckId systemCheckId, String fileName) {
+        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
+                , String.format(
+                        "开始执行写入excel文件,系统id:%s,文件名:%s========>"
+                        , systemCheckId
+                        , fileName
+                )
+        );
+        long begin = System.currentTimeMillis();
+
+        //写入文件
+        Path path = Paths.get(TEMP_DIR_CACHE.get(systemCheckId).toString(), fileName);
+        try {
+            ExcelUtils.writeFile(head, data, Files.newOutputStream(path), ExcelEnum.XLSX
+                    , GisSurveyExcelDefine.FILE_HANDLE.HEADER_ROW_NUM, GisSurveyExcelDefine.FILE_HANDLE.DATA_ROW_NUM);
+
+            long end = System.currentTimeMillis();
+            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
+                    , String.format(
+                            "结束执行写入结果文件,系统id:%s,文件名:%s,用时(毫秒):%d"
+                            , systemCheckId
+                            , fileName
+                            , (end - begin)
+                    )
+            );
+        } catch (IOException e) {
+            //打印报错信息
+            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
+                    , String.format(
+                            "监测到io异常 系统检查id:%s msg:%s"
+                            , systemCheckId
+                            , e.getMessage()
+                    )
+            );
+        }
+    }
+
     /**
      * 替换结果
      *

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

@@ -7,6 +7,7 @@ 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.GisSurveyExcelDefine;
+import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckResultHead;
 import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckResultPath;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dto.GisMetadataLayerTemplate;
@@ -26,9 +27,11 @@ import org.springframework.util.concurrent.ListenableFuture;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
+import java.util.stream.IntStream;
 
 /**
  * 重复点寻找器
@@ -192,10 +195,15 @@ public class DuplicatePointsFinder {
             , GisSurveySystemCheckId systemCheckId, long begin) {
         //数据大小
         final int size = data.size();
-        //写入路径
-        String path = GisSurveySystemCheckResultPath.DUPLICATE_POINTS;
-        //写入文件
-        gisSurveySystemCheckResultManager.writeResult(data, systemCheckId, path);
+        //结果路径
+        String resultPath = GisSurveySystemCheckResultPath.DUPLICATE_POINTS;
+        //excel路径
+        String excelPath = GisSurveySystemCheckResultPath.DUPLICATE_POINTS_EXCEL;
+        //写入结果
+        gisSurveySystemCheckResultManager.writeResult(data, systemCheckId, resultPath);
+        //写入excel
+        gisSurveySystemCheckResultManager.writeExcel(GisSurveySystemCheckResultHead.DUPLICATE_POINTS
+                , buildExcel(data), systemCheckId, excelPath);
 
         long end = System.currentTimeMillis();
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
@@ -206,6 +214,28 @@ public class DuplicatePointsFinder {
         );
 
         //构建结果
-        return new GisSurveySystemCheckResultDetail(true, GisSurveySystemCheckResultPath.relativePath(systemCheckId, path), size);
+        return new GisSurveySystemCheckResultDetail(true
+                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, resultPath)
+                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, excelPath)
+                , size);
+    }
+
+    /**
+     * 构建excel数据
+     *
+     * @param data 数据
+     * @return excel数据
+     */
+    private List<Map<String, Object>> buildExcel(List<List<GisSurveySystemCheckElement>> data) {
+        return IntStream.range(0, data.size())
+                .boxed()
+                .flatMap(i -> data.get(i).stream().map(element -> {
+                    Map<String, Object> map = new HashMap<>();
+                    map.put(GisSurveySystemCheckResultHead.KEYS.GROUP_NAME, i + 1);
+                    map.put(GisSurveySystemCheckResultHead.KEYS.NO, element.getNo());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.CODE, element.getCode());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.NAME, element.getName());
+                    return map;
+                })).collect(Collectors.toList());
     }
 }

+ 38 - 5
src/main/java/com/shkpr/service/alambizplugin/components/checker/IsolatedLinesFinder.java

@@ -5,6 +5,7 @@ import com.global.base.log.LogLevelFlag;
 import com.global.base.log.LogPrintMgr;
 import com.shkpr.service.alambizplugin.commtools.BeanUtil;
 import com.shkpr.service.alambizplugin.components.GisSurveySystemCheckResultManager;
+import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckResultHead;
 import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckResultPath;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dto.GisSurveyLayerApplyLine;
@@ -20,6 +21,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
 
 /**
  * 孤立线查找
@@ -74,10 +77,15 @@ public class IsolatedLinesFinder {
             , GisSurveySystemCheckId systemCheckId, long begin) {
         //数据大小
         final int size = data.size();
-        //写入路径
-        String path = GisSurveySystemCheckResultPath.ISOLATED_LINES;
-        //写入文件
-        gisSurveySystemCheckResultManager.writeResult(data, systemCheckId, path);
+        //结果路径
+        String resultPath = GisSurveySystemCheckResultPath.ISOLATED_LINES;
+        //excel路径
+        String excelPath = GisSurveySystemCheckResultPath.ISOLATED_LINES_EXCEL;
+        //写入结果
+        gisSurveySystemCheckResultManager.writeResult(data, systemCheckId, resultPath);
+        //写入excel
+        gisSurveySystemCheckResultManager.writeExcel(GisSurveySystemCheckResultHead.ISOLATED_LINES
+                , buildExcel(data), systemCheckId, excelPath);
 
         long end = System.currentTimeMillis();
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
@@ -88,7 +96,32 @@ public class IsolatedLinesFinder {
         );
 
         //构建结果
-        return new GisSurveySystemCheckResultDetail(true, GisSurveySystemCheckResultPath.relativePath(systemCheckId, path), size);
+        return new GisSurveySystemCheckResultDetail(true
+                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, resultPath)
+                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, excelPath)
+                , size);
+    }
+
+    /**
+     * 构建excel数据
+     *
+     * @param data 数据
+     * @return excel数据
+     */
+    private List<Map<String, Object>> buildExcel(List<List<GisSurveySystemCheckElement>> data) {
+        return IntStream.range(0, data.size())
+                .boxed()
+                .flatMap(i -> data.get(i).stream().map(element -> {
+                    Map<String, Object> map = new HashMap<>();
+                    map.put(GisSurveySystemCheckResultHead.KEYS.GROUP_NAME, i + 1);
+                    map.put(GisSurveySystemCheckResultHead.KEYS.UP_NO, element.getUpNo());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.DOWN_NO, element.getDownNo());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.CODE, element.getCode());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.UP_NODE, element.getUpNode());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.DOWN_NODE, element.getDownNode());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.NAME, element.getName());
+                    return map;
+                })).collect(Collectors.toList());
     }
 
     /**

+ 31 - 5
src/main/java/com/shkpr/service/alambizplugin/components/checker/IsolatedPointsFinder.java

@@ -5,6 +5,7 @@ import com.global.base.log.LogLevelFlag;
 import com.global.base.log.LogPrintMgr;
 import com.shkpr.service.alambizplugin.commtools.BeanUtil;
 import com.shkpr.service.alambizplugin.components.GisSurveySystemCheckResultManager;
+import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckResultHead;
 import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckResultPath;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dto.GisSurveyLayerApplyLine;
@@ -19,8 +20,10 @@ import org.springframework.stereotype.Component;
 import org.springframework.util.concurrent.ListenableFuture;
 
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
@@ -105,10 +108,15 @@ public class IsolatedPointsFinder {
             , GisSurveySystemCheckId systemCheckId, long begin) {
         //数据大小
         final int size = data.size();
-        //写入路径
-        String path = GisSurveySystemCheckResultPath.ISOLATED_POINTS;
-        //写入文件
-        systemCheckResultManager.writeResult(data, systemCheckId, path);
+        //结果路径
+        String resultPath = GisSurveySystemCheckResultPath.ISOLATED_POINTS;
+        //excel路径
+        String excelPath = GisSurveySystemCheckResultPath.ISOLATED_POINTS_EXCEL;
+        //写入结果
+        systemCheckResultManager.writeResult(data, systemCheckId, resultPath);
+        //写入excel
+        systemCheckResultManager.writeExcel(GisSurveySystemCheckResultHead.ISOLATED_POINTS,
+                buildExcel(data), systemCheckId, excelPath);
 
         long end = System.currentTimeMillis();
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
@@ -119,7 +127,25 @@ public class IsolatedPointsFinder {
         );
 
         //构建结果
-        return new GisSurveySystemCheckResultDetail(true, GisSurveySystemCheckResultPath.relativePath(systemCheckId, path), size);
+        return new GisSurveySystemCheckResultDetail(true
+                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, resultPath)
+                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, excelPath)
+                , size);
     }
 
+    /**
+     * 构建excel数据
+     *
+     * @param data 数据
+     * @return excel数据
+     */
+    private List<Map<String, Object>> buildExcel(List<GisSurveySystemCheckElement> data) {
+        return data.stream().map(element -> {
+            Map<String, Object> map = new HashMap<>();
+            map.put(GisSurveySystemCheckResultHead.KEYS.NO, element.getNo());
+            map.put(GisSurveySystemCheckResultHead.KEYS.CODE, element.getCode());
+            map.put(GisSurveySystemCheckResultHead.KEYS.NAME, element.getName());
+            return map;
+        }).collect(Collectors.toList());
+    }
 }

+ 39 - 4
src/main/java/com/shkpr/service/alambizplugin/components/checker/OverlapLinesFinder.java

@@ -4,6 +4,7 @@ import com.global.base.log.LogLevelFlag;
 import com.global.base.log.LogPrintMgr;
 import com.shkpr.service.alambizplugin.commtools.BeanUtil;
 import com.shkpr.service.alambizplugin.components.GisSurveySystemCheckResultManager;
+import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckResultHead;
 import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckResultPath;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dto.GisSurveyLayerApplyLine;
@@ -20,7 +21,11 @@ import org.springframework.util.concurrent.ListenableFuture;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
 
 /**
  * 寻找重叠线
@@ -130,10 +135,15 @@ public class OverlapLinesFinder {
             , GisSurveySystemCheckId systemCheckId, long begin) {
         //数据大小
         final int size = data.size();
-        //写入路径
-        String path = GisSurveySystemCheckResultPath.OVERLAP_LINES;
+        //结果路径
+        String resultPath = GisSurveySystemCheckResultPath.OVERLAP_LINES;
+        //excel路径
+        String excelPath = GisSurveySystemCheckResultPath.OVERLAP_LINES_EXCEL;
         //写入文件
-        gisSurveySystemCheckResultManager.writeResult(data, systemCheckId, path);
+        gisSurveySystemCheckResultManager.writeResult(data, systemCheckId, resultPath);
+        //写入excel
+        gisSurveySystemCheckResultManager.writeExcel(GisSurveySystemCheckResultHead.OVERLAP_LINES,
+                buildExcel(data), systemCheckId, excelPath);
 
         long end = System.currentTimeMillis();
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
@@ -144,6 +154,31 @@ public class OverlapLinesFinder {
         );
 
         //构建结果
-        return new GisSurveySystemCheckResultDetail(true, GisSurveySystemCheckResultPath.relativePath(systemCheckId, path), size);
+        return new GisSurveySystemCheckResultDetail(true
+                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, resultPath)
+                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, excelPath)
+                , size);
+    }
+
+    /**
+     * 构建excel数据
+     *
+     * @param data 数据
+     * @return excel数据
+     */
+    private List<Map<String, Object>> buildExcel(List<List<GisSurveySystemCheckElement>> data) {
+        return IntStream.range(0, data.size())
+                .boxed()
+                .flatMap(i -> data.get(i).stream().map(element -> {
+                    Map<String, Object> map = new HashMap<>();
+                    map.put(GisSurveySystemCheckResultHead.KEYS.GROUP_NAME, i + 1);
+                    map.put(GisSurveySystemCheckResultHead.KEYS.UP_NO, element.getUpNo());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.DOWN_NO, element.getDownNo());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.CODE, element.getCode());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.UP_NODE, element.getUpNode());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.DOWN_NODE, element.getDownNode());
+                    map.put(GisSurveySystemCheckResultHead.KEYS.NAME, element.getName());
+                    return map;
+                })).collect(Collectors.toList());
     }
 }

+ 94 - 0
src/main/java/com/shkpr/service/alambizplugin/constants/GisSurveySystemCheckResultHead.java

@@ -0,0 +1,94 @@
+package com.shkpr.service.alambizplugin.constants;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * 系统检查结果表头
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+public class GisSurveySystemCheckResultHead {
+    /**
+     * 孤立点
+     */
+    public final static Map<String, String> ISOLATED_POINTS = new LinkedHashMap<String, String>() {{
+        put(KEYS.NO, "点号");
+        put(KEYS.CODE, "编码");
+        put(KEYS.NAME, "类型");
+    }};
+    /**
+     * 孤立线
+     */
+    public final static Map<String, String> ISOLATED_LINES = new LinkedHashMap<String, String>() {{
+        put(KEYS.GROUP_NAME, "组名");
+        put(KEYS.UP_NO, "起点号");
+        put(KEYS.DOWN_NO, "终点号");
+        put(KEYS.CODE, "编码");
+        put(KEYS.UP_NODE, "起点编码");
+        put(KEYS.DOWN_NODE, "终点编码");
+        put(KEYS.NAME, "类型");
+    }};
+    /**
+     * 重复点
+     */
+    public final static Map<String, String> DUPLICATE_POINTS = new LinkedHashMap<String, String>() {{
+        put(KEYS.GROUP_NAME, "组名");
+        put(KEYS.NO, "点号");
+        put(KEYS.CODE, "编码");
+        put(KEYS.NAME, "类型");
+    }};
+    /**
+     * 重叠线
+     */
+    public final static Map<String, String> OVERLAP_LINES = new LinkedHashMap<String, String>() {{
+        put(KEYS.GROUP_NAME, "组名");
+        put(KEYS.UP_NO, "起点号");
+        put(KEYS.DOWN_NO, "终点号");
+        put(KEYS.CODE, "编码");
+        put(KEYS.UP_NODE, "起点编码");
+        put(KEYS.DOWN_NODE, "终点编码");
+        put(KEYS.NAME, "类型");
+    }};
+
+    /**
+     * 键
+     */
+    public interface KEYS {
+        /**
+         * 分组
+         */
+        String GROUP_NAME = "groupName";
+        /**
+         * 点号
+         */
+        String NO = "no";
+        /**
+         * 线的起点号
+         */
+        String UP_NO = "upNo";
+
+        /**
+         * 线的终点号
+         */
+        String DOWN_NO = "downNo";
+        /**
+         * 元素唯一编码
+         */
+        String CODE = "code";
+        /**
+         * 线的起点唯一编码
+         */
+        String UP_NODE = "upNode";
+
+        /**
+         * 线的终点唯一编码
+         */
+        String DOWN_NODE = "downNode";
+        /**
+         * 图层名称
+         */
+        String NAME = "name";
+    }
+}

+ 16 - 0
src/main/java/com/shkpr/service/alambizplugin/constants/GisSurveySystemCheckResultPath.java

@@ -18,17 +18,33 @@ public class GisSurveySystemCheckResultPath {
      */
     public final static String ISOLATED_POINTS = "isolatedPoints.json";
     /**
+     * 孤立点excel
+     */
+    public final static String ISOLATED_POINTS_EXCEL = "isolatedPoints.xlsx";
+    /**
      * 孤立线
      */
     public final static String ISOLATED_LINES = "isolatedLines.json";
     /**
+     * 孤立线excel
+     */
+    public final static String ISOLATED_LINES_EXCEL = "isolatedLines.xlsx";
+    /**
      * 重复点
      */
     public final static String DUPLICATE_POINTS = "duplicatePoints.json";
     /**
+     * 重复点excel
+     */
+    public final static String DUPLICATE_POINTS_EXCEL = "duplicatePoints.xlsx";
+    /**
      * 重叠线
      */
     public final static String OVERLAP_LINES = "overlapLines.json";
+    /**
+     * 重叠线excel
+     */
+    public final static String OVERLAP_LINES_EXCEL = "overlapLines.xlsx";
 
     /**
      * 获取相对路径

+ 5 - 0
src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveyLayerApply.java

@@ -31,6 +31,11 @@ public class GisSurveyLayerApply {
     private String layer;
 
     /**
+     * 图层名称
+     */
+    private String name;
+
+    /**
      * 元素分类:point--点;line--线;face--面
      */
     private String kind;

+ 12 - 1
src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveyLayerApplyLine.java

@@ -24,6 +24,10 @@ public class GisSurveyLayerApplyLine {
      */
     private String layer;
     /**
+     * 图层名称
+     */
+    private String name;
+    /**
      * 元素分类:point--点;line--线;face--面
      */
     private String kind;
@@ -43,9 +47,16 @@ public class GisSurveyLayerApplyLine {
      * 线的起点唯一编码
      */
     private String upNode;
-
     /**
      * 线的终点唯一编码
      */
     private String downNode;
+    /**
+     * 起点号
+     */
+    private String upNo;
+    /**
+     * 终点号
+     */
+    private String downNo;
 }

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

@@ -24,6 +24,10 @@ public class GisSurveyLayerApplyPoint {
      */
     private String layer;
     /**
+     * 图层名称
+     */
+    private String name;
+    /**
      * 元素分类:point--点;line--线;face--面
      */
     private String kind;

+ 13 - 0
src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveySystemCheckElement.java

@@ -35,6 +35,10 @@ public class GisSurveySystemCheckElement {
     @JsonDeserialize(using = GeometryDeserializer.class)
     private Geometry gis;
     /**
+     * 图层名称
+     */
+    private String name;
+    /**
      * 元素分类:point--点;line--线;face--面
      */
     private String kind;
@@ -46,4 +50,13 @@ public class GisSurveySystemCheckElement {
      * 点号
      */
     private String no;
+    /**
+     * 线的起点号
+     */
+    private String upNo;
+
+    /**
+     * 线的终点号
+     */
+    private String downNo;
 }

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

@@ -25,6 +25,10 @@ public class GisSurveySystemCheckResultDetail {
      */
     private String path;
     /**
+     * excel地址
+     */
+    private String excelPath;
+    /**
      * 结果大小
      */
     private Integer size;

+ 34 - 6
src/main/resources/mapper/GisSurveyLayerApplyMapper.xml

@@ -6,6 +6,7 @@
         <id column="job_id" jdbcType="VARCHAR" property="jobId"/>
         <id column="code" jdbcType="VARCHAR" property="code"/>
         <result column="layer" jdbcType="VARCHAR" property="layer"/>
+        <result column="name" jdbcType="VARCHAR" property="name"/>
         <result column="kind" jdbcType="VARCHAR" property="kind"/>
         <result column="gis" jdbcType="VARCHAR" property="gis"
                 typeHandler="com.shkpr.service.alambizplugin.dbdao.pgtype.GeomTypeHandlePg"/>
@@ -31,6 +32,7 @@
         <id column="code" jdbcType="VARCHAR" property="code"/>
         <id column="job_id" jdbcType="VARCHAR" property="jobId"/>
         <result column="layer" jdbcType="VARCHAR" property="layer"/>
+        <result column="name" jdbcType="VARCHAR" property="name"/>
         <result column="kind" jdbcType="VARCHAR" property="kind"/>
         <result column="gis" jdbcType="VARCHAR" property="gis"
                 typeHandler="com.shkpr.service.alambizplugin.dbdao.pgtype.GeomPointTypeHandlePg"/>
@@ -45,6 +47,7 @@
         <id column="job_id" jdbcType="VARCHAR" property="jobId"/>
         <id column="code" jdbcType="VARCHAR" property="code"/>
         <result column="layer" jdbcType="VARCHAR" property="layer"/>
+        <result column="name" jdbcType="VARCHAR" property="name"/>
         <result column="kind" jdbcType="VARCHAR" property="kind"/>
         <result column="gis" jdbcType="VARCHAR" property="gis"
                 typeHandler="com.shkpr.service.alambizplugin.dbdao.pgtype.GeomLineStringTypeHandlePg"/>
@@ -52,22 +55,32 @@
         <result column="source" jdbcType="SMALLINT" property="source"/>
         <result column="up_node" jdbcType="VARCHAR" property="upNode"/>
         <result column="down_node" jdbcType="VARCHAR" property="downNode"/>
+        <result column="up_no" jdbcType="VARCHAR" property="upNo"/>
+        <result column="down_no" jdbcType="VARCHAR" property="downNo"/>
     </resultMap>
 
     <select id="findAddPointByProjId" fetchSize="3000" resultMap="Point">
-        select la.code, la.job_id, la.layer, la.kind, la.gis, la.apply, la.source, la.elevation, la.no
+        select la.code, la.job_id, la.layer, la.kind, la.gis, la.apply, la.source, la.elevation, la.no,
+        case when lt.name is null then
+        (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
+        else lt.name end as name
         from k3_gis_survey_layer_apply la
         join k3_gis_survey_job_info jo on la.job_id = jo.uid
         join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
+        left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
         where pit.uid = #{projId,jdbcType=VARCHAR}
         and jo.disused = 0
-        and la.apply = 'add' and kind = 'point'
+        and la.apply = 'add' and la.kind = 'point'
     </select>
 
     <select id="findAddLineByProjId" fetchSize="3000" resultMap="Line">
         select la.code, la.job_id, la.layer, la.kind, la.apply, la.source, la.up_node, la.down_node,
+        un.no as up_no, dn.no as down_no,
         case when un.code is not null and dn.code is not null then concat('[', un.gis, ',', dn.gis, ']') else la.gis end
-        as gis
+        as gis,
+        case when lt.name is null then
+        (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
+        else lt.name end as name
         from k3_gis_survey_layer_apply as la
         join k3_gis_survey_job_info jo on la.job_id = jo.uid
         join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
@@ -75,24 +88,33 @@
         on la.up_node = un.code and un.kind = 'point' and la.job_id = un.job_id
         left join k3_gis_survey_layer_apply as dn
         on la.down_node = dn.code and dn.kind = 'point' and la.job_id = dn.job_id
+        left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
         where pit.uid = #{projId,jdbcType=VARCHAR}
         and jo.disused = 0
         and la.apply = 'add' and la.kind = 'line';
     </select>
 
     <select id="findAddPointByJobId" fetchSize="3000" resultMap="Point">
-        select la.code, la.job_id, la.layer, la.kind, la.gis, la.apply, la.source, la.elevation, la.no
+        select la.code, la.job_id, la.layer, la.kind, la.gis, la.apply, la.source, la.elevation, la.no,
+        case when lt.name is null then
+        (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
+        else lt.name end as name
         from k3_gis_survey_layer_apply la
         join k3_gis_survey_job_info jo on la.job_id = jo.uid
         join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
+        left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
         where jo.uid = #{jobId,jdbcType=VARCHAR}
-        and la.apply = 'add' and kind = 'point'
+        and la.apply = 'add' and la.kind = 'point'
     </select>
 
     <select id="findAddLineByJobId" fetchSize="3000" resultMap="Line">
         select la.code, la.job_id, la.layer, la.kind, la.apply, la.source, la.up_node, la.down_node,
+        un.no as up_no, dn.no as down_no,
         case when un.code is not null and dn.code is not null then concat('[', un.gis, ',', dn.gis, ']') else la.gis end
-        as gis
+        as gis,
+        case when lt.name is null then
+        (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
+        else lt.name end as name
         from k3_gis_survey_layer_apply as la
         join k3_gis_survey_job_info jo on la.job_id = jo.uid
         join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
@@ -100,6 +122,7 @@
         on la.up_node = un.code and un.kind = 'point' and la.job_id = un.job_id
         left join k3_gis_survey_layer_apply as dn
         on la.down_node = dn.code and dn.kind = 'point' and la.job_id = dn.job_id
+        left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
         where jo.uid = #{jobId,jdbcType=VARCHAR}
         and la.apply = 'add' and la.kind = 'line';
     </select>
@@ -109,15 +132,20 @@
         la.depth, la.no,
         case when la.kind = 'line' and un.code is not null and dn.code is not null
         then concat('[', un.gis, ',', dn.gis, ']') else la.gis end as gis,
+        case when lt.name is null then
+        (select td.name from k2_type_define td where td.key = la.layer and td.kind = 7)
+        else lt.name end as name,
         pv.property as property_property, pv.code as property_code, pv.job_id as property_job_id,
         pv.value as property_value
         from k3_gis_survey_layer_apply as la
         join k3_gis_survey_job_info jo on la.job_id = jo.uid
+        join k3_gis_survey_project_info pit on jo.proj_id = pit.uid
         left join k3_gis_survey_layer_apply as un
         on la.up_node = un.code and un.kind = 'point' and la.job_id = un.job_id
         left join k3_gis_survey_layer_apply as dn
         on la.down_node = dn.code and dn.kind = 'point' and la.job_id = dn.job_id
         left join k3_gis_survey_property_value pv on la.code = pv.code and la.job_id = pv.job_id
+        left join k3_gis_metadata_layer_template lt on pit.nature = lt.nature and la.layer = lt.key
         where la.job_id = #{jobId,jdbcType=VARCHAR} and la.kind = #{kind,jdbcType=VARCHAR}
     </select>