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 629bf40c..6c024945 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 @@ -204,4 +204,13 @@ public class DcEventController extends BaseController public AjaxResult skipClear(@ApiParam(value="事件id", name="eventId", required=true) @RequestParam ("eventId") String eventId){ return dcEventService.skipClear(eventId); } + + @ApiOperation("调度记录-事件列表 按时间展示交通事件,默认当天时间 。可查询条件 交通事件状态 ,时间范围") + @GetMapping("/dispatchRecordEventList") + public TableDataInfo dispatchRecordEventList(DcEvent dcEvent){ + + List list = dcEventService.dispatchRecordEventList(dcEvent); + return getDataTable(list); + } + } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEvent.java b/zc-business/src/main/java/com/zc/business/domain/DcEvent.java index fd84070d..14f05f49 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEvent.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEvent.java @@ -1,16 +1,16 @@ package com.zc.business.domain; -import java.util.Date; -import java.util.List; - import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import com.ruoyi.common.annotation.Excel; + +import java.util.Date; +import java.util.List; /** * 事件信息对象 dc_event @@ -58,8 +58,8 @@ public class DcEvent { * 2-中 * 3-下 */ - @Excel(name = "方向", readConverterExp = "1=菏泽方向,3=济南方向") - //@Excel(name = "方向") + @Excel(name = "方向", readConverterExp = "1=菏泽方向,3=济南方向") + //@Excel(name = "方向") @ApiModelProperty("方向") private String direction; @@ -69,7 +69,7 @@ public class DcEvent { @ApiModelProperty("处理人员") private Long userId; - @ApiModelProperty("事件子类") + @ApiModelProperty("事件子类") private String eventSubclassName; /** @@ -156,12 +156,12 @@ public class DcEvent { private String description; /** * 事件状态: - 事件状态: - 0-待确认 - 1-已确认 - 2-处理中 - 3-已完成 - 4-已撤销 + * 事件状态: + * 0-待确认 + * 1-已确认 + * 2-处理中 + * 3-已完成 + * 4-已撤销 */ @ApiModelProperty("事件状态 事件状态:* 0-未解决1-已解决2-已关闭") private Long eventState; @@ -200,7 +200,7 @@ public class DcEvent { /** * 是否处在隧道 */ - @Excel(name = "是否处在隧道" , readConverterExp = "0=否,1=是") + @Excel(name = "是否处在隧道", readConverterExp = "0=否,1=是") @ApiModelProperty("是否处在隧道 0 表示 false,1 表示 true") private Integer inTunnel; //@Excel(name = "高速") @@ -214,27 +214,27 @@ public class DcEvent { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty("发生时间") private Date occurrenceTime; - @Excel(name = "是否是感知事件" , readConverterExp = "0=否,1=是") + @Excel(name = "是否是感知事件", readConverterExp = "0=否,1=是") @ApiModelProperty("是否是感知事件 0 表示 false,1 表示 true") private Integer isPerceived; @Excel(name = "影响车道") - @ApiModelProperty("影响车道 车道占用:0-应急1-行1,2-行2,3-行3,4-行4") + @ApiModelProperty("影响车道 车道占用:0-应急1-行1,2-行2,3-行3,4-行4") private String lang; @ApiModelProperty("高速名") @TableField(exist = false) - private String roadName; + private String roadName; @ApiModelProperty("机构") @TableField(exist = false) - private String organizationName; + private String organizationName; @ApiModelProperty("事件流程") @TableField(exist = false) - private List processConfigList; -@ApiModelProperty("事件标题") + private List processConfigList; + @ApiModelProperty("事件标题") private String eventTitle; -@ApiModelProperty("维度") + @ApiModelProperty("维度") private String dimension; -@ApiModelProperty("经度") + @ApiModelProperty("经度") private String longitude; /** * 2014/2/21新增 @@ -291,20 +291,29 @@ public class DcEvent { private String processNode; - - /** 更新时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + /** + * 更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; - /** 创建时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; - /** 备注 */ + /** + * 备注 + */ private String remark; private String subclass; -@ApiModelProperty("关联管制事件id") -private String linkId; + @ApiModelProperty("关联管制事件id") + private String linkId; + + @TableField(exist = false) + private List dcEventProcessList; + } 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 89f211a9..63ed43a8 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 @@ -119,6 +119,8 @@ public interface DcEventMapper extends BaseMapper boolean completeEvent(@Param("eventId") String eventId); int selectClearInfo(String eventId); + + List dispatchRecordEventList(DcEvent dcEvent); } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java index 4a00c447..7e4798d9 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java @@ -87,4 +87,6 @@ public interface DcEventProcessMapper * @return 状态 0未完成 1已完成 */ int selectPreviousNodeStatus(@Param("eventId") String eventId, @Param("processId") Long processId); + + List selectDcEventProcessByEventId(String eventId); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java index 3d261edd..91948483 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java @@ -83,4 +83,6 @@ public interface IDcEventProcessService * @return status 0未完成 1已完成 */ int selectPreviousNodeStatus(String eventId, Long processId); + + List selectDcEventProcessByEventId(String eventId); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventService.java index 058a6469..9a740f91 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEventService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventService.java @@ -127,4 +127,6 @@ public interface IDcEventService * @return com.ruoyi.common.core.domain.AjaxResult */ AjaxResult skipClear(String eventId); + + List dispatchRecordEventList(DcEvent dcEvent); } 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 6dd2a68c..bddefec7 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 @@ -163,4 +163,9 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService return dcEventProcessMapper.selectPreviousNodeStatus(eventId,processId); } + @Override + public List selectDcEventProcessByEventId(String eventId) { + return dcEventProcessMapper.selectDcEventProcessByEventId(eventId); + } + } 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 0fafc02c..453f9260 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 @@ -245,11 +245,25 @@ public class DcEventServiceImpl extends ServiceImpl impl updateDcEventState(dcEvent.getId(), 1); dcEvent.getDcEventTrafficControl().setId(uuid); int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); - DcEvent dcEvent1 = new DcEvent(); - dcEvent1.setId(dcEventId);//事件id - dcEvent1.setEventNature(1l);//首发事件 - dcEvent1.setLinkId(uuid);//关联管制事件id - dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质 + //查询事件 + DcEvent dcEvent2 = dcEventMapper.selectDcEventById(dcEventId); + //判断事件 关联事件id是否为空 + if (dcEvent2.getLinkId()==null){ + DcEvent dcEvent1 = new DcEvent(); + dcEvent1.setId(dcEventId);//事件id + dcEvent1.setEventNature(1l);//首发事件 + dcEvent1.setLinkId(uuid);//关联管制事件id + dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质 + }else { + + DcEvent dcEvent1 = new DcEvent(); + dcEvent1.setId(dcEventId);//事件id + dcEvent1.setEventNature(1l);//首发事件 + dcEvent1.setLinkId(dcEvent2.getLinkId()+","+uuid);//关联管制事件id + dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质 + } + + break; } // 插入多个收费站 @@ -261,6 +275,7 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEvent1.setEventNature(1l);//首发事件 dcEvent1.setLinkId(uuid);//关联管制事件id dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质 + dcEvent.getDcEventTrafficControl().setId(uuid); dcEvent.getDcEventTrafficControl().setFacilityId(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]);//取出数组字段赋值 设施id int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());// @@ -1762,6 +1777,23 @@ public class DcEventServiceImpl extends ServiceImpl impl return AjaxResult.success("无需清障成功"); } + /** + * 调度记录 + * @param dcEvent + * @return + */ + @Override + public List dispatchRecordEventList(DcEvent dcEvent) { + dcEvent.setEventState(2l); + List dcEvents = dcEventMapper.dispatchRecordEventList(dcEvent); + for (DcEvent event : dcEvents) { + List dcEventProcess= dcEventProcessService.selectDcEventProcessByEventId(event.getId()); + event.setDcEventProcessList(dcEventProcess); + } + + return dcEvents; + } + //时间比对 public static String getDatePoor(Date endDate, Date nowDate) { diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcFacilityServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcFacilityServiceImpl.java index 4737cc8d..4f1338ee 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcFacilityServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcFacilityServiceImpl.java @@ -50,7 +50,7 @@ public class DcFacilityServiceImpl extends ServiceImpl + \ No newline at end of file diff --git a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml index 6a7ea7fb..68376d4f 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml @@ -150,4 +150,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where event_id = #{eventId} and process_type = '1' and process_id = #{processId} - 1 + + \ No newline at end of file