Browse Source

修改添加无桩号事件处理逻辑

develop
王兴琳 9 months ago
parent
commit
5dfdf4e61a
  1. 20
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

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

@ -60,6 +60,7 @@ public class DcEventServiceImpl implements IDcEventService {
@Autowired @Autowired
private IMiddleDatabaseService middleDatabaseService; private IMiddleDatabaseService middleDatabaseService;
//查询路网信息 //查询路网信息
@Autowired
private DcFacilityServiceImpl dcFacilityService; private DcFacilityServiceImpl dcFacilityService;
@ -115,6 +116,8 @@ public class DcEventServiceImpl implements IDcEventService {
*/ */
@Override @Override
public int insertDcEvent(DcEvent dcEvent) { public int insertDcEvent(DcEvent dcEvent) {
//获取事件类型
int eventType = Math.toIntExact(dcEvent.getEventType());
//设置事件Id UUID无下划线格式32 //设置事件Id UUID无下划线格式32
String uuid = IdUtils.fastSimpleUUID(); String uuid = IdUtils.fastSimpleUUID();
@ -129,35 +132,37 @@ public class DcEventServiceImpl implements IDcEventService {
//处理无桩号事件 //处理无桩号事件
//交通事故 //交通事故
if (dcEvent.getDcEventAccident().getFacilityId() != null) { if (eventType ==1&& dcEvent.getDcEventAccident().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventAccident().getFacilityId()); String facilityId = String.valueOf(dcEvent.getDcEventAccident().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId)); dcEvent.setStakeMark( extracted(facilityId));
} }
//车辆事故 //车辆事故
if (dcEvent.getDcEventVehicleAccident().getFacilityId() != null) { if (eventType ==2 && dcEvent.getDcEventVehicleAccident().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventVehicleAccident().getFacilityId()); String facilityId = String.valueOf(dcEvent.getDcEventVehicleAccident().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId)); dcEvent.setStakeMark( extracted(facilityId));
} }
//交通管制 //交通管制
if (dcEvent.getDcEventTrafficControl().getFacilityId() != null) { if (eventType ==3 && dcEvent.getDcEventTrafficControl().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityId()); String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId)); dcEvent.setStakeMark( extracted(facilityId));
} }
//交通拥堵 //交通拥堵
if (dcEvent.getDcEventTrafficCongestion().getFacilityId() != null) { if (eventType ==4 && dcEvent.getDcEventTrafficCongestion().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventTrafficCongestion().getFacilityId()); String facilityId = String.valueOf(dcEvent.getDcEventTrafficCongestion().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId)); dcEvent.setStakeMark( extracted(facilityId));
} }
//施工建设 //施工建设
if (dcEvent.getDcEventConstruction().getFacilityId() != null) { if ( eventType ==7&& dcEvent.getDcEventConstruction().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventConstruction().getFacilityId()); String facilityId = String.valueOf(dcEvent.getDcEventConstruction().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId)); dcEvent.setStakeMark( extracted(facilityId));
} }
//服务区异常 //服务区异常
if (dcEvent.getDcEventServiceArea().getFacilityId() != null) { if (eventType ==8 && dcEvent.getDcEventServiceArea().getFacilityId() != null) {
String facilityId = String.valueOf(dcEvent.getDcEventServiceArea().getFacilityId()); String facilityId = String.valueOf(dcEvent.getDcEventServiceArea().getFacilityId());
dcEvent.setStakeMark( extracted(facilityId)); dcEvent.setStakeMark( extracted(facilityId));
} }
int i7 = dcEventMapper.insertDcEvent(dcEvent); int i7 = dcEventMapper.insertDcEvent(dcEvent);
if (i7 > 0) { if (i7 > 0) {
@ -165,9 +170,6 @@ public class DcEventServiceImpl implements IDcEventService {
//中间库 //中间库
MdEvent mdEvent = new MdEvent(dcEvent); MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent); middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
//获取事件类型
int eventType = Math.toIntExact(dcEvent.getEventType());
switch (eventType) { switch (eventType) {
//交通事故 //交通事故
case 1: case 1:

Loading…
Cancel
Save