Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-dc into develop

develop
lau572 1 year ago
parent
commit
15ee3c62c3
  1. 5
      zc-business/src/main/java/com/zc/business/domain/DcEvent.java
  2. 60
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  3. 10
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml

5
zc-business/src/main/java/com/zc/business/domain/DcEvent.java

@ -61,10 +61,11 @@ public class DcEvent extends BaseEntity {
* 2-
* 3-
*/
@Excel(name = "方向", readConverterExp = "1=上行,3=下行")
@Excel(name = "方向", readConverterExp = "1=菏泽方向,3=济南方向")
//@Excel(name = "方向")
@ApiModelProperty("方向")
private String direction;
/**
* 处理人员
*/
@ -135,7 +136,7 @@ public class DcEvent extends BaseEntity {
* 3-3 立交封闭和限行
* 3-4 服务区封闭和限行
*/
@Excel(name = "设备编号")
@Excel(name = "事件类型")
@ApiModelProperty("事件子类 例:事件子类:* 1-1 追尾* 1-2 侧翻* 1-3 撞护栏* 1-4 自然* 1-5 其他事故* 2-1 车辆故障")
private String eventSubclass;

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

@ -1,10 +1,5 @@
package com.zc.business.service.impl;
import java.awt.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
@ -17,6 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 事件信息Service业务层处理
@ -26,8 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
*/
@Service
@Transactional
public class DcEventServiceImpl implements IDcEventService
{
public class DcEventServiceImpl implements IDcEventService {
@Autowired
private DcEventMapper dcEventMapper;
//异常天气
@ -63,7 +61,6 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper;
private IMiddleDatabaseService middleDatabaseService;
/**
* 查询事件信息
*
@ -71,8 +68,7 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper;
* @return 事件信息
*/
@Override
public DcEvent selectDcEventById( String id)
{
public DcEvent selectDcEventById(String id) {
DcEvent dcEvent = dcEventMapper.selectDcEventById(id);
List<DcProcessConfig> processConfigList = dcProcessConfigMapper.selectDcProcessConfigByEventType(Math.toIntExact(dcEvent.getEventType()));
@ -87,8 +83,7 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper;
* @return 事件信息
*/
@Override
public List<DcEvent> selectDcEventList(DcEvent dcEvent)
{
public List<DcEvent> selectDcEventList(DcEvent dcEvent) {
if (dcEvent.getStakeMark() != null) {
//处理URl地址栏获取参数+号消失
String replace = dcEvent.getStakeMark().replace(" ", "+");
@ -96,8 +91,8 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper;
String replace1 = dcEvent.getEndStakeMark().replace(" ", "+");
dcEvent.setEndStakeMark(replace1);
}
List<DcEvent> dcEventList = dcEventMapper.selectDcEventList(dcEvent);
List<DcEvent> dcEventList = dcEventMapper.selectDcEventList(dcEvent);
for (DcEvent dcEvents : dcEventList) {
// 根据 deptId 获取部门名称
Long deptId = dcEvents.getDeptId();
@ -107,7 +102,7 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper;
dcEvents.setDeptName(deptName);
}
return dcEventMapper.selectDcEventList(dcEvent);
return dcEventList;
}
/**
@ -117,8 +112,7 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper;
* @return 结果
*/
@Override
public int insertDcEvent(DcEvent dcEvent)
{
public int insertDcEvent(DcEvent dcEvent) {
//设置事件Id UUID无下划线格式32
String uuid = IdUtils.fastSimpleUUID();
@ -129,7 +123,6 @@ dcEvent.setDeptId(SecurityUtils.getDeptId());
//用户
dcEvent.setUserId(SecurityUtils.getUserId());
dcEvent.setCreateTime(DateUtils.getNowDate());
int i7 = dcEventMapper.insertDcEvent(dcEvent);
@ -144,23 +137,33 @@ dcEvent.setUserId(SecurityUtils.getUserId());
switch (eventType) {
//交通事故
case 1:
if (dcEvent.getDcEventAccident() != null) {
dcEvent.getDcEventAccident().setId(uuid);
int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident());
}
break;
//车辆事故
case 2:
if (dcEvent.getDcEventVehicleAccident()!=null){
dcEvent.getDcEventVehicleAccident().setId(uuid);
int i5 = dcEventVehicleAccidentMapper.insertDcEventVehicleAccident(dcEvent.getDcEventVehicleAccident());
}
break;
//交通管制
case 3:
if (dcEvent.getDcEventTrafficControl()!=null){
dcEvent.getDcEventTrafficControl().setId(uuid);
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
}
break;
//交通拥堵
case 4:
if (dcEvent.getDcEventTrafficCongestion()!=null){
dcEvent.getDcEventTrafficCongestion().setId(uuid);
int i4 = dcEventTrafficCongestionMapper.insertDcEventTrafficCongestion(dcEvent.getDcEventTrafficCongestion());
}
break;
//非法上路
@ -171,21 +174,28 @@ dcEvent.setUserId(SecurityUtils.getUserId());
break;
//施工建设
case 7:
if (dcEvent.getDcEventConstruction()!=null){
dcEvent.getDcEventConstruction().setId(uuid);
int i2 = dcEventConstructionMapper.insertDcEventConstruction(dcEvent.getDcEventConstruction());
}
break;
//服务区异常
case 8:
if (dcEvent.getDcEventServiceArea()!=null){
dcEvent.getDcEventServiceArea().setId(uuid);
int i3 = dcEventServiceAreaMapper.insertDcEventServiceArea(dcEvent.getDcEventServiceArea());
}
break;
//设施设备隐患
case 9:
break;
//异常天气
case 10:
if (dcEvent.getDcEventAbnormalWeather()!=null){
dcEvent.getDcEventAbnormalWeather().setId(uuid);
int i = dcEventAbnormalWeatherMapper.insertDcEventAbnormalWeather(dcEvent.getDcEventAbnormalWeather());
}
break;
//其他事件
case 11:
@ -208,8 +218,7 @@ dcEvent.setUserId(SecurityUtils.getUserId());
* @return 结果
*/
@Override
public int updateDcEvent(DcEvent dcEvent)
{
public int updateDcEvent(DcEvent dcEvent) {
dcEvent.setUpdateTime(DateUtils.getNowDate());
int i7 = dcEventMapper.updateDcEvent(dcEvent);
if (i7 > 0) {
@ -280,8 +289,7 @@ dcEvent.setUserId(SecurityUtils.getUserId());
* @return 结果
*/
@Override
public int deleteDcEventByIds( int eventType,String[] ids)
{
public int deleteDcEventByIds(int eventType, String[] ids) {
int i7 = dcEventMapper.deleteDcEventByIds(ids);
if (i7 > 0) {
switch (eventType) {
@ -335,6 +343,7 @@ dcEvent.setUserId(SecurityUtils.getUserId());
return -1;
}
}
/**
* 删除事件信息信息
*
@ -342,12 +351,12 @@ dcEvent.setUserId(SecurityUtils.getUserId());
* @return 结果
*/
@Override
public int deleteDcEventById(String id)
{
public int deleteDcEventById(String id) {
return dcEventMapper.deleteDcEventById(id);
}
/**调度记录-事件列表 按时间展示交通事件默认当天时间 可查询条件 交通事件状态 时间范围
*
/**
* 调度记录-事件列表 按时间展示交通事件默认当天时间 可查询条件 交通事件状态 时间范围
*/
@Override
public List<DcEvent> selectDispatchEventList(DcEvent dcEvent) {
@ -356,6 +365,7 @@ dcEvent.setUserId(SecurityUtils.getUserId());
/**
* 获取事件以及子类详细信息
*
* @param eventType
* @param id
* @return

10
zc-business/src/main/resources/mapper/business/DcEventMapper.xml

@ -143,7 +143,10 @@
id,
dc_event.dept_id as dept_id,
stake_mark,
direction,
CASE direction
WHEN '1' THEN '菏泽方向'
WHEN '3' THEN '济南方向'
END AS direction,
dc_event.user_id as user_id,
sys_user.nick_name as nickName,
start_time,
@ -353,7 +356,10 @@
/*详情可以调用事件处理流程*/
SELECT dc_event.id AS id,
dc_event.stake_mark,
dc_event.direction,
CASE dc_event.direction
WHEN '1' THEN '菏泽方向'
WHEN '3' THEN '济南方向'
END AS direction,
dc_event.user_id,
dc_event.user_id as user_id,
sys_user.nick_name as nickName,

Loading…
Cancel
Save