|
@@ -36,6 +36,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -527,13 +528,13 @@ public class KwsAlarmService {
|
|
|
String unit = kwsThreshold.getItemName() == null ? null :
|
|
String 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(itemName).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());
|
|
|
- vo.setCurrentOffset(computeOffset + unit);
|
|
|
|
|
|
|
+ vo.setCurrentOffset(computeOffset.setScale(2, RoundingMode.HALF_UP) + unit);
|
|
|
vo.setOriginalValue(deviceReference.getOriginalValue());
|
|
vo.setOriginalValue(deviceReference.getOriginalValue());
|
|
|
- vo.setOriginalOffset(computeOriginalOffset + unit);
|
|
|
|
|
|
|
+ vo.setOriginalOffset(computeOriginalOffset.setScale(2, RoundingMode.HALF_UP) + unit);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
vo.setCurrentValue(deviceReference == null ? null : deviceReference.getCurrentValue());
|
|
vo.setCurrentValue(deviceReference == null ? null : deviceReference.getCurrentValue());
|
|
@@ -861,12 +862,19 @@ public class KwsAlarmService {
|
|
|
.eq(KwsDeviceReference::getDeviceId, deviceId)
|
|
.eq(KwsDeviceReference::getDeviceId, deviceId)
|
|
|
.eq(KwsDeviceReference::getItem, itemName)
|
|
.eq(KwsDeviceReference::getItem, itemName)
|
|
|
);
|
|
);
|
|
|
|
|
+ List<String> list = new ArrayList<>();
|
|
|
|
|
+ list.add(DictItemEnum.LONGITUDE_X.getValue());
|
|
|
|
|
+ list.add(DictItemEnum.LATITUDE_Y.getValue());
|
|
|
|
|
+ list.add(DictItemEnum.ALTITUDE_Z.getValue());
|
|
|
if (deviceReference != null) {
|
|
if (deviceReference != null) {
|
|
|
|
|
+// if (list.contains(itemName)){
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
vo.setItemName(itemName);
|
|
vo.setItemName(itemName);
|
|
|
vo.setCurrentValue(deviceReference.getCurrentValue());
|
|
vo.setCurrentValue(deviceReference.getCurrentValue());
|
|
|
- vo.setCurrentOffset(deviceReference.getOffset());
|
|
|
|
|
|
|
+ vo.setCurrentOffset(deviceReference.getOffset().toString());
|
|
|
vo.setOriginalValue(deviceReference.getOriginalValue());
|
|
vo.setOriginalValue(deviceReference.getOriginalValue());
|
|
|
- vo.setOriginalOffset(new BigDecimal("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)
|
|
|
.eq(KwsDeviceReference::getDeviceId, deviceId)
|
|
.eq(KwsDeviceReference::getDeviceId, deviceId)
|