| | |
| | | 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) { |
| | |
| | | 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 |
| | | }) |
| | | } |
| | | } |