Memory_LG hace 3 semanas
padre
commit
9d00d3ac06

+ 16 - 0
src/main/java/com/sooka/sponest/event/eventFireContingencyPlan/domain/EventFireContingencyPlan.java

@@ -0,0 +1,16 @@
+package com.sooka.sponest.event.eventFireContingencyPlan.domain;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.ibatis.type.Alias;
+
+@Setter
+@Getter
+@Alias("eventFireContingencyPlan")
+public class EventFireContingencyPlan {
+    private String id;
+    private String eventId;
+    private String reserveId;
+    private String reserveName;
+    private String reserveUrl;
+}

+ 7 - 0
src/main/java/com/sooka/sponest/event/eventFireContingencyPlan/mapper/EventFireContingencyPlanMapper.java

@@ -0,0 +1,7 @@
+package com.sooka.sponest.event.eventFireContingencyPlan.mapper;
+
+import com.sooka.sponest.event.eventFireContingencyPlan.domain.EventFireContingencyPlan;
+
+public interface EventFireContingencyPlanMapper {
+    void updateContingencyPlan(EventFireContingencyPlan eventFireContingencyPlan);
+}

+ 7 - 0
src/main/java/com/sooka/sponest/event/eventFireContingencyPlan/service/EventFireContingencyPlanService.java

@@ -0,0 +1,7 @@
+package com.sooka.sponest.event.eventFireContingencyPlan.service;
+
+import com.sooka.sponest.event.eventFireContingencyPlan.domain.EventFireContingencyPlan;
+
+public interface EventFireContingencyPlanService {
+    void updateContingencyPlan(EventFireContingencyPlan eventFireContingencyPlan);
+}

+ 19 - 0
src/main/java/com/sooka/sponest/event/eventFireContingencyPlan/service/impl/EventFireContingencyPlanServiceImpl.java

@@ -0,0 +1,19 @@
+package com.sooka.sponest.event.eventFireContingencyPlan.service.impl;
+
+import com.sooka.sponest.event.eventFireContingencyPlan.domain.EventFireContingencyPlan;
+import com.sooka.sponest.event.eventFireContingencyPlan.mapper.EventFireContingencyPlanMapper;
+import com.sooka.sponest.event.eventFireContingencyPlan.service.EventFireContingencyPlanService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+@Service
+public class EventFireContingencyPlanServiceImpl implements EventFireContingencyPlanService {
+
+    @Resource
+    private EventFireContingencyPlanMapper contingencyPlanMapper;
+    @Override
+    public void updateContingencyPlan(EventFireContingencyPlan eventFireContingencyPlan) {
+        contingencyPlanMapper.updateContingencyPlan(eventFireContingencyPlan);
+    }
+}

+ 4 - 0
src/main/java/com/sooka/sponest/event/eventPostDisasterAssess/domain/FireAssess.java

