Ver código fonte

系统检查实现动态启动子任务。删除系统检查结果管理,使用通用异步结果管理

欧阳劲驰 1 mês atrás
pai
commit
fcd034d867
27 arquivos alterados com 565 adições e 826 exclusões
  1. 3 23
      src/main/java/com/shkpr/service/alambizplugin/apiparam/GisSurveyCheckParams.java
  2. 137 70
      src/main/java/com/shkpr/service/alambizplugin/bizservice/GisSurveySystemCheckBizService.java
  3. 2 3
      src/main/java/com/shkpr/service/alambizplugin/bizservice/GisSurveyThirdExportBizService.java
  4. 5 0
      src/main/java/com/shkpr/service/alambizplugin/commproperties/AsyncTaskProperties.java
  5. 0 28
      src/main/java/com/shkpr/service/alambizplugin/commproperties/GisSurveySystemCheckProperties.java
  6. 53 4
      src/main/java/com/shkpr/service/alambizplugin/components/AsyncResultManager.java
  7. 0 308
      src/main/java/com/shkpr/service/alambizplugin/components/GisSurveySystemCheckResultManager.java
  8. 96 44
      src/main/java/com/shkpr/service/alambizplugin/components/GisSurveySystemChecker.java
  9. 14 16
      src/main/java/com/shkpr/service/alambizplugin/components/checker/DuplicatePointsFinder.java
  10. 14 16
      src/main/java/com/shkpr/service/alambizplugin/components/checker/ElevationDiffFinder.java
  11. 14 16
      src/main/java/com/shkpr/service/alambizplugin/components/checker/IsolatedLinesFinder.java
  12. 14 16
      src/main/java/com/shkpr/service/alambizplugin/components/checker/IsolatedPointsFinder.java
  13. 14 16
      src/main/java/com/shkpr/service/alambizplugin/components/checker/OverlapLinesFinder.java
  14. 1 8
      src/main/java/com/shkpr/service/alambizplugin/configuration/WebMvcConfiguration.java
  15. 30 0
      src/main/java/com/shkpr/service/alambizplugin/constants/GisSurveySystemCheckKeys.java
  16. 0 67
      src/main/java/com/shkpr/service/alambizplugin/constants/GisSurveySystemCheckResultPath.java
  17. 8 8
      src/main/java/com/shkpr/service/alambizplugin/controller/ApiGisSurveyController.java
  18. 21 0
      src/main/java/com/shkpr/service/alambizplugin/dbdao/mapper/GisSurveySystemCheckDefineMapper.java
  19. 33 0
      src/main/java/com/shkpr/service/alambizplugin/dbdao/services/GisSurveySystemCheckDefineServiceImpl.java
  20. 18 0
      src/main/java/com/shkpr/service/alambizplugin/dbdao/services/intef/GisSurveySystemCheckDefineService.java
  21. 17 2
      src/main/java/com/shkpr/service/alambizplugin/dto/CommAsyncCache.java
  22. 39 0
      src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveySystemCheckDefine.java
  23. 13 2
      src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveySystemCheckId.java
  24. 0 136
      src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveySystemCheckResult.java
  25. 0 38
      src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveySystemCheckSubtask.java
  26. 1 5
      src/main/resources/application.properties
  27. 18 0
      src/main/resources/mapper/GisSurveySystemCheckDefineMapper.xml

+ 3 - 23
src/main/java/com/shkpr/service/alambizplugin/apiparam/GisSurveyCheckParams.java

@@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
 import java.time.LocalDateTime;
 import java.util.Arrays;
+import java.util.List;
 import java.util.Objects;
 
 /**
@@ -60,30 +61,9 @@ public class GisSurveyCheckParams {
     private Boolean checkStart = true;
 
     /**
-     * 孤立点启动
+     * 启动的子项key
      */
-    private Boolean isolatedPointsStart = true;
-
-    /**
-     * 孤立线启动
-     */
-    private Boolean isolatedLinesStart = true;
-
-    /**
-     * 重复点启动
-     */
-    private Boolean duplicatePointsStart = true;
-
-    /**
-     * 重叠线启动
-     */
-    private Boolean overlapLinesStart = true;
-
-    /**
-     * 高程差启动
-     */
-    private Boolean elevationDiffStart = true;
-
+    private List<String> subitemKeys;
 
     /**
      * 元素/属性的变化时间

+ 137 - 70
src/main/java/com/shkpr/service/alambizplugin/bizservice/GisSurveySystemCheckBizService.java

@@ -1,22 +1,24 @@
 package com.shkpr.service.alambizplugin.bizservice;
 
+import com.fasterxml.jackson.core.type.TypeReference;
 import com.global.base.log.LogLevelFlag;
 import com.global.base.log.LogPrintMgr;
 import com.shkpr.service.alambizplugin.apiparam.GisSurveyCheckParams;
 import com.shkpr.service.alambizplugin.commproperties.AsyncTaskProperties;
-import com.shkpr.service.alambizplugin.commproperties.GisSurveySystemCheckProperties;
-import com.shkpr.service.alambizplugin.components.GisSurveySystemCheckResultManager;
+import com.shkpr.service.alambizplugin.components.AsyncResultManager;
 import com.shkpr.service.alambizplugin.components.GisSurveySystemChecker;
 import com.shkpr.service.alambizplugin.constants.CommAsyncStatusEnum;
 import com.shkpr.service.alambizplugin.constants.GisSurveyCheckTypeEnum;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dbdao.services.intef.GisSurveyJobInfoService;
 import com.shkpr.service.alambizplugin.dbdao.services.intef.GisSurveyProjectInfoService;
+import com.shkpr.service.alambizplugin.dbdao.services.intef.GisSurveySystemCheckDefineService;
+import com.shkpr.service.alambizplugin.dto.CommAsyncCache;
+import com.shkpr.service.alambizplugin.dto.CommAsyncResult;
 import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckId;
-import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckResult;
-import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckSubtask;
+import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckResultDetail;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
 import org.springframework.stereotype.Component;
 import org.springframework.util.concurrent.ListenableFuture;
@@ -24,10 +26,12 @@ import org.springframework.util.concurrent.ListenableFuture;
 import java.time.Duration;
 import java.time.Instant;
 import java.time.LocalDateTime;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
 
 /**
  * 系统检查管理service
@@ -36,21 +40,21 @@ import java.util.concurrent.ExecutionException;
  * @since 1.0.0
  */
 @Component
