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");