From 4c7270a764eec908a9351560f3c02edb499e3ce6 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, 5 Nov 2024 09:08:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E9=80=9A=E6=B5=81=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=A2=84=E8=AD=A6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcWarningController.java | 18 ++++++++++-------- .../business/domain/DcNoStakeWarningTable.java | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java b/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java index 580440a6..48cbd239 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java @@ -245,14 +245,16 @@ public class DcWarningController extends BaseController List updatedList = list.stream() .peek(warningTable -> { - JSONObject otherConfig = JSONObject.parseObject(warningTable.getOtherConfig()); - String earlyWorningSignal = otherConfig.getString("earlyWorningSignal"); - String[] split = earlyWorningSignal.split(UniversalEnum.YJ_STRING.getValue()); - String content = WeatherTrafficProposeUtil.content( - Integer.parseInt(split[UniversalEnum.ONE.getNumber()]), - split[UniversalEnum.ZERO.getNumber()] - ); - warningTable.setWarningDescription(warningTable.getWarningDescription() + "\n" +content); + if ("2".equals(warningTable.getWarningType())) { + JSONObject otherConfig = JSONObject.parseObject(warningTable.getOtherConfig()); + String earlyWorningSignal = otherConfig.getString("earlyWorningSignal"); + String[] split = earlyWorningSignal.split(UniversalEnum.YJ_STRING.getValue()); + String content = WeatherTrafficProposeUtil.content( + Integer.parseInt(split[UniversalEnum.ONE.getNumber()]), + split[UniversalEnum.ZERO.getNumber()] + ); + warningTable.setWarningDescription(warningTable.getWarningDescription() + "\n" + content); + } }) .collect(Collectors.toList()); diff --git a/zc-business/src/main/java/com/zc/business/domain/DcNoStakeWarningTable.java b/zc-business/src/main/java/com/zc/business/domain/DcNoStakeWarningTable.java index ae28822f..6e88a959 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcNoStakeWarningTable.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcNoStakeWarningTable.java @@ -21,7 +21,7 @@ public class DcNoStakeWarningTable { @Excel(name = "预警描述") private String warningDescription; @ApiModelProperty("预警类型") - @Excel(name = "预警类型", readConverterExp = "1=交通流预警,2=气象预警") + @Excel(name = "预警类型", readConverterExp = "1=交通流预警,2=气象预警,3=交通流异常预警") private String warningType; @ApiModelProperty("创建时间") @Excel(name = "创建时间")