From 99ede1778ee31d9c793bcd57da77e440d8a7cfc2 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Wed, 22 May 2024 17:12:13 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=8E=A5=E5=8F=A3=E4=B8=AD=E7=9A=84=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=AD=98=E5=82=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DcEmergencyPlansServiceImpl.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index 8fb9bc13..8bca9564 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java @@ -907,11 +907,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { termList.add(JSON.parseObject(device.getOtherConfig())); params.put("termList", termList); - JSONObject returnResult = broadcastController.nearCamListDistance(params); JSONObject result = new JSONObject(); result.put("device", device.getId()); result.put("deviceName",device.getDeviceName()); result.put("content",params.get("text")); + JSONObject returnResult = broadcastController.nearCamListDistance(params); result.put("result", returnResult); resultArray.add(result); @@ -1010,25 +1010,21 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { props11.put("parameters", list); AjaxResult ajaxResult13 = dcDeviceController.invokedFunction(iotDeviceId, functionId, props11); JSONObject result = new JSONObject(); + result.put("device", device.getId()); + result.put("deviceName",device.getDeviceName()); if (ajaxResult13.get("code").equals(200)) { HashMap props1B = new HashMap<>(); // 3: 执行1B功能码 functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_1B; props1B.put("fileId", "11"); AjaxResult ajaxResult1B = dcDeviceController.invokedFunction(iotDeviceId, functionId, props1B); - result.put("device", device.getId()); - result.put("deviceName",device.getDeviceName()); result.put("content",dcInfoBoardTemplate.getContent()); result.put("result", ajaxResult1B); - resultArray.add(result); - } else { - result.put("device", device.getId()); - result.put("deviceName",device.getDeviceName()); result.put("content","发布失败"); result.put("result", ajaxResult13); - resultArray.add(result); } + resultArray.add(result); } } From 46ae553dadcee60d5707afa3af45a2cc1f4d8f0f 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, 22 May 2024 17:13:20 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BA=A4=E9=80=9A=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E5=A4=84=E7=BD=AE=E9=A1=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/DcEventTrafficControl.java | 4 ++ .../service/impl/DcEventServiceImpl.java | 67 +++++++++++++------ 2 files changed, 50 insertions(+), 21 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java b/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java index 50e5ec94..469152cf 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java @@ -1,6 +1,7 @@ package com.zc.business.domain; import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; @@ -11,9 +12,12 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import java.util.List; + /** * 交通管制事件 + "管制设施"为事件“事件子类”对象 dc_event_traffic_control * * @author ruoyi 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 f47a16ce..55db80e7 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 @@ -6,12 +6,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StakeMarkUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.system.service.ISysDeptService; import com.zc.business.domain.*; -import com.zc.business.enums.*; +import com.zc.business.enums.EventSubclass; +import com.zc.business.enums.EventSubclassEnum; +import com.zc.business.enums.ValueConverter; import com.zc.business.mapper.*; import com.zc.business.service.IDcEventProcessService; import com.zc.business.service.IDcEventService; @@ -146,7 +147,9 @@ public class DcEventServiceImpl extends ServiceImpl impl //设置事件Id UUID无下划线格式32 String uuid = IdUtils.fastSimpleUUID(); dcEvent.setId(uuid); - dcEvent.setEventState(0L); + if (dcEvent.getEventState() == null) { + dcEvent.setEventState(0L); + } //获取部门信息 dcEvent.setDeptId(SecurityUtils.getDeptId()); //用户 @@ -170,7 +173,7 @@ public class DcEventServiceImpl extends ServiceImpl impl String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]); dcEvent.setStakeMark(extracted(facilityId)); } - if (eventType == 3 && dcEvent.getDcEventTrafficControl().getFacilityId() != null && dcEvent.getDcEventTrafficControl().getFacilityId()>0) { + if (eventType == 3 && dcEvent.getDcEventTrafficControl().getFacilityId() != null && dcEvent.getDcEventTrafficControl().getFacilityId() > 0) { String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityId()); dcEvent.setStakeMark(extracted(facilityId)); } @@ -179,6 +182,7 @@ public class DcEventServiceImpl extends ServiceImpl impl String facilityId = String.valueOf(dcEvent.getDcEventTrafficCongestion().getFacilityId()); dcEvent.setStakeMark(extracted(facilityId)); } + //施工建设 if (eventType == 7 && dcEvent.getDcEventConstruction().getFacilityId() != null) { String facilityId = String.valueOf(dcEvent.getDcEventConstruction().getFacilityId()); @@ -223,9 +227,23 @@ public class DcEventServiceImpl extends ServiceImpl impl //交通管制 case 3: if (dcEvent.getDcEventTrafficControl() != null) { - if (dcEvent.getDcEventTrafficControl().getFacilityId()==null || dcEvent.getDcEventTrafficControl().getFacilityId()>0){ + if (dcEventId == null) {//非首页进入 + if (dcEvent.getDcEventTrafficControl().getFacilityId() == null || dcEvent.getDcEventTrafficControl().getFacilityId() > 0) { + dcEvent.getDcEventTrafficControl().setId(uuid); + int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); + break; + } + } + //事件处置页 + if (dcEvent.getEventState() == 1 && dcEvent.getDcEventTrafficControl().getFacilityIds() == null) {//新增的数据不是收费站 + updateDcEventState(dcEvent.getId(), dcEvent.getEventState().intValue()); dcEvent.getDcEventTrafficControl().setId(uuid); int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); + DcEvent dcEvent1 = new DcEvent(); + dcEvent1.setId(dcEventId);//事件id + dcEvent1.setEventNature(1l);//首发事件 + dcEvent1.setLinkId(uuid);//关联管制事件id + dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质 break; } // 插入多个收费站 @@ -325,7 +343,11 @@ public class DcEventServiceImpl extends ServiceImpl impl //新增第一条数据 dcEvent.setId(map.get("facilityId" + i)); - dcEvent.setEventState(0L); + + if (dcEvent.getEventState() == null) { + dcEvent.setEventState(0L); + } + dcEvent.setDeptId(SecurityUtils.getDeptId()); dcEvent.setUserId(SecurityUtils.getUserId()); dcEvent.setCreateTime(DateUtils.getNowDate()); @@ -346,7 +368,6 @@ public class DcEventServiceImpl extends ServiceImpl impl String linkId = sb.toString(); dcEvent.setLinkId(linkId); - System.out.println(linkId); //交通管制 if (eventType == 3 && dcEvent.getDcEventTrafficControl().getFacilityIds()[i] != null) { @@ -354,8 +375,11 @@ public class DcEventServiceImpl extends ServiceImpl impl dcEvent.setStakeMark(extracted(facilityId)); } + dcEventMapper.insertDcEvent(dcEvent); extracted(dcEvent); + //首页事件 交通管制事件 添加 状态默认为 1 处置中 + updateDcEventState(dcEvent.getId(), dcEvent.getEventState().intValue()); int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); } } @@ -702,9 +726,9 @@ public class DcEventServiceImpl extends ServiceImpl impl } */ - // 事件子类校验 + // 事件子类校验 for (EventSubclass value : EventSubclass.values()) { - if (value.getDescription().equals(dcEvent.getEventSubclass())){ + if (value.getDescription().equals(dcEvent.getEventSubclass())) { dcEvent.setEventSubclass(value.getCode()); } } @@ -716,9 +740,10 @@ public class DcEventServiceImpl extends ServiceImpl impl }*/ //事件方向 - if (dcEvent.getDirection().equals("菏泽方向")){ + if (dcEvent.getDirection().equals("菏泽方向")) { dcEvent.setDirection("1"); - } if (dcEvent.getDirection().equals("济南方向")){ + } + if (dcEvent.getDirection().equals("济南方向")) { dcEvent.setDirection("3"); } @@ -818,7 +843,7 @@ public class DcEventServiceImpl extends ServiceImpl impl int i7 = -1; for (String id : ids) { DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id); - if (dcEvent==null){ + if (dcEvent == null) { continue; } // todo 删除信息发布记录 @@ -1034,18 +1059,18 @@ public class DcEventServiceImpl extends ServiceImpl impl @Override public int updateDcEventState(String id, int state) { - //多次修改请求 + //多次修改请求 DcEvent dcEvent1 = dcEventMapper.selectDcEventById(id); //事件删除 后 返回成功 - if (dcEvent1 ==null){ - return 1; + if (dcEvent1 == null) { + return 1; } //事件状态已被修改 返回成功 - if (dcEvent1.getEventState()==state){ - return 1; + if (dcEvent1.getEventState() == state) { + return 1; } - int i = dcEventMapper.updateDcEventState(id, state); + int i = dcEventMapper.updateDcEventState(id, state); if (i > 0) { DcEvent dcEvent = dcEventMapper.selectDcEventMainById(id); @@ -1530,7 +1555,7 @@ public class DcEventServiceImpl extends ServiceImpl impl } } String label = ValueConverter.eventLabel(result.getRightPath()); - if (StringUtils.isNotEmpty(label)){ + if (StringUtils.isNotEmpty(label)) { context = context + label + "修改为:" + result.getRight() + ","; } } @@ -1609,10 +1634,10 @@ public class DcEventServiceImpl extends ServiceImpl impl DcEvent dcEvent = dcEventMapper.selectDcEventById(eventId); - if (dcEvent.getEventType() == null || (dcEvent.getEventType() != 1 && dcEvent.getEventType() != 2 && dcEvent.getEventType() != 6)){ + if (dcEvent.getEventType() == null || (dcEvent.getEventType() != 1 && dcEvent.getEventType() != 2 && dcEvent.getEventType() != 6)) { return AjaxResult.error("该事件类型无需清障!"); } - if (dcEvent.getEventState() != null && dcEvent.getEventState() == 2){ + if (dcEvent.getEventState() != null && dcEvent.getEventState() == 2) { return AjaxResult.error("该事件已结束,无法进行操作!"); } int i = dcEventMapper.selectClearInfo(eventId); From 4a95d46e8183950b011222928970bae8e3d5d849 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, 22 May 2024 17:45:57 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BA=A4=E9=80=9A=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E5=A4=84=E7=BD=AE=E9=A1=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/service/impl/DcEventServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 55db80e7..7f05332c 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 @@ -228,7 +228,7 @@ public class DcEventServiceImpl extends ServiceImpl impl case 3: if (dcEvent.getDcEventTrafficControl() != null) { if (dcEventId == null) {//非首页进入 - if (dcEvent.getDcEventTrafficControl().getFacilityId() == null || dcEvent.getDcEventTrafficControl().getFacilityId() > 0) { + if (dcEvent.getDcEventTrafficControl().getFacilityIds() ==null ) { dcEvent.getDcEventTrafficControl().setId(uuid); int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl()); break; From 1f24ffc77f96d346f443ef662867c90b67955de0 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, 22 May 2024 18:45:56 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E4=BA=A4=E9=80=9A?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=20=20=E6=A1=A9=E5=8F=B7=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/service/impl/DcEventServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 7f05332c..ab74c226 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 @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StakeMarkUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.system.service.ISysDeptService; @@ -140,7 +141,10 @@ public class DcEventServiceImpl extends ServiceImpl impl public int insertDcEvent(DcEvent dcEvent) { String dcEventId = dcEvent.getId(); - + //桩号校验 + if (!StakeMarkUtils.checkStakeMark(dcEvent.getStakeMark())){ + return -1; + } //获取事件类型 int eventType = Math.toIntExact(dcEvent.getEventType());