From df365b3f807eaddb0466721a89d275766dabc5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Wed, 14 Aug 2024 14:00:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E6=96=BD=E6=97=A0?= =?UTF-8?q?=E6=A1=A9=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DcEventServiceImpl.java | 46 +++++++++++++++---- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index 87fb4d65..b6a56db2 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java @@ -938,14 +938,45 @@ public class DcEventServiceImpl extends ServiceImpl 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 impl MdEvent mdEvent = new MdEvent(dcEvent); middleDatabaseService.updateMiddleDatabaseEvent(mdEvent); - int eventType = Math.toIntExact(dcEvent.getEventType()); switch (eventType) { //交通事故 case 1: