|
@@ -6,6 +6,7 @@ import com.global.base.log.LogPrintMgr;
|
|
|
import com.shkpr.service.alambizplugin.apiparam.GisSurveyCheckParams;
|
|
|
import com.shkpr.service.alambizplugin.components.checker.DuplicatePointsFinder;
|
|
|
import com.shkpr.service.alambizplugin.components.checker.ElevationDiffFinder;
|
|
|
+import com.shkpr.service.alambizplugin.components.checker.InvalidLinesFinder;
|
|
|
import com.shkpr.service.alambizplugin.components.checker.IsolatedLinesFinder;
|
|
|
import com.shkpr.service.alambizplugin.components.checker.IsolatedPointsFinder;
|
|
|
import com.shkpr.service.alambizplugin.components.checker.OverlapLinesFinder;
|
|
@@ -56,14 +57,15 @@ public class GisSurveySystemChecker {
|
|
|
private final IsolatedPointsFinder isolatedPointsFinder;
|
|
|
private final IsolatedLinesFinder isolatedLinesFinder;
|
|
|
private final DuplicatePointsFinder duplicatePointsFinder;
|
|
|
+ private final InvalidLinesFinder invalidLinesFinder;
|
|
|
private final OverlapLinesFinder overlapLinesFinder;
|
|
|
private final ElevationDiffFinder elevationDiffFinder;
|
|
|
|
|
|
public GisSurveySystemChecker(AsyncResultManager asyncResultManager
|
|
|
, GisSurveyLayerApplyService gisSurveyLayerApplyService, TypeDefineService typeDefineService
|
|
|
, IsolatedPointsFinder isolatedPointsFinder, IsolatedLinesFinder isolatedLinesFinder
|
|
|
- , DuplicatePointsFinder duplicatePointsFinder, OverlapLinesFinder overlapLinesFinder
|
|
|
- , ElevationDiffFinder elevationDiffFinder) {
|
|
|
+ , DuplicatePointsFinder duplicatePointsFinder, InvalidLinesFinder invalidLinesFinder
|
|
|
+ , OverlapLinesFinder overlapLinesFinder, ElevationDiffFinder elevationDiffFinder) {
|
|
|
mStrClassName = "GisSurveySystemChecker";
|
|
|
mBizType = LogFlagBusiType.BUSI_GIS_SURVEY.toStrValue();
|
|
|
this.asyncResultManager = asyncResultManager;
|
|
@@ -72,6 +74,7 @@ public class GisSurveySystemChecker {
|
|
|
this.isolatedPointsFinder = isolatedPointsFinder;
|
|
|
this.isolatedLinesFinder = isolatedLinesFinder;
|
|
|
this.duplicatePointsFinder = duplicatePointsFinder;
|
|
|
+ this.invalidLinesFinder = invalidLinesFinder;
|
|
|
this.overlapLinesFinder = overlapLinesFinder;
|
|
|
this.elevationDiffFinder = elevationDiffFinder;
|
|
|
}
|
|
@@ -103,6 +106,8 @@ public class GisSurveySystemChecker {
|
|
|
ListenableFuture<GisSurveySystemCheckResultDetail> isolatedLinesFuture = null;
|
|
|
//重复点任务
|
|
|
ListenableFuture<GisSurveySystemCheckResultDetail> duplicatePointsFuture = null;
|
|
|
+ //无效线任务
|
|
|
+ ListenableFuture<GisSurveySystemCheckResultDetail> invalidLinesFuture = null;
|
|
|
//重叠线任务
|
|
|
ListenableFuture<GisSurveySystemCheckResultDetail> overlapLinesFuture = null;
|
|
|
//高程差任务
|
|
@@ -152,6 +157,13 @@ public class GisSurveySystemChecker {
|
|
|
subtask.put(GisSurveySystemCheckKeys.ISOLATED_POINTS, isolatedPointsFuture);
|
|
|
}
|
|
|
}
|
|
|
+ //无效线检查
|
|
|
+ if (points != null && lines != null) {
|
|
|
+ if (params.getSubitemKeys().contains(GisSurveySystemCheckKeys.INVALID_LINES)) {
|
|
|
+ invalidLinesFuture = invalidLinesFinder.finderInvalidLines(points, lines, systemCheckId);
|
|
|
+ subtask.put(GisSurveySystemCheckKeys.INVALID_LINES, invalidLinesFuture);
|
|
|
+ }
|
|
|
+ }
|
|
|
//重复点检查
|
|
|
if (points != null) {
|
|
|
if (params.getSubitemKeys().contains(GisSurveySystemCheckKeys.DUPLICATE_POINTS)) {
|
|
@@ -182,7 +194,7 @@ public class GisSurveySystemChecker {
|
|
|
CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>> lastResult = asyncResultManager.getResult(FLAG, new TypeReference<CommAsyncResult<Map<String, GisSurveySystemCheckResultDetail>>>() {
|
|
|
});
|
|
|
//设置数据
|
|
|
- Map<String, GisSurveySystemCheckResultDetail> data = new HashMap<>();
|
|
|
+ Map<String, GisSurveySystemCheckResultDetail> data = new HashMap<>();
|
|
|
if (lastResult != null && lastResult.getData() != null) data = lastResult.getData();
|
|
|
//设置数据时间
|
|
|
Map<String, LocalDateTime> refreshTimes = new HashMap<>();
|
|
@@ -194,16 +206,16 @@ public class GisSurveySystemChecker {
|
|
|
final GisSurveySystemCheckResultDetail isolatedPointsResult = isolatedPointsFuture.get();
|
|
|
data.put(GisSurveySystemCheckKeys.ISOLATED_POINTS, isolatedPointsResult);
|
|
|
refreshTimes.put(GisSurveySystemCheckKeys.ISOLATED_POINTS, params.getRefreshTime());
|
|
|
- //释放点缓存(孤立点和重复点都完成时,后续不需要点数据,释放缓存节省内存)
|
|
|
- if (duplicatePointsFuture != null && duplicatePointsFuture.isDone()) points.clear();
|
|
|
+ //释放点缓存
|
|
|
+ clearPoints(points, isolatedPointsFuture, duplicatePointsFuture, invalidLinesFuture);
|
|
|
}
|
|
|
if (duplicatePointsFuture != null) {
|
|
|
//监听重复点
|
|
|
final GisSurveySystemCheckResultDetail duplicatePointsResult = duplicatePointsFuture.get();
|
|
|
data.put(GisSurveySystemCheckKeys.DUPLICATE_POINTS, duplicatePointsResult);
|
|
|
refreshTimes.put(GisSurveySystemCheckKeys.DUPLICATE_POINTS, params.getRefreshTime());
|
|
|
- //释放点缓存(孤立点和重复点都完成时,后续不需要点数据,释放缓存节省内存)
|
|
|
- if (isolatedPointsFuture != null && isolatedPointsFuture.isDone()) points.clear();
|
|
|
+ //释放点缓存
|
|
|
+ clearPoints(points, isolatedPointsFuture, duplicatePointsFuture, invalidLinesFuture);
|
|
|
}
|
|
|
if (isolatedLinesFuture != null) {
|
|
|
//监听孤立线
|
|
@@ -211,6 +223,14 @@ public class GisSurveySystemChecker {
|
|
|
data.put(GisSurveySystemCheckKeys.ISOLATED_LINES, isolatedLinesResult);
|
|
|
refreshTimes.put(GisSurveySystemCheckKeys.ISOLATED_LINES, params.getRefreshTime());
|
|
|
}
|
|
|
+ if (invalidLinesFuture != null) {
|
|
|
+ //监听无效线
|
|
|
+ final GisSurveySystemCheckResultDetail invalidLinesResult = invalidLinesFuture.get();
|
|
|
+ data.put(GisSurveySystemCheckKeys.INVALID_LINES, invalidLinesResult);
|
|
|
+ refreshTimes.put(GisSurveySystemCheckKeys.INVALID_LINES, params.getRefreshTime());
|
|
|
+ //释放点缓存
|
|
|
+ clearPoints(points, isolatedPointsFuture, duplicatePointsFuture, invalidLinesFuture);
|
|
|
+ }
|
|
|
if (overlapLinesFuture != null) {
|
|
|
//监听重叠线
|
|
|
final GisSurveySystemCheckResultDetail overlapLinesResult = overlapLinesFuture.get();
|
|
@@ -275,6 +295,7 @@ public class GisSurveySystemChecker {
|
|
|
if (isolatedPointsFuture != null) isolatedPointsFuture.cancel(true);
|
|
|
if (isolatedLinesFuture != null) isolatedLinesFuture.cancel(true);
|
|
|
if (duplicatePointsFuture != null) duplicatePointsFuture.cancel(true);
|
|
|
+ if (invalidLinesFuture != null) invalidLinesFuture.cancel(true);
|
|
|
if (overlapLinesFuture != null) overlapLinesFuture.cancel(true);
|
|
|
if (elevationDiffFuture != null) elevationDiffFuture.cancel(true);
|
|
|
|
|
@@ -287,4 +308,22 @@ public class GisSurveySystemChecker {
|
|
|
return new AsyncResult<>(result);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 清除点缓存
|
|
|
+ *
|
|
|
+ * @param points 点集合
|
|
|
+ * @param isolatedPointsFuture 孤立点任务
|
|
|
+ * @param duplicatePointsFuture 重复点任务
|
|
|
+ * @param invalidLinesFuture 无效线任务
|
|
|
+ */
|
|
|
+ public void clearPoints(List<GisSurveyLayerApplyPoint> points
|
|
|
+ , ListenableFuture<GisSurveySystemCheckResultDetail> isolatedPointsFuture
|
|
|
+ , ListenableFuture<GisSurveySystemCheckResultDetail> duplicatePointsFuture
|
|
|
+ , ListenableFuture<GisSurveySystemCheckResultDetail> invalidLinesFuture) {
|
|
|
+ //点相关任务都完成,则清除缓存
|
|
|
+ if (isolatedPointsFuture != null && isolatedPointsFuture.isDone() &&
|
|
|
+ duplicatePointsFuture != null && duplicatePointsFuture.isDone() &&
|
|
|
+ invalidLinesFuture != null && invalidLinesFuture.isDone()) points.clear();
|
|
|
+ }
|
|
|
}
|