fix(property): 修复水表能耗预警逻辑
This commit is contained in:
@@ -263,7 +263,7 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
||||
boolean isDaytime = hour > 8 && hour <= 20;
|
||||
BigDecimal threshold = isDaytime ? info.getDayWarning() : info.getNightWarning();
|
||||
// 如果阈值为0,则不处理(阈值不为0且读数大于阈值,自动上报)
|
||||
if (threshold.compareTo(BigDecimal.ZERO) != 0 && record.getCurrentReading().compareTo(threshold) > 0) {
|
||||
if (threshold.compareTo(BigDecimal.ZERO) != 0 && (record.getCurrentReading().subtract(record.getPreviousReading())).compareTo(threshold) > 0) {
|
||||
// 根据仪表类型设置工单名称和类型
|
||||
String orderName = "能耗异常";
|
||||
Long orderType = 0L;
|
||||
|
Reference in New Issue
Block a user