Merge pull request 'fix(property): 修复水表能耗预警逻辑' (#11) from master into prod
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 12m40s

合并分支
This commit is contained in:
lsm
2025-09-15 20:16:57 +08:00

View File

@@ -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;