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;