Browse Source

1.中间库事件信息

2.中间库毫米波雷达统计数据
develop
lau572 5 months ago
parent
commit
8fa43c7ee9
  1. 12
      zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java
  2. 137
      zc-business/src/main/java/com/zc/business/domain/MdEvent.java
  3. 11
      zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java
  4. 8
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  5. 49
      zc-business/src/main/resources/mapper/business/MiddleDatabaseMapper.xml

12
zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java

@ -8,9 +8,11 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.zc.business.domain.DcEvent;
import com.zc.business.domain.DcEventProcess;
import com.zc.business.domain.MdEvent;
import com.zc.business.enums.UniversalEnum;
import com.zc.business.service.IDcEventProcessService;
import com.zc.business.service.IDcEventService;
import com.zc.business.service.IMiddleDatabaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -18,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
/**
@ -35,6 +38,8 @@ public class DcEventProcessController extends BaseController
private IDcEventProcessService dcEventProcessService;
@Autowired
private IDcEventService dcEventService;
@Autowired
private IMiddleDatabaseService middleDatabaseService;
/**
* 查询事件处理流程列表
@ -106,6 +111,13 @@ public class DcEventProcessController extends BaseController
return AjaxResult.error(UniversalEnum.THE_FRONT_NODE_IS_NOT_LIT.getValue());
}
}
if ((dcEvent.getEventType() == 1 || dcEvent.getEventType() == 2) && dcEventProcess.getProcessId() == 3){
//中间库 更新清障到达时间
MdEvent mdEvent = new MdEvent();
mdEvent.setFusionId(dcEventProcess.getEventId());
mdEvent.setClearArriveTime(new Date());
middleDatabaseService.updateMiddleDatabaseEvent(mdEvent);
}
return toAjax(dcEventProcessService.insertDcEventProcess(dcEventProcess));
}

137
zc-business/src/main/java/com/zc/business/domain/MdEvent.java

@ -5,6 +5,7 @@ import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.utils.StringUtils;
import com.zc.business.enums.ValueConverter;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -191,6 +192,44 @@ public class MdEvent
@Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date deletionTime;
/** 开始处置时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始处置时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/** 清障到达时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "清障到达时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date clearArriveTime;
/** 清障完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "清障完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date clearEndTime;
/** 小型车数量 */
private Long car;
/** 客车数量 */
private Long bus;
/** 货车数量 */
private Long truck;
/** 罐车(大型货车)数量 */
private Long heavyTruck;
/**
* 前方是否拥堵
*/
private Integer congestionAhead;
/**
* 压车(公里)
*/
private Float trafficJam;
public void setId(Long id)
{
this.id = id;
@ -559,6 +598,78 @@ public class MdEvent
this.eventTypeName2 = eventTypeName2;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getClearArriveTime() {
return clearArriveTime;
}
public void setClearArriveTime(Date clearArriveTime) {
this.clearArriveTime = clearArriveTime;
}
public Date getClearEndTime() {
return clearEndTime;
}
public void setClearEndTime(Date clearEndTime) {
this.clearEndTime = clearEndTime;
}
public Long getCar() {
return car;
}
public void setCar(Long car) {
this.car = car;
}
public Long getBus() {
return bus;
}
public void setBus(Long bus) {
this.bus = bus;
}
public Long getTruck() {
return truck;
}
public void setTruck(Long truck) {
this.truck = truck;
}
public Long getHeavyTruck() {
return heavyTruck;
}
public void setHeavyTruck(Long heavyTruck) {
this.heavyTruck = heavyTruck;
}
public Integer getCongestionAhead() {
return congestionAhead;
}
public void setCongestionAhead(Integer congestionAhead) {
this.congestionAhead = congestionAhead;
}
public Float getTrafficJam() {
return trafficJam;
}
public void setTrafficJam(Float trafficJam) {
this.trafficJam = trafficJam;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -639,6 +750,18 @@ public class MdEvent
this.accidentWeather = dcEventAccident.getWeatherCondition();
//事故压车(公里)
this.accidentQueue = new BigDecimal(Float.toString(dcEventAccident.getTrafficJam()));
//小型车数量
this.car = dcEventAccident.getSmallCar();
//客车数量
this.bus = dcEventAccident.getBuses();
//货车数量
this.truck = dcEventAccident.getTrucks();
//罐车(大型货车)数量
this.heavyTruck = dcEventAccident.getTankers();
//前方是否拥堵
this.congestionAhead = dcEventAccident.getCongestionAhead();
//压车(公里)
this.trafficJam = dcEventAccident.getTrafficJam();
}
} else if ("2".equals(eventType)){
DcEventVehicleAccident dcEventVehicleAccident = dcEvent.getDcEventVehicleAccident();
@ -647,6 +770,18 @@ public class MdEvent
this.accidentWeather = dcEventVehicleAccident.getWeatherCondition();
//事故压车(公里)
this.accidentQueue = new BigDecimal(Float.toString(dcEventVehicleAccident.getTrafficJam()));
//小型车数量
this.car = dcEventVehicleAccident.getSmallCar();
//客车数量
this.bus = dcEventVehicleAccident.getBuses();
//货车数量
this.truck = dcEventVehicleAccident.getTrucks();
//罐车(大型货车)数量
this.heavyTruck = dcEventVehicleAccident.getTankers();
//前方是否拥堵
this.congestionAhead = dcEventVehicleAccident.getCongestionAhead();
//压车(公里)
this.trafficJam = dcEventVehicleAccident.getTrafficJam();
}
} else if ("3".equals(eventType)){
DcEventTrafficControl dcEventTrafficControl = dcEvent.getDcEventTrafficControl();
@ -727,5 +862,7 @@ public class MdEvent
}
//事件原因
this.eventCause = dcEvent.getEventCause();
//开始时间
this.startTime = dcEvent.getStartTime();
}
}

