Browse Source

修改添加无桩号事件逻辑

develop
王兴琳 9 months ago
parent
commit
02ead12876
  1. 65
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

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

@ -59,6 +59,8 @@ public class DcEventServiceImpl implements IDcEventService {
private ISysDeptService deptService;
@Autowired
private IMiddleDatabaseService middleDatabaseService;
//查询路网信息
private DcFacilityServiceImpl dcFacilityService;
/**
@ -124,6 +126,38 @@ public class DcEventServiceImpl implements IDcEventService {
dcEvent.setUserId(SecurityUtils.getUserId());
dcEvent.setCreateTime(DateUtils.getNowDate());
//处理无桩号事件
//交通事故
if (dcEvent.getDcEventAccident().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventAccident().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
//车辆事故
if (dcEvent.getDcEventVehicleAccident().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventVehicleAccident().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
//交通管制
if (dcEvent.getDcEventTrafficControl().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
//交通拥堵
if (dcEvent.getDcEventTrafficCongestion().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventTrafficCongestion().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
//施工建设
if (dcEvent.getDcEventConstruction().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventConstruction().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
//服务区异常
if (dcEvent.getDcEventServiceArea().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventServiceArea().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId));
}
int i7 = dcEventMapper.insertDcEvent(dcEvent);
if (i7 > 0) {
@ -139,13 +173,14 @@ public class DcEventServiceImpl implements IDcEventService {
case 1:
if (dcEvent.getDcEventAccident() != null) {
dcEvent.getDcEventAccident().setId(uuid);
int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident());
}
break;
//车辆事故
case 2:
if (dcEvent.getDcEventVehicleAccident()!=null){
if (dcEvent.getDcEventVehicleAccident() != null) {
dcEvent.getDcEventVehicleAccident().setId(uuid);
int i5 = dcEventVehicleAccidentMapper.insertDcEventVehicleAccident(dcEvent.getDcEventVehicleAccident());
}
@ -153,14 +188,14 @@ public class DcEventServiceImpl implements IDcEventService {
break;
//交通管制
case 3:
if (dcEvent.getDcEventTrafficControl()!=null){
if (dcEvent.getDcEventTrafficControl() != null) {
dcEvent.getDcEventTrafficControl().setId(uuid);
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
}
break;
//交通拥堵
case 4:
if (dcEvent.getDcEventTrafficCongestion()!=null){
if (dcEvent.getDcEventTrafficCongestion() != null) {
dcEvent.getDcEventTrafficCongestion().setId(uuid);
int i4 = dcEventTrafficCongestionMapper.insertDcEventTrafficCongestion(dcEvent.getDcEventTrafficCongestion());
}
@ -174,7 +209,7 @@ public class DcEventServiceImpl implements IDcEventService {
break;
//施工建设
case 7:
if (dcEvent.getDcEventConstruction()!=null){
if (dcEvent.getDcEventConstruction() != null) {
dcEvent.getDcEventConstruction().setId(uuid);
int i2 = dcEventConstructionMapper.insertDcEventConstruction(dcEvent.getDcEventConstruction());
}
@ -182,7 +217,7 @@ public class DcEventServiceImpl implements IDcEventService {
break;
//服务区异常
case 8:
if (dcEvent.getDcEventServiceArea()!=null){
if (dcEvent.getDcEventServiceArea() != null) {
dcEvent.getDcEventServiceArea().setId(uuid);
int i3 = dcEventServiceAreaMapper.insertDcEventServiceArea(dcEvent.getDcEventServiceArea());
}
@ -192,7 +227,7 @@ public class DcEventServiceImpl implements IDcEventService {
break;
//异常天气
case 10:
if (dcEvent.getDcEventAbnormalWeather()!=null){
if (dcEvent.getDcEventAbnormalWeather() != null) {
dcEvent.getDcEventAbnormalWeather().setId(uuid);
int i = dcEventAbnormalWeatherMapper.insertDcEventAbnormalWeather(dcEvent.getDcEventAbnormalWeather());
}
@ -211,6 +246,12 @@ public class DcEventServiceImpl implements IDcEventService {
}
}
//根据路网设施查询桩号
private String extracted(String facilityId) {
DcFacility facility = dcFacilityService.getFacility(facilityId);
return facility.getStakeMark();
}
@Override
public int insertDcEventWarning(DcEvent dcEvent) {
//设置事件Id UUID无下划线格式32
@ -234,7 +275,7 @@ public class DcEventServiceImpl implements IDcEventService {
break;
//车辆事故
case 2:
if (dcEvent.getDcEventVehicleAccident()!=null){
if (dcEvent.getDcEventVehicleAccident() != null) {
dcEvent.getDcEventVehicleAccident().setId(uuid);
int i5 = dcEventVehicleAccidentMapper.insertDcEventVehicleAccident(dcEvent.getDcEventVehicleAccident());
}
@ -242,14 +283,14 @@ public class DcEventServiceImpl implements IDcEventService {
break;
//交通管制
case 3:
if (dcEvent.getDcEventTrafficControl()!=null){
if (dcEvent.getDcEventTrafficControl() != null) {
dcEvent.getDcEventTrafficControl().setId(uuid);
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
}
break;
//交通拥堵
case 4:
if (dcEvent.getDcEventTrafficCongestion()!=null){
if (dcEvent.getDcEventTrafficCongestion() != null) {
dcEvent.getDcEventTrafficCongestion().setId(uuid);
int i4 = dcEventTrafficCongestionMapper.insertDcEventTrafficCongestion(dcEvent.getDcEventTrafficCongestion());
}
@ -263,7 +304,7 @@ public class DcEventServiceImpl implements IDcEventService {
break;
//施工建设
case 7:
if (dcEvent.getDcEventConstruction()!=null){
if (dcEvent.getDcEventConstruction() != null) {
dcEvent.getDcEventConstruction().setId(uuid);
int i2 = dcEventConstructionMapper.insertDcEventConstruction(dcEvent.getDcEventConstruction());
}
@ -271,7 +312,7 @@ public class DcEventServiceImpl implements IDcEventService {
break;
//服务区异常
case 8:
if (dcEvent.getDcEventServiceArea()!=null){
if (dcEvent.getDcEventServiceArea() != null) {
dcEvent.getDcEventServiceArea().setId(uuid);
int i3 = dcEventServiceAreaMapper.insertDcEventServiceArea(dcEvent.getDcEventServiceArea());
}
@ -281,7 +322,7 @@ public class DcEventServiceImpl implements IDcEventService {
break;
//异常天气
case 10:
if (dcEvent.getDcEventAbnormalWeather()!=null){
if (dcEvent.getDcEventAbnormalWeather() != null) {
dcEvent.getDcEventAbnormalWeather().setId(uuid);
int i = dcEventAbnormalWeatherMapper.insertDcEventAbnormalWeather(dcEvent.getDcEventAbnormalWeather());
}

Loading…
Cancel
Save