From 083cbf614987eb8cc1e56bb9d1bfd6c3e489226e Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Mon, 15 Sep 2025 20:15:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(property):=20=E4=BF=AE=E5=A4=8D=E6=B0=B4?= =?UTF-8?q?=E8=A1=A8=E8=83=BD=E8=80=97=E9=A2=84=E8=AD=A6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java index ff396837..3501de38 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/smartDevicesImpl/TbMeterRecordServiceImpl.java @@ -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;