Bläddra i källkod

修复空指针问题

欧阳劲驰 2 månader sedan
förälder
incheckning
8228790fc6

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

@@ -75,9 +75,9 @@ public class GisSurveySystemCheckResultManager {
             //打印报错信息
             LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
                     , String.format(
-                            "监测到io异常 系统检查id:%s msg:%s"
+                            "监测到io异常 系统检查id:%s error:%s"
                             , systemCheckId
-                            , e.getMessage()
+                            , e
                     )
             );
             return null;

+ 3 - 2
src/main/java/com/shkpr/service/alambizplugin/components/GisSurveySystemChecker.java

@@ -195,9 +195,10 @@ public class GisSurveySystemChecker {
         } catch (InterruptedException | ExecutionException e) {
             LogPrintMgr.getInstance().printLogMsg(LogLevelFlag.LOG_ERROR, mBizType, mStrClassName
                     , String.format(
-                            "监测到中断或执行异常,开始清除子任务 检查类型:%s, code:%s",
+                            "监测到中断或执行异常,开始清除子任务 检查类型:%s, code:%s ,error:%s",
                             systemCheckId.getCheckType().getFlag(),
-                            systemCheckId.getCode()
+                            systemCheckId.getCode(),
+                            e
                     )
             );
 

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

@@ -118,7 +118,7 @@ public class IsolatedLinesFinder {
                 //当前code
                 String currentRoot = line.getCode();
                 //处理起点,合并当前线与以upNode为终点的根线
-                if (pointRoot.containsKey(line.getDownNode())) {
+                if (pointRoot.containsKey(line.getUpNode())) {
                     String existingRoot = pointRoot.get(line.getUpNode());
                     currentRoot = unionAndGetRoot(currentRoot, existingRoot);
                 }

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

@@ -64,10 +64,12 @@ public class OverlapLinesFinder {
         //双层循环遍历所有线
         for (int i = 0; i < lines.size(); i++) {
             GisSurveyLayerApplyLine line1 = lines.get(i);
+            if (line1.getGis() == null) continue;
             //响应中断
             if (Thread.interrupted()) throw new InterruptedException();
             for (int j = i + 1; j < lines.size(); j++) {
                 GisSurveyLayerApplyLine line2 = lines.get(j);
+                if (line2.getGis() == null) continue;
                 //响应中断
                 if (Thread.interrupted()) throw new InterruptedException();
                 // 判断是否重叠
@@ -91,7 +93,7 @@ public class OverlapLinesFinder {
      */
     public boolean calcOverlapLines(GisSurveyLayerApplyLine line1, GisSurveyLayerApplyLine line2) {
         //取出四个点
-        Coordinate a = line2.getGis().getCoordinateN(0);
+        Coordinate a = line1.getGis().getCoordinateN(0);
         Coordinate b = line1.getGis().getCoordinateN(1);
         Coordinate c = line2.getGis().getCoordinateN(0);
         Coordinate d = line2.getGis().getCoordinateN(1);
@@ -100,7 +102,7 @@ public class OverlapLinesFinder {
         //检查C和D是否在AB的直线上(叉积为0,则方向一致)
         if (Orientation.index(a, b, c) != 0 || Orientation.index(a, b, d) != 0) return false;
         LineSegment seg1 = new LineSegment(a, b);
-        LineSegment seg2 = new LineSegment(a, b);
+        LineSegment seg2 = new LineSegment(c, d);
         //四点共点判断
         if (seg1.equals(seg2)) return true;
         //获取C和D对于线段1的投影因子