From 7b6f9ff84ef84aeecc0f0a5c22777bc04949e174 Mon Sep 17 00:00:00 2001 From: qinjie <463333974@qq.com> Date: Wed, 11 Dec 2024 12:47:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=88=97=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DeviceServiceImpl.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java b/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java index 22fdf40..276fbd8 100644 --- a/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java @@ -68,6 +68,8 @@ public class DeviceServiceImpl extends ServiceImpl implements if (CollectionUtil.isNotEmpty(deviceVOList)) { Map runModeMap = this.dictionaryService.getValueMapByType("runMode"); Map plugStatusMap = this.dictionaryService.getValueMapByType("plugStatus"); + Map controlModeMap = this.dictionaryService.getValueMapByType("controlMode"); + Map ctlModeMap = this.dictionaryService.getValueMapByType("ctlMode"); try { for (DeviceVO deviceVO : deviceVOList) { @@ -91,7 +93,14 @@ public class DeviceServiceImpl extends ServiceImpl implements if (runMode == null) { deviceVO.setRunMode(""); } else { - Dictionary runMode1 = runModeMap.get(runMode.toString()); + Dictionary runMode1 = null; + if(PersistenceHandler.ETC_MODBUS_TYPE.equalsIgnoreCase(deviceVO.getProduct().getCode())){ + runMode1 = controlModeMap.get(runMode.toString()); + }else if(PersistenceHandler.SCSS_MODBUS_TYPE.equalsIgnoreCase(deviceVO.getProduct().getCode())){ + runMode1 = ctlModeMap.get(runMode.toString()); + }else{ + runMode1 = runModeMap.get(runMode.toString()); + } deviceVO.setRunMode(runMode1 == null ? "" : runMode1.getName()); } Object plugStatus = this.redisTemplate.opsForHash().get(deviceKey, "plugStatus"); @@ -218,6 +227,8 @@ public class DeviceServiceImpl extends ServiceImpl implements Map runModeMap = this.dictionaryService.getValueMapByType("runMode"); if(PersistenceHandler.ETC_MODBUS_TYPE.equalsIgnoreCase(device.getProduct().getCode())){ runModeMap = this.dictionaryService.getValueMapByType("controlMode"); + }else if(PersistenceHandler.SCSS_MODBUS_TYPE.equalsIgnoreCase(device.getProduct().getCode())){ + runModeMap = this.dictionaryService.getValueMapByType("ctlMode"); } Map plugStatusMap = this.dictionaryService.getValueMapByType("plugStatus");