|
@@ -425,6 +425,7 @@ public class KwsAlarmService {
|
|
|
location.append(kwsDevice.getLogicLat()).append(remark).append(";");
|
|
location.append(kwsDevice.getLogicLat()).append(remark).append(";");
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotBlank(kwsDevice.getLogicAlt())) {
|
|
if (StringUtils.isNotBlank(kwsDevice.getLogicAlt())) {
|
|
|
|
|
+ String remark = dictByDictCode.get(DictItemEnum.ALTITUDE_Z.getValue()).getRemark();
|
|
|
location.append(kwsDevice.getLogicAlt()).append(";");
|
|
location.append(kwsDevice.getLogicAlt()).append(";");
|
|
|
}
|
|
}
|
|
|
vo.setLocation(location.toString());
|
|
vo.setLocation(location.toString());
|
|
@@ -450,13 +451,16 @@ public class KwsAlarmService {
|
|
|
KwsDevice kwsDevice = deviceMapper.selectById(kwsThreshold == null ? null : kwsThreshold.getDeviceId());
|
|
KwsDevice kwsDevice = deviceMapper.selectById(kwsThreshold == null ? null : kwsThreshold.getDeviceId());
|
|
|
StringBuilder location = new StringBuilder();
|
|
StringBuilder location = new StringBuilder();
|
|
|
if (StringUtils.isNotBlank(kwsDevice.getLogicLng())) {
|
|
if (StringUtils.isNotBlank(kwsDevice.getLogicLng())) {
|
|
|
- location.append(kwsDevice.getLogicLng()).append(";");
|
|
|
|
|
|
|
+ String remark = dictByDictCode.get(DictItemEnum.LONGITUDE_X.getValue()).getRemark();
|
|
|
|
|
+ location.append(kwsDevice.getLogicLng()).append(remark).append(";");
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotBlank(kwsDevice.getLogicLat())) {
|
|
if (StringUtils.isNotBlank(kwsDevice.getLogicLat())) {
|
|
|
- location.append(kwsDevice.getLogicLat()).append(";");
|
|
|
|
|
|
|
+ String remark = dictByDictCode.get(DictItemEnum.LATITUDE_Y.getValue()).getRemark();
|
|
|
|
|
+ location.append(kwsDevice.getLogicLat()).append(remark).append(";");
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isNotBlank(kwsDevice.getLogicAlt())) {
|
|
if (StringUtils.isNotBlank(kwsDevice.getLogicAlt())) {
|
|
|
- location.append(kwsDevice.getLogicAlt()).append(";");
|
|
|
|
|
|
|
+ String remark = dictByDictCode.get(DictItemEnum.ALTITUDE_Z.getValue()).getRemark();
|
|
|
|
|
+ location.append(kwsDevice.getLogicAlt()).append(remark).append(";");
|
|
|
}
|
|
}
|
|
|
// vo.setLocation(kwsDevice == null ? null : kwsDevice.getLogicAlt() + ";" + kwsDevice.getLogicLat() + ";" + kwsDevice.getLogicLng());
|
|
// vo.setLocation(kwsDevice == null ? null : kwsDevice.getLogicAlt() + ";" + kwsDevice.getLogicLat() + ";" + kwsDevice.getLogicLng());
|
|
|
vo.setLocation(location.toString());
|
|
vo.setLocation(location.toString());
|
|
@@ -522,28 +526,29 @@ public class KwsAlarmService {
|
|
|
vo.setAlarmDetailId(id);
|
|
vo.setAlarmDetailId(id);
|
|
|
vo.setDeviceId(deviceId.toString());
|
|
vo.setDeviceId(deviceId.toString());
|
|
|
vo.setItemName(itemName);
|
|
vo.setItemName(itemName);
|
|
|
- vo.setLastReferenceValue(deviceReference == null ? null : deviceReference.getCurrentValue());
|
|
|
|
|
|
|
+ String unit = "";
|
|
|
if (devices != null) {
|
|
if (devices != null) {
|
|
|
String val = devices.getVal();
|
|
String val = devices.getVal();
|
|
|
if (list.contains(kwsThreshold.getItemName())) {
|
|
if (list.contains(kwsThreshold.getItemName())) {
|
|
|
if (deviceReference != null) {
|
|
if (deviceReference != null) {
|
|
|
- String unit = kwsThreshold.getItemName() == null ? null :
|
|
|
|
|
|
|
+ unit = kwsThreshold.getItemName() == null ? null :
|
|
|
(dictByDictCode == null ?
|
|
(dictByDictCode == null ?
|
|
|
kwsThreshold.getItemName() : (dictByDictCode.get(kwsThreshold.getItemName()) == null ?
|
|
kwsThreshold.getItemName() : (dictByDictCode.get(kwsThreshold.getItemName()) == null ?
|
|
|
kwsThreshold.getItemName() : dictByDictCode.get(kwsThreshold.getItemName()).getUrl()));
|
|
kwsThreshold.getItemName() : dictByDictCode.get(kwsThreshold.getItemName()).getUrl()));
|
|
|
BigDecimal computeOffset = commonService.computeOffset(val, kwsThreshold.getItemName(), deviceReference);
|
|
BigDecimal computeOffset = commonService.computeOffset(val, kwsThreshold.getItemName(), deviceReference);
|
|
|
BigDecimal computeOriginalOffset = commonService.computeOriginalOffset(val, kwsThreshold.getItemName(), deviceReference);
|
|
BigDecimal computeOriginalOffset = commonService.computeOriginalOffset(val, kwsThreshold.getItemName(), deviceReference);
|
|
|
- vo.setCurrentValue(deviceReference.getCurrentValue());
|
|
|
|
|
|
|
+ vo.setCurrentValue(deviceReference.getCurrentValue() + unit);
|
|
|
vo.setCurrentOffset(computeOffset.setScale(2, RoundingMode.HALF_UP) + unit);
|
|
vo.setCurrentOffset(computeOffset.setScale(2, RoundingMode.HALF_UP) + unit);
|
|
|
- vo.setOriginalValue(deviceReference.getOriginalValue());
|
|
|
|
|
|
|
+ vo.setOriginalValue(deviceReference.getOriginalValue() + unit);
|
|
|
vo.setOriginalOffset(computeOriginalOffset.setScale(2, RoundingMode.HALF_UP) + unit);
|
|
vo.setOriginalOffset(computeOriginalOffset.setScale(2, RoundingMode.HALF_UP) + unit);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- vo.setCurrentValue(deviceReference == null ? null : deviceReference.getCurrentValue());
|
|
|
|
|
- vo.setOriginalValue(deviceReference == null ? null : deviceReference.getOriginalValue());
|
|
|
|
|
|
|
+ vo.setCurrentValue(deviceReference == null ? null : deviceReference.getCurrentValue() + unit);
|
|
|
|
|
+ vo.setOriginalValue(deviceReference == null ? null : deviceReference.getOriginalValue() + unit);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ vo.setLastReferenceValue(deviceReference == null ? null : deviceReference.getCurrentValue() + unit);
|
|
|
}
|
|
}
|
|
|
Map<String, SystemDict> levelDict = commonService.getDictByDictCode(DictEnum.THRESHOLD_LEVEL);
|
|
Map<String, SystemDict> levelDict = commonService.getDictByDictCode(DictEnum.THRESHOLD_LEVEL);
|
|
|
Map<String, SystemDict> typeDict = commonService.getDictByDictCode(DictEnum.ALARM_TYPE);
|
|
Map<String, SystemDict> typeDict = commonService.getDictByDictCode(DictEnum.ALARM_TYPE);
|
|
@@ -852,6 +857,7 @@ public class KwsAlarmService {
|
|
|
Long pid = kwsAlarmDetail.getPid();
|
|
Long pid = kwsAlarmDetail.getPid();
|
|
|
KwsAlarm kwsAlarm = alarmMapper.selectById(alarmId);
|
|
KwsAlarm kwsAlarm = alarmMapper.selectById(alarmId);
|
|
|
Integer type = kwsAlarm.getType();
|
|
Integer type = kwsAlarm.getType();
|
|
|
|
|
+ Map<String, SystemDict> dictByDictCode = commonService.getDictByDictCode(DictEnum.MODEL_PART);
|
|
|
if (2 == type) {
|
|
if (2 == type) {
|
|
|
KwsThreshold kwsThreshold = thresholdMapper.selectById(pid);
|
|
KwsThreshold kwsThreshold = thresholdMapper.selectById(pid);
|
|
|
if (kwsThreshold == null) {
|
|
if (kwsThreshold == null) {
|
|
@@ -872,10 +878,15 @@ public class KwsAlarmService {
|
|
|
// if (list.contains(itemName)){
|
|
// if (list.contains(itemName)){
|
|
|
//
|
|
//
|
|
|
// }
|
|
// }
|
|
|
|
|
+
|
|
|
vo.setItemName(itemName);
|
|
vo.setItemName(itemName);
|
|
|
- vo.setCurrentValue(deviceReference.getCurrentValue());
|
|
|
|
|
|
|
+ String unit = kwsThreshold.getItemName() == null ? null :
|
|
|
|
|
+ (dictByDictCode == null ?
|
|
|
|
|
+ kwsThreshold.getItemName() : (dictByDictCode.get(kwsThreshold.getItemName()) == null ?
|
|
|
|
|
+ kwsThreshold.getItemName() : dictByDictCode.get(kwsThreshold.getItemName()).getUrl()));
|
|
|
|
|
+ vo.setCurrentValue(deviceReference.getCurrentValue() + unit);
|
|
|
vo.setCurrentOffset(deviceReference.getOffset().toString());
|
|
vo.setCurrentOffset(deviceReference.getOffset().toString());
|
|
|
- vo.setOriginalValue(deviceReference.getOriginalValue());
|
|
|
|
|
|
|
+ vo.setOriginalValue(deviceReference.getOriginalValue() + unit);
|
|
|
vo.setOriginalOffset("0.00");
|
|
vo.setOriginalOffset("0.00");
|
|
|
KwsDeviceReference lastDeviceReference = deviceReferenceMapper.selectOne(new LambdaQueryWrapper<KwsDeviceReference>()
|
|
KwsDeviceReference lastDeviceReference = deviceReferenceMapper.selectOne(new LambdaQueryWrapper<KwsDeviceReference>()
|
|
|
.eq(KwsDeviceReference::getDelFlag, 1)
|
|
.eq(KwsDeviceReference::getDelFlag, 1)
|
|
@@ -884,7 +895,7 @@ public class KwsAlarmService {
|
|
|
.orderByDesc(KwsDeviceReference::getUpdateTime)
|
|
.orderByDesc(KwsDeviceReference::getUpdateTime)
|
|
|
.last("limit 1")
|
|
.last("limit 1")
|
|
|
);
|
|
);
|
|
|
- vo.setLastReferenceValue(lastDeviceReference == null ? null : lastDeviceReference.getCurrentValue());
|
|
|
|
|
|
|
+ vo.setLastReferenceValue(lastDeviceReference == null ? null : lastDeviceReference.getCurrentValue() + unit);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
Map<String, SystemDict> levelDict = commonService.getDictByDictCode(DictEnum.THRESHOLD_LEVEL);
|
|
Map<String, SystemDict> levelDict = commonService.getDictByDictCode(DictEnum.THRESHOLD_LEVEL);
|