Ver Fonte

修复任务执行状态不对

chenendian há 1 mês atrás
pai
commit
2f3da7ed8f

+ 2 - 4
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/DecisionTaskServiceImpl.java

@@ -102,7 +102,6 @@ public class DecisionTaskServiceImpl implements DecisionTaskService {
         decisionTask.setFilePath(shapeFilePath);
         decisionTaskMapper.add(decisionTask);
         //return decisionTask;
-
         String finalShape = shape;
         try{
             Arrays.stream(DecisionType.values()).forEach(type -> {
@@ -120,22 +119,21 @@ public class DecisionTaskServiceImpl implements DecisionTaskService {
                     decisionTaskMapper.insertDecisionIntersection(param);
                 }
             });
-
             DecisionTask decisionTaskForUpdate = new DecisionTask();
             decisionTaskForUpdate.setId(decisionTask.getId());
             decisionTaskForUpdate.setStatus("2"); // 任务状态 0 创建 1 执行中 2 成功 3 失败
             decisionTaskForUpdate.setEndTime(new Date());
             decisionTaskMapper.update(decisionTaskForUpdate);
         }catch (Exception e){
-            e.printStackTrace();
             log.warn("------数据分析交集计算出现异常,{}",e);
-        }finally {
             DecisionTask decisionTaskForUpdate = new DecisionTask();
             decisionTaskForUpdate.setId(decisionTask.getId());
             decisionTaskForUpdate.setStatus("3"); // 任务状态 0 创建 1 执行中 2 成功 3 失败
             decisionTaskForUpdate.setEndTime(new Date());
             decisionTaskMapper.update(decisionTaskForUpdate);
+            e.printStackTrace();
         }
+
         return decisionTask;
     }