-@EnableConfigurationProperties({GisSurveySystemCheckProperties.class})
 public class GisSurveySystemCheckBizService {
     /**
-     * 任务缓存
+     * 任务缓存{@code <系统检查id,异步任务<异步结果<系统检查key,结果详情>>>}
      */
-    private final static Map<GisSurveySystemCheckId, ListenableFuture<GisSurveySystemCheckResult>> TASK_CACHE = new ConcurrentHashMap<>();
+    private final static Map<GisSurveySystemCheckId, ListenableFuture<CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>>>>
+            TASK_CACHE = new ConcurrentHashMap<>();
     /**
-     * 子任务缓存
+     * 子任务缓存{@code <系统检查id,异步任务<异步结果<结果详情>>>}
      */
-    private final static Map<GisSurveySystemCheckId, GisSurveySystemCheckSubtask> SUBTASK_CACHE = new ConcurrentHashMap<>();
-
+    private final static Map<GisSurveySystemCheckId, Map<String, ListenableFuture<GisSurveySystemCheckResultDetail>>>
+            SUBTASK_CACHE = new ConcurrentHashMap<>();
     /**
-     * 开始时间缓存
+     * 信息缓存
      */
-    private final static Map<GisSurveySystemCheckId, LocalDateTime> TIME_CACHE = new ConcurrentHashMap<>();
+    private final static Map<GisSurveySystemCheckId, CommAsyncCache> INFO_CACHE = new ConcurrentHashMap<>();
     /**
      * log
      */
@@ -58,29 +62,29 @@ public class GisSurveySystemCheckBizService {
     private final String mBizType;
 
     private final AsyncTaskProperties asyncTaskProperties;
-    private final GisSurveySystemCheckProperties systemCheckProperties;
     private final ThreadPoolTaskScheduler taskScheduler;
-    private final GisSurveySystemCheckResultManager systemCheckFileManager;
+    private final AsyncResultManager asyncResultManager;
     private final GisSurveySystemChecker systemChecker;
     private final GisSurveyProjectInfoService projectInfoService;
     private final GisSurveyJobInfoService jobInfoService;
+    private final GisSurveySystemCheckDefineService systemCheckDefineService;
 
     public GisSurveySystemCheckBizService(AsyncTaskProperties asyncTaskProperties
-            , GisSurveySystemCheckProperties systemCheckProperties
             , @Qualifier("timeThreadPoolTaskScheduler") ThreadPoolTaskScheduler taskScheduler
-            , GisSurveySystemCheckResultManager systemCheckFileManager
+            , AsyncResultManager asyncResultManager
             , GisSurveySystemChecker systemChecker
             , GisSurveyProjectInfoService projectInfoService
-            , GisSurveyJobInfoService jobInfoService) {
+            , GisSurveyJobInfoService jobInfoService
+            , GisSurveySystemCheckDefineService systemCheckDefineService) {
         mStrClassName = "GisSurveySystemCheckBizService";
         mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
         this.asyncTaskProperties = asyncTaskProperties;
-        this.systemCheckProperties = systemCheckProperties;
         this.taskScheduler = taskScheduler;
-        this.systemCheckFileManager = systemCheckFileManager;
+        this.asyncResultManager = asyncResultManager;
         this.systemChecker = systemChecker;
         this.projectInfoService = projectInfoService;
         this.jobInfoService = jobInfoService;
+        this.systemCheckDefineService = systemCheckDefineService;
     }
 
     /**
@@ -89,64 +93,127 @@ public class GisSurveySystemCheckBizService {
      * @param params 系统检查参数
      * @return 检查状态
      */
-    public GisSurveySystemCheckResult sysCheckFun(GisSurveyCheckParams params) {
+    public CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>> sysCheckFun(GisSurveyCheckParams params) {
         //系统检查id
         GisSurveySystemCheckId systemCheckId = GisSurveySystemCheckId.generateId(params);
-        if (systemCheckId == null) return GisSurveySystemCheckResult.notExists(params);
-        //获取已存在的任务
-        ListenableFuture<GisSurveySystemCheckResult> previousFuture = TASK_CACHE.get(systemCheckId);
-        //如任务已完成,则检查历史失败
-        if (!params.getIgnoreFail() && previousFuture != null && previousFuture.isDone()) {
-            try {
-                //获取结果,并检查失败
-                GisSurveySystemCheckResult gisSurveySystemCheckResult = previousFuture.get();
-                if (Objects.equals(gisSurveySystemCheckResult.getCheckStatus(), CommAsyncStatusEnum.FAIL.getCode()))
-                    return gisSurveySystemCheckResult;
-            } catch (InterruptedException | ExecutionException e) {
-                //打印报错信息(不太可能走到这)
-                LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
-                        , String.format("检查历史失败异常 系统检查id:%s msg:%s", systemCheckId, e.getMessage())
-                );
-            }
+        if (systemCheckId == null) return CommAsyncResult.fail(null);
 
-        }
+        //获取上次结果
+        CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>> lastResult = getTempResult(systemCheckId);
+        //失败/进行中处理
+        if (lastResult != null && !Objects.equals(CommAsyncStatusEnum.SUCCESS.getCode(), lastResult.getStatus()))
+            return lastResult;
 
-        //获取已存在的结果
-        GisSurveySystemCheckResult result = systemCheckFileManager.getResult(systemCheckId);
-        //获取元素更新时间
+        //文件结果flag
+        final String FLAG = systemCheckId.getFlag();
+        //获取文件结果
+        CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>> fileResult = asyncResultManager.getResult(FLAG, new TypeReference<CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>>>() {
+        });
+        //获取数据更新时间
         LocalDateTime refreshTime = getRefreshTimeDuration(systemCheckId);
         //回填元素更新时间
         params.setRefreshTime(refreshTime);
+        //获取支持检查项
+        List<String> supportedKeys = systemCheckDefineService.findKeys();
+        //对入参取交集
+        params.getSubitemKeys().retainAll(supportedKeys);
+
         //判断结果是否存在
-        if (result != null) {
-            //判断时间间隔,如滞后未到临界,则直接返回结果
-            if (result.getRefreshTime() != null && refreshTime != null) {
-                //结果滞后数据库的时间
-                Duration lags = Duration.between(result.getRefreshTime(), refreshTime);
-                //规定滞后时间大于真实滞后时间,直接返回结果
-                if (systemCheckProperties.getResultLagDuration().compareTo(lags) >= 0) {
-                    return result;
+        if (fileResult != null && refreshTime != null) {
+            //过滤启动key
+            List<String> startKeys = params.getSubitemKeys().stream().filter(key -> {
+                //文件结果包含数据库时间
+                if (fileResult.getRefreshTimes() != null && fileResult.getRefreshTimes().containsKey(key)
+                        //文件结果数据包含当前项
+                        && fileResult.getData() != null && fileResult.getData().containsKey(key)) {
+
+                    //文件结果落后数据间隔
+                    Duration lags = Duration.between(fileResult.getRefreshTimes().get(key), refreshTime);
+                    //规定落后时间小于落后数据间隔(数据落后),需要启动
+                    return asyncTaskProperties.getSystemCheckResultLag().compareTo(lags) < 0;
                 }
-            }
+                return true;
+            }).collect(Collectors.toList());
+            params.setSubitemKeys(startKeys);
         }
 
-        //系统检查子任务
-        GisSurveySystemCheckSubtask checkSubtask = SUBTASK_CACHE.get(systemCheckId);
-        //进行中判断(未完成且未清除)
-        if (previousFuture != null && !previousFuture.isDone() && !previousFuture.isCancelled())
-            return GisSurveySystemCheckResult.inProgress(params, checkSubtask, TIME_CACHE.get(systemCheckId));
         //启动检查任务
-        if (Boolean.TRUE.equals(params.getCheckStart())) {
+        if (Boolean.TRUE.equals(params.getCheckStart()) && CollectionUtils.isNotEmpty(params.getSubitemKeys())) {
             startTask(systemCheckId, params);
             //如需要返回上次结果,则直接返回结果
-            if (Boolean.TRUE.equals(params.getReturnLastResult())) {
-                return result;
-            }
+            if (Boolean.TRUE.equals(params.getReturnLastResult())) return fileResult;
             //返回进行中
-            return GisSurveySystemCheckResult.inProgress(params, checkSubtask, LocalDateTime.now());
+            return CommAsyncResult.inProgress(systemCheckId.toString(), LocalDateTime.now(), params.getOperator());
         }
         //未启动返回结果
-        return result;
+        return fileResult;
+    }
+
+    /**
+     * 获取缓存结果
+     *
+     * @param systemCheckId 系统检查id
+     * @return 缓存结果
+     */
+    private CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>> getTempResult(GisSurveySystemCheckId systemCheckId) {
+        //获取已存在的任务
+        ListenableFuture<CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>>> previousFuture
+                = TASK_CACHE.get(systemCheckId);
+
+        //判断完成
+        if (previousFuture != null && previousFuture.isDone()) {
+            try {
+                //获取结果
+                CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>> result = previousFuture.get();
+                //如成功/失败,则直接返回
+                if (Objects.equals(result.getStatus(), CommAsyncStatusEnum.FAIL.getCode()) ||
+                        Objects.equals(result.getStatus(), CommAsyncStatusEnum.SUCCESS.getCode()))
+                    removeCache(systemCheckId);
+                return result;
+            } catch (InterruptedException | ExecutionException e) {
+                //打印报错信息
+                LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
+                        , String.format("查询系统检查异常 异步任务id:%s error:%s", systemCheckId, e)
+                );
+                return CommAsyncResult.fail(systemCheckId.toString());
+            }
+        }
+
+        //进行中判断(未完成且未清除)
+        if (previousFuture != null && !previousFuture.isDone() && !previousFuture.isCancelled()) {
+            //获取缓存信息
+            CommAsyncCache asyncCache = INFO_CACHE.get(systemCheckId);
+            //设置进行中信息,并返回
+            if (asyncCache != null) {
+                CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>> tempResult = CommAsyncResult.inProgress(
+                        systemCheckId.toString(), asyncCache.getStartTime(), asyncCache.getOperator());
+                tempResult.setSubitemKeys(asyncCache.getSubitemKeys());
+                tempResult.setData(getProgressData(systemCheckId));
+                return tempResult;
+            }
+        }
+
+        //取消判断
+        if (previousFuture != null && previousFuture.isCancelled()) removeCache(systemCheckId);
+
+        return null;
+    }
+
+    /**
+     * 获取进行中数据
+     *
+     * @return 进行中详情
+     */
+    private Map<String, GisSurveySystemCheckResultDetail> getProgressData(GisSurveySystemCheckId systemCheckId) {
+        return SUBTASK_CACHE.get(systemCheckId).entrySet().stream()
+                .collect(Collectors.toMap(
+                        Map.Entry::getKey,
+                        entry -> {
+                            GisSurveySystemCheckResultDetail resultDetail = new GisSurveySystemCheckResultDetail();
+                            resultDetail.setDone(entry.getValue().isDone());
+                            return resultDetail;
+                        }
+                ));
     }
 
     /**
@@ -155,12 +222,12 @@ public class GisSurveySystemCheckBizService {
      * @param params 系统检查参数
      * @return 检查结果(可能进行中)
      */
-    public GisSurveySystemCheckResult cancelCheck(GisSurveyCheckParams params) {
+    public int cancelCheck(GisSurveyCheckParams params) {
         //任务标识
         GisSurveySystemCheckId systemCheckId = GisSurveySystemCheckId.generateId(params);
-        if (systemCheckId == null) return GisSurveySystemCheckResult.fail(params);
+        if (systemCheckId == null) return CommAsyncStatusEnum.NOT_EXISTS.getCode();
         //如无缓存,则直接返回不存在
-        if (!TASK_CACHE.containsKey(systemCheckId)) return GisSurveySystemCheckResult.notExists(params);
+        if (!TASK_CACHE.containsKey(systemCheckId)) return CommAsyncStatusEnum.NOT_EXISTS.getCode();
         //关闭检查任务
         if (stopTask(TASK_CACHE.get(systemCheckId))) {
             removeCache(systemCheckId);
@@ -171,9 +238,9 @@ public class GisSurveySystemCheckBizService {
                             , systemCheckId
                     )
             );
-            return GisSurveySystemCheckResult.success(params);
+            return CommAsyncStatusEnum.SUCCESS.getCode();
         }
-        return GisSurveySystemCheckResult.fail(params);
+        return CommAsyncStatusEnum.FAIL.getCode();
     }
 
     /**
@@ -201,12 +268,12 @@ public class GisSurveySystemCheckBizService {
      */
     private void startTask(GisSurveySystemCheckId systemCheckId, GisSurveyCheckParams params) {
         //获取已存在的任务
-        ListenableFuture<GisSurveySystemCheckResult> previousFuture = TASK_CACHE.get(systemCheckId);
+        ListenableFuture<CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>>> previousFuture = TASK_CACHE.get(systemCheckId);
         //已结束判断,删除缓存
         if (previousFuture != null && (previousFuture.isDone() || previousFuture.isCancelled()))
             removeCache(systemCheckId);
         //异步执行系统检查任务
-        ListenableFuture<GisSurveySystemCheckResult> future = systemChecker.systemCheckTask(params,
+        ListenableFuture<CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>>> future = systemChecker.systemCheckTask(params,
                 //缓存子任务句柄
                 subtask -> SUBTASK_CACHE.put(systemCheckId, subtask),
                 //删除子任务句柄
@@ -227,7 +294,7 @@ public class GisSurveySystemCheckBizService {
         //缓存任务句柄
         TASK_CACHE.put(systemCheckId, future);
         //缓存时间
-        TIME_CACHE.put(systemCheckId, LocalDateTime.now());
+        INFO_CACHE.put(systemCheckId, new CommAsyncCache(LocalDateTime.now(), params.getOperator(), params.getSubitemKeys()));
     }
 
     /**
@@ -251,6 +318,6 @@ public class GisSurveySystemCheckBizService {
     private void removeCache(GisSurveySystemCheckId systemCheckId) {
         TASK_CACHE.remove(systemCheckId);
         SUBTASK_CACHE.remove(systemCheckId);
-        TIME_CACHE.remove(systemCheckId);
+        INFO_CACHE.remove(systemCheckId);
     }
 }

+ 2 - 3
src/main/java/com/shkpr/service/alambizplugin/bizservice/GisSurveyThirdExportBizService.java

@@ -77,7 +77,6 @@ public class GisSurveyThirdExportBizService {
     public CommAsyncResult<Map<String, String>> thirdExport(String jobId, FileTypeEnum fileType, String operator) {
         //获取上次结果
         CommAsyncResult<Map<String, String>> lastResult = getTempResult(jobId);
-
         //失败/进行中处理
         if (lastResult != null && !Objects.equals(CommAsyncStatusEnum.SUCCESS.getCode(), lastResult.getStatus()))
             return lastResult;
@@ -98,7 +97,7 @@ public class GisSurveyThirdExportBizService {
 
             //文件结果落后数据间隔
             Duration lags = Duration.between(fileResult.getRefreshTimes().get(fileType.getName()), refreshTime);
-            //超出间隔,直接返回
+            //规定落后时间大于落后数据间隔(数据未落后),直接返回
             if (asyncTaskProperties.getThirdExportResultLag().compareTo(lags) >= 0) return fileResult;
         }
 
@@ -152,7 +151,7 @@ public class GisSurveyThirdExportBizService {
             } catch (InterruptedException | ExecutionException e) {
                 //打印报错信息
                 LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
-                        , String.format("查询转换导出异常 任务id:%s error:%s", jobId, e)
+                        , String.format("查询导出异常 任务id:%s error:%s", jobId, e)
                 );
                 return CommAsyncResult.fail(jobId);
             }

+ 5 - 0
src/main/java/com/shkpr/service/alambizplugin/commproperties/AsyncTaskProperties.java

@@ -23,6 +23,11 @@ public class AsyncTaskProperties {
     private Duration systemCheckTimeout;
 
     /**
+     * 系统检查结果落后时间
+     */
+    private Duration systemCheckResultLag;
+
+    /**
      * 第三方导入超时时间
      */
     private Duration thirdImportTimeout;

+ 0 - 28
src/main/java/com/shkpr/service/alambizplugin/commproperties/GisSurveySystemCheckProperties.java

@@ -1,28 +0,0 @@
-package com.shkpr.service.alambizplugin.commproperties;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.time.Duration;
-
-/**
- * 系统检查配置
- *
- * @author 欧阳劲驰
- * @since 0.0.1
- */
-@Getter
-@Setter
-@ConfigurationProperties(prefix = "system-check")
-public class GisSurveySystemCheckProperties {
-    /**
-     * 资源路径
-     */
-    private String resourcePath;
-    /**
-     * 结果滞后时间
-     */
-    private Duration resultLagDuration;
-
-}

+ 53 - 4
src/main/java/com/shkpr/service/alambizplugin/components/AsyncResultManager.java

@@ -145,7 +145,7 @@ public class AsyncResultManager {
     public Path writeJson(Object data, String flag, String fileName) {
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
                 , String.format(
-                        "开始执行写入结果文件,结果标识:%s,文件名:%s========>"
+                        "开始执行写入json文件,结果标识:%s,文件名:%s========>"
                         , flag
                         , fileName
                 )
@@ -163,7 +163,7 @@ public class AsyncResultManager {
                 long end = System.currentTimeMillis();
                 LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
                         , String.format(
-                                "结束执行写入结果文件,结果标识:%s,文件名:%s,用时(毫秒):%d"
+                                "结束执行写入json文件,结果标识:%s,文件名:%s,用时(毫秒):%d"
                                 , flag
                                 , fileName
                                 , (end - begin)
@@ -233,6 +233,55 @@ public class AsyncResultManager {
     }
 
     /**
+     * 写入excel文件
+     *
+     * @param head     表头
+     * @param data     数据
+     * @param flag     结果标识
+     * @param fileName 文件名
+     */
+    public Path writeExcel(Map<String, String> head, List<Map<String, Object>> data, String flag, String fileName) {
+        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
+                , String.format(
+                        "开始执行写入excel文件,结果标识:%s,文件名:%s========>"
+                        , flag
+                        , fileName
+                )
+        );
+        long begin = System.currentTimeMillis();
+
+        //写入文件
+        Path path = Paths.get(TEMP_DIR_CACHE.get(flag).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(
+                            "结束执行写入excel文件,结果标识:%s,文件名:%s,用时(毫秒):%d"
+                            , flag
+                            , fileName
+                            , (end - begin)
+                    )
+            );
+
+            return path;
+        } catch (IOException e) {
+            //打印报错信息
+            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
+                    , String.format(
+                            "监测到io异常 结果标识:%s error:%s"
+                            , flag
+                            , e
+                    )
+            );
+            return null;
+        }
+    }
+
+
+    /**
      * 写入shape文件
      *
      * @param data     数据
@@ -328,7 +377,7 @@ public class AsyncResultManager {
      * @param flag 结果标识
      * @return 替换状态
      */
-    public boolean replaceResult(String flag) {
+    public Boolean replaceResult(String flag) {
         //临时文件路径
         Path path = TEMP_DIR_CACHE.get(flag);
         try {
@@ -345,7 +394,7 @@ public class AsyncResultManager {
                             , e
                     )
             );
+            return false;
         }
-        return false;
     }
 }

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

@@ -1,308 +0,0 @@
-package com.shkpr.service.alambizplugin.components;
-
-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;
-import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckResult;
-import org.apache.commons.io.FileUtils;
-import org.springframework.stereotype.Component;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-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;
-
-/**
- * 系统检查结果管理
- *
- * @author 欧阳劲驰
- * @since 1.0.0
- */
-@Component
-public class GisSurveySystemCheckResultManager {
-    /**
-     * 临时文件夹缓存
-     */
-    private final static Map<GisSurveySystemCheckId, Path> TEMP_DIR_CACHE = new ConcurrentHashMap<>();
-
-    private final static Integer BUFFER_SIZE = 4 * 1024;
-    /**
-     * log
-     */
-    private final String mStrClassName;
-    private final String mBizType;
-    private final GisSurveySystemCheckProperties systemCheckProperties;
-    private final ObjectMapper objectMapper;
-
-    public GisSurveySystemCheckResultManager(GisSurveySystemCheckProperties systemCheckProperties, ObjectMapper objectMapper) {
-        mStrClassName = "GisSurveySystemCheckResultManager";
-        mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
-        this.systemCheckProperties = systemCheckProperties;
-        this.objectMapper = objectMapper;
-    }
-
-    /**
-     * 获取结果
-     *
-     * @param systemCheckId 系统检查id
-     * @return 检查结果
-     */
-    public GisSurveySystemCheckResult getResult(GisSurveySystemCheckId systemCheckId) {
-        //创建文件输入流
-        File file = Paths.get(getResultDirPath(systemCheckId).toString(), GisSurveySystemCheckResultPath.RESULT).toFile();
-        if (!file.exists()) return null;
-        try (FileInputStream fileInputStream = new FileInputStream(file)) {
-            //获取文件通道
-            FileChannel channel = fileInputStream.getChannel();
-            //创建缓冲区
-            ByteBuffer byteBuffer = ByteBuffer.allocate((int) file.length());
-            //读取通道
-            int read = channel.read(byteBuffer);
-            //输入读取信息
-            if (read > 0) return objectMapper.readValue(byteBuffer.array(), GisSurveySystemCheckResult.class);
-        } catch (IOException e) {
-            //打印报错信息
-            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
-                    , String.format(
-                            "监测到io异常 系统检查id:%s error:%s"
-                            , systemCheckId
-                            , e
-                    )
-            );
-            return null;
-        }
-        return null;
-    }
-
-    /**
-     * 创建临时文件夹
-     *
-     * @param systemCheckId 系统id
-     */
-    public Boolean createTempDirectory(GisSurveySystemCheckId systemCheckId) {
-        try {
-            //创建临时文件夹,并缓存路径
-            Path tempDirectory = Files.createTempDirectory(Paths.get(systemCheckProperties.getResourcePath()),
-                    systemCheckId.getCheckType().getFlag() + "-" + systemCheckId.getCode() + "-");
-            TEMP_DIR_CACHE.put(systemCheckId, tempDirectory);
-            return tempDirectory.toFile().exists();
-        } catch (IOException e) {
-            //打印报错信息
-            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
-                    , String.format(
-                            "监测到io异常 系统检查id:%s msg:%s"
-                            , systemCheckId
-                            , e.getMessage()
-                    )
-            );
-            return false;
-        }
-    }
-
-    /**
-     * 删除临时文件夹
-     *
-     * @param systemCheckId 系统检查id
-     */
-    public void deleteTempDirectory(GisSurveySystemCheckId systemCheckId) {
-        if (TEMP_DIR_CACHE.containsKey(systemCheckId)) {
-            //删除缓存,并删除文件夹
-            Path remove = TEMP_DIR_CACHE.remove(systemCheckId);
-            try {
-                FileUtils.deleteDirectory(remove.toFile());
-            } catch (IOException e) {
-                //打印报错信息
-                LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
-                        , String.format(
-                                "监测到io异常 系统检查id:%s msg:%s"
-                                , systemCheckId
-                                , e.getMessage()
-                        )
-                );
-            }
-        }
-    }
-
-    /**
-     * 写入结果文件
-     *
-     * @param data          数据
-     * @param systemCheckId 系统检查id
-     * @param fileName      文件名
-     */
-    public void writeResult(Object data, GisSurveySystemCheckId systemCheckId, String fileName) {
-        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
-                , String.format(
-                        "开始执行写入结果文件,系统id:%s,文件名:%s========>"
-                        , systemCheckId
-                        , fileName
-                )
-        );
-        long begin = System.currentTimeMillis();
-
-        //写入文件
-        File file = Paths.get(TEMP_DIR_CACHE.get(systemCheckId).toString(), fileName).toFile();
-        try {
-            //序列化数据
-            final byte[] bytes = objectMapper.writeValueAsBytes(data);
-            //写入文件
-            int total = writeFile(bytes, file);
-            if (total > 0) {
-                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()
-                    )
-            );
-        }
-    }
-
-
-    /**
-     * 写入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()
-                    )
-            );
-        }
-    }
-
-    /**
-     * 替换结果
-     *
-     * @param systemCheckId 系统检查id
-     * @return 替换状态
-     */
-    public boolean replaceResult(GisSurveySystemCheckId systemCheckId) {
-        //临时文件路径
-        Path path = TEMP_DIR_CACHE.get(systemCheckId);
-        try {
-            //替换结果目录
-            FileUtils.copyDirectory(path.toFile(), getResultDirPath(systemCheckId).toFile());
-            //删除临时文件
-            deleteTempDirectory(systemCheckId);
-
-            return true;
-        } catch (IOException e) {
-            //打印报错信息
-            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
-                    , String.format(
-                            "监测到io异常 系统检查id:%s msg:%s"
-                            , systemCheckId
-                            , e.getMessage()
-                    )
-            );
-        }
-        return false;
-    }
-
-    /**
-     * 获取结果文件夹路径
-     *
-     * @param systemCheckId 系统检查id
-     * @return 结果文件夹路径
-     */
-    private Path getResultDirPath(GisSurveySystemCheckId systemCheckId) {
-        return Paths.get(systemCheckProperties.getResourcePath(), systemCheckId.getCheckType().getFlag() +
-                "-" + systemCheckId.getCode());
-    }
-
-    /**
-     * 写文件
-     *
-     * @param data 数据
-     * @param file 文件
-     * @return 写入数量
-     * @throws IOException io异常
-     */
-    private int writeFile(final byte[] data, final File file) throws IOException {
-        //创建文件输出流(此处会创建文件)
-        try (FileOutputStream fileOutputStream = new FileOutputStream(file)) {
-            //获取文件通道
-            FileChannel channel = fileOutputStream.getChannel();
-            //创建缓冲区
-            ByteBuffer byteBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE);
-            //偏移量
-            int offset = 0;
-            //写入总数
-            int total = 0;
-            while (offset < data.length) {
-                //分片大小
-                int chunkSize = Math.min(BUFFER_SIZE, data.length - offset);
-                //重置缓冲区,存入缓冲区,翻转
-                byteBuffer.clear();
-                byteBuffer.put(data, offset, chunkSize);
-                byteBuffer.flip();
-                //写入当前块
-                total += channel.write(byteBuffer);
-                offset += chunkSize;
-            }
-            //强制写入
-            channel.force(true);
-            return total;
-        }
-    }
-}

