Browse Source

#通讯中断告警统计去重

zhongwei
yang_shj 9 months ago
parent
commit
c7283d7f05
  1. 6
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/business/interruption/service/impl/InterruptionServiceImpl.java

6
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<InterruptionMapper,
InterruptionVo interruption = new InterruptionVo();
interruption.setStationId(entry.getKey());
interruption.setStationName(entry.getValue().get(0).getStationName());
interruption.setCount((int) entry.getValue().stream().filter(o-> o.getStatus().equals(0)).count());
// 去重
List<InterruptionEntity> deduplications = this.deduplication(entry.getValue());;
// 去除重复告警
List<InterruptionEntity> 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;

Loading…
Cancel
Save