From 21427a082fc07bed414dbfe0473678d8aeb37006 Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期四, 02 十一月 2023 11:56:13 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/main/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTask.kt | 2 +- src/test/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTaskTest.kt | 31 +++++++++++++++++++++++++++++++ src/main/java/com/flightfeather/monitor/enumration/dust/ExceptionType.kt | 1 + src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionDataExceed.kt | 2 +- src/main/resources/generator/generatorConfig4ds1.xml | 8 ++++---- 5 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionDataExceed.kt b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionDataExceed.kt index d092f3e..4de2461 100644 --- a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionDataExceed.kt +++ b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionDataExceed.kt @@ -9,7 +9,7 @@ */ 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 diff --git a/src/main/java/com/flightfeather/monitor/enumration/dust/ExceptionType.kt b/src/main/java/com/flightfeather/monitor/enumration/dust/ExceptionType.kt index ccc5f77..1551ec3 100644 --- a/src/main/java/com/flightfeather/monitor/enumration/dust/ExceptionType.kt +++ b/src/main/java/com/flightfeather/monitor/enumration/dust/ExceptionType.kt @@ -3,6 +3,7 @@ enum class ExceptionType(val value:Int, val des:String) { TYPE0(0, "鏂綉鎴栨帀绾�"), TYPE1(1, "鏁版嵁瓒呬綆寮傚父"), + TYPE2(2, "鏁版嵁瓒呮爣"), TYPE3(3, "鏁版嵁闀挎椂娈垫棤娉㈠姩"), TYPE4(4, "閲忕骇绐佸彉寮傚父"), TYPE5(5, "涓磋繎瓒呮爣寮傚父"), diff --git a/src/main/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTask.kt b/src/main/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTask.kt index 631da3a..a1fb853 100644 --- a/src/main/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTask.kt +++ b/src/main/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTask.kt @@ -47,7 +47,7 @@ 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 diff --git a/src/main/resources/generator/generatorConfig4ds1.xml b/src/main/resources/generator/generatorConfig4ds1.xml index a6775aa..d7e6201 100644 --- a/src/main/resources/generator/generatorConfig4ds1.xml +++ b/src/main/resources/generator/generatorConfig4ds1.xml @@ -82,10 +82,10 @@ <!-- 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" diff --git a/src/test/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTaskTest.kt b/src/test/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTaskTest.kt new file mode 100644 index 0000000..0924fff --- /dev/null +++ b/src/test/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTaskTest.kt @@ -0,0 +1,31 @@ +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) + } + } +} \ No newline at end of file -- Gitblit v1.9.3