From 8f7542559760324c4dd6a2f9795d4c4df21df7af Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 31 十月 2023 14:38:57 +0800 Subject: [PATCH] 1. 修改了数据超标分析模块的类型为数据超标类型 --- src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionExceedingTimes.kt | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionExceedingTimes.kt b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionExceedingTimes.kt index a1b2496..6d2729f 100644 --- a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionExceedingTimes.kt +++ b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionExceedingTimes.kt @@ -16,6 +16,12 @@ private var exceedingCount = 0 private var startData: DustSiteData? = null + override fun init() { + super.init() + exceedingCount = 0 + startData = null + } + override fun getExceptionType(): ExceptionType = ExceptionType.TYPE6 override fun onNextData(data: DustSiteData) { @@ -30,16 +36,18 @@ if (exceedingCount >= config.dayExceedBorderlineLowNum && exceedingCount < config.dayExceedBorderlineHighNum) { startData?.let { val eType = getExceptionType() - val t = LocalDateTime.ofInstant(it.lst.toInstant(), ZoneId.systemDefault()) - t.withHour(0) - val sT = + val t = LocalDateTime.ofInstant(it.lst.toInstant(), ZoneId.systemDefault()).withHour(0).withMinute(0).withSecond(0) + val sT = Date.from(t.atZone(ZoneId.systemDefault()).toInstant()) + val n = t.plusDays(1).minusSeconds(1) + val eT = Date.from(n.atZone(ZoneId.systemDefault()).toInstant()) + resultList.add(DustExceptionData().apply { mnCode = it.mnCode exception = eType.des exceptionType = eType.value region = config.region -// beginTime = if (p == null) n.lst else p.lst -// endTime = n.lst + beginTime = sT + endTime = eT }) } } -- Gitblit v1.9.3