From c7283d7f057baffb12b5045fb55b8b96566e21b3 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Tue, 20 Feb 2024 15:50:58 +0800 Subject: [PATCH] =?UTF-8?q?#=E9=80=9A=E8=AE=AF=E4=B8=AD=E6=96=AD=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E7=BB=9F=E8=AE=A1=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/interruption/service/impl/InterruptionServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/business/interruption/service/impl/InterruptionServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/business/interruption/service/impl/InterruptionServiceImpl.java index beb586a..9fd4e74 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/business/interruption/service/impl/InterruptionServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/business/interruption/service/impl/InterruptionServiceImpl.java @@ -66,9 +66,9 @@ public class InterruptionServiceImpl extends BaseServiceImpl o.getStatus().equals(0)).count()); - // 去重 - List deduplications = this.deduplication(entry.getValue());; + // 去除重复告警 + List deduplications = this.deduplication(entry.getValue()); + interruption.setCount((int) deduplications.stream().filter(o-> o.getStatus().equals(0)).count()); long time = innterruptionTime(deduplications, DateUtil.parse(param.getStartTime(),DateUtil.PATTERN_DATETIME),DateUtil.parse(param.getEndTime(),DateUtil.PATTERN_DATETIME)); interruption.setDuration(BigDecimal.valueOf(time / (1000 * 60 * 60.00)).setScale(2, RoundingMode.HALF_UP).doubleValue()); return interruption;