diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventController.java index 7a2899a7..c15bd0bc 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventController.java @@ -9,14 +9,7 @@ import com.zc.business.service.IDcEventService; import com.zc.common.core.websocket.WebSocketService; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -197,7 +190,7 @@ public class DcEventController extends BaseController */ @ApiOperation("解除事件") @PostMapping("/completeEvent") - public AjaxResult completeEvent(String eventId){ + public AjaxResult completeEvent(@ApiParam(value="事件id", name="eventId", required=true) @RequestParam("eventId") String eventId){ return dcEventService.completeEvent(eventId); } @@ -211,7 +204,7 @@ public class DcEventController extends BaseController */ @ApiOperation("无需清障") @PostMapping("/skipClear") - public AjaxResult skipClear(String eventId){ + public AjaxResult skipClear(@ApiParam(value="事件id", name="eventId", required=true) @RequestParam ("eventId") String eventId){ return dcEventService.skipClear(eventId); } } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java index 40d81d8c..4b0786ae 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java @@ -115,6 +115,8 @@ public interface DcEventMapper extends BaseMapper * @return boolean */ boolean completeEvent(@Param("eventId") String eventId); + + int selectClearInfo(String eventId); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java index cbd1bc7b..a097984a 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java @@ -75,12 +75,12 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService } }*/ //判断是否最后一个节点 - if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){ + /*if (dcEventProcess.getProcessType() != null && dcEventProcess.getProcessType() == 1){ int finalNode = dcEventProcessMapper.selectFinalNode(dcEventProcess.getEventId()); if (finalNode == dcEventProcess.getProcessId()){ dcEventService.updateDcEventState(dcEventProcess.getEventId(),2); } - } + }*/ dcEventProcess.setOperationTime(new Date()); dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); dcEventProcess.setOperatorName(SecurityUtils.getLoginUser().getUser().getNickName()); @@ -114,6 +114,9 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService @Override public int updateDcEventProcess(DcEventProcess dcEventProcess) { + dcEventProcess.setOperationTime(new Date()); + dcEventProcess.setOperator(SecurityUtils.getUserId().toString()); + dcEventProcess.setOperatorName(SecurityUtils.getLoginUser().getUser().getNickName()); return dcEventProcessMapper.updateDcEventProcess(dcEventProcess); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index 0ee94f4b..80a158d3 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java @@ -1387,11 +1387,16 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId == */ @Override public AjaxResult completeEvent(String eventId){ + + DcEvent dcEvent = dcEventMapper.selectDcEventById(eventId); + if (dcEvent.getEventState() != null && dcEvent.getEventState().equals(2L)){ + return AjaxResult.error("无法重复解除"); + } + boolean flag = dcEventMapper.completeEvent(eventId); if (flag){ - DcEvent dcEvent = dcEventMapper.selectDcEventById(eventId); - String datePoor = getDatePoor(dcEvent.getEndTime(),dcEvent.getStartTime()); + String datePoor = getDatePoor(new Date(),dcEvent.getStartTime()); //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); @@ -1416,6 +1421,11 @@ if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId == @Override public AjaxResult skipClear(String eventId){ + int i = dcEventMapper.selectClearInfo(eventId); + if (i > 0){ + return AjaxResult.error("无法重复跳过清障"); + } + //事件处置流程记录 DcEventProcess dcEventProcess = new DcEventProcess(); dcEventProcess.setEventId(eventId); diff --git a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml index d50cb525..b476cfaf 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml @@ -754,6 +754,11 @@ LEFT JOIN dc_process_config t2 on t1.event_type = t2.event_type left join dc_event_process t3 on t1.id = t3.event_id and t2.node_node = t3.process_id and t3.process_type = '1' where t1.id = #{eventId} + ORDER BY nodeNode + +