+ 96 - 44
src/main/java/com/shkpr/service/alambizplugin/components/GisSurveySystemChecker.java

@@ -1,5 +1,6 @@
 package com.shkpr.service.alambizplugin.components;
 
+import com.fasterxml.jackson.core.type.TypeReference;
 import com.global.base.log.LogLevelFlag;
 import com.global.base.log.LogPrintMgr;
 import com.shkpr.service.alambizplugin.apiparam.GisSurveyCheckParams;
@@ -10,25 +11,28 @@ import com.shkpr.service.alambizplugin.components.checker.IsolatedPointsFinder;
 import com.shkpr.service.alambizplugin.components.checker.OverlapLinesFinder;
 import com.shkpr.service.alambizplugin.constants.CommAsyncStatusEnum;
 import com.shkpr.service.alambizplugin.constants.GisSurveyCheckTypeEnum;
-import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckResultPath;
+import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckKeys;
 import com.shkpr.service.alambizplugin.constants.LogFlagBusiType;
 import com.shkpr.service.alambizplugin.dbdao.services.intef.GisSurveyLayerApplyService;
 import com.shkpr.service.alambizplugin.dbdao.services.intef.TypeDefineService;
+import com.shkpr.service.alambizplugin.dto.CommAsyncResult;
 import com.shkpr.service.alambizplugin.dto.GisSurveyLayerApplyLine;
 import com.shkpr.service.alambizplugin.dto.GisSurveyLayerApplyPoint;
 import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckId;
