|
@@ -174,17 +174,19 @@ public class MonitorInfoController {
|
|
|
DeviceAttributeSpecsEntity deviceAttributeSpecsEntity = new DeviceAttributeSpecsEntity();
|
|
|
deviceAttributeSpecsEntity.setAttributeId(item.getAttributeId());
|
|
|
List<DeviceAttributeSpecsEntity> deviceAttributeSpecsEntities = deviceAttributeSpecsService.findList(deviceAttributeSpecsEntity);
|
|
|
- Double value = map.get(item.getAttributeId()).getDataValue();
|
|
|
- if (deviceAttributeSpecsEntities.size() > 0) {
|
|
|
- if (value != null) {
|
|
|
- for (DeviceAttributeSpecsEntity specsEntity : deviceAttributeSpecsEntities)
|
|
|
- if (Integer.valueOf(specsEntity.getSpecsValue()) == value.intValue()) {
|
|
|
- item.setMonitorValue(specsEntity.getSpecsName());
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- item.setMonitorValue(String.format("%.3f", map.get(item.getAttributeId()).getDataValue()) + (StringUtils.isNotEmpty(map.get(item.getAttributeId()).getUnit()) ? map.get(item.getAttributeId()).getUnit() : ""));
|
|
|
- }
|
|
|
+ if(map.containsKey(item.getAttributeId())) {
|
|
|
+ Double value = map.get(item.getAttributeId()).getDataValue();
|
|
|
+ if (deviceAttributeSpecsEntities.size() > 0) {
|
|
|
+ if (value != null) {
|
|
|
+ for (DeviceAttributeSpecsEntity specsEntity : deviceAttributeSpecsEntities)
|
|
|
+ if (Integer.valueOf(specsEntity.getSpecsValue()) == value.intValue()) {
|
|
|
+ item.setMonitorValue(specsEntity.getSpecsName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ item.setMonitorValue(String.format("%.3f", map.get(item.getAttributeId()).getDataValue()) + (StringUtils.isNotEmpty(map.get(item.getAttributeId()).getUnit()) ? map.get(item.getAttributeId()).getUnit() : ""));
|
|
|
+ }
|
|
|
+ }
|
|
|
//判断是否报警
|
|
|
if (mapAlarm.containsKey(item.getAttributeId().intValue()))
|
|
|
item.setIsAlarm(1);
|