459242451@qq.com 3 년 전
부모
커밋
82dfb45b1a
1개의 변경된 파일5개의 추가작업 그리고 29개의 파일을 삭제
  1. 5 29
      ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/IncidentServiceImpl.java

+ 5 - 29
ruoyi-zhdd/src/main/java/com/ruoyi/zhdd/service/impl/IncidentServiceImpl.java

@@ -74,48 +74,24 @@ public class IncidentServiceImpl extends ServicePlusImpl<IncidentMapper, Inciden
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
     public Boolean insertByBo(IncidentBo bo) {
         Incident add = BeanUtil.toBean(bo, Incident.class);
         validEntityBeforeSave(add);
-        save(add);
-        // 新增处置流程数据
-        IncidentProcess incidentProcess = new IncidentProcess();
-        incidentProcess.setIId(add.getId());
-        incidentProcess.setStatus(add.getStatus());
-        incidentProcess.setDes("新增预警事件");
-        incidentProcessService.save(incidentProcess);
-        return true;
+        return save(add);
     }
 
     @Override
     public Boolean updateByBo(IncidentBo bo) {
         // 是否为状态变更
-        boolean flag = false;
+//        boolean flag = false;
         // 查询变更前信息
         IncidentVo beforeInfo = getVoById(bo.getId());
-        if (beforeInfo != null) {
+        /*if (beforeInfo != null) {
             flag = !(beforeInfo.getStatus().equals(bo.getStatus()));
-        }
+        }*/
         Incident update = BeanUtil.toBean(bo, Incident.class);
         validEntityBeforeSave(update);
-        updateById(update);
-        // 处理后续业务
-        if (flag) {
-            // 新增处置流程数据
-            IncidentProcess incidentProcess = new IncidentProcess();
-            incidentProcess.setIId(update.getId());
-            incidentProcess.setStatus(update.getStatus());
-            if (update.getStatus() == 2) {
-                // 转为事件---待派发
-                incidentProcess.setDes("转为事件");
-            } else if (update.getStatus() == 3) {
-                // 派发---待处置
-                incidentProcess.setDes("派发");
-            }
-            incidentProcessService.save(incidentProcess);
-        }
-        return true;
+        return updateById(update);
     }
 
     /**