From 512b4c1e28f09a3764f2fdba7cfd37a9e5df26b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Tue, 16 Jul 2024 09:59:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5=E9=93=83?= =?UTF-8?q?=E9=93=9B=20=E4=BA=8B=E4=BB=B6=E6=97=B6=E9=97=B4=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message/device/handler/DeviceMessageHandler.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 f401e0fe..f55b91ef 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 @@ -320,7 +320,9 @@ public class DeviceMessageHandler { String title = direction + WarningSubclassEnum.getDecorateInfo(warningSubclass); // 标题 dcWarning.setWarningTitle(title); - dcWarning.setRemark(DateUtil.formatDateTime(DateUtil.date(captureTime)) + UniversalEnum.BLANK_SPACE.getValue() + title); + SimpleDateFormat sdf = new SimpleDateFormat(UniversalEnum.CHINESE_CHARACTER_TIME_FORMAT.getValue()); + String formattedDate = sdf.format(new Date()); + dcWarning.setRemark(formattedDate + UniversalEnum.BLANK_SPACE.getValue() + title); // 影响车道 // 物联设备id @@ -622,7 +624,9 @@ public class DeviceMessageHandler { DcWarning dcWarning = new DcWarning(); dcWarning.setWarningState(UniversalEnum.ONE.getNumber()); - dcWarning.setRemark(new Date() + UniversalEnum.BLANK_SPACE.getValue() + content); + SimpleDateFormat sdf = new SimpleDateFormat(UniversalEnum.CHINESE_CHARACTER_TIME_FORMAT.getValue()); + String formattedDate = sdf.format(new Date()); + dcWarning.setRemark(formattedDate + UniversalEnum.BLANK_SPACE.getValue() + content); dcWarning.setWarningTime(new Date()); dcWarning.setWarningType(UniversalEnum.EIGHT_ONE.getNumber()); dcWarning.setWarningSubclass(UniversalEnum.EIGHT_ONE.getValue()); @@ -669,7 +673,9 @@ public class DeviceMessageHandler { String string = object.toString(); DcWarning dcWarning = new DcWarning(); dcWarning.setWarningState(UniversalEnum.ONE.getNumber()); - dcWarning.setRemark(new Date() + UniversalEnum.BLANK_SPACE.getValue() + content); + SimpleDateFormat sdf = new SimpleDateFormat(UniversalEnum.CHINESE_CHARACTER_TIME_FORMAT.getValue()); + String formattedDate = sdf.format(new Date()); + dcWarning.setRemark(formattedDate + UniversalEnum.BLANK_SPACE.getValue() + content); dcWarning.setWarningTime(new Date()); dcWarning.setWarningType(UniversalEnum.EIGHT_FOUR.getNumber()); dcWarning.setWarningSubclass(UniversalEnum.EIGHT_FOUR.getValue());