This commit is contained in:
lxj
2025-09-15 20:55:10 +08:00

View File

@@ -263,7 +263,7 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
boolean isDaytime = hour > 8 && hour <= 20; boolean isDaytime = hour > 8 && hour <= 20;
BigDecimal threshold = isDaytime ? info.getDayWarning() : info.getNightWarning(); BigDecimal threshold = isDaytime ? info.getDayWarning() : info.getNightWarning();
// 如果阈值为0则不处理阈值不为0且读数大于阈值自动上报 // 如果阈值为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 = "能耗异常"; String orderName = "能耗异常";
Long orderType = 0L; Long orderType = 0L;