Browse Source

修改添加无桩号事件逻辑

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

41
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,6 +173,7 @@ public class DcEventServiceImpl implements IDcEventService {
case 1:
if (dcEvent.getDcEventAccident() != null) {
dcEvent.getDcEventAccident().setId(uuid);
int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident());
}
@ -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

Loading…
Cancel
Save