-import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckResult;
 import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckResultDetail;
-import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckSubtask;
 import com.shkpr.service.alambizplugin.dto.TypeDefine;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.AsyncResult;
 import org.springframework.stereotype.Component;
 import org.springframework.util.concurrent.ListenableFuture;
 
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.time.Duration;
 import java.time.LocalDateTime;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.function.Consumer;
 
@@ -46,7 +50,7 @@ public class GisSurveySystemChecker {
     private final String mStrClassName;
     private final String mBizType;
 
-    private final GisSurveySystemCheckResultManager systemCheckResultManager;
+    private final AsyncResultManager asyncResultManager;
     private final GisSurveyLayerApplyService gisSurveyLayerApplyService;
     private final TypeDefineService typeDefineService;
     private final IsolatedPointsFinder isolatedPointsFinder;
@@ -55,14 +59,14 @@ public class GisSurveySystemChecker {
     private final OverlapLinesFinder overlapLinesFinder;
     private final ElevationDiffFinder elevationDiffFinder;
 
-    public GisSurveySystemChecker(GisSurveySystemCheckResultManager systemCheckResultManager
+    public GisSurveySystemChecker(AsyncResultManager asyncResultManager
             , GisSurveyLayerApplyService gisSurveyLayerApplyService, TypeDefineService typeDefineService
             , IsolatedPointsFinder isolatedPointsFinder, IsolatedLinesFinder isolatedLinesFinder
             , DuplicatePointsFinder duplicatePointsFinder, OverlapLinesFinder overlapLinesFinder
             , ElevationDiffFinder elevationDiffFinder) {
         mStrClassName = "GisSurveySystemChecker";
         mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
-        this.systemCheckResultManager = systemCheckResultManager;
+        this.asyncResultManager = asyncResultManager;
         this.gisSurveyLayerApplyService = gisSurveyLayerApplyService;
         this.typeDefineService = typeDefineService;
         this.isolatedPointsFinder = isolatedPointsFinder;
@@ -81,16 +85,18 @@ public class GisSurveySystemChecker {
      * @return 系统检查返回
      */
     @Async
-    public ListenableFuture<GisSurveySystemCheckResult> systemCheckTask(GisSurveyCheckParams params
-            , Consumer<GisSurveySystemCheckSubtask> onStartSubtask, Consumer<GisSurveySystemCheckId> onDeprecatedSubtask) {
+    public ListenableFuture<CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>>> systemCheckTask(
+            GisSurveyCheckParams params
+            , Consumer<Map<String, ListenableFuture<GisSurveySystemCheckResultDetail>>> onStartSubtask
+            , Consumer<GisSurveySystemCheckId> onDeprecatedSubtask) {
         //系统检查id
         GisSurveySystemCheckId systemCheckId = GisSurveySystemCheckId.generateId(params);
-        if (systemCheckId == null) return new AsyncResult<>(GisSurveySystemCheckResult.fail(params));
-        //创建临时文件夹
-        if (!systemCheckResultManager.createTempDirectory(systemCheckId))
-            return new AsyncResult<>(GisSurveySystemCheckResult.fail(params));
+        if (systemCheckId == null) return new AsyncResult<>(CommAsyncResult.fail(null));
+
         //构建返回
-        GisSurveySystemCheckResult result = GisSurveySystemCheckResult.fail(params);
+        CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>> result = CommAsyncResult.fail(systemCheckId.toString());
+        result.setOperator(params.getOperator());
+
         //孤立点任务
         ListenableFuture<GisSurveySystemCheckResultDetail> isolatedPointsFuture = null;
         //孤立线任务
@@ -101,19 +107,21 @@ public class GisSurveySystemChecker {
         ListenableFuture<GisSurveySystemCheckResultDetail> overlapLinesFuture = null;
         //高程差任务
         ListenableFuture<GisSurveySystemCheckResultDetail> elevationDiffFuture = null;
+
         //点集合
         List<GisSurveyLayerApplyPoint> points = null;
         //线集合
         List<GisSurveyLayerApplyLine> lines = null;
-        try {
-            LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
-                    , String.format(
-                            "开始执行系统检查;检查类型 检查类型:%s code:%s"
-                            , systemCheckId.getCheckType().getFlag()
-                            , systemCheckId.getCode()
-                    )
-            );
 
+        LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
+                , String.format(
+                        "开始执行系统检查;检查类型 检查类型:%s code:%s"
+                        , systemCheckId.getCheckType().getFlag()
+                        , systemCheckId.getCode()
+                )
+        );
+
+        try {
             //根据项目查询点线信息
             if (GisSurveyCheckTypeEnum.PROJECT == systemCheckId.getCheckType()) {
                 points = gisSurveyLayerApplyService.findAddPointByProjId(systemCheckId.getCode());
@@ -127,76 +135,123 @@ public class GisSurveySystemChecker {
             //查询经纬度类型定义
             List<TypeDefine> typeDefines = typeDefineService.findLatLng();
 
+
+            //结果flag
+            final String FLAG = systemCheckId.getFlag();
+            //创建临时文件夹
+            if (!asyncResultManager.createTempDirectory(FLAG))
+                return new AsyncResult<>(result);
+
+            //子任务
+            HashMap<String, ListenableFuture<GisSurveySystemCheckResultDetail>> subtask = new HashMap<>();
+
             //孤立点检查
             if (points != null && lines != null) {
-                if (params.getIsolatedPointsStart())
+                if (params.getSubitemKeys().contains(GisSurveySystemCheckKeys.ISOLATED_POINTS)) {
                     isolatedPointsFuture = isolatedPointsFinder.findIsolatedPoints(points, lines, systemCheckId);
+                    subtask.put(GisSurveySystemCheckKeys.ISOLATED_POINTS, isolatedPointsFuture);
+                }
             }
             //重复点检查
             if (points != null) {
-                if (params.getDuplicatePointsStart())
+                if (params.getSubitemKeys().contains(GisSurveySystemCheckKeys.DUPLICATE_POINTS)) {
                     duplicatePointsFuture = duplicatePointsFinder.findDuplicatePoints(points, typeDefines, systemCheckId);
+                    subtask.put(GisSurveySystemCheckKeys.DUPLICATE_POINTS, duplicatePointsFuture);
+                }
             }
             //孤立线\重叠线\高程差异常检查
             if (lines != null) {
-                if (params.getIsolatedLinesStart())
+                if (params.getSubitemKeys().contains(GisSurveySystemCheckKeys.ISOLATED_LINES)) {
                     isolatedLinesFuture = isolatedLinesFinder.findIsolatedLines(lines, systemCheckId);
-                if (params.getOverlapLinesStart())
+                    subtask.put(GisSurveySystemCheckKeys.ISOLATED_LINES, isolatedLinesFuture);
+                }
+                if (params.getSubitemKeys().contains(GisSurveySystemCheckKeys.OVERLAP_LINES)) {
                     overlapLinesFuture = overlapLinesFinder.findOverlapLines(lines, systemCheckId);
-                if (params.getElevationDiffStart())
+                    subtask.put(GisSurveySystemCheckKeys.OVERLAP_LINES, overlapLinesFuture);
+                }
+                if (params.getSubitemKeys().contains(GisSurveySystemCheckKeys.ELEVATION_DIFF)) {
                     elevationDiffFuture = elevationDiffFinder.findElevationDiff(lines, systemCheckId);
+                    subtask.put(GisSurveySystemCheckKeys.ELEVATION_DIFF, elevationDiffFuture);
+                }
             }
 
             //返回子任务
-            onStartSubtask.accept(
-                    new GisSurveySystemCheckSubtask(isolatedPointsFuture, isolatedLinesFuture, duplicatePointsFuture
-                            , overlapLinesFuture,elevationDiffFuture)
-            );
+            onStartSubtask.accept(subtask);
+
+            //获取上次结果
+            CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>> lastResult = asyncResultManager.getResult(FLAG, new TypeReference<CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>>>() {
+            });
+            //设置数据
+            Map<String, GisSurveySystemCheckResultDetail>  data = new HashMap<>();
+            if (lastResult != null && lastResult.getData() != null) data = lastResult.getData();
+            //设置数据时间
+            Map<String, LocalDateTime> refreshTimes = new HashMap<>();
+            if (lastResult != null && lastResult.getRefreshTimes() != null) refreshTimes = lastResult.getRefreshTimes();
 
             //等待结果,并存入返回,优先监听点相关(执行速度快且只需要点集合,优先释放点集合内存)
             if (isolatedPointsFuture != null) {
                 //监听孤立点
                 final GisSurveySystemCheckResultDetail isolatedPointsResult = isolatedPointsFuture.get();
-                result.setIsolatedPointsResult(isolatedPointsResult);
+                data.put(GisSurveySystemCheckKeys.ISOLATED_POINTS, isolatedPointsResult);
+                refreshTimes.put(GisSurveySystemCheckKeys.ISOLATED_POINTS, params.getRefreshTime());
                 //释放点缓存(孤立点和重复点都完成时,后续不需要点数据,释放缓存节省内存)
                 if (duplicatePointsFuture != null && duplicatePointsFuture.isDone()) points.clear();
             }
             if (duplicatePointsFuture != null) {
                 //监听重复点
                 final GisSurveySystemCheckResultDetail duplicatePointsResult = duplicatePointsFuture.get();
-                result.setDuplicatePointsResult(duplicatePointsResult);
+                data.put(GisSurveySystemCheckKeys.DUPLICATE_POINTS, duplicatePointsResult);
+                refreshTimes.put(GisSurveySystemCheckKeys.DUPLICATE_POINTS, params.getRefreshTime());
                 //释放点缓存(孤立点和重复点都完成时,后续不需要点数据,释放缓存节省内存)
                 if (isolatedPointsFuture != null && isolatedPointsFuture.isDone()) points.clear();
             }
             if (isolatedLinesFuture != null) {
-                //监听重复线
+                //监听孤立线
                 final GisSurveySystemCheckResultDetail isolatedLinesResult = isolatedLinesFuture.get();
-                result.setIsolatedLinesResult(isolatedLinesResult);
+                data.put(GisSurveySystemCheckKeys.ISOLATED_LINES, isolatedLinesResult);
+                refreshTimes.put(GisSurveySystemCheckKeys.ISOLATED_LINES, params.getRefreshTime());
             }
             if (overlapLinesFuture != null) {
                 //监听重叠线
                 final GisSurveySystemCheckResultDetail overlapLinesResult = overlapLinesFuture.get();
-                result.setOverlapLinesResult(overlapLinesResult);
+                data.put(GisSurveySystemCheckKeys.OVERLAP_LINES, overlapLinesResult);
+                refreshTimes.put(GisSurveySystemCheckKeys.OVERLAP_LINES, params.getRefreshTime());
             }
             if (elevationDiffFuture != null) {
                 //监听高程差异常
                 final GisSurveySystemCheckResultDetail elevationDiffResult = elevationDiffFuture.get();
-                result.setElevationDiffResult(elevationDiffResult);
+                data.put(GisSurveySystemCheckKeys.ELEVATION_DIFF, elevationDiffResult);
+                refreshTimes.put(GisSurveySystemCheckKeys.ELEVATION_DIFF, params.getRefreshTime());
             }
 
             //完成检查
-            result.setCheckStatus(CommAsyncStatusEnum.SUCCESS.getCode());
+            result.setStatus(CommAsyncStatusEnum.SUCCESS.getCode());
             result.setCompleteTime(LocalDateTime.now());
+            result.setData(data);
+            result.setRefreshTimes(refreshTimes);
+            result.setSubitemKeys(params.getSubitemKeys());
 
             //写入结果
-            systemCheckResultManager.writeResult(result, systemCheckId, GisSurveySystemCheckResultPath.RESULT);
+            Path resultPath = asyncResultManager.writeJson(result, FLAG, AsyncResultManager.RESULT_FILE_NAME);
+            if (resultPath == null || !Files.exists(resultPath)) {
+                //弃用子任务
+                onDeprecatedSubtask.accept(systemCheckId);
+                //打印报错信息
+                LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
+                        , String.format("第三方导出文件写入失败, 任务id:%s", systemCheckId)
+                );
+                return new AsyncResult<>(CommAsyncResult.fail(systemCheckId.toString()));
+            }
+
             //替换结果
-            if (!systemCheckResultManager.replaceResult(systemCheckId)) {
+            if (!asyncResultManager.replaceResult(FLAG)) {
                 //弃用子任务
                 onDeprecatedSubtask.accept(systemCheckId);
-                return new AsyncResult<>(GisSurveySystemCheckResult.fail(params));
+                return new AsyncResult<>(CommAsyncResult.fail(systemCheckId.toString()));
             }
 
+            //弃用子任务
+            onDeprecatedSubtask.accept(systemCheckId);
             LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
                     , String.format(
                             "结束执行系统检查;检查类型: %s, code:%s , 用时(毫秒):%d",
@@ -205,9 +260,6 @@ public class GisSurveySystemChecker {
                             Duration.between(result.getRequestTime(), result.getCompleteTime()).toMillis()
                     )
             );
-
-            //弃用子任务
-            onDeprecatedSubtask.accept(systemCheckId);
             return new AsyncResult<>(result);
         } catch (InterruptedException | ExecutionException e) {
             LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
@@ -227,7 +279,7 @@ public class GisSurveySystemChecker {
             if (elevationDiffFuture != null) elevationDiffFuture.cancel(true);
 
             //失败信息
-            result.setCheckStatus(CommAsyncStatusEnum.FAIL.getCode());
+            result.setStatus(CommAsyncStatusEnum.FAIL.getCode());
             result.setCompleteTime(LocalDateTime.now());
 
             //弃用子任务

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

@@ -4,11 +4,11 @@ import com.global.base.log.LogLevelFlag;
 import com.global.base.log.LogPrintMgr;
 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.components.AsyncResultManager;
 import com.shkpr.service.alambizplugin.constants.GisMetadataDefine;
 import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
+import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckKeys;
 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;
 import com.shkpr.service.alambizplugin.dto.GisSurveyLayerApplyPoint;
@@ -27,6 +27,7 @@ import org.springframework.util.concurrent.ListenableFuture;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.nio.file.Path;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -58,12 +59,12 @@ public class DuplicatePointsFinder {
      */
     private final String mStrClassName;
     private final String mBizType;
-    private final GisSurveySystemCheckResultManager gisSurveySystemCheckResultManager;
+    private final AsyncResultManager asyncResultManager;
 
-    public DuplicatePointsFinder(GisSurveySystemCheckResultManager gisSurveySystemCheckResultManager) {
+    public DuplicatePointsFinder(AsyncResultManager asyncResultManager) {
         mStrClassName = "DuplicatePointsFinder";
         mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
-        this.gisSurveySystemCheckResultManager = gisSurveySystemCheckResultManager;
+        this.asyncResultManager = asyncResultManager;
     }
 
     /**
@@ -195,15 +196,12 @@ public class DuplicatePointsFinder {
             , GisSurveySystemCheckId systemCheckId, long begin) {
         //数据大小
         final int size = data.size();
-        //结果路径
-        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);
+        //结果flag
+        final String FLAG = systemCheckId.getFlag();
+        //写入json和excel结果
+        Path jsonPath = asyncResultManager.writeJson(data, FLAG, GisSurveySystemCheckKeys.DUPLICATE_POINTS + ".json");
+        Path excelPath = asyncResultManager.writeExcel(GisSurveySystemCheckResultHead.DUPLICATE_POINTS
+                , buildExcel(data), FLAG, GisSurveySystemCheckKeys.DUPLICATE_POINTS + ".xlsx");
 
         long end = System.currentTimeMillis();
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
@@ -215,8 +213,8 @@ public class DuplicatePointsFinder {
 
         //构建结果
         return new GisSurveySystemCheckResultDetail(true
-                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, resultPath)
-                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, excelPath)
+                , FLAG + "/" + jsonPath.getFileName()
+                , FLAG + "/" + excelPath.getFileName()
                 , size);
     }
 

+ 14 - 16
src/main/java/com/shkpr/service/alambizplugin/components/checker/ElevationDiffFinder.java

@@ -3,9 +3,9 @@ package com.shkpr.service.alambizplugin.components.checker;
 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.components.AsyncResultManager;
+import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckKeys;
 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;
 import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckElement;
@@ -19,6 +19,7 @@ import org.springframework.scheduling.annotation.AsyncResult;
 import org.springframework.stereotype.Component;
 import org.springframework.util.concurrent.ListenableFuture;
 
+import java.nio.file.Path;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -37,13 +38,13 @@ public class ElevationDiffFinder {
      */
     private final String mStrClassName;
     private final String mBizType;
-    private final GisSurveySystemCheckResultManager systemCheckResultManager;
+    private final AsyncResultManager asyncResultManager;
 
 
-    public ElevationDiffFinder(GisSurveySystemCheckResultManager systemCheckResultManager) {
+    public ElevationDiffFinder(AsyncResultManager asyncResultManager) {
         mStrClassName = "ElevationDiffFinder";
         mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
-        this.systemCheckResultManager = systemCheckResultManager;
+        this.asyncResultManager = asyncResultManager;
     }
 
     /**
@@ -100,15 +101,12 @@ public class ElevationDiffFinder {
             , GisSurveySystemCheckId systemCheckId, long begin) {
         //数据大小
         final int size = data.size();
-        //结果路径
-        String resultPath = GisSurveySystemCheckResultPath.ELEVATION_DIFF;
-        //excel路径
-        String excelPath = GisSurveySystemCheckResultPath.ELEVATION_DIFF_EXCEL;
-        //写入结果
-        systemCheckResultManager.writeResult(data, systemCheckId, resultPath);
-        //写入excel
-        systemCheckResultManager.writeExcel(GisSurveySystemCheckResultHead.ELEVATION_DIFF,
-                buildExcel(data), systemCheckId, excelPath);
+        //结果flag
+        final String FLAG = systemCheckId.getFlag();
+        //写入json和excel结果
+        Path jsonPath = asyncResultManager.writeJson(data, FLAG, GisSurveySystemCheckKeys.ELEVATION_DIFF + ".json");
+        Path excelPath = asyncResultManager.writeExcel(GisSurveySystemCheckResultHead.ELEVATION_DIFF,
+                buildExcel(data), FLAG, GisSurveySystemCheckKeys.ELEVATION_DIFF + ".xlsx");
 
         long end = System.currentTimeMillis();
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
@@ -120,8 +118,8 @@ public class ElevationDiffFinder {
 
         //构建结果
         return new GisSurveySystemCheckResultDetail(true
-                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, resultPath)
-                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, excelPath)
+                , FLAG + "/" + jsonPath.getFileName()
+                , FLAG + "/" + excelPath.getFileName()
                 , size);
     }
 

+ 14 - 16
src/main/java/com/shkpr/service/alambizplugin/components/checker/IsolatedLinesFinder.java

@@ -4,9 +4,9 @@ package com.shkpr.service.alambizplugin.components.checker;
 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.components.AsyncResultManager;
+import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckKeys;
 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;
 import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckElement;
@@ -17,6 +17,7 @@ import org.springframework.scheduling.annotation.AsyncResult;
 import org.springframework.stereotype.Component;
 import org.springframework.util.concurrent.ListenableFuture;
 
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -37,12 +38,12 @@ public class IsolatedLinesFinder {
      */
     private final String mStrClassName;
     private final String mBizType;
-    private final GisSurveySystemCheckResultManager gisSurveySystemCheckResultManager;
+    private final AsyncResultManager asyncResultManager;
 
-    public IsolatedLinesFinder(GisSurveySystemCheckResultManager gisSurveySystemCheckResultManager) {
+    public IsolatedLinesFinder(AsyncResultManager asyncResultManager) {
         mStrClassName = "IsolatedLinesFinder";
         mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
-        this.gisSurveySystemCheckResultManager = gisSurveySystemCheckResultManager;
+        this.asyncResultManager = asyncResultManager;
     }
 
     /**
@@ -77,15 +78,12 @@ public class IsolatedLinesFinder {
             , GisSurveySystemCheckId systemCheckId, long begin) {
         //数据大小
         final int size = data.size();
-        //结果路径
-        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);
+        //结果flag
+        final String FLAG = systemCheckId.getFlag();
+        //写入json和excel结果
+        Path jsonPath = asyncResultManager.writeJson(data, FLAG, GisSurveySystemCheckKeys.ISOLATED_LINES + ".json");
+        Path excelPath = asyncResultManager.writeExcel(GisSurveySystemCheckResultHead.ISOLATED_LINES,
+                buildExcel(data), FLAG, GisSurveySystemCheckKeys.ISOLATED_LINES + ".xlsx");
 
         long end = System.currentTimeMillis();
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
@@ -97,8 +95,8 @@ public class IsolatedLinesFinder {
 
         //构建结果
         return new GisSurveySystemCheckResultDetail(true
-                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, resultPath)
-                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, excelPath)
+                , FLAG + "/" + jsonPath.getFileName()
+                , FLAG + "/" + excelPath.getFileName()
                 , size);
     }
 

+ 14 - 16
src/main/java/com/shkpr/service/alambizplugin/components/checker/IsolatedPointsFinder.java

@@ -4,9 +4,9 @@ package com.shkpr.service.alambizplugin.components.checker;
 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.components.AsyncResultManager;
+import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckKeys;
 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;
 import com.shkpr.service.alambizplugin.dto.GisSurveyLayerApplyPoint;
@@ -19,6 +19,7 @@ import org.springframework.scheduling.annotation.AsyncResult;
 import org.springframework.stereotype.Component;
 import org.springframework.util.concurrent.ListenableFuture;
 
+import java.nio.file.Path;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -38,12 +39,12 @@ public class IsolatedPointsFinder {
      */
     private final String mStrClassName;
     private final String mBizType;
-    private final GisSurveySystemCheckResultManager systemCheckResultManager;
+    private final AsyncResultManager asyncResultManager;
 
-    public IsolatedPointsFinder(GisSurveySystemCheckResultManager systemCheckResultManager) {
+    public IsolatedPointsFinder(AsyncResultManager asyncResultManager) {
         mStrClassName = "IsolatedPointsFinder";
         mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
-        this.systemCheckResultManager = systemCheckResultManager;
+        this.asyncResultManager = asyncResultManager;
     }
 
     /**
@@ -108,15 +109,12 @@ public class IsolatedPointsFinder {
             , GisSurveySystemCheckId systemCheckId, long begin) {
         //数据大小
         final int size = data.size();
-        //结果路径
-        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);
+        //结果flag
+        final String FLAG = systemCheckId.getFlag();
+        //写入json和excel结果
+        Path jsonPath = asyncResultManager.writeJson(data, FLAG, GisSurveySystemCheckKeys.ISOLATED_POINTS + ".json");
+        Path excelPath = asyncResultManager.writeExcel(GisSurveySystemCheckResultHead.ISOLATED_POINTS,
+                buildExcel(data), FLAG, GisSurveySystemCheckKeys.ISOLATED_POINTS + ".xlsx");
 
         long end = System.currentTimeMillis();
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
@@ -128,8 +126,8 @@ public class IsolatedPointsFinder {
 
         //构建结果
         return new GisSurveySystemCheckResultDetail(true
-                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, resultPath)
-                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, excelPath)
+                , FLAG + "/" + jsonPath.getFileName()
+                , FLAG + "/" + excelPath.getFileName()
                 , size);
     }
 

+ 14 - 16
src/main/java/com/shkpr/service/alambizplugin/components/checker/OverlapLinesFinder.java

@@ -3,9 +3,9 @@ package com.shkpr.service.alambizplugin.components.checker;
 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.components.AsyncResultManager;
+import com.shkpr.service.alambizplugin.constants.GisSurveySystemCheckKeys;
 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;
 import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckElement;
@@ -19,6 +19,7 @@ import org.springframework.scheduling.annotation.AsyncResult;
 import org.springframework.stereotype.Component;
 import org.springframework.util.concurrent.ListenableFuture;
 
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -42,12 +43,12 @@ public class OverlapLinesFinder {
      */
     private final String mStrClassName;
     private final String mBizType;
-    private final GisSurveySystemCheckResultManager gisSurveySystemCheckResultManager;
+    private final AsyncResultManager asyncResultManager;
 
-    public OverlapLinesFinder(GisSurveySystemCheckResultManager gisSurveySystemCheckResultManager) {
+    public OverlapLinesFinder(AsyncResultManager asyncResultManager) {
         mStrClassName = "OverlapLinesFinder";
         mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
-        this.gisSurveySystemCheckResultManager = gisSurveySystemCheckResultManager;
+        this.asyncResultManager = asyncResultManager;
     }
 
     /**
@@ -135,15 +136,12 @@ public class OverlapLinesFinder {
             , GisSurveySystemCheckId systemCheckId, long begin) {
         //数据大小
         final int size = data.size();
-        //结果路径
-        String resultPath = GisSurveySystemCheckResultPath.OVERLAP_LINES;
-        //excel路径
-        String excelPath = GisSurveySystemCheckResultPath.OVERLAP_LINES_EXCEL;
-        //写入文件
-        gisSurveySystemCheckResultManager.writeResult(data, systemCheckId, resultPath);
-        //写入excel
-        gisSurveySystemCheckResultManager.writeExcel(GisSurveySystemCheckResultHead.OVERLAP_LINES,
-                buildExcel(data), systemCheckId, excelPath);
+        //结果flag
+        final String FLAG = systemCheckId.getFlag();
+        //写入json和excel结果
+        Path jsonPath = asyncResultManager.writeJson(data, FLAG, GisSurveySystemCheckKeys.OVERLAP_LINES + ".json");
+        Path excelPath = asyncResultManager.writeExcel(GisSurveySystemCheckResultHead.OVERLAP_LINES,
+                buildExcel(data), FLAG, GisSurveySystemCheckKeys.OVERLAP_LINES + ".xlsx");
 
         long end = System.currentTimeMillis();
         LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_INFO, mBizType, mStrClassName
@@ -155,8 +153,8 @@ public class OverlapLinesFinder {
 
         //构建结果
         return new GisSurveySystemCheckResultDetail(true
-                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, resultPath)
-                , GisSurveySystemCheckResultPath.relativePath(systemCheckId, excelPath)
+                , FLAG + "/" + jsonPath.getFileName()
+                , FLAG + "/" + excelPath.getFileName()
                 , size);
     }
 

+ 1 - 8
src/main/java/com/shkpr/service/alambizplugin/configuration/WebMvcConfiguration.java

@@ -2,7 +2,6 @@ package com.shkpr.service.alambizplugin.configuration;
 
 import com.shkpr.service.alambizplugin.SpringContextUtil;
 import com.shkpr.service.alambizplugin.commproperties.AsyncTaskProperties;
-import com.shkpr.service.alambizplugin.commproperties.GisSurveySystemCheckProperties;
 import com.shkpr.service.alambizplugin.commproperties.TempFileProperties;
 import com.shkpr.service.alambizplugin.constants.ApiURI;
 import com.shkpr.service.alambizplugin.interfaces.URIInterceptorIntef;
@@ -32,13 +31,10 @@ import java.util.TreeMap;
 @Configuration
 @EnableWebMvc
 public class WebMvcConfiguration implements WebMvcConfigurer {
-    private final GisSurveySystemCheckProperties systemCheckProperties;
     private final TempFileProperties tempFileProperties;
     private final AsyncTaskProperties asyncTaskProperties;
 
-    public WebMvcConfiguration(GisSurveySystemCheckProperties systemCheckProperties
-    , TempFileProperties tempFileProperties , AsyncTaskProperties asyncTaskProperties) {
-        this.systemCheckProperties = systemCheckProperties;
+    public WebMvcConfiguration(TempFileProperties tempFileProperties , AsyncTaskProperties asyncTaskProperties) {
         this.tempFileProperties = tempFileProperties;
         this.asyncTaskProperties = asyncTaskProperties;
     }
@@ -48,9 +44,6 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
      */
     @Override
     public void addResourceHandlers(ResourceHandlerRegistry registry) {
-        //系统检查结果映射
-        registry.addResourceHandler(ApiURI.URI_GIS_SURVEY_H + "/" + ApiURI.URI_XXX_SYS_CHECK_RESULTS + "/**")
-                .addResourceLocations("file:" + systemCheckProperties.getResourcePath() + "/");
         //临时文件映射
         registry.addResourceHandler(ApiURI.URI_GIS_SURVEY_H + "/" + ApiURI.URI_XXX_TEMP_FILES + "/**")
                 .addResourceLocations("file:" + tempFileProperties.getResourcePath() + "/");

+ 30 - 0
src/main/java/com/shkpr/service/alambizplugin/constants/GisSurveySystemCheckKeys.java

@@ -0,0 +1,30 @@
+package com.shkpr.service.alambizplugin.constants;
+
+/**
+ * 系统检查key
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+public interface GisSurveySystemCheckKeys {
+    /**
+     * 孤立点
+     */
+    String ISOLATED_POINTS = "isolatedPoints";
+    /**
+     * 孤立线
+     */
+    String ISOLATED_LINES = "isolatedLines";
+    /**
+     * 重复点
+     */
+    String DUPLICATE_POINTS = "duplicatePoints";
+    /**
+     * 重叠线
+     */
+    String OVERLAP_LINES = "overlapLines";
+    /**
+     * 高程差异常
+     */
+    String ELEVATION_DIFF = "elevationDiff";
+}

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

@@ -1,67 +0,0 @@
-package com.shkpr.service.alambizplugin.constants;
-
-import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckId;
-
-/**
- * 系统检查结果路径
- *
- * @author 欧阳劲驰
- * @since 1.0.0
- */
-public class GisSurveySystemCheckResultPath {
-    /**
-     * 结果
-     */
-    public final static String RESULT = "result.json";
-    /**
-     * 孤立点
-     */
-    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";
-    /**
-     * 高程差异常
-     */
-    public final static String ELEVATION_DIFF = "elevationDiff.json";
-    /**
-     * 高程差异常excel
-     */
-    public final static String ELEVATION_DIFF_EXCEL = "elevationDiff.xlsx";
-
-    /**
-     * 获取相对路径
-     *
-     * @param systemCheckId 系统检查id
-     * @param fileName      文件名
-     * @return 相对路径
-     */
-    public static String relativePath(GisSurveySystemCheckId systemCheckId, String fileName) {
-        return systemCheckId.getCheckType().getFlag() + "-" + systemCheckId.getCode() + "/" + fileName;
-    }
-}

+ 8 - 8
src/main/java/com/shkpr/service/alambizplugin/controller/ApiGisSurveyController.java

@@ -25,7 +25,7 @@ import com.shkpr.service.alambizplugin.dbdao.services.GisSurveyLayerApplyThirdCo
 import com.shkpr.service.alambizplugin.dbdao.services.intef.GisSurveyLayerApplyService;
 import com.shkpr.service.alambizplugin.dto.CommAsyncResult;
 import com.shkpr.service.alambizplugin.dto.GisSurveyLayerApplyThirdCopy;
-import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckResult;
+import com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckResultDetail;
 import com.shkpr.service.alambizplugin.dto.GisSurveyThirdImportResult;
 import com.shkpr.service.alambizplugin.dto.PageResponse;
 import com.shkpr.service.alambizplugin.dto.ResponseRes;
@@ -129,7 +129,7 @@ public class ApiGisSurveyController {
         final String URI_PATH = request.getRequestURI();
         final String strPlatform = CommTool.getPlatformByAgent(strClientType, strUserAgent);
         final String strUserId = (String) request.getAttribute(TokenAuthenticationService.HEADER_USERID);
-        if (oJsonParam == null || bindRes.hasErrors() || !oJsonParam.checkValid()) {
+        if (oJsonParam == null || CollectionUtils.isEmpty(oJsonParam.getSubitemKeys()) || bindRes.hasErrors() || !oJsonParam.checkValid()) {
             throw new SelfException(ResponseCode.STATUS_ERROR_JSON_FORMAT.toStrCode()
                     , String.format(ApiURI.EXCEPTION_FORMAT
                     , strPlatform
@@ -151,7 +151,7 @@ public class ApiGisSurveyController {
         resResult.setResmsg(ResponseCode.RESULT_SYSTEM_CHECK_FAILED.toStrMsg());
 
         //执行系统检查
-        GisSurveySystemCheckResult result = systemCheckBizService.sysCheckFun(oJsonParam);
+        CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>> result = systemCheckBizService.sysCheckFun(oJsonParam);
         String resultStr = null;
         try {
             if (result != null) resultStr = objectMapper.writeValueAsString(result);
@@ -161,13 +161,13 @@ public class ApiGisSurveyController {
         }
 
         //执行成功
-        if (resultStr != null && !Objects.equals(result.getCheckStatus(), CommAsyncStatusEnum.FAIL.getCode())) {
+        if (resultStr != null && !Objects.equals(result.getStatus(), CommAsyncStatusEnum.FAIL.getCode())) {
             resResult.setRescode(ResponseCode.RESULT_NORMAL.toStrCode());
             resResult.setResmsg(ResponseCode.RESULT_NORMAL.toStrMsg());
             resResult.setResdata(resultStr);
         }
         //执行失败
-        if (resultStr != null && Objects.equals(result.getCheckStatus(), CommAsyncStatusEnum.FAIL.getCode())) {
+        if (resultStr != null && Objects.equals(result.getStatus(), CommAsyncStatusEnum.FAIL.getCode())) {
             resResult.setResdata(resultStr);
         }
         //结果为空
@@ -231,14 +231,14 @@ public class ApiGisSurveyController {
         resResult.setRescode(ResponseCode.RESULT_SYSTEM_CHECK_CANCEL_FAILED.toStrCode());
         resResult.setResmsg(ResponseCode.RESULT_SYSTEM_CHECK_CANCEL_FAILED.toStrMsg());
         //清除检查
-        GisSurveySystemCheckResult cancelCheck = systemCheckBizService.cancelCheck(oJsonParam);
+        Integer cancelCheck = systemCheckBizService.cancelCheck(oJsonParam);
         //成功
-        if (Objects.equals(cancelCheck.getCheckStatus(), CommAsyncStatusEnum.SUCCESS.getCode())) {
+        if (Objects.equals(cancelCheck, CommAsyncStatusEnum.SUCCESS.getCode())) {
             resResult.setRescode(ResponseCode.RESULT_NORMAL.toStrCode());
             resResult.setResmsg(ResponseCode.RESULT_NORMAL.toStrMsg());
         }
         //不存在
-        else if (Objects.equals(cancelCheck.getCheckStatus(), CommAsyncStatusEnum.NOT_EXISTS.getCode())) {
+        else if (Objects.equals(cancelCheck, CommAsyncStatusEnum.NOT_EXISTS.getCode())) {
             resResult.setRescode(ResponseCode.RESULT_SYSTEM_CHECK_NOT_FOUND.toStrCode());
             resResult.setResmsg(ResponseCode.RESULT_SYSTEM_CHECK_NOT_FOUND.toStrMsg());
         }

+ 21 - 0
src/main/java/com/shkpr/service/alambizplugin/dbdao/mapper/GisSurveySystemCheckDefineMapper.java

@@ -0,0 +1,21 @@
+package com.shkpr.service.alambizplugin.dbdao.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 系统检查项定义mapper
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@Mapper
+public interface GisSurveySystemCheckDefineMapper {
+    /**
+     * 获取key集合
+     *
+     * @return key集合
+     */
+    List<String> findKeys();
+}

+ 33 - 0
src/main/java/com/shkpr/service/alambizplugin/dbdao/services/GisSurveySystemCheckDefineServiceImpl.java

@@ -0,0 +1,33 @@
+package com.shkpr.service.alambizplugin.dbdao.services;
+
+import com.shkpr.service.alambizplugin.dbdao.mapper.GisSurveySystemCheckDefineMapper;
+import com.shkpr.service.alambizplugin.dbdao.services.intef.GisSurveySystemCheckDefineService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 系统检查项定义service实现
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+@Service
+public class GisSurveySystemCheckDefineServiceImpl implements GisSurveySystemCheckDefineService {
+    final
+    GisSurveySystemCheckDefineMapper systemCheckDefineMapper;
+
+    public GisSurveySystemCheckDefineServiceImpl(GisSurveySystemCheckDefineMapper systemCheckDefineMapper) {
+        this.systemCheckDefineMapper = systemCheckDefineMapper;
+    }
+
+    /**
+     * 获取key集合
+     *
+     * @return key集合
+     */
+    @Override
+    public List<String> findKeys() {
+        return systemCheckDefineMapper.findKeys();
+    }
+}

+ 18 - 0
src/main/java/com/shkpr/service/alambizplugin/dbdao/services/intef/GisSurveySystemCheckDefineService.java

@@ -0,0 +1,18 @@
+package com.shkpr.service.alambizplugin.dbdao.services.intef;
+
+import java.util.List;
+
+/**
+ * 系统检查项定义service
+ *
+ * @author 欧阳劲驰
+ * @since 1.0.0
+ */
+public interface GisSurveySystemCheckDefineService {
+    /**
+     * 获取key集合
+     *
+     * @return key集合
+     */
+    List<String> findKeys();
+}

+ 17 - 2
src/main/java/com/shkpr/service/alambizplugin/dto/CommAsyncCache.java

@@ -1,11 +1,11 @@
 package com.shkpr.service.alambizplugin.dto;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.AllArgsConstructor;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.time.LocalDateTime;
+import java.util.List;
 
 /**
  * 通用异步缓存
@@ -14,7 +14,6 @@ import java.time.LocalDateTime;
  * @since 1.0.0
  */
 @Data
-@AllArgsConstructor
 public class CommAsyncCache {
     /**
      * 启动时间
@@ -27,4 +26,20 @@ public class CommAsyncCache {
      * 操作人
      */
     private String operator;
+
+    /**
+     * 启动的子项key
+     */
+    private List<String> subitemKeys;
+
+    public CommAsyncCache(LocalDateTime startTime, String operator) {
+        this.startTime = startTime;
+        this.operator = operator;
+    }
+
+    public CommAsyncCache(LocalDateTime startTime, String operator, List<String> subitemKeys) {
+        this.startTime = startTime;
+        this.operator = operator;
+        this.subitemKeys = subitemKeys;
+    }
 }

+ 39 - 0
src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveySystemCheckDefine.java

@@ -0,0 +1,39 @@
+package com.shkpr.service.alambizplugin.dto;
+
+import lombok.Data;
+
+/**
+ * 系统检查项定义
+ */
+@Data
+public class GisSurveySystemCheckDefine {
+    /**
+    * 检查项key
+    */
+    private String key;
+
+    /**
+    * 检查项名称
+    */
+    private String name;
+
+    /**
+    * 相关函数(预留备用)
+    */
+    private String functions;
+
+    /**
+    * 相关参数(预留备用)
+    */
+    private String params;
+
+    /**
+    * 详细描述
+    */
+    private String remarks;
+
+    /**
+    * 显示顺序
+    */
+    private Short ordering;
+}

+ 13 - 2
src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveySystemCheckId.java

@@ -4,7 +4,6 @@ import com.shkpr.service.alambizplugin.apiparam.GisSurveyCheckParams;
 import com.shkpr.service.alambizplugin.constants.GisSurveyCheckTypeEnum;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
-import lombok.ToString;
 
 import java.util.Arrays;
 import java.util.Objects;
@@ -17,9 +16,12 @@ import java.util.Objects;
  */
 @Getter
 @AllArgsConstructor
-@ToString
 public class GisSurveySystemCheckId {
     /**
+     * 前缀
+     */
+    private static final String PREFIX = "system-check";
+    /**
      * 检查类型:0:项目,1:任务
      */
     private final GisSurveyCheckTypeEnum checkType;
@@ -51,6 +53,10 @@ public class GisSurveySystemCheckId {
         return null;
     }
 
+    public String getFlag() {
+        return PREFIX + "-" + this.checkType + "-" + this.code;
+    }
+
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
@@ -63,4 +69,9 @@ public class GisSurveySystemCheckId {
     public int hashCode() {
         return Objects.hash(checkType, code);
     }
+
+    @Override
+    public String toString() {
+        return this.checkType + "-" + this.code;
+    }
 }

+ 0 - 136
src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveySystemCheckResult.java

@@ -1,136 +0,0 @@
-package com.shkpr.service.alambizplugin.dto;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.shkpr.service.alambizplugin.apiparam.GisSurveyCheckParams;
-import com.shkpr.service.alambizplugin.constants.CommAsyncStatusEnum;
-import lombok.Data;
-import org.springframework.beans.BeanUtils;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.time.LocalDateTime;
-
-/**
- * 系统检查返回dto
- *
- * @author 欧阳劲驰
- * @since 1.0.0
- */
-@Data
-public class GisSurveySystemCheckResult {
-    /**
-     * 检查状态:0:进行中,1:成功,2:失败,3:不存在
-     */
-    private Integer checkStatus;
-    /**
-     * 检查类型:0:项目,1:任务
-     */
-    private Integer checkType;
-    /**
-     * 项目id
-     */
-    private String projId;
-    /**
-     * 任务id
-     */
-    private String jobId;
-    /**
-     * 当前操作人id
-     */
-    private String operator;
-    /**
-     * 请求检查时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "Asia/Shanghai")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime requestTime;
-    /**
-     * 完成检查时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "Asia/Shanghai")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime completeTime;
-    /**
-     * 元素/属性的变化时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "Asia/Shanghai")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private LocalDateTime refreshTime;
-    /**
-     * 孤立点结果
-     */
-    private GisSurveySystemCheckResultDetail isolatedPointsResult = new GisSurveySystemCheckResultDetail();
-    /**
-     * 孤立线结果
-     */
-    private GisSurveySystemCheckResultDetail isolatedLinesResult = new GisSurveySystemCheckResultDetail();
-    /**
-     * 重复点结果
-     */
-    private GisSurveySystemCheckResultDetail duplicatePointsResult = new GisSurveySystemCheckResultDetail();
-    /**
-     * 重叠线结果
-     */
-    private GisSurveySystemCheckResultDetail overlapLinesResult = new GisSurveySystemCheckResultDetail();
-    /**
-     * 高程差异常结果
-     */
-    private GisSurveySystemCheckResultDetail elevationDiffResult = new GisSurveySystemCheckResultDetail();
-    /**
-     * 进行中
-     */
-    public static GisSurveySystemCheckResult inProgress(GisSurveyCheckParams params, GisSurveySystemCheckSubtask subtask, LocalDateTime requestTime) {
-        GisSurveySystemCheckResult result = new GisSurveySystemCheckResult();
-        BeanUtils.copyProperties(params, result);
-
-        //设置子任务状态
-        if (subtask != null) {
-            if (subtask.getIsolatedPointsFuture() != null)
-                result.getIsolatedPointsResult().setDone(subtask.getIsolatedPointsFuture().isDone());
-            if (subtask.getIsolatedLinesFuture() != null)
-                result.getIsolatedLinesResult().setDone(subtask.getIsolatedLinesFuture().isDone());
-            if (subtask.getDuplicatePointsFuture() != null)
-                result.getDuplicatePointsResult().setDone(subtask.getDuplicatePointsFuture().isDone());
-            if (subtask.getOverlapLinesFuture() != null)
-                result.getOverlapLinesResult().setDone(subtask.getOverlapLinesFuture().isDone());
-            if (subtask.getElevationDiffFuture() != null)
-                result.getElevationDiffResult().setDone(subtask.getElevationDiffFuture().isDone());
-        }
-
-        result.setCheckStatus(CommAsyncStatusEnum.IN_PROGRESS.getCode());
-        result.setRequestTime(requestTime);
-        return result;
-    }
-
-    /**
-     * 成功
-     */
-    public static GisSurveySystemCheckResult success(GisSurveyCheckParams params) {
-        GisSurveySystemCheckResult result = new GisSurveySystemCheckResult();
-        BeanUtils.copyProperties(params, result);
-        result.setCheckStatus(CommAsyncStatusEnum.SUCCESS.getCode());
-        result.setRequestTime(LocalDateTime.now());
-        return result;
-    }
-
-    /**
-     * 失败
-     */
-    public static GisSurveySystemCheckResult fail(GisSurveyCheckParams params) {
-        GisSurveySystemCheckResult result = new GisSurveySystemCheckResult();
-        BeanUtils.copyProperties(params, result);
-        result.setCheckStatus(CommAsyncStatusEnum.FAIL.getCode());
-        result.setRequestTime(LocalDateTime.now());
-        return result;
-    }
-
-    /**
-     * 不存在
-     */
-    public static GisSurveySystemCheckResult notExists(GisSurveyCheckParams params) {
-        GisSurveySystemCheckResult result = new GisSurveySystemCheckResult();
-        BeanUtils.copyProperties(params, result);
-        result.setCheckStatus(CommAsyncStatusEnum.NOT_EXISTS.getCode());
-        return result;
-    }
-
-}

+ 0 - 38
src/main/java/com/shkpr/service/alambizplugin/dto/GisSurveySystemCheckSubtask.java

@@ -1,38 +0,0 @@
-package com.shkpr.service.alambizplugin.dto;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.util.concurrent.ListenableFuture;
-
-/**
- * 系统检查子任务
- *
- * @author 欧阳劲驰
- * @since 0.0.1
- */
-@Getter
-@Setter
-@AllArgsConstructor
-public class GisSurveySystemCheckSubtask {
-    /**
-     * 孤立点任务
-     */
-    private ListenableFuture<GisSurveySystemCheckResultDetail> isolatedPointsFuture;
-    /**
-     * 孤立线任务
-     */
-    private ListenableFuture<GisSurveySystemCheckResultDetail> IsolatedLinesFuture;
-    /**
-     * 重复点任务
-     */
-    private ListenableFuture<GisSurveySystemCheckResultDetail> duplicatePointsFuture;
-    /**
-     * 重叠线任务
-     */
-    private ListenableFuture<GisSurveySystemCheckResultDetail> overlapLinesFuture;
-    /**
-     * 高程差异常任务
-     */
-    private ListenableFuture<GisSurveySystemCheckResultDetail> elevationDiffFuture;
-}

+ 1 - 5
src/main/resources/application.properties

@@ -138,11 +138,6 @@ fdfs.pool.max-wait-millis=5000
 #fdfs的目标代理地址(主要用于获取或显示用)
 des.proxy.fdfs=http://116.63.130.83:9999
 
-#=============系统检查========================
-#资源路径
-system-check.resource-path=/home/kprCloud/alam_dma_kpr_plugin/sys-check-results/
-#结果滞后时间
-system-check.result-lag-duration=30m
 #=============cad转换========================
 #栅格化最小宽度
 cad-convert.rasterization-min-width=800
@@ -150,6 +145,7 @@ cad-convert.rasterization-min-width=800
 cad-convert.rasterization-min-height=800
 #=============异步任务========================
 async-task.system-check-timeout=PT1H
+async-task.system-check-result-lag=PT30M
 async-task.third-import-timeout=PT30M
 async-task.third-export-timeout=PT30M
 async-task.third-export-result-lag=PT1S

+ 18 - 0
src/main/resources/mapper/GisSurveySystemCheckDefineMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.shkpr.service.alambizplugin.dbdao.mapper.GisSurveySystemCheckDefineMapper">
+    <resultMap id="BaseResultMap" type="com.shkpr.service.alambizplugin.dto.GisSurveySystemCheckDefine">
+        <!--@Table k3_gis_survey_system_check_define-->
+        <id column="key" jdbcType="VARCHAR" property="key"/>
+        <result column="name" jdbcType="VARCHAR" property="name"/>
+        <result column="functions" jdbcType="VARCHAR" property="functions"/>
+        <result column="params" jdbcType="VARCHAR" property="params"/>
+        <result column="remarks" jdbcType="VARCHAR" property="remarks"/>
+        <result column="ordering" jdbcType="SMALLINT" property="ordering"/>
+    </resultMap>
+
+    <select id="findKeys" resultType="java.lang.String">
+        select key
+        from k3_gis_survey_system_check_define
+    </select>
+</mapper>