feiyu02
2023-10-24 70a7d1ec98064e1acb3130e56e16c45af52ade6c
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
                })
            }
        }