|
|
@ -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,14 +25,13 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
@Transactional |
|
|
|
public class DcEventServiceImpl implements IDcEventService |
|
|
|
{ |
|
|
|
public class DcEventServiceImpl implements IDcEventService { |
|
|
|
@Autowired |
|
|
|
private DcEventMapper dcEventMapper; |
|
|
|
//异常天气
|
|
|
|
@Autowired |
|
|
|
private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper; |
|
|
|
//交通事故事件
|
|
|
|
@Autowired |
|
|
|
private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper; |
|
|
|
//交通事故事件
|
|
|
|
@Autowired |
|
|
|
private DcEventAccidentMapper dcEventAccidentMapper; |
|
|
|
//施工建设
|
|
|
@ -47,8 +45,8 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper; |
|
|
|
private DcEventTrafficCongestionMapper dcEventTrafficCongestionMapper; |
|
|
|
//车辆事故事件
|
|
|
|
@Autowired |
|
|
|
private DcEventVehicleAccidentMapper dcEventVehicleAccidentMapper; |
|
|
|
//交通管制事件
|
|
|
|
private DcEventVehicleAccidentMapper dcEventVehicleAccidentMapper; |
|
|
|
//交通管制事件
|
|
|
|
@Autowired |
|
|
|
private DcEventTrafficControlMapper dcEventTrafficControlMapper; |
|
|
|
|
|
|
@ -63,7 +61,6 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper; |
|
|
|
private IMiddleDatabaseService middleDatabaseService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 查询事件信息 |
|
|
|
* |
|
|
@ -71,12 +68,11 @@ 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())); |
|
|
|
dcEvent.setProcessConfigList(processConfigList); |
|
|
|
dcEvent.setProcessConfigList(processConfigList); |
|
|
|
return dcEvent; |
|
|
|
} |
|
|
|
|
|
|
@ -87,17 +83,16 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper; |
|
|
|
* @return 事件信息 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<DcEvent> selectDcEventList(DcEvent dcEvent) |
|
|
|
{ |
|
|
|
if (dcEvent.getStakeMark()!=null){ |
|
|
|
public List<DcEvent> selectDcEventList(DcEvent dcEvent) { |
|
|
|
if (dcEvent.getStakeMark() != null) { |
|
|
|
//处理URl地址栏获取参数+号消失
|
|
|
|
String replace = dcEvent.getStakeMark().replace(" ", "+"); |
|
|
|
dcEvent.setStakeMark(replace); |
|
|
|
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,23 +112,21 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper; |
|
|
|
* @return 结果 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public int insertDcEvent(DcEvent dcEvent) |
|
|
|
{ |
|
|
|
public int insertDcEvent(DcEvent dcEvent) { |
|
|
|
|
|
|
|
//设置事件Id UUID无下划线格式32
|
|
|
|
String uuid = IdUtils.fastSimpleUUID(); |
|
|
|
dcEvent.setId(uuid); |
|
|
|
dcEvent.setEventState(0L); |
|
|
|
//获取部门信息
|
|
|
|
dcEvent.setDeptId(SecurityUtils.getDeptId()); |
|
|
|
dcEvent.setDeptId(SecurityUtils.getDeptId()); |
|
|
|
//用户
|
|
|
|
dcEvent.setUserId(SecurityUtils.getUserId()); |
|
|
|
|
|
|
|
dcEvent.setUserId(SecurityUtils.getUserId()); |
|
|
|
|
|
|
|
dcEvent.setCreateTime(DateUtils.getNowDate()); |
|
|
|
int i7 = dcEventMapper.insertDcEvent(dcEvent); |
|
|
|
|
|
|
|
if (i7>0){ |
|
|
|
if (i7 > 0) { |
|
|
|
|
|
|
|
//中间库
|
|
|
|
// MdEvent mdEvent = new MdEvent(dcEvent);
|
|
|
@ -141,26 +134,36 @@ dcEvent.setUserId(SecurityUtils.getUserId()); |
|
|
|
|
|
|
|
//获取事件类型
|
|
|
|
int eventType = Math.toIntExact(dcEvent.getEventType()); |
|
|
|
switch (eventType){ |
|
|
|
switch (eventType) { |
|
|
|
//交通事故
|
|
|
|
case 1: |
|
|
|
dcEvent.getDcEventAccident().setId(uuid); |
|
|
|
int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident()); |
|
|
|
if (dcEvent.getDcEventAccident() != null) { |
|
|
|
dcEvent.getDcEventAccident().setId(uuid); |
|
|
|
int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident()); |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
//车辆事故
|
|
|
|
case 2: |
|
|
|
dcEvent.getDcEventVehicleAccident().setId(uuid); |
|
|
|
int i5 = dcEventVehicleAccidentMapper.insertDcEventVehicleAccident(dcEvent.getDcEventVehicleAccident()); |
|
|
|
if (dcEvent.getDcEventVehicleAccident()!=null){ |
|
|
|
dcEvent.getDcEventVehicleAccident().setId(uuid); |
|
|
|
int i5 = dcEventVehicleAccidentMapper.insertDcEventVehicleAccident(dcEvent.getDcEventVehicleAccident()); |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
//交通管制
|
|
|
|
case 3: |
|
|
|
dcEvent.getDcEventTrafficControl().setId(uuid); |
|
|
|
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); |
|
|
|
if (dcEvent.getDcEventTrafficControl()!=null){ |
|
|
|
dcEvent.getDcEventTrafficControl().setId(uuid); |
|
|
|
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); |
|
|
|
} |
|
|
|
break; |
|
|
|
//交通拥堵
|
|
|
|
case 4: |
|
|
|
dcEvent.getDcEventTrafficCongestion().setId(uuid); |
|
|
|
int i4 = dcEventTrafficCongestionMapper.insertDcEventTrafficCongestion(dcEvent.getDcEventTrafficCongestion()); |
|
|
|
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: |
|
|
|
dcEvent.getDcEventConstruction().setId(uuid); |
|
|
|
int i2 = dcEventConstructionMapper.insertDcEventConstruction(dcEvent.getDcEventConstruction()); |
|
|
|
if (dcEvent.getDcEventConstruction()!=null){ |
|
|
|
dcEvent.getDcEventConstruction().setId(uuid); |
|
|
|
int i2 = dcEventConstructionMapper.insertDcEventConstruction(dcEvent.getDcEventConstruction()); |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
//服务区异常
|
|
|
|
case 8: |
|
|
|
dcEvent.getDcEventServiceArea().setId(uuid); |
|
|
|
int i3 = dcEventServiceAreaMapper.insertDcEventServiceArea(dcEvent.getDcEventServiceArea()); |
|
|
|
if (dcEvent.getDcEventServiceArea()!=null){ |
|
|
|
dcEvent.getDcEventServiceArea().setId(uuid); |
|
|
|
int i3 = dcEventServiceAreaMapper.insertDcEventServiceArea(dcEvent.getDcEventServiceArea()); |
|
|
|
} |
|
|
|
break; |
|
|
|
//设施设备隐患
|
|
|
|
case 9: |
|
|
|
break; |
|
|
|
//异常天气
|
|
|
|
case 10: |
|
|
|
dcEvent.getDcEventAbnormalWeather().setId(uuid); |
|
|
|
int i = dcEventAbnormalWeatherMapper.insertDcEventAbnormalWeather(dcEvent.getDcEventAbnormalWeather()); |
|
|
|
if (dcEvent.getDcEventAbnormalWeather()!=null){ |
|
|
|
dcEvent.getDcEventAbnormalWeather().setId(uuid); |
|
|
|
int i = dcEventAbnormalWeatherMapper.insertDcEventAbnormalWeather(dcEvent.getDcEventAbnormalWeather()); |
|
|
|
} |
|
|
|
break; |
|
|
|
//其他事件
|
|
|
|
case 11: |
|
|
@ -196,7 +206,7 @@ dcEvent.setUserId(SecurityUtils.getUserId()); |
|
|
|
|
|
|
|
} |
|
|
|
return i7; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
return -1; |
|
|
|
} |
|
|
|
} |
|
|
@ -208,18 +218,17 @@ 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) { |
|
|
|
if (i7 > 0) { |
|
|
|
|
|
|
|
//中间库
|
|
|
|
// MdEvent mdEvent = new MdEvent(dcEvent);
|
|
|
|
// middleDatabaseService.updateMiddleDatabaseEvent(mdEvent);
|
|
|
|
|
|
|
|
int eventType = Math.toIntExact(dcEvent.getEventType()); |
|
|
|
switch (eventType){ |
|
|
|
switch (eventType) { |
|
|
|
//交通事故
|
|
|
|
case 1: |
|
|
|
int i1 = dcEventAccidentMapper.updateDcEventAccident(dcEvent.getDcEventAccident()); |
|
|
@ -267,7 +276,7 @@ dcEvent.setUserId(SecurityUtils.getUserId()); |
|
|
|
|
|
|
|
} |
|
|
|
return i7; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
return -1; |
|
|
|
} |
|
|
|
|
|
|
@ -280,10 +289,9 @@ 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){ |
|
|
|
if (i7 > 0) { |
|
|
|
switch (eventType) { |
|
|
|
//交通事故
|
|
|
|
case 1: |
|
|
@ -330,11 +338,12 @@ dcEvent.setUserId(SecurityUtils.getUserId()); |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
return i7; |
|
|
|
}else { |
|
|
|
return i7; |
|
|
|
} else { |
|
|
|
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,82 +365,83 @@ dcEvent.setUserId(SecurityUtils.getUserId()); |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取事件以及子类详细信息 |
|
|
|
* |
|
|
|
* @param eventType |
|
|
|
* @param id |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public DcEvent selectEventSubclassById(int eventType, String id) { |
|
|
|
//todo
|
|
|
|
DcEvent dcEvent = dcEventMapper.selectDcEventById(id); |
|
|
|
switch (eventType) { |
|
|
|
//交通事故
|
|
|
|
case 1: |
|
|
|
DcEventAccident dcEventAccident = dcEventAccidentMapper.selectDcEventAccidentById(id); |
|
|
|
dcEvent.setDcEventAccident(dcEventAccident); |
|
|
|
break; |
|
|
|
//车辆事故
|
|
|
|
case 2: |
|
|
|
DcEventVehicleAccident dcEventVehicleAccident = dcEventVehicleAccidentMapper.selectDcEventVehicleAccidentById(id); |
|
|
|
dcEvent.setDcEventVehicleAccident(dcEventVehicleAccident); |
|
|
|
break; |
|
|
|
//交通管制
|
|
|
|
case 3: |
|
|
|
DcEventTrafficControl dcEventTrafficControl = dcEventTrafficControlMapper.selectDcEventTrafficControlById(id); |
|
|
|
dcEvent.setDcEventTrafficControl(dcEventTrafficControl); |
|
|
|
break; |
|
|
|
//交通拥堵
|
|
|
|
case 4: |
|
|
|
DcEventTrafficCongestion dcEventTrafficCongestion = dcEventTrafficCongestionMapper.selectDcEventTrafficCongestionById(id); |
|
|
|
dcEvent.setDcEventTrafficCongestion(dcEventTrafficCongestion); |
|
|
|
break; |
|
|
|
//非法上路
|
|
|
|
case 5: |
|
|
|
break; |
|
|
|
//路障清除
|
|
|
|
case 6: |
|
|
|
break; |
|
|
|
//施工建设
|
|
|
|
case 7: |
|
|
|
DcEventConstruction dcEventConstruction = dcEventConstructionMapper.selectDcEventConstructionById(id); |
|
|
|
dcEvent.setDcEventConstruction(dcEventConstruction); |
|
|
|
break; |
|
|
|
//服务区异常
|
|
|
|
case 8: |
|
|
|
DcEventServiceArea dcEventServiceArea = dcEventServiceAreaMapper.selectDcEventServiceAreaById(id); |
|
|
|
dcEvent.setDcEventServiceArea(dcEventServiceArea); |
|
|
|
break; |
|
|
|
//设施设备隐患
|
|
|
|
case 9: |
|
|
|
break; |
|
|
|
//异常天气
|
|
|
|
case 10: |
|
|
|
DcEventAbnormalWeather dcEventAbnormalWeather = dcEventAbnormalWeatherMapper.selectDcEventAbnormalWeatherById(id); |
|
|
|
dcEvent.setDcEventAbnormalWeather(dcEventAbnormalWeather); |
|
|
|
break; |
|
|
|
//其他事件
|
|
|
|
case 11: |
|
|
|
break; |
|
|
|
//
|
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
return dcEvent; |
|
|
|
//todo
|
|
|
|
DcEvent dcEvent = dcEventMapper.selectDcEventById(id); |
|
|
|
switch (eventType) { |
|
|
|
//交通事故
|
|
|
|
case 1: |
|
|
|
DcEventAccident dcEventAccident = dcEventAccidentMapper.selectDcEventAccidentById(id); |
|
|
|
dcEvent.setDcEventAccident(dcEventAccident); |
|
|
|
break; |
|
|
|
//车辆事故
|
|
|
|
case 2: |
|
|
|
DcEventVehicleAccident dcEventVehicleAccident = dcEventVehicleAccidentMapper.selectDcEventVehicleAccidentById(id); |
|
|
|
dcEvent.setDcEventVehicleAccident(dcEventVehicleAccident); |
|
|
|
break; |
|
|
|
//交通管制
|
|
|
|
case 3: |
|
|
|
DcEventTrafficControl dcEventTrafficControl = dcEventTrafficControlMapper.selectDcEventTrafficControlById(id); |
|
|
|
dcEvent.setDcEventTrafficControl(dcEventTrafficControl); |
|
|
|
break; |
|
|
|
//交通拥堵
|
|
|
|
case 4: |
|
|
|
DcEventTrafficCongestion dcEventTrafficCongestion = dcEventTrafficCongestionMapper.selectDcEventTrafficCongestionById(id); |
|
|
|
dcEvent.setDcEventTrafficCongestion(dcEventTrafficCongestion); |
|
|
|
break; |
|
|
|
//非法上路
|
|
|
|
case 5: |
|
|
|
break; |
|
|
|
//路障清除
|
|
|
|
case 6: |
|
|
|
break; |
|
|
|
//施工建设
|
|
|
|
case 7: |
|
|
|
DcEventConstruction dcEventConstruction = dcEventConstructionMapper.selectDcEventConstructionById(id); |
|
|
|
dcEvent.setDcEventConstruction(dcEventConstruction); |
|
|
|
break; |
|
|
|
//服务区异常
|
|
|
|
case 8: |
|
|
|
DcEventServiceArea dcEventServiceArea = dcEventServiceAreaMapper.selectDcEventServiceAreaById(id); |
|
|
|
dcEvent.setDcEventServiceArea(dcEventServiceArea); |
|
|
|
break; |
|
|
|
//设施设备隐患
|
|
|
|
case 9: |
|
|
|
break; |
|
|
|
//异常天气
|
|
|
|
case 10: |
|
|
|
DcEventAbnormalWeather dcEventAbnormalWeather = dcEventAbnormalWeatherMapper.selectDcEventAbnormalWeatherById(id); |
|
|
|
dcEvent.setDcEventAbnormalWeather(dcEventAbnormalWeather); |
|
|
|
break; |
|
|
|
//其他事件
|
|
|
|
case 11: |
|
|
|
break; |
|
|
|
//
|
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
return dcEvent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String,Object> selectCount() { |
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
public Map<String, Object> selectCount() { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
int i = dcWarningMapper.selectCount(); |
|
|
|
System.out.println("***********************************"+i); |
|
|
|
List<Map<String,String>> strings = dcEventMapper.selectCount(); |
|
|
|
System.out.println("***********************************" + i); |
|
|
|
List<Map<String, String>> strings = dcEventMapper.selectCount(); |
|
|
|
for (int i1 = 0; i1 < strings.size(); i1++) { |
|
|
|
strings.get(i1).get("status"); |
|
|
|
strings.get(i1).get("count"); |
|
|
|
map.put(strings.get(i1).get("status"),strings.get(i1).get("count")); |
|
|
|
map.put(strings.get(i1).get("status"), strings.get(i1).get("count")); |
|
|
|
} |
|
|
|
map.put("warningCount",i); |
|
|
|
map.put("warningCount", i); |
|
|
|
return map; |
|
|
|
} |
|
|
|
} |
|
|
|