From b3c8d75ca0653a3900fc534ec5de67fc17d9771d Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Wed, 27 Mar 2024 14:14:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=A4=E6=A0=8F=E7=A2=B0?= =?UTF-8?q?=E6=92=9E=E4=BA=8B=E4=BB=B6=E4=B8=8A=E6=8A=A5=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NonAutomaticWarningController.java | 2 ++ .../device/handler/DeviceMessageHandler.java | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/NonAutomaticWarningController.java b/zc-business/src/main/java/com/zc/business/controller/NonAutomaticWarningController.java index 0663a021..cd286852 100644 --- a/zc-business/src/main/java/com/zc/business/controller/NonAutomaticWarningController.java +++ b/zc-business/src/main/java/com/zc/business/controller/NonAutomaticWarningController.java @@ -14,6 +14,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.eclipse.paho.client.mqttv3.*; import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; +import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -32,6 +33,7 @@ import java.util.Objects; */ @Api(tags = "非机预警接口") @RestController +@Component @RequestMapping("/nonAutomaticWarning") public class NonAutomaticWarningController extends BaseController { diff --git a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java index c3209c98..43b77323 100644 --- a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java +++ b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java @@ -378,16 +378,20 @@ public class DeviceMessageHandler { String direction = ""; if (Objects.equals(location, "0")) { dcWarning.setDirection("1"); - direction = "上行右侧"; + dcWarning.setLane("0"); + direction = "菏泽方向右侧护栏"; } else if (Objects.equals(location, "1")) { dcWarning.setDirection("1"); - direction = "上行左侧"; + dcWarning.setLane("1"); + direction = "菏泽方向左侧护栏"; } else if (Objects.equals(location, "10")) { dcWarning.setDirection("0"); - direction = "下行右侧"; + dcWarning.setLane("0"); + direction = "济南方向右侧护栏"; } else if (Objects.equals(location, "11")) { dcWarning.setDirection("0"); - direction = "下行左侧"; + dcWarning.setLane("1"); + direction = "济南方向左侧护栏"; } String eventType = ""; @@ -423,8 +427,11 @@ public class DeviceMessageHandler { dcWarning.setStakeMark(dcDevices.get(0).getStakeMark()); dcWarning.setWarningType(9); + dcWarning.setWarningSubclass("4"); + dcWarning.setWarningState(1); dcWarning.setCreateTime(new Date()); - dcWarning.setWarningTitle("护栏碰撞上报事件:区域号为" + areaCode + "在" + timeOfFireAlarming + direction + "发生" + eventType + "事件"); + dcWarning.setDirection("护栏碰撞上报事件:区域号为" + areaCode + "在20" + timeOfFireAlarming + direction + "发生" + eventType + "事件"); + dcWarning.setWarningTitle("护栏碰撞在20" + timeOfFireAlarming + direction + "发生" + eventType + "事件"); dcWarning.setOtherConfig(dataJsonObject.toJSONString()); dcWarningService.insertDcWarning(dcWarning); }