@@ -81,6 +81,10 @@ public class FireAssess {
      */
     private String fireLevel;
     /**
+     * 火灾半径
+     */
+    private String fireRadius;
+    /**
      *  总面积合计
      */
     private String areaTotal;

+ 9 - 0
src/main/java/com/sooka/sponest/event/eventProcess/controller/EventProcessController.java

@@ -11,6 +11,7 @@ import com.sooka.sponest.event.eventProcess.domain.EventInfo;
 import com.sooka.sponest.event.eventProcess.domain.VO.EventProcess;
 import com.sooka.sponest.event.eventProcess.service.EventProcessService;
 import org.apache.commons.lang.StringUtils;
+import org.apache.poi.ss.formula.functions.Even;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -230,6 +231,14 @@ public class EventProcessController extends BaseController {
     }
 
     /**
+     * 签收过后, 更换应急预案
+     */
+    @PostMapping("/updateContingencyPlan")
+    public AjaxResult updateContingencyPlan(@RequestBody EventInfo eventInfo){
+        return eventProcessService.updateContingencyPlan(eventInfo);
+    }
+
+    /**
      * 事件日志
      * 非事件流转, 新增事件日志
      *

+ 6 - 1
src/main/java/com/sooka/sponest/event/eventProcess/domain/EventInfo.java

@@ -1,8 +1,8 @@
 package com.sooka.sponest.event.eventProcess.domain;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
-import com.ruoyi.common.core.web.domain.BaseEntity;
 import com.ruoyi.common.datascope.base.domain.BaseBusinessEntity;
+import com.sooka.sponest.event.eventFireContingencyPlan.domain.EventFireContingencyPlan;
 import com.sooka.sponest.event.eventLog.domain.EventLog;
 import lombok.AllArgsConstructor;
 import lombok.Data;
@@ -135,6 +135,11 @@ public class EventInfo extends BaseBusinessEntity {
 
     private String deptId;
 
+    /**
+     * 应急预案
+     */
+    private EventFireContingencyPlan eventFireContingencyPlan;
+
 
     public EventInfo(String eventId, String eventType, String eventName, String eventDescription, String reportSource, String longitude, String latitude, String reporter, Date reportTime, String cameraCode, String eventStatus, String address, String isUrged, String createBy, Date createTime) {
         this.eventId = eventId;

+ 4 - 0
src/main/java/com/sooka/sponest/event/eventProcess/service/EventProcessService.java

@@ -68,6 +68,8 @@ public interface EventProcessService {
 
     AjaxResult cooperateDeptList(EventInfo eventInfo);
 
+    AjaxResult updateContingencyPlan(EventInfo eventInfo);
+
 
     void insertSensorEvent(SensorEventVo sensorEventVo);
 
@@ -78,4 +80,6 @@ public interface EventProcessService {
     AjaxResult insertProcessEvent(EventProcess eventInfo);
 
     AjaxResult getCountFromMenuIdAndEventType(EventInfo eventInfo);
+
+
 }

+ 55 - 15
src/main/java/com/sooka/sponest/event/eventProcess/service/impl/EventProcessServiceImpl.java

@@ -19,10 +19,12 @@ import com.sooka.sponest.event.eventAttach.domain.EventAttach;
 import com.sooka.sponest.event.eventAttach.mapper.EventAttachMapper;
 import com.sooka.sponest.event.eventAttach.service.EventAttachService;
 import com.sooka.sponest.event.eventDept.service.EventDeptService;
+import com.sooka.sponest.event.eventFireContingencyPlan.service.EventFireContingencyPlanService;
 import com.sooka.sponest.event.eventLog.domain.EventLog;
 import com.sooka.sponest.event.eventLog.service.EventLogService;
 import com.sooka.sponest.event.eventMessage.domain.*;
 import com.sooka.sponest.event.eventProcess.domain.BO.EventInfoBO;
+import com.sooka.sponest.event.eventFireContingencyPlan.domain.EventFireContingencyPlan;
 import com.sooka.sponest.event.eventProcess.domain.EventInfo;
 import com.sooka.sponest.event.eventProcess.domain.VO.EventProcess;
 import com.sooka.sponest.event.eventProcess.domain.VO.EventUnconfirmed;
@@ -76,6 +78,9 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
     @Resource
     private EventAttachMapper eventAttachMapper;
 
+    @Resource
+    private EventFireContingencyPlanService contingencyPlanService;
+
     private final Lock lock = new ReentrantLock(true); // 公平锁
 
     /**
@@ -664,28 +669,63 @@ public class EventProcessServiceImpl extends BaseServiceImpl implements EventPro
      * 协同处理事件部门
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public AjaxResult cooperateDeptList(EventInfo eventInfo) {
-        if (!eventInfo.getDeptIdList().isEmpty()) {
-            LoginUser loginUser = SecurityUtils.getLoginUser();
-            //业务代码
-            if (null == loginUser) {
-                return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
-            }
-            SysUser sysUser = loginUser.getSysUser();
+        try{
+            if (!eventInfo.getDeptIdList().isEmpty()) {
+                LoginUser loginUser = SecurityUtils.getLoginUser();
+                //业务代码
+                if (null == loginUser) {
+                    return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
+                }
+                SysUser sysUser = loginUser.getSysUser();
 
+                EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
+                if (null == eventProcessDetail || (!EVENT_STATUS_2.equals(eventProcessDetail.getEventStatus()) && !EVENT_STATUS_3.equals(eventProcessDetail.getEventStatus()))) {
+                    return AjaxResult.error(EventEnum.EVENT_NOT_FOUND.getDescribe());
+                }
+
+                List<CenterdataTAidevicedept> listDept = new ArrayList<>();
+                eventInfo.getDeptIdList().forEach(deptId -> listDept.add(new CenterdataTAidevicedept(deptId, "")));
+                eventDeptService.insertEventDept(eventInfo.getEventId(), listDept);
+
+                eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + EventEnum.COOPERATE_DEPT.getDescribe(), EVENT_LOG_TYPE_100, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), DateUtils.getNowDate());
 
-            EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
-            if (null == eventProcessDetail || (!EVENT_STATUS_2.equals(eventProcessDetail.getEventStatus()) && !EVENT_STATUS_3.equals(eventProcessDetail.getEventStatus()))) {
-                return AjaxResult.error(EventEnum.EVENT_NOT_FOUND.getDescribe());
             }
+            return AjaxResult.success();
+        }catch (Exception e){
+            logger.error("cooperateDeptList --> 添加协同部门失败!");
+            return AjaxResult.error("添加协同部门失败!");
+        }
+    }
 
-            eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + EventEnum.COOPERATE_DEPT.getDescribe(), EVENT_LOG_TYPE_100, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), DateUtils.getNowDate());
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public AjaxResult updateContingencyPlan(EventInfo eventInfo) {
+        try{
+            if(eventInfo.getEventFireContingencyPlan() != null){
+                LoginUser loginUser = SecurityUtils.getLoginUser();
+                //业务代码
+                if (null == loginUser) {
+                    return AjaxResult.error(EventEnum.USER_NOT_FOUND.getDescribe());
+                }
+                SysUser sysUser = loginUser.getSysUser();
 
-            List<CenterdataTAidevicedept> listDept = new ArrayList<>();
-            eventInfo.getDeptIdList().forEach(deptId -> listDept.add(new CenterdataTAidevicedept(deptId, "")));
-            eventDeptService.insertEventDept(eventInfo.getEventId(), listDept);
+                EventInfo eventProcessDetail = eventProcessMapper.getProcessEventDetail(eventInfo);
+                if (null == eventProcessDetail || (!EVENT_STATUS_2.equals(eventProcessDetail.getEventStatus()) && !EVENT_STATUS_3.equals(eventProcessDetail.getEventStatus()))) {
+                    return AjaxResult.error(EventEnum.EVENT_NOT_FOUND.getDescribe());
+                }
+
+                EventFireContingencyPlan eventFireContingencyPlan = eventInfo.getEventFireContingencyPlan();
+                contingencyPlanService.updateContingencyPlan(eventFireContingencyPlan);
+
+                eventLogService.insertEventLog(eventInfo.getEventId(), sysUser.getDeptNames() + sysUser.getNickName() + EventEnum.CONTINGENCY_PLAN.getDescribe() + "预案编号: " + eventFireContingencyPlan.getReserveName(), EVENT_LOG_TYPE_100, EVENT_LOG_SOURCE_99, String.valueOf(sysUser.getUserId()), DateUtils.getNowDate());
+            }
+            return AjaxResult.success();
+        }catch (Exception e){
+            logger.error("updateContingencyPlan --> 变更应急预案失败!");
+            return AjaxResult.error("变更应急预案失败!");
         }
-        return AjaxResult.success();
     }
 
     @Override

+ 2 - 0
src/main/java/com/sooka/sponest/event/utils/eventEnum/EventEnum.java

@@ -22,6 +22,8 @@ public enum EventEnum {
 
     COOPERATE_DEPT("添加协同部门!"), // 归档该事件!
 
+    CONTINGENCY_PLAN("配置应急预案!"), // 归档该事件!
+
     USER_NOT_FOUND("未找到登录用户信息!"), // 未找到登录用户信息!
 
     DEPT_NOT_FOUND("未查询到责任单位!"), // 未查询到责任单位!

+ 3 - 0
src/main/resources/mapper/event/eventPostDisasterAssess/FireAssessMapper.xml

@@ -22,6 +22,7 @@
         <result property="fireSource" column="fire_source"/>
         <result property="fireType" column="fire_type"/>
         <result property="fireLevel" column="fire_level"/>
+        <result property="fireRadius" column="fire_radius"/>
         <result property="areaTotal" column="area_total"/>
         <result property="forestLossAreaTotal" column="forest_loss_area_total"/>
         <result property="originalForestArea" column="original_forest_area"/>
@@ -86,6 +87,7 @@
             <if test="fireSource != null">fire_source,</if>
             <if test="fireType != null">fire_type,</if>
             <if test="fireLevel != null">fire_level,</if>
+            <if test="fireRadius != null">fire_radius,</if>
             <if test="areaTotal != null">area_total,</if>
             <if test="forestLossAreaTotal != null">forest_loss_area_total,</if>
             <if test="originalForestArea != null">original_forest_area,</if>
@@ -147,6 +149,7 @@
             <if test="fireSource != null">#{fireSource},</if>
             <if test="fireType != null">#{fireType},</if>
             <if test="fireLevel != null">#{fireLevel},</if>
+            <if test="fireRadius != null">#{fireRadius},</if>
             <if test="areaTotal != null">#{areaTotal},</if>
             <if test="forestLossAreaTotal != null">#{forestLossAreaTotal},</if>
             <if test="originalForestArea != null">#{originalForestArea},</if>