|
|
@ -1,11 +1,16 @@ |
|
|
|
package com.zc.business.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
|
import com.ruoyi.common.core.redis.RedisCache; |
|
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
|
import com.ruoyi.common.utils.SecurityUtils; |
|
|
|
import com.ruoyi.common.utils.uuid.IdUtils; |
|
|
|
import com.zc.business.domain.*; |
|
|
|
import com.zc.business.domain.DcEvent; |
|
|
|
import com.zc.business.domain.DcWaringStrategy; |
|
|
|
import com.zc.business.domain.DcWarning; |
|
|
|
import com.zc.business.domain.DcWarningBatchConvert; |
|
|
|
import com.zc.business.enums.ValueConverter; |
|
|
|
import com.zc.business.mapper.DcEventMapper; |
|
|
|
import com.zc.business.mapper.DcWarningMapper; |
|
|
@ -16,11 +21,14 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
import org.json.JSONObject; |
|
|
|
import org.json.JSONArray; |
|
|
|
/** |
|
|
|
* 预警信息Service业务层处理 |
|
|
|
* |
|
|
@ -37,6 +45,12 @@ public class DcWarningServiceImpl implements IDcWarningService |
|
|
|
private DcEventMapper dcEventMapper; |
|
|
|
@Autowired |
|
|
|
private IDcEventService dcEventService; |
|
|
|
@Resource |
|
|
|
private RedisCache redisCache; |
|
|
|
|
|
|
|
private static final String WARNINGSTRATEGY = "warningStrategy";//redis策略缓存的key
|
|
|
|
private static final String WARNINGDATA = "warningData:";//redis事件缓存的key
|
|
|
|
private static String JUDGE = "1"; //自定义判断参数,1为满足0为不满足
|
|
|
|
/** |
|
|
|
* 查询预警信息 |
|
|
|
* |
|
|
@ -44,7 +58,7 @@ public class DcWarningServiceImpl implements IDcWarningService |
|
|
|
* @return 预警信息 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public DcWarning selectDcWarningById(String id) |
|
|
|
public HashMap<String, Object> selectDcWarningById(String id) |
|
|
|
{ |
|
|
|
return dcWarningMapper.selectDcWarningById(id); |
|
|
|
} |
|
|
@ -75,15 +89,149 @@ public class DcWarningServiceImpl implements IDcWarningService |
|
|
|
@Override |
|
|
|
public int insertDcWarning(DcWarning dcWarning) |
|
|
|
{ |
|
|
|
|
|
|
|
dcWarning.setCreateTime(DateUtils.getNowDate()); |
|
|
|
if (dcWarning.getId()==null) { |
|
|
|
//设置事件Id UUID无下划线格式32
|
|
|
|
String uuid = IdUtils.fastSimpleUUID(); |
|
|
|
dcWarning.setId(uuid); |
|
|
|
//设置事件Id UUID无下划线格式32
|
|
|
|
String uuid = IdUtils.fastSimpleUUID(); |
|
|
|
dcWarning.setId(uuid); |
|
|
|
int priority = new DcWarningServiceImpl().priority(dcWarning); |
|
|
|
if (priority==0){ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
return dcWarningMapper.insertDcWarning(dcWarning); |
|
|
|
} |
|
|
|
|
|
|
|
//优先级策略
|
|
|
|
public int priority(DcWarning dcWarning){ |
|
|
|
if (StringUtils.isBlank(dcWarning.getStakeMark())||dcWarning.getWarningSource()==null||dcWarning.getWarningType()==null|| |
|
|
|
StringUtils.isBlank(dcWarning.getWarningSubclass())||StringUtils.isBlank(dcWarning.getDirection())){ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
String redisKye=dcWarning.getWarningSource().toString()+dcWarning.getWarningType().toString()+dcWarning.getWarningSubclass();//配置数据的key 事件源+事件类型+策略
|
|
|
|
Map<String, JSONObject> redisWarningStrategy = redisCache.getCacheMap(WARNINGSTRATEGY);//获取缓存全部的配置数据
|
|
|
|
if (redisWarningStrategy==null){//如果缓存为空,查询数据重新加入缓存
|
|
|
|
Map<String, JSONObject> redisMap = new HashMap<>(); |
|
|
|
List<DcWaringStrategy> dcWaringStrategies = dcWarningMapper.selectDcWaringStrategyList();//数据库全部配置数据
|
|
|
|
for (DcWaringStrategy waringStrategy : dcWaringStrategies) { |
|
|
|
String key = waringStrategy.getWarningSource().toString() + waringStrategy.getWarningType().toString() |
|
|
|
+ waringStrategy.getWarningSubclass()+waringStrategy.getStrategy().toString();//redis配置数据key
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("strategy", waringStrategy.getStrategy());//策略模式
|
|
|
|
jsonObject.put("strategyTime", waringStrategy.getStrategyTime());//模式时长,单位为分钟
|
|
|
|
jsonObject.put("priority", waringStrategy.getPriority());//策略模式
|
|
|
|
redisMap.put(key, jsonObject); |
|
|
|
} |
|
|
|
redisCache.setCacheMap(WARNINGSTRATEGY, redisMap);//数据库配置数据加入缓存中
|
|
|
|
redisWarningStrategy = redisCache.getCacheMap(WARNINGSTRATEGY);//缓存数据为空重新加入到缓存在取出缓存的配置
|
|
|
|
} |
|
|
|
String key=dcWarning.getStakeMark()+dcWarning.getDirection()+dcWarning.getWarningSource(). |
|
|
|
toString()+dcWarning.getWarningType().toString()+dcWarning.getWarningSubclass();//key,redis存储事件的key(桩号+方向+事件源+类型)
|
|
|
|
String dataId = redisCache.getCacheObject(WARNINGDATA + key);//查看redis是否存在数据(id的值)
|
|
|
|
JSONObject redisValueOne = redisWarningStrategy.get(redisKye+"1");//查看传入的事件类型是否配置策略1(优先级策略)
|
|
|
|
if(redisValueOne!=null){//执行策略1(暂时未定义,定义后开发)
|
|
|
|
|
|
|
|
} |
|
|
|
JSONObject redisValueTwo = redisWarningStrategy.get(redisKye+"2");//查看传入的事件类型是否配置策略2(延迟策略)
|
|
|
|
if (redisValueOne==null&&redisValueTwo!=null){ //执行策略2,执行到这里说明1不存在或者1未满足过滤条件
|
|
|
|
String strategyTime = redisValueTwo.getString("strategyTime").toString();//策略时长
|
|
|
|
if (dataId==null){//如果不存在直接加入数据库,加入缓存,配置对应的过期时间
|
|
|
|
int insertDcWarning = new DcWarningServiceImpl().insertDcWarning(dcWarning);//加入数据库
|
|
|
|
if (insertDcWarning==0){ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
String id = dcWarning.getId();//取出加入后的id作为value
|
|
|
|
redisCache.setCacheObject(WARNINGDATA+key,id,Integer.parseInt(strategyTime),TimeUnit.MINUTES);//加入缓存并设置延迟时间(单位分钟)
|
|
|
|
} |
|
|
|
//redis存在数据,取出redis的id找对对应事件的配置,合成事件配置,重新定义延迟时间
|
|
|
|
HashMap<String, Object> map = dcWarningMapper.selectDcWarningById(dataId); |
|
|
|
String otherConfig = map.get("otherConfig").toString();//取出原id的配置信息
|
|
|
|
String otherConfigString = dcWarning.getOtherConfig();//新增的配置信息
|
|
|
|
JSONObject jsonObjectOne = new JSONObject(otherConfig); |
|
|
|
JSONObject jsonObjectTwo = new JSONObject(otherConfigString); |
|
|
|
JSONObject jsonObject = new DcWarningServiceImpl().mergeJsonObjects(jsonObjectOne, jsonObjectTwo);//合成新的json
|
|
|
|
Integer integer = dcWarningMapper.updateOtherConfig(dataId, jsonObject.toString());//修改数据库配置
|
|
|
|
redisCache.setCacheObject(WARNINGDATA+key,dataId,Integer.parseInt(strategyTime),TimeUnit.MINUTES);//重新设置延迟时间
|
|
|
|
if (integer==0){ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
return 1; |
|
|
|
} |
|
|
|
JSONObject redisValueThree = redisWarningStrategy.get(redisKye+"3");//查看传入的事件类型是否配置策略3(时间窗口策略)
|
|
|
|
if (redisValueOne==null&&redisValueTwo==null&&redisValueThree!=null){ //执行策略3,执行到这里说明1不存在或者2不存在或者1未满足过滤条件
|
|
|
|
if (dataId==null){//如果不存在直接加入数据库,加入缓存,配置对应的过期时间(30分钟)
|
|
|
|
int insertDcWarning = new DcWarningServiceImpl().insertDcWarning(dcWarning);//加入数据库
|
|
|
|
if (insertDcWarning==0){ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
String id = dcWarning.getId();//取出加入后的id作为value
|
|
|
|
redisCache.setCacheObject(WARNINGDATA+key,id,30,TimeUnit.MINUTES);//加入缓存并设置延迟时间(单位分钟)
|
|
|
|
} |
|
|
|
//redis存在数据,取出redis的id找对对应事件的配置,合成事件配置
|
|
|
|
HashMap<String, Object> map = dcWarningMapper.selectDcWarningById(dataId); |
|
|
|
String otherConfig = map.get("otherConfig").toString();//取出原id的配置信息
|
|
|
|
String otherConfigString = dcWarning.getOtherConfig();//新增的配置信息
|
|
|
|
JSONObject jsonObjectOne = new JSONObject(otherConfig); |
|
|
|
JSONObject jsonObjectTwo = new JSONObject(otherConfigString); |
|
|
|
JSONObject jsonObject = new DcWarningServiceImpl().mergeJsonObjects(jsonObjectOne, jsonObjectTwo);//合成新的json
|
|
|
|
Integer integer = dcWarningMapper.updateOtherConfig(dataId, jsonObject.toString());//修改数据库配置
|
|
|
|
if (integer==0){ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
return 1; |
|
|
|
} |
|
|
|
JSONObject redisValueFour = redisWarningStrategy.get(redisKye+"4");//查看传入的事件类型是否配置策略3(自动结束策略)
|
|
|
|
if (redisValueOne==null&&redisValueTwo==null&&redisValueThree==null&&redisValueFour!=null){ //执行策略4,执行到这里说明1不存在或者2、3不存在或者1未满足过滤条件
|
|
|
|
if (dataId==null){//如果不存在直接加入数据库,加入缓存
|
|
|
|
int insertDcWarning = new DcWarningServiceImpl().insertDcWarning(dcWarning);//加入数据库
|
|
|
|
if (insertDcWarning==0){ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
String id = dcWarning.getId();//取出加入后的id作为value
|
|
|
|
redisCache.setCacheObject(WARNINGDATA+key,id);//加入缓存????存在问题会数据累计
|
|
|
|
} |
|
|
|
//redis存在数据,取出redis的id找对对应事件的配置,合成事件配置
|
|
|
|
HashMap<String, Object> map = dcWarningMapper.selectDcWarningById(dataId); |
|
|
|
String otherConfig = map.get("otherConfig").toString();//取出原id的配置信息
|
|
|
|
String otherConfigString = dcWarning.getOtherConfig();//新增的配置信息
|
|
|
|
JSONObject jsonObjectOne = new JSONObject(otherConfig); |
|
|
|
JSONObject jsonObjectTwo = new JSONObject(otherConfigString); |
|
|
|
JSONObject jsonObject = new DcWarningServiceImpl().mergeJsonObjects(jsonObjectOne, jsonObjectTwo);//合成新的json
|
|
|
|
Integer integer = dcWarningMapper.updateOtherConfig(dataId, jsonObject.toString());//修改数据库配置
|
|
|
|
redisCache.deleteObject(WARNINGDATA + key);//删除对应的合成事件
|
|
|
|
if (integer==0){ |
|
|
|
return 0; |
|
|
|
} |
|
|
|
return 1; |
|
|
|
} |
|
|
|
return 1; |
|
|
|
} |
|
|
|
private JSONObject mergeJsonObjects(JSONObject jsonObjectOne, JSONObject jsonObjectTwo){ |
|
|
|
// 合并videoList
|
|
|
|
if (jsonObjectTwo.has("videoList")) { |
|
|
|
JSONArray videoListTwo = jsonObjectTwo.getJSONArray("videoList"); |
|
|
|
JSONArray videoListOne = jsonObjectOne.optJSONArray("videoList"); |
|
|
|
if (videoListOne == null) { |
|
|
|
videoListOne = new JSONArray(); |
|
|
|
} |
|
|
|
for (int i = 0; i < videoListTwo.length(); i++) { |
|
|
|
videoListOne.put(videoListTwo.get(i)); |
|
|
|
} |
|
|
|
jsonObjectOne.put("videoList", videoListOne); |
|
|
|
} |
|
|
|
// 合并pictures
|
|
|
|
if (jsonObjectTwo.has("pictures")) { |
|
|
|
JSONArray picturesTwo = jsonObjectTwo.getJSONArray("pictures"); |
|
|
|
JSONArray picturesOne = jsonObjectOne.optJSONArray("pictures"); |
|
|
|
if (picturesOne == null) { |
|
|
|
picturesOne = new JSONArray(); |
|
|
|
} |
|
|
|
for (int i = 0; i < picturesTwo.length(); i++) { |
|
|
|
picturesOne.put(picturesTwo.get(i)); |
|
|
|
} |
|
|
|
jsonObjectOne.put("pictures", picturesOne); |
|
|
|
} |
|
|
|
return jsonObjectOne; |
|
|
|
} |
|
|
|
/** |
|
|
|
* 修改预警信息 |
|
|
|
* |
|
|
@ -203,7 +351,7 @@ public class DcWarningServiceImpl implements IDcWarningService |
|
|
|
if ("0".equals(dcWarningBatchConvert.getType())){ |
|
|
|
dcWarningMapper.batchDelete(dcWarningList); |
|
|
|
} else { |
|
|
|
//确认,批量转换为事件
|
|
|
|
//确认,批量转换为事件
|
|
|
|
List<DcEvent> dcEventList = new ArrayList<>(); |
|
|
|
for (DcWarning dcWarning : dcWarningList) { |
|
|
|
if (dcWarning == null || dcWarning.getId() == null || StringUtils.isBlank(dcWarning.getStakeMark()) || |
|
|
@ -238,156 +386,6 @@ public class DcWarningServiceImpl implements IDcWarningService |
|
|
|
dcEvent.setCreateTime(DateUtils.getNowDate());//创建时间
|
|
|
|
dcEvent.setUserId(SecurityUtils.getUserId());//处置人员
|
|
|
|
|
|
|
|
Calendar cal = Calendar.getInstance(); |
|
|
|
cal.add(Calendar.HOUR,3); |
|
|
|
dcEvent.setEstimatedEndTime(cal.getTime()); //预计解除时间
|
|
|
|
dcEvent.setRoadId(1L); //道路id
|
|
|
|
dcEvent.setRoadName("济菏高速"); //道路id
|
|
|
|
dcEvent.setInTunnel(0); //是否处在隧道
|
|
|
|
|
|
|
|
|
|
|
|
Integer warningType = dcWarning.getWarningType(); |
|
|
|
if (warningType == 1){ |
|
|
|
|
|
|
|
//交通拥堵
|
|
|
|
DcEventTrafficCongestion dcEventTrafficCongestion = new DcEventTrafficCongestion(); |
|
|
|
dcEventTrafficCongestion.setId(dcWarning.getId()); |
|
|
|
dcEventTrafficCongestion.setCongestionCause(5L); |
|
|
|
dcEventTrafficCongestion.setCongestionMileage(0F); |
|
|
|
dcEventTrafficCongestion.setMaxCongestionMileage(0F); |
|
|
|
dcEvent.setDcEventTrafficCongestion(dcEventTrafficCongestion); |
|
|
|
} else if (warningType == 4) { |
|
|
|
//停车
|
|
|
|
DcEventVehicleAccident dcEventVehicleAccident = new DcEventVehicleAccident(); |
|
|
|
dcEventVehicleAccident.setId(dcWarning.getId()); |
|
|
|
|
|
|
|
if (dcWarning.getWarningSource() == 1) { |
|
|
|
dcEventVehicleAccident.setReporterName("视频AI"); |
|
|
|
} else if (dcWarning.getWarningSource() == 2) { |
|
|
|
dcEventVehicleAccident.setReporterName("雷达识别"); |
|
|
|
} else if (dcWarning.getWarningSource() == 3) { |
|
|
|
dcEventVehicleAccident.setReporterName("智慧锥桶"); |
|
|
|
} else if (dcWarning.getWarningSource() == 4) { |
|
|
|
dcEventVehicleAccident.setReporterName("护栏碰撞"); |
|
|
|
} else if (dcWarning.getWarningSource() == 6) { |
|
|
|
dcEventVehicleAccident.setReporterName("非机预警"); |
|
|
|
} |
|
|
|
dcEventVehicleAccident.setReporterPhoneNumber("96659"); |
|
|
|
dcEventVehicleAccident.setLocationType(1L); |
|
|
|
dcEventVehicleAccident.setTrafficJam(0L); |
|
|
|
dcEventVehicleAccident.setWeatherCondition(1L); |
|
|
|
dcEventVehicleAccident.setCongestionAhead(1); |
|
|
|
dcEventVehicleAccident.setAtIntersection(1); |
|
|
|
dcEventVehicleAccident.setOnCurve(1); |
|
|
|
dcEventVehicleAccident.setSmallCar(0L); |
|
|
|
dcEventVehicleAccident.setTrucks(0L); |
|
|
|
dcEventVehicleAccident.setBuses(0L); |
|
|
|
dcEventVehicleAccident.setTankers(0L); |
|
|
|
dcEventVehicleAccident.setMinorInjuries(0L); |
|
|
|
dcEventVehicleAccident.setSeriousInjuries(0L); |
|
|
|
dcEventVehicleAccident.setFatalities(0L); |
|
|
|
dcEvent.setDcEventVehicleAccident(dcEventVehicleAccident); |
|
|
|
} else if (warningType == 7){ |
|
|
|
//道路施工
|
|
|
|
|
|
|
|
} else if (warningType == 8) { |
|
|
|
//异常天气
|
|
|
|
DcEventAbnormalWeather dcEventAbnormalWeather = new DcEventAbnormalWeather(); |
|
|
|
dcEventAbnormalWeather.setId(dcWarning.getId()); |
|
|
|
dcEventAbnormalWeather.setEmergencyLevel(1L); |
|
|
|
dcEvent.setDcEventAbnormalWeather(dcEventAbnormalWeather); |
|
|
|
} else if (warningType == 9) { |
|
|
|
//护栏碰撞
|
|
|
|
DcEventAccident dcEventAccident = new DcEventAccident(); |
|
|
|
dcEventAccident.setId(dcWarning.getId()); |
|
|
|
if (dcWarning.getWarningSource() == 1) { |
|
|
|
dcEventAccident.setReporterName("视频AI"); |
|
|
|
dcEventAccident.setReporterPhoneNumber("96659"); |
|
|
|
} else if (dcWarning.getWarningSource() == 2) { |
|
|
|
dcEventAccident.setReporterName("雷达识别"); |
|
|
|
dcEventAccident.setReporterPhoneNumber("96659"); |
|
|
|
} else if (dcWarning.getWarningSource() == 3) { |
|
|
|
dcEventAccident.setReporterName("智慧锥桶"); |
|
|
|
dcEventAccident.setReporterPhoneNumber("96659"); |
|
|
|
} else if (dcWarning.getWarningSource() == 4) { |
|
|
|
dcEventAccident.setReporterName("护栏碰撞"); |
|
|
|
dcEventAccident.setReporterPhoneNumber("96659"); |
|
|
|
} else if (dcWarning.getWarningSource() == 5) { |
|
|
|
dcEventAccident.setReporterName("扫码报警"); |
|
|
|
JSONObject otherConfig = JSONObject.parseObject(dcWarning.getOtherConfig()); |
|
|
|
if (otherConfig != null && otherConfig.containsKey("phone")) { |
|
|
|
dcEventAccident.setReporterPhoneNumber(otherConfig.getString("phone")); |
|
|
|
dcEventAccident.setVehicleOwnerPhone(otherConfig.getString("phone")); |
|
|
|
} |
|
|
|
} else if (dcWarning.getWarningSource() == 6) { |
|
|
|
dcEventAccident.setReporterName("非机预警"); |
|
|
|
dcEventAccident.setReporterPhoneNumber("96659"); |
|
|
|
} |
|
|
|
dcEventAccident.setLocationType(1L); |
|
|
|
dcEventAccident.setTrafficJam(0f); |
|
|
|
dcEventAccident.setWeatherCondition(1L); |
|
|
|
dcEventAccident.setImpactLevel(1L); |
|
|
|
dcEventAccident.setIsReverseCargo(0); |
|
|
|
dcEventAccident.setIsMaintenance(0); |
|
|
|
dcEventAccident.setCongestionAhead(0); |
|
|
|
dcEventAccident.setOnCurve(0); |
|
|
|
dcEventAccident.setSmallCar(0L); |
|
|
|
dcEventAccident.setTrucks(0L); |
|
|
|
dcEventAccident.setBuses(0L); |
|
|
|
dcEventAccident.setTankers(0L); |
|
|
|
dcEventAccident.setMinorInjuries(0L); |
|
|
|
dcEventAccident.setSeriousInjuries(0L); |
|
|
|
dcEventAccident.setFatalities(0L); |
|
|
|
dcEvent.setDcEventAccident(dcEventAccident); |
|
|
|
} else if (warningType == 10) { |
|
|
|
//交通事故
|
|
|
|
DcEventAccident dcEventAccident = new DcEventAccident(); |
|
|
|
|
|
|
|
|
|
|
|
} else if (warningType == 11) { |
|
|
|
//车辆故障
|
|
|
|
DcEventVehicleAccident dcEventVehicleAccident = new DcEventVehicleAccident(); |
|
|
|
dcEventVehicleAccident.setId(dcWarning.getId()); |
|
|
|
|
|
|
|
if (dcWarning.getWarningSource() == 1) { |
|
|
|
dcEventVehicleAccident.setReporterName("视频AI"); |
|
|
|
dcEventVehicleAccident.setReporterPhoneNumber("96659"); |
|
|
|
} else if (dcWarning.getWarningSource() == 2) { |
|
|
|
dcEventVehicleAccident.setReporterName("雷达识别"); |
|
|
|
dcEventVehicleAccident.setReporterPhoneNumber("96659"); |
|
|
|
} else if (dcWarning.getWarningSource() == 3) { |
|
|
|
dcEventVehicleAccident.setReporterName("智慧锥桶"); |
|
|
|
dcEventVehicleAccident.setReporterPhoneNumber("96659"); |
|
|
|
} else if (dcWarning.getWarningSource() == 4) { |
|
|
|
dcEventVehicleAccident.setReporterName("护栏碰撞"); |
|
|
|
dcEventVehicleAccident.setReporterPhoneNumber("96659"); |
|
|
|
} else if (dcWarning.getWarningSource() == 5) { |
|
|
|
dcEventVehicleAccident.setReporterName("扫码报警"); |
|
|
|
JSONObject otherConfig = JSONObject.parseObject(dcWarning.getOtherConfig()); |
|
|
|
if (otherConfig != null && otherConfig.containsKey("phone")) { |
|
|
|
dcEventVehicleAccident.setReporterPhoneNumber(otherConfig.getString("phone")); |
|
|
|
} |
|
|
|
} else if (dcWarning.getWarningSource() == 6) { |
|
|
|
dcEventVehicleAccident.setReporterName("非机预警"); |
|
|
|
dcEventVehicleAccident.setReporterPhoneNumber("96659"); |
|
|
|
} |
|
|
|
dcEventVehicleAccident.setLocationType(1L); |
|
|
|
dcEventVehicleAccident.setTrafficJam(0L); |
|
|
|
dcEventVehicleAccident.setWeatherCondition(1L); |
|
|
|
dcEventVehicleAccident.setCongestionAhead(1); |
|
|
|
dcEventVehicleAccident.setAtIntersection(1); |
|
|
|
dcEventVehicleAccident.setOnCurve(1); |
|
|
|
dcEventVehicleAccident.setSmallCar(0L); |
|
|
|
dcEventVehicleAccident.setTrucks(0L); |
|
|
|
dcEventVehicleAccident.setBuses(0L); |
|
|
|
dcEventVehicleAccident.setTankers(0L); |
|
|
|
dcEventVehicleAccident.setMinorInjuries(0L); |
|
|
|
dcEventVehicleAccident.setSeriousInjuries(0L); |
|
|
|
dcEventVehicleAccident.setFatalities(0L); |
|
|
|
dcEvent.setDcEventVehicleAccident(dcEventVehicleAccident); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dcEventList.add(dcEvent); |
|
|
|
} |
|
|
|
|
|
|
@ -395,7 +393,6 @@ public class DcWarningServiceImpl implements IDcWarningService |
|
|
|
dcWarningMapper.batchUpdateState(SecurityUtils.getUserId(),dcWarningList); |
|
|
|
//批量插入事件表
|
|
|
|
dcEventService.batchInsertDcEventWarning(dcEventList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|