|
|
@ -938,14 +938,45 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
@Override |
|
|
|
|
|
|
|
public int updateDcEvent(DcEvent dcEvent) { |
|
|
|
/* |
|
|
|
//事件类型校验
|
|
|
|
for (EventTypeEnum value : EventTypeEnum.values()) { |
|
|
|
if (dcEvent.getEventType().toString().equals(value.getInfo())){ |
|
|
|
dcEvent.setEventType(Long.valueOf(value.getCode())); |
|
|
|
} |
|
|
|
//获取事件类型
|
|
|
|
int eventType = Math.toIntExact(dcEvent.getEventType()); |
|
|
|
|
|
|
|
//处理无桩号事件
|
|
|
|
//交通事故
|
|
|
|
if (eventType == UniversalEnum.ONE.getNumber() && dcEvent.getDcEventAccident().getFacilityId() != null) { |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventAccident().getFacilityId()); |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
|
//车辆事故
|
|
|
|
if (eventType == UniversalEnum.TWO.getNumber() && dcEvent.getDcEventVehicleAccident().getFacilityId() != null) { |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventVehicleAccident().getFacilityId()); |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
|
//交通管制
|
|
|
|
if (eventType == UniversalEnum.THREE.getNumber() && dcEvent.getDcEventTrafficControl().getFacilityIds() != null) { |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityIds()[UniversalEnum.ZERO.getNumber()]); |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
|
if (eventType == UniversalEnum.THREE.getNumber() && dcEvent.getDcEventTrafficControl().getFacilityId() != null && dcEvent.getDcEventTrafficControl().getFacilityId() > 0) { |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityId()); |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
|
//交通拥堵
|
|
|
|
if (eventType == UniversalEnum.FOUR.getNumber() && dcEvent.getDcEventTrafficCongestion().getFacilityId() != null) { |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventTrafficCongestion().getFacilityId()); |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
|
|
|
|
|
//施工建设
|
|
|
|
if (eventType == UniversalEnum.SEVEN.getNumber() && dcEvent.getDcEventConstruction().getFacilityId() != null) { |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventConstruction().getFacilityId()); |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
|
//服务区异常
|
|
|
|
if (eventType == UniversalEnum.EIGHT.getNumber() && dcEvent.getDcEventServiceArea().getFacilityId() != null) { |
|
|
|
String facilityId = String.valueOf(dcEvent.getDcEventServiceArea().getFacilityId()); |
|
|
|
dcEvent.setStakeMark(extracted(facilityId)); |
|
|
|
} |
|
|
|
*/ |
|
|
|
//桩号校验
|
|
|
|
if (!com.ruoyi.common.utils.StakeMarkUtils.checkStakeMark(dcEvent.getStakeMark())) { |
|
|
|
return UniversalEnum.MINUS_ONE.getNumber(); |
|
|
@ -997,7 +1028,6 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
MdEvent mdEvent = new MdEvent(dcEvent); |
|
|
|
middleDatabaseService.updateMiddleDatabaseEvent(mdEvent); |
|
|
|
|
|
|
|
int eventType = Math.toIntExact(dcEvent.getEventType()); |
|
|
|
switch (eventType) { |
|
|
|
//交通事故
|
|
|
|
case 1: |
|
|
|