设备列表查询修改
This commit is contained in:
parent
328c5f0f9d
commit
7b6f9ff84e
|
@ -68,6 +68,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceDao, Device> implements
|
||||||
if (CollectionUtil.isNotEmpty(deviceVOList)) {
|
if (CollectionUtil.isNotEmpty(deviceVOList)) {
|
||||||
Map<String, Dictionary> runModeMap = this.dictionaryService.getValueMapByType("runMode");
|
Map<String, Dictionary> runModeMap = this.dictionaryService.getValueMapByType("runMode");
|
||||||
Map<String, Dictionary> plugStatusMap = this.dictionaryService.getValueMapByType("plugStatus");
|
Map<String, Dictionary> plugStatusMap = this.dictionaryService.getValueMapByType("plugStatus");
|
||||||
|
Map<String, Dictionary> controlModeMap = this.dictionaryService.getValueMapByType("controlMode");
|
||||||
|
Map<String, Dictionary> ctlModeMap = this.dictionaryService.getValueMapByType("ctlMode");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (DeviceVO deviceVO : deviceVOList) {
|
for (DeviceVO deviceVO : deviceVOList) {
|
||||||
|
@ -91,7 +93,14 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceDao, Device> implements
|
||||||
if (runMode == null) {
|
if (runMode == null) {
|
||||||
deviceVO.setRunMode("");
|
deviceVO.setRunMode("");
|
||||||
} else {
|
} 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());
|
deviceVO.setRunMode(runMode1 == null ? "" : runMode1.getName());
|
||||||
}
|
}
|
||||||
Object plugStatus = this.redisTemplate.opsForHash().get(deviceKey, "plugStatus");
|
Object plugStatus = this.redisTemplate.opsForHash().get(deviceKey, "plugStatus");
|
||||||
|
@ -218,6 +227,8 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceDao, Device> implements
|
||||||
Map<String, Dictionary> runModeMap = this.dictionaryService.getValueMapByType("runMode");
|
Map<String, Dictionary> runModeMap = this.dictionaryService.getValueMapByType("runMode");
|
||||||
if(PersistenceHandler.ETC_MODBUS_TYPE.equalsIgnoreCase(device.getProduct().getCode())){
|
if(PersistenceHandler.ETC_MODBUS_TYPE.equalsIgnoreCase(device.getProduct().getCode())){
|
||||||
runModeMap = this.dictionaryService.getValueMapByType("controlMode");
|
runModeMap = this.dictionaryService.getValueMapByType("controlMode");
|
||||||
|
}else if(PersistenceHandler.SCSS_MODBUS_TYPE.equalsIgnoreCase(device.getProduct().getCode())){
|
||||||
|
runModeMap = this.dictionaryService.getValueMapByType("ctlMode");
|
||||||
}
|
}
|
||||||
Map<String, Dictionary> plugStatusMap = this.dictionaryService.getValueMapByType("plugStatus");
|
Map<String, Dictionary> plugStatusMap = this.dictionaryService.getValueMapByType("plugStatus");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue