feiyu02
2023-10-31 8f7542559760324c4dd6a2f9795d4c4df21df7af
1. 修改了数据超标分析模块的类型为数据超标类型
已修改4个文件
已添加1个文件
44 ■■■■ 文件已修改
src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionDataExceed.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/enumration/dust/ExceptionType.kt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTask.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig4ds1.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/flightfeather/monitor/scheduledtasks/DustAnalysisTaskTest.kt 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
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, "临近超标异常"),
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
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"
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)
        }
    }
}