Browse Source

事件处置流程

develop
lau572 7 months ago
parent
commit
e12f76f880
  1. 13
      zc-business/src/main/java/com/zc/business/controller/DcEventController.java
  2. 2
      zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java
  3. 7
      zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java
  4. 14
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  5. 5
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml

13
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);
}
}

2
zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java

@ -115,6 +115,8 @@ public interface DcEventMapper extends BaseMapper<DcEvent>
* @return boolean
*/
boolean completeEvent(@Param("eventId") String eventId);
int selectClearInfo(String eventId);
}

7
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);
}

14
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);

5
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
</select>
<select id="selectClearInfo" resultType="java.lang.Integer">
select * from dc_event_process
where event_id = #{eventId} and process_id = '6' and process_type = '1'
</select>

Loading…
Cancel
Save