11
zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java

@ -220,6 +220,17 @@ public class DeviceMessageHandler {
} else if (Objects.equals(eventTopic, UniversalEnum.TIME_RANGE.getValue())) {
// 交通统计
String deviceId = event.getString("deviceId");
//保存至中间库
MdDeviceData mdDeviceData = new MdDeviceData();
mdDeviceData.setDevNo(deviceId);
mdDeviceData.setDevType(UniversalEnum.SEVEN.getValue());
mdDeviceData.setTimeStamp(jsonObject.getDate("timestamp"));
mdDeviceData.setCreatorUserId(UniversalEnum.AUTOMATIC_STORAGE.getValue());
mdDeviceData.setExpands(jsonObject.getString("laneParam"));
middleDatabaseService.insertMiddleDatabaseDeviceData(mdDeviceData);
} else if (Objects.equals(eventTopic, UniversalEnum.REAL_TIME.getValue())) {
// 交通状态数据

8
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -1906,11 +1906,11 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
boolean flag = dcEventMapper.completeEvent(eventId);
if (flag) {
//中间库
MdEvent mdEvent = new MdEvent();
mdEvent.setFusionId(eventId);
mdEvent.setEventStatus(Long.valueOf(UniversalEnum.TWO.getNumber()));
mdEvent.setEndTime(new Date());
middleDatabaseService.updateMiddleDatabaseEvent(mdEvent);
String datePoor = getDatePoor(new Date(), dcEvent.getStartTime());
@ -1952,6 +1952,12 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
return AjaxResult.error(UniversalEnum.THIS_EVENT_HAS_BEEN_CLEARED_AND_CANNOT_BE_OPERATED.getValue());
}
//中间库,更新清障结束时间
MdEvent mdEvent = new MdEvent();
mdEvent.setFusionId(eventId);
mdEvent.setClearEndTime(new Date());
middleDatabaseService.updateMiddleDatabaseEvent(mdEvent);
//事件处置流程记录
DcEventProcess dcEventProcess = new DcEventProcess();
dcEventProcess.setEventId(eventId);

49
zc-business/src/main/resources/mapper/business/MiddleDatabaseMapper.xml

@ -76,6 +76,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deleterUserId != null">DeleterUserId,</if>
<if test="deletionTime != null">DeletionTime,</if>
CreationTime,
<if test="startTime != null">start_time,</if>
<if test="clearArriveTime != null">clear_arrive_time,</if>
<if test="clearEndTime != null">clear_end_time,</if>
<if test="car != null">car,</if>
<if test="bus != null">bus,</if>
<if test="truck != null">truck,</if>
<if test="heavyTruck != null">heavy_truck,</if>
<if test="congestionAhead != null">congestion_ahead,</if>
<if test="trafficJam != null">traffic_jam,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fusionId != null">#{fusionId},</if>
@ -117,7 +126,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDeleted != null">#{isDeleted},</if>
<if test="deleterUserId != null">#{deleterUserId},</if>
<if test="deletionTime != null">#{deletionTime},</if>
now()
now(),
<if test="startTime != null">#{startTime},</if>
<if test="clearArriveTime != null">#{clearArriveTime},</if>
<if test="clearEndTime != null">#{clearEndTime},</if>
<if test="car != null">#{car},</if>
<if test="bus != null">#{bus},</if>
<if test="truck != null">#{truck},</if>
<if test="heavyTruck != null">#{heavyTruck},</if>
<if test="congestionAhead != null">#{congestionAhead},</if>
<if test="trafficJam != null">#{trafficJam},</if>
</trim>
</insert>
@ -284,6 +302,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mdEvent.deleterUserId != null">DeleterUserId,</if>
<if test="mdEvent.deletionTime != null">DeletionTime,</if>
CreationTime,
<if test="mdEvent。startTime != null">start_time,</if>
<if test="mdEvent.clearArriveTime != null">clear_arrive_time,</if>
<if test="mdEvent.clearEndTime != null">clear_end_time,</if>
<if test="mdEvent.car != null">car,</if>
<if test="mdEvent.bus != null">bus,</if>
<if test="mdEvent.truck != null">truck,</if>
<if test="mdEvent.heavyTruck != null">heavy_truck,</if>
<if test="mdEvent.congestionAhead != null">congestion_ahead,</if>
<if test="mdEvent.trafficJam != null">traffic_jam,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mdEvent.fusionId != null">#{mdEvent.fusionId},</if>
@ -325,7 +352,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mdEvent.isDeleted != null">#{mdEvent.isDeleted},</if>
<if test="mdEvent.deleterUserId != null">#{mdEvent.deleterUserId},</if>
<if test="mdEvent.deletionTime != null">#{mdEvent.deletionTime},</if>
now()
now(),
<if test="mdEvent.startTime != null">#{mdEvent.startTime},</if>
<if test="mdEvent.clearArriveTime != null">#{mdEvent.clearArriveTime},</if>
<if test="mdEvent.clearEndTime != null">#{mdEvent.clearEndTime},</if>
<if test="mdEvent.car != null">#{mdEvent.car},</if>
<if test="mdEvent.bus != null">#{mdEvent.bus},</if>
<if test="mdEvent.truck != null">#{mdEvent.truck},</if>
<if test="mdEvent.heavyTruck != null">#{mdEvent.heavyTruck},</if>
<if test="mdEvent.congestionAhead != null">#{mdEvent.congestionAhead},</if>
<if test="mdEvent.trafficJam != null">#{mdEvent.trafficJam},</if>
</trim>
</foreach>
</insert>
@ -406,6 +442,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDeleted != null">IsDeleted = #{isDeleted},</if>
<if test="deleterUserId != null">DeleterUserId = #{deleterUserId},</if>
<if test="deletionTime != null">DeletionTime = #{deletionTime},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="clearArriveTime != null">clear_arriveTime = #{clearArriveTime},</if>
<if test="clearEndTime != null">clear_end_time = #{clearEndTime},</if>
<if test="car != null">car = #{car},</if>
<if test="bus != null">bus = #{bus},</if>
<if test="truck != null">truck = #{truck},</if>
<if test="heavyTruck != null">heavy_truck = #{heavyTruck},</if>
<if test="congestionAhead != null">congestion_ahead = #{congestionAhead},</if>
<if test="trafficJam != null">traffic_jam = #{trafficJam},</if>
</trim>
where fusionId = #{fusionId}
</update>

Loading…
Cancel
Save