| | |
| | | */ |
| | | class ExceptionDataExceed(config: DustExceptionSetting) : BaseExceptionContinuous(config) { |
| | | |
| | | override fun getExceptionType(): ExceptionType = ExceptionType.TYPE1 |
| | | override fun getExceptionType(): ExceptionType = ExceptionType.TYPE2 |
| | | |
| | | override fun judgeException(p: DustSiteData?, n: DustSiteData): Boolean { |
| | | return n.dustValue >= config.exceedingStandard |
| | |
| | | enum class ExceptionType(val value:Int, val des:String) { |
| | | TYPE0(0, "æç½ææçº¿"), |
| | | TYPE1(1, "æ°æ®è¶
ä½å¼å¸¸"), |
| | | TYPE2(2, "æ°æ®è¶
æ "), |
| | | TYPE3(3, "æ°æ®é¿æ¶æ®µæ æ³¢å¨"), |
| | | TYPE4(4, "é级çªåå¼å¸¸"), |
| | | TYPE5(5, "临è¿è¶
æ å¼å¸¸"), |
| | |
| | | statisticAnalysisController.autoRunDailyStatics() |
| | | } |
| | | |
| | | if (localtime.dayOfMonth == 1 && localtime.hour == 9 && localtime.minute == 0) { |
| | | if (task3Delay || (localtime.dayOfMonth == 1 && localtime.hour == 9 && localtime.minute == 0)) { |
| | | val task = requestTaskRep.findLatestTask(localtime) |
| | | task3Delay = isTaskDelay(task) |
| | | if (task3Delay) return |
| | |
| | | <!-- enableCountByExample="false"--> |
| | | <!-- enableUpdateByExample="false" enableDeleteByExample="false"--> |
| | | <!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <table tableName="du_js_t_request_task_log" domainObjectName="RequestTaskLog" |
| | | enableCountByExample="false" |
| | | enableUpdateByExample="false" enableDeleteByExample="false" |
| | | enableSelectByExample="false" selectByExampleQueryId="false"/> |
| | | <!-- <table tableName="du_js_t_request_task_log" domainObjectName="RequestTaskLog"--> |
| | | <!-- enableCountByExample="false"--> |
| | | <!-- enableUpdateByExample="false" enableDeleteByExample="false"--> |
| | | <!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> |
| | | <table tableName="du_js_t_request_task" domainObjectName="RequestTask" |
| | | enableCountByExample="false" |
| | | enableUpdateByExample="false" enableDeleteByExample="false" |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.monitor.scheduledtasks |
| | | |
| | | |
| | | import org.junit.Test |
| | | import org.junit.jupiter.api.Assertions.* |
| | | import org.junit.jupiter.api.extension.ExtendWith |
| | | import org.junit.runner.RunWith |
| | | import org.springframework.beans.factory.annotation.Autowired |
| | | import org.springframework.boot.test.context.SpringBootTest |
| | | import org.springframework.test.context.junit.jupiter.SpringExtension |
| | | import org.springframework.test.context.junit4.SpringRunner |
| | | import java.time.LocalDateTime |
| | | |
| | | @RunWith(SpringRunner::class) |
| | | @ExtendWith(SpringExtension::class) |
| | | @SpringBootTest |
| | | class DustAnalysisTaskTest { |
| | | |
| | | @Autowired |
| | | lateinit var dustAnalysisTask: DustAnalysisTask |
| | | |
| | | @Test |
| | | fun doTask() { |
| | | var time = LocalDateTime.of(2023, 10, 31, 8, 0, 0) |
| | | while (time.hour < 10) { |
| | | dustAnalysisTask.doTask(time) |
| | | time = time.plusMinutes(15) |
| | | Thread.sleep(5000) |
| | | } |
| | | } |
| | | } |