feiyu02
2024-07-08 b212ef0208cb094f63ea8a239a1361f8e859c839
2024.7.8
已修改29个文件
已添加8个文件
已重命名4个文件
1324 ■■■■ 文件已修改
pom.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/SupervisionApplication.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/AopDataAnalysis.kt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopEvaluation.kt 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/bgtask/TaskFinishEvaluation.kt 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/bgtask/TaskFinishSubtask.kt 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/bgtask/TaskFinishTopTask.kt 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchController.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchData.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstruction.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearby.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/location/UtilFile.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/config/AsyncConfig.kt 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/SubtaskMapper.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/EvaluationRep.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SceneRep.kt 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRep.kt 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/SubtaskService.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AutoScoreResultVo.kt 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/SubTaskSummary.kt 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/log4j2.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/EvaluationMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/InspectionMapper.xml 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/SubtaskMapper.xml 458 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrlTest.kt 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/bgtask/JinAnScoreTaskCtrlTest.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstructionTest.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/business/subtask/TaskTest.kt 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRepTest.kt 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml
@@ -34,24 +34,23 @@
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-quartz</artifactId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>spring-boot-starter-logging</artifactId>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-quartz</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>spring-boot-starter-logging</artifactId>
                    <groupId>org.springframework.boot</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
@@ -123,11 +122,6 @@
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
src/main/kotlin/cn/flightfeather/supervision/SupervisionApplication.kt
@@ -1,15 +1,16 @@
package cn.flightfeather.supervision
import cn.flightfeather.supervision.datafetch.FetchController
import cn.flightfeather.supervision.infrastructure.service.ServerManager
import cn.flightfeather.supervision.business.datafetch.FetchController
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.ApplicationRunner
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.context.annotation.Bean
import org.springframework.scheduling.annotation.EnableScheduling
@SpringBootApplication
@EnableScheduling
class SupervisionApplication {
    @Autowired
@@ -18,7 +19,7 @@
    @Bean
    fun runner() = ApplicationRunner {
        fetchController. run()
        fetchController.run()
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/AopDataAnalysis.kt
@@ -106,6 +106,8 @@
                drMin = tempMin.total
                drOverAvgPer = overAvgRate(drAvg, dAvg)
                drDataNum = count(dataList)
                // å½“数据量为0时,超月度区均值百分比变为0
                if (drDataNum == 0) drOverAvgPer = .0
                drEffectiveRate = effectiveRate(dataList, evaluationScene)
            }
            //更新入库
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt
@@ -70,7 +70,9 @@
                    evaluationScene.clear()
                    evaluationScene.index = i
                    evaluationScene.setDefaultScene(scene)
                    callback(i, evaluationScene)
                    do {
                        callback(i, evaluationScene)
                    } while (evaluationScene.gotoNextSubTask())
                }
            }
            1 -> {
@@ -92,6 +94,9 @@
        sceneSourceList.clear()
        val taskSceneIdList =
            aopDbMapper.scenseMapper.getSceneByType(config.topTaskGuid, config.sceneType, config.townCode)
        taskSceneIdList.forEach {
            println(it.name)
        }
        sceneSourceList.addAll(taskSceneIdList)
    }
@@ -150,12 +155,21 @@
            })
        }
        //巡查任务信息
        var subTaskIndex = 0
        val subTask = InfoProxy<Subtask> {_,_ ->
            return@InfoProxy if (subTaskList.value?.isNotEmpty() == true) {
                subTaskList.value?.get(subTaskIndex)
            } else {
                null
            }
        }
        val subTaskList = InfoProxy<List<Subtask>> {_,_ ->
            return@InfoProxy aopDbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
                createCriteria().andEqualTo("scenseid", scene.value?.guid)
//                    .andBetween("planstarttime", config?.startTime, config?.endTime)
                    .andEqualTo("tguid", config?.topTaskGuid)
            })?.takeIf { it.isNotEmpty() }?.get(0)
            })
        }
        //现场巡查信息
@@ -341,21 +355,43 @@
         */
        fun clear() {
            scene.clear()
            subTaskIndex = 0
            subTaskList.clear()
            userInfo.clear()
            userInfoTZ.clear()
            baseScene.clear()
            problemTypes.clear()
            ledgerCount.clear()
            ledgerRecords.clear()
            clearSubtask()
        }
        fun clearSubtask() {
            subTask.clear()
            inspection.clear()
            baseScene.clear()
            problems.clear()
            evaluation.clear()
            itemevaluationList.clear()
            problemTypes.clear()
            baseRule.clear()
            totalScore.clear()
            topItems.clear()
            baseRule.clear()
            rules.clear()
            ledgerCount.clear()
            ledgerRecords.clear()
        }
        /**
         * åˆ‡æ¢è‡³ä¸‹ä¸€ä¸ªå·¡æŸ¥ä»»åŠ¡
         * ä¸€ä¸ªåœºæ™¯å¯èƒ½åŒæ—¶å­˜åœ¨å¤šä¸ªå·¡æŸ¥ä»»åŠ¡[subTaskList],需要对每个巡查任务分别进行评分
         * @return æ˜¯å¦æœ‰ä¸‹ä¸€ä¸ªå·¡æŸ¥ä»»åŠ¡
         */
        fun gotoNextSubTask(): Boolean {
            return if (subTaskIndex + 1 < (subTaskList.value?.size ?: 0)) {
                clearSubtask()
                subTaskIndex++
                true
            } else {
                false
            }
        }
        /**
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/score/AopEvaluation.kt
@@ -43,6 +43,11 @@
    reScoreItem10: ReScoreItem10,
    reScoreItem11: ReScoreItem11,
) {
    //正在进行评估的巡查任务
    private val runningSubtask = mutableListOf<String>()
    //正在进行评估的总巡查任务
    private val runningTopTask = mutableListOf<String>()
    //特定评分项(除了统一的根据巡查问题直接扣分外,有特定的扣分逻辑的评估项)
    private val itemList = mutableListOf<ScoreItem>()
@@ -73,9 +78,31 @@
    /**
     * å¯¹ç‰¹å®šçš„巡查任务进行单独评分
     */
    fun executeBySubTask(subTask:Subtask) {
    fun executeBySubTask(subTask: Subtask) {
        if (checkSubtaskExist(subTask)) return
        val source = setResource(subTask)
        execute(source)
        runningSubtask.remove(subTask.stguid)
    }
    @Synchronized
    private fun checkTopTaskExist(topTaskGuid: String?): Boolean {
        return if (runningTopTask.contains(topTaskGuid)) {
            true
        } else {
            topTaskGuid?.let { runningTopTask.add(it) }
            false
        }
    }
    @Synchronized
    private fun checkSubtaskExist(subTask: Subtask): Boolean {
        return if (subTask.stguid == null || runningSubtask.contains(subTask.stguid)) {
            true
        } else {
            runningSubtask.add(subTask.stguid!!)
            false
        }
    }
    private fun setResource(subTask: Subtask): AopDataSource {
@@ -101,7 +128,7 @@
    private fun execute(source: AopDataSource) {
        //获取数据源(待评估的场景)
        //循环处理每个场景
        source.loop {index, evaluationScene ->
        source.loop { index, evaluationScene ->
            if (evaluationScene.noRecord()) return@loop
            itemGrade(index, evaluationScene)
@@ -166,7 +193,10 @@
    /**
     * è®¡ç®—总分
     */
    private fun totalGrade(index: Int, evaluationScene: AopDataSource.EvaluationScene): Pair<Evaluation, List<Itemevaluation>>? {
    private fun totalGrade(
        index: Int,
        evaluationScene: AopDataSource.EvaluationScene,
    ): Pair<Evaluation, List<Itemevaluation>>? {
        val scene = evaluationScene.scene.value ?: return null
        val topItems = evaluationScene.topItems.value ?: return null
        val rules = evaluationScene.rules.value ?: return null
@@ -179,7 +209,7 @@
            total += top.extension1?.toIntOrNull() ?: 0
        }
        val evaluation = Evaluation().apply {
                evaluationScene.baseRule.value?.let {
            evaluationScene.baseRule.value?.let {
                guid = UUIDGenerator.generate16ShortUUID()
                iguid = inspection?.guid
                stguid = subTask?.stguid
src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt
@@ -12,6 +12,7 @@
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.springframework.stereotype.Component
import java.time.LocalDateTime
/**
 * è‡ªåŠ¨è¯„ä¼°ä»»åŠ¡ç®¡ç†
@@ -37,6 +38,29 @@
        dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE1.value.toInt(), jsCsDataAnalysis)
        dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE2.value.toInt(), jsWhDataAnalysis)
        dataAnalysisMap["310116"]?.put(Constant.SceneType.TYPE3.value.toInt(), jsMpDataAnalysis)
    }
    fun startAllEvaluation(time: LocalDateTime) {
        startEvaluation(getArea(time, "310106", "静安区", Constant.SceneType.TYPE1))
        startEvaluation(getArea(time, "310104", "徐汇区", Constant.SceneType.TYPE5))
        startEvaluation(getArea(time, "310116", "金山区", Constant.SceneType.TYPE1))
        startEvaluation(getArea(time, "310116", "金山区", Constant.SceneType.TYPE2))
        startEvaluation(getArea(time, "310116", "金山区", Constant.SceneType.TYPE3))
    }
    fun startEvaluation(areaVo: AreaVo) {
        val task = taskRep.findOneTask(areaVo)
        val taskId = task?.tguid
        val sceneType = areaVo.scensetypeid?.toInt() ?: throw BizException("场景类型未设置,无法评估")
        aopEvaluation.executeByTopTask(taskId, sceneType)
    }
    fun startAll(time: LocalDateTime) {
        startNewTask(getArea(time, "310106", "静安区", Constant.SceneType.TYPE1))
        startNewTask(getArea(time, "310104", "徐汇区", Constant.SceneType.TYPE5))
        startNewTask(getArea(time, "310116", "金山区", Constant.SceneType.TYPE1))
        startNewTask(getArea(time, "310116", "金山区", Constant.SceneType.TYPE2))
        startNewTask(getArea(time, "310116", "金山区", Constant.SceneType.TYPE3))
    }
    fun startNewTask(areaVo: AreaVo): BgTaskStatus {
@@ -78,4 +102,17 @@
        aopDataAnalysis?.setResource(taskId, sceneType, year, month)
        aopDataAnalysis?.execute()
    }
    fun getArea(time: LocalDateTime, dCode: String, dName: String, sceneType: Constant.SceneType): AreaVo {
        return AreaVo().apply {
            provincecode = "31"
            provincename = "上海市"
            citycode = "3100"
            cityname = "上海市"
            starttime = time
            districtcode = dCode
            districtname = dName
            scensetypeid = sceneType.value
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/bgtask/TaskFinishEvaluation.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
package cn.flightfeather.supervision.business.bgtask
import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep
import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep
import org.springframework.stereotype.Component
import java.time.LocalDateTime
import java.util.*
/**
 * è¡¥å……完成所有正在执行的巡查任务,并且对未评分的任务进行自动评分
 */
@Component
class TaskFinishEvaluation(
    private val subTaskRep: SubTaskRep,
    private val evaluationRep: EvaluationRep,
    private val aopEvaluation: AopEvaluation,
) {
    fun handle() {
        val list = subTaskRep.findByTime(2024, 5)
        list.forEach {
            it ?: return@forEach
            evaluationRep.findBySubtask(it.stguid) ?: aopEvaluation.executeBySubTask(it)
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/bgtask/TaskFinishSubtask.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
package cn.flightfeather.supervision.business.bgtask
import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep
import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep
import org.springframework.stereotype.Component
import java.util.*
/**
 * ç»“束所有正在执行的巡查任务,并且对未评分的任务进行自动评分
 */
@Component
class TaskFinishSubtask(
    private val subTaskRep: SubTaskRep,
    private val evaluationRep: EvaluationRep,
    private val aopEvaluation: AopEvaluation,
) {
    fun handle() {
        val list = subTaskRep.findByStatus(Constant.TaskProgress.RUNINGSTATUS2)
        list.forEach {
            it ?: return@forEach
            evaluationRep.findBySubtask(it.stguid) ?: aopEvaluation.executeBySubTask(it)
            it.status = Constant.TaskProgress.RUNINGSTATUS3.text
            it.executionendtime = Date()
            subTaskRep.update(it)
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/bgtask/TaskFinishTopTask.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
package cn.flightfeather.supervision.business.bgtask
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.entity.Task
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import org.springframework.stereotype.Component
import java.time.LocalDateTime
import java.time.ZoneId
/**
 * ç»“束本月之前所有已创建的日任务都完成的的顶层任务
 * @date 2024/7/2
 * @author feiyu02
 */
@Component
class TaskFinishTopTask(private val taskRep: TaskRep) {
    fun handle() {
        // ç­›é€‰æ‰€æœ‰æ­£åœ¨æ‰§è¡Œä¸­çš„顶层任务
        val topTasks = taskRep.findTasks(Task().apply {
            levelnum = 2
            runingstatus = Constant.TaskProgress.RUNINGSTATUS2.text
        })
        // èŽ·å–ä¸Šæœˆåº•æ—¶é—´
        val lastMonth = LocalDateTime.now().withDayOfMonth(1).withHour(0)
            .withMinute(0).withSecond(0).minusSeconds(1)
        topTasks.forEach { tt ->
            if (tt == null) return@forEach
            val time = LocalDateTime.ofInstant(tt.starttime?.toInstant(), ZoneId.systemDefault())
            // ç­›é€‰æœ¬æœˆä¹‹å‰çš„顶层任务
            if (time.isBefore(lastMonth)) {
                // ç»Ÿè®¡å¯¹åº”的所有日任务是否都已结束,若都结束,则结束该顶层任务
                val dayTasks = taskRep.findDayTasks(tt.tguid)
                var finished = true
                for (dt in dayTasks) {
                    if (dt?.runingstatus != Constant.TaskProgress.RUNINGSTATUS3.text) {
                        finished = false
                        break
                    }
                }
                if (finished) {
                    tt.runingstatus = Constant.TaskProgress.RUNINGSTATUS3.text
                    taskRep.update(tt)
                }
            }
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchController.kt
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/datafetch/FetchController.kt ÐÞ¸Ä
@@ -1,4 +1,4 @@
package cn.flightfeather.supervision.datafetch
package cn.flightfeather.supervision.business.datafetch
import org.springframework.stereotype.Component
import java.util.*
src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchData.kt
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/datafetch/FetchData.kt ÐÞ¸Ä
@@ -1,4 +1,4 @@
package cn.flightfeather.supervision.datafetch
package cn.flightfeather.supervision.business.datafetch
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
src/main/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstruction.kt
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/datafetch/FetchNightConstruction.kt ÐÞ¸Ä
@@ -1,4 +1,4 @@
package cn.flightfeather.supervision.datafetch
package cn.flightfeather.supervision.business.datafetch
import cn.flightfeather.supervision.common.net.NCHttpService
import cn.flightfeather.supervision.domain.ds1.entity.NightConstruction
@@ -11,7 +11,6 @@
import com.github.pagehelper.PageHelper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import org.springframework.transaction.annotation.Transactional
import tk.mybatis.mapper.entity.Example
import java.util.*
import javax.annotation.PostConstruct
src/main/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearby.kt
@@ -53,7 +53,7 @@
            }
            utilFile.index = 1
        }
        utilFile.outPutToFile()
        utilFile.outPutToFile(distance)
    }
    /**
src/main/kotlin/cn/flightfeather/supervision/business/location/UtilFile.kt
@@ -74,9 +74,10 @@
        index++
    }
    fun outPutToFile() {
    fun outPutToFile(distance: Double? = null) {
        val workbook = HSSFWorkbook()
        val fileName = "金山区周边点位-${DateUtil().DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls"
        val tag = if (distance == null) "" else  "${distance}ç±³"
        val fileName = "周边${tag}点位-${DateUtil().DateToString(Date(), "yyyy-MM-ddhhmmss")}.xls"
        val filePath = "C:\\work\\工作\\第三方监管\\周边点位\\$fileName"
        val out = FileOutputStream(File(filePath))
        ExcelUtil.write(heads, contents, workbook)
src/main/kotlin/cn/flightfeather/supervision/config/AsyncConfig.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package cn.flightfeather.supervision.config
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.scheduling.annotation.EnableAsync
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
import java.util.concurrent.Executor
@Configuration
@EnableAsync
class AsyncConfig {
    /*
     *此处成员变量应该使用@Value从配置中读取
    */
    private val corePoolSize = 10
    private val maxPoolSize = 200
    private val queueCapacity = 10
    @Bean
    fun taskExecutor(): Executor {
        val executor = ThreadPoolTaskExecutor()
        executor.corePoolSize = corePoolSize
        executor.maxPoolSize = maxPoolSize
        executor.setQueueCapacity(queueCapacity)
        executor.initialize()
        return executor
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/SubtaskMapper.kt
@@ -3,10 +3,7 @@
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
import cn.flightfeather.supervision.domain.util.MyMapper
import cn.flightfeather.supervision.lightshare.vo.SubTaskSearchResultVo2
import cn.flightfeather.supervision.lightshare.vo.SubTaskSummary
import cn.flightfeather.supervision.lightshare.vo.SubtaskSearchResultVo
import cn.flightfeather.supervision.lightshare.vo.SubtaskVo
import cn.flightfeather.supervision.lightshare.vo.*
import org.apache.ibatis.annotations.Mapper
import java.time.LocalDateTime
import java.util.*
@@ -24,6 +21,9 @@
    fun getSummary(topTaskId: String, sceneTypeId: Int?): List<SubTaskSummary>
    // æ ¹æ®åŒºåŸŸèŒƒå›´ç­›é€‰
    fun getSummaryByArea(areaVo: AreaVo): List<SubTaskSummary>
    fun getSummaryByScene(sceneId: String, startTime: LocalDateTime?, endTime: LocalDateTime?): List<SubTaskSummary>
    fun findSubTasksByProType(topTaskId: String, sceneTypeId: String, proType: String): List<Subtask>
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/EvaluationRep.kt
@@ -1,5 +1,6 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.common.exception.BizException
import cn.flightfeather.supervision.domain.ds1.entity.Evaluation
import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation
import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationMapper
@@ -33,6 +34,14 @@
        return if (res.isNotEmpty()) res[0] else null
    }
    fun findBySubtask(subTaskId: String?): Evaluation? {
        try {
            return evaluationMapper.selectOne(Evaluation().apply { stguid = subTaskId })
        } catch (e: Exception) {
            throw BizException("巡查[${subTaskId}]对应了多条评估总分记录,请检查是否有系统逻辑错误")
        }
    }
    /**
     * æŸ¥æ‰¾è‡ªåŠ¨è¯„åˆ†ç»“æžœ
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SceneRep.kt
@@ -5,7 +5,6 @@
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper
import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper
import javafx.scene.Scene
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
import java.util.*
@@ -20,11 +19,11 @@
    private val subTaskRep: SubTaskRep,
) {
    fun insert(scense: Scense?):Int {
        scense ?: return 0
        if (scense.guid == null) scense.guid = UUIDGenerator.generate16ShortUUID()
        scense.createdate = Date()
        return scenseMapper.insertSelective(scense)
    fun insert(scene: Scense?):Int {
        scene ?: return 0
        if (scene.guid == null) scene.guid = UUIDGenerator.generate16ShortUUID()
        scene.createdate = Date()
        return scenseMapper.insertSelective(scene)
    }
    /**
@@ -53,7 +52,7 @@
    }
    fun findBySubTask(subTaskId: String): Scense? {
        val subtask = subTaskRep.find(subTaskId)
        val subtask = subTaskRep.findOne(subTaskId)
        return scenseMapper.selectByPrimaryKey(subtask?.scenseid)
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRep.kt
@@ -1,20 +1,60 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
import cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.SubTaskSummary
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
import java.time.LocalDateTime
@Repository
class SubTaskRep(private val subtaskMapper: SubtaskMapper) {
    fun update(subtask: Subtask): Int {
        return subtaskMapper.updateByPrimaryKey(subtask)
    }
    fun find(id:String): Subtask? {
    fun findOne(id:String): Subtask? {
        return subtaskMapper.selectByPrimaryKey(id)
    }
    fun findAll(subtask: Subtask): List<Subtask?> {
        return subtaskMapper.select(subtask)
    }
    /**
     * æ ¹æ®æ€»ä»»åŠ¡ã€åœºæ™¯ç±»åž‹ã€é—®é¢˜ç±»åž‹ï¼ŒèŽ·å–å‘çŽ°è¯¥ç§ç±»é—®é¢˜çš„åœºæ™¯ä¿¡æ¯
     */
    fun findSubtasks(topTaskId: String, sceneTypeId:String, proType: String): List<Subtask?> {
        return subtaskMapper.findSubTasksByProType(topTaskId, sceneTypeId, proType)
    }
    /**
     * æŸ¥æ‰¾æ­£åœ¨æ‰§è¡Œçš„巡查任务
     */
    fun findByStatus(status: Constant.TaskProgress): List<Subtask?> {
        return subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
            createCriteria().andEqualTo("status", status.text)
        })
    }
    fun findByTime(sT: LocalDateTime, eT: LocalDateTime): List<Subtask?> {
        return subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
            createCriteria().andBetween("planstarttime", sT, eT)
        })
    }
    fun findByTime(year: Int, month: Int): List<Subtask?> {
        val sT = LocalDateTime.of(year, month, 1, 0, 0, 0)
        val eT = sT.plusMonths(1).minusSeconds(1)
        return findByTime(sT, eT)
    }
    // å·¡æŸ¥ä»»åŠ¡é—®é¢˜æ•´æ”¹è¯¦æƒ…ç»Ÿè®¡ç›¸å…³
    fun findSummary(areaVo: AreaVo): List<SubTaskSummary> {
        return subtaskMapper.getSummaryByArea(areaVo)
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/TaskRep.kt
@@ -6,6 +6,7 @@
import cn.flightfeather.supervision.domain.ds1.mapper.TaskMapper
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
import java.time.ZoneId
import java.util.*
@@ -24,6 +25,11 @@
            endtime = Date.from(mEnd.atZone(ZoneId.systemDefault()).toInstant())
        }
    }
    fun update(task: Task): Int {
        return taskMapper.updateByPrimaryKeySelective(task)
    }
    /**
     * æŸ¥æ‰¾ä¸€ä¸ªæ€»ä»»åŠ¡
     */
@@ -37,6 +43,10 @@
        return taskMapper.select(example)
    }
    fun findTasks(task: Task): List<Task?> {
        return taskMapper.select(task)
    }
    /**
     * èŽ·å–æ€»ä»»åŠ¡å¯¹åº”çš„ç›‘ç®¡ç‰ˆæœ¬
     */
@@ -44,4 +54,15 @@
        val monitorList = monitorobjectversionMapper.findMonitorListByScene(taskId, sceneTypeId)
        return monitorList.sortedBy { it.displayid }
    }
    /**
     * èŽ·å–æ—¥ä»»åŠ¡
     * @param taskId é¡¶å±‚任务id
     */
    fun findDayTasks(taskId: String?): List<Task?> {
        return taskMapper.selectByExample(Example(Task::class.java).apply {
            createCriteria().andEqualTo("tsguid", taskId)
            orderBy("starttime").desc()
        })
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/SubtaskService.kt
@@ -45,9 +45,11 @@
    fun getByTopTaskAndDate(topTaskId: String, startTime: String?, endTime: String?, sceneTypeId: Int? = null): List<Subtask>
    fun getTaskProgressByArea(areaVo: AreaVo): List<TaskProgressVo>
    fun getSummary(topTaskId: String, sceneTypeId: Int? = null): List<SubTaskSummary>
    fun getSummaryByArea(areaVo: AreaVo): List<TaskProgressVo>
    fun getByScene(sceneId: String, startTime: LocalDateTime?, endTime: LocalDateTime?): List<SubTaskSummary>
    fun getSummaryByArea(areaVo: AreaVo): List<SubTaskSummary>
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/MediafileServiceImpl.kt
@@ -50,8 +50,8 @@
    //新增媒体文件
    override fun addMedifile(mediafileVoList: String, files: Array<MultipartFile>) {
        logging.info("上传文件方法调用")
        logging.info("mediafileVoList:" + mediafileVoList)
//        logging.info("上传文件方法调用")
//        logging.info("mediafileVoList:" + mediafileVoList)
        val mapper = ObjectMapper()
        //json转object
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt
@@ -12,6 +12,7 @@
import cn.flightfeather.supervision.domain.ds1.mapper.*
import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep
import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRuleRep
import cn.flightfeather.supervision.domain.ds1.repository.SceneRep
import cn.flightfeather.supervision.domain.ds2.mapper.LedgerRecordMapper
import cn.flightfeather.supervision.domain.ds2.mapper.LedgerSubTypeMapper
import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper
@@ -62,6 +63,7 @@
    val taskService: TaskService,
    private val evaluationRep: EvaluationRep,
    private val evaluationRuleRep: EvaluationRuleRep,
    private val sceneRep: SceneRep,
    @Value("\${filePath}") var filePath: String,
    @Value("\${imgPath}") var imgPath: String,
) : SearchService {
@@ -560,15 +562,22 @@
    }
    override fun getScoreDetail(subTaskId: String): ScoreDetail {
        //场景信息
        val scene = sceneRep.findBySubTask(subTaskId)
        //总分
        val evaluation = evaluationRep.findBySubtask(subTaskId)
        //子规则逐条得分
        val subRuleScores = evaluationRep.findItemEvaluation(subTaskId)
        if (subRuleScores.isEmpty()) throw BizException("无评估记录")
        //评分总规则
        val rule = evaluationRuleRep.findAutoEvaluationRule(subTaskId) ?: throw BizException("未找到相关自动评估规则")
        //总规则对应的评分子规则
        val subRules = evaluationRuleRep.findSubRule(rule.guid)
        //查询结果
        val result = ScoreDetail()
        result.status = if (scene?.extension1.equals("1")) "在建" else "完工"
        result.updateTime = evaluation?.updatedate
        subRules.forEach {
            it.ertype ?: return@forEach
            result.addDetail(result.details, it, it.ertype!! - 1, subRuleScores, true)
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SubtaskServiceImpl.kt
@@ -7,6 +7,7 @@
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.DateUtil
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.service.SubtaskService
import cn.flightfeather.supervision.lightshare.service.TaskService
@@ -27,6 +28,7 @@
    private val subtaskMapper: SubtaskMapper,
    private val aopEvaluation: AopEvaluation,
    private val taskRep: TaskRep,
    private val subTaskRep: SubTaskRep,
) : SubtaskService {
    val dateUtil = DateUtil()
@@ -393,7 +395,7 @@
//        //根据日期获取日任务
//        val daytaskVo = taskService.findByDate(dateUtil.getDate(subtask.planstarttime)!!)
        //2019.3.1 by Riku åº”该直接根据子任务的日任务id查询日任务
        //应该直接根据子任务的日任务id查询日任务
        val daytaskVo = taskService.findByID(subtask.tsguid!!)
        //判断是否有日任务
@@ -442,28 +444,28 @@
        }
        //判断对应顶层任务的执行状态
        val daytaskVolist = taskService.getDayTaskByTaskID(toptaskVo.tguid!!)
        val iterator: Iterator<TaskVo> = daytaskVolist.iterator()
        if (daytaskVo.runingstatus == Constant.TaskProgress.RUNINGSTATUS3.text
                && toptaskVo.runingstatus == Constant.TaskProgress.RUNINGSTATUS2.text) {
            var bool = false
            while (iterator.hasNext()) {
                val tmp = iterator.next()
                if (tmp.runingstatus != Constant.TaskProgress.RUNINGSTATUS3.text) {
                    bool = true
                    break
                }
            }
            if (!bool){
                toptaskVo.runingstatus = Constant.TaskProgress.RUNINGSTATUS3.text
            }
        }
        else if (daytaskVo.runingstatus != toptaskVo.runingstatus){
            toptaskVo.runingstatus = Constant.TaskProgress.RUNINGSTATUS2.text
        }
        val toptask = Task()
        BeanUtils.copyProperties(toptaskVo, toptask)
        taskMapper.updateByPrimaryKeySelective(toptask)
//        val daytaskVolist = taskService.getDayTaskByTaskID(toptaskVo.tguid!!)
//        val iterator: Iterator<TaskVo> = daytaskVolist.iterator()
//        if (daytaskVo.runingstatus == Constant.TaskProgress.RUNINGSTATUS3.text
//                && toptaskVo.runingstatus == Constant.TaskProgress.RUNINGSTATUS2.text) {
//            var bool = false
//            while (iterator.hasNext()) {
//                val tmp = iterator.next()
//                if (tmp.runingstatus != Constant.TaskProgress.RUNINGSTATUS3.text) {
//                    bool = true
//                    break
//                }
//            }
//            if (!bool){
//                toptaskVo.runingstatus = Constant.TaskProgress.RUNINGSTATUS3.text
//            }
//        }
//        else if (daytaskVo.runingstatus != toptaskVo.runingstatus){
//            toptaskVo.runingstatus = Constant.TaskProgress.RUNINGSTATUS2.text
//        }
//        val toptask = Task()
//        BeanUtils.copyProperties(toptaskVo, toptask)
//        taskMapper.updateByPrimaryKeySelective(toptask)
        //对已结束的子任务进行自动评分
        if (subtask.status == Constant.TaskProgress.RUNINGSTATUS3.text) {
@@ -946,8 +948,8 @@
        return subtaskMapper.getSummary(topTaskId, sceneTypeId)
    }
    override fun getSummaryByArea(areaVo: AreaVo): List<TaskProgressVo> {
        areaVo.scensetypeid ?: throw BizException("缺少场景类型参数")
    override fun getTaskProgressByArea(areaVo: AreaVo): List<TaskProgressVo> {
//        areaVo.scensetypeid ?: throw BizException("缺少场景类型参数")
        val res = mutableListOf<TaskProgressVo>()
        taskRep.findTasks(areaVo).forEach {t->
            if (t?.tguid == null) return@forEach
@@ -973,4 +975,8 @@
    override fun getByScene(sceneId: String, startTime: LocalDateTime?, endTime: LocalDateTime?): List<SubTaskSummary> {
        return subtaskMapper.getSummaryByScene(sceneId, startTime, endTime)
    }
    override fun getSummaryByArea(areaVo: AreaVo): List<SubTaskSummary> {
        return subTaskRep.findSummary(areaVo)
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AutoScoreResultVo.kt
@@ -12,6 +12,7 @@
    var userId: String? = null
    var userName: String? = null
    var isEnable: Boolean = true
    var sceneIndex: Int? = null
    var sceneId: String? = null
    var sceneName: String? = null
    var pName: String? = null
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt
@@ -3,17 +3,27 @@
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2
import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation
import com.fasterxml.jackson.annotation.JsonInclude
import java.util.*
/**
 * è¯„分规则及得分
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
class ScoreDetail {
    // å·¥åœ°çŠ¶æ€ï¼ˆåœ¨å»ºæˆ–å®Œå·¥ï¼‰
    var status: String? = null
    // æ€»åˆ†
    var totalScore: Int = 0
    // å¾—分
    var score: Int = 0
    // è§„范性等级
    var grade: String? = null
    // æ›´æ–°æ—¶é—´
    var updateTime: Date? = null
    // å¾—分细则
    var details = mutableListOf<ScoreItem>()
@@ -69,12 +79,27 @@
    fun calScore() {
        details.forEach {
            totalScore += it.maxScore
            if (it.gradeMode == "minus_mode") {
                score += (it.score + it.maxScore)
            } else if (it.gradeMode == "add_mode") {
                score += it.score
            score += when (it.gradeMode) {
                "minus_mode" -> {
                    (it.score + it.maxScore)
                }
                "add_mode" -> {
                    it.score
                }
                else -> {
                    (it.score + it.maxScore)
                }
            }
        }
        grade = when {
            score >= 95 -> "规范"
            // åŸºæœ¬è§„范(90..94)和规范(>=95)
            score >= 90 -> "基本规范"
            // ä¸è§„范
            score >= 50 -> "不规范"
            // ä¸¥é‡ä¸è§„范
            else -> "严重不规范"
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/SubTaskSummary.kt
@@ -1,20 +1,37 @@
package cn.flightfeather.supervision.lightshare.vo
import cn.flightfeather.supervision.domain.ds1.entity.Inspection
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.entity.Subtask
import java.math.BigDecimal
import java.util.*
class SubTaskSummary {
    // å·¡æŸ¥ä»»åŠ¡
    var stGuid: String? = null
    var stName: String? = null
    var insGuid: String? = null
    var sceneId: String? = null
    var sceneName: String? = null
    var sceneType: String? = null
    var stPlanTime: Date? = null
    var stStatus:String? = null
    var subtask: Subtask? = null
    // å·¡æŸ¥æ‰§è¡Œè®°å½•
    var insGuid: String? = null
    var inspection: Inspection? = null
    // å¯¹åº”场景信息
    var sceneId: String? = null
    var sceneName: String? = null
    var sceneTypeId: Byte? = null
    var sceneType: String? = null
    var sceneIndex: Int? = null
    var longitude: BigDecimal? = null
    var latitude: BigDecimal? = null
    var location: String? = null
    var scene: Scense? = null
    // é—®é¢˜æ•´æ”¹åŠå…¶å¯¹åº”审核的计数
    var proNum = 0
    var changeNum = 0
    var proCheckedNum: Int = 0
    var changeCheckedNum: Int = 0
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/SubtaskController.kt
@@ -4,7 +4,6 @@
import cn.flightfeather.supervision.lightshare.service.SubtaskService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.TaskVo
import com.fasterxml.jackson.annotation.JsonFormat
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.format.annotation.DateTimeFormat
@@ -76,9 +75,9 @@
    @ApiOperation("获取某类场景的巡查任务统计信息")
    @PostMapping("/summary/area")
    fun getSummaryByArea(
    fun getTaskProgressByArea(
        @RequestBody areaVo: AreaVo,
    ) = subtaskService.getSummaryByArea(areaVo)
    ) = resPack { subtaskService.getTaskProgressByArea(areaVo) }
    @ApiOperation("获取某个场景的巡查任务")
    @GetMapping("/byScene")
@@ -87,4 +86,10 @@
        @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") startTime: LocalDateTime?,
        @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") endTime: LocalDateTime?,
    ) = subtaskService.getByScene(sceneId, startTime, endTime)
    @ApiOperation("获取某类场景的巡查任务统计信息")
    @PostMapping("/summary/area/problem")
    fun getSummaryByArea(
        @RequestBody areaVo: AreaVo,
    ) = resPack { subtaskService.getSummaryByArea(areaVo) }
}
src/main/kotlin/cn/flightfeather/supervision/scheduler/ScheduleService.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
package cn.flightfeather.supervision.scheduler
import cn.flightfeather.supervision.business.bgtask.AopTaskCtrl
import cn.flightfeather.supervision.business.bgtask.TaskFinishSubtask
import cn.flightfeather.supervision.business.bgtask.TaskFinishTopTask
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.scheduling.annotation.Async
import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Component
import java.time.LocalDateTime
/**
 * å®šæ—¶ä»»åŠ¡è°ƒåº¦
 * ä¸€ä¸ªcron表达式有至少6个(也可能7个)有空格分隔的时间元素。按顺序依次为:
 * ç§’(0~59)
 * åˆ†é’Ÿï¼ˆ0~59)
 * å°æ—¶ï¼ˆ0~23)
 * å¤©ï¼ˆ1~31)
 * æœˆï¼ˆ1~12)
 * æ˜ŸæœŸï¼ˆ1~7 1=SUN æˆ– SUN,MON,TUE,WED,THU,FRI,SAT)
 */
@Component
class ScheduleService(
    private val taskFinishSubtask: TaskFinishSubtask,
    private val taskFinishTopTask: TaskFinishTopTask,
    private val aopTaskCtrl: AopTaskCtrl,
) {
    val logger: Logger = LoggerFactory.getLogger(ScheduleService::class.java)
    @Async
    @Scheduled(cron = "0 0 0 * * *")
    fun eachDay() {
        logger.info("=====>>>>>每日任务执行 {}", System.currentTimeMillis())
        taskFinishSubtask.handle()
        logger.info("=====>>>>>每日任务结束 {}", System.currentTimeMillis())
    }
    @Async
    @Scheduled(cron = "0 0 0 * * MON")
    fun eachWeek() {
        logger.info("=====>>>>>每周任务执行 {}", System.currentTimeMillis())
        // æ‰§è¡Œä¸Šå‘¨çš„自评任务
        aopTaskCtrl.startAllEvaluation(LocalDateTime.now())
        logger.info("=====>>>>>每周任务结束 {}", System.currentTimeMillis())
    }
    @Async
    @Scheduled(cron = "0 0 0 2 * *")
    fun eachMonth() {
        logger.info("=====>>>>>每月任务执行 {}", System.currentTimeMillis())
        // æ‰§è¡Œä¸Šä¸ªæœˆçš„完整自评任务
        aopTaskCtrl.startAll(LocalDateTime.now().minusMonths(1))
        // æ‰§è¡Œé¡¶å±‚任务自动结束任务
        taskFinishTopTask.handle()
        logger.info("=====>>>>>每月任务结束 {}", System.currentTimeMillis())
    }
}
src/main/resources/application.yml
@@ -71,8 +71,12 @@
# mybatis é…ç½®
mybatis:
  type-aliases-package: cn.flightfeather.supervision.domain.ds1.entity, cn.flightfeather.supervision.domain.ds2.entity
  type-aliases-package: cn.flightfeather.supervision.domain.ds1.entity, cn.flightfeather.supervision.domain.ds2.entity, cn.flightfeather.supervision.domain.ds3.entity
  mapper-locations: classpath*:mapper/**/*.xml
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  #    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
  #    map-underscore-to-camel-case: true
## é€šç”¨ Mapper é…ç½®
#mappers å¤šä¸ªæŽ¥å£æ—¶é€—号隔开
@@ -83,7 +87,9 @@
#logging路径设置
logging:
    config: classpath:log4j2.xml
#  config: classpath:log4j2.xml
  level:
    cn.flightfeather.supervision.domain: debug
springfox:
  documentation:
src/main/resources/log4j2.xml
@@ -59,24 +59,28 @@
    <!--然后定义logger,只有定义了logger并引入的appender,appender才会生效-->
    <Loggers>
        <!--过滤掉spring和mybatis的一些无用的DEBUG信息-->
        <logger name="org.springframework" level="INFO">
        <logger name="org.springframework" level="ERROR">
            <appender-ref ref="Console"/>
        </logger>
        <logger name="org.mybatis" level="DEBUG">
<!--            <appender-ref ref="Console"/>-->
            <appender-ref ref="Console"/>
        </logger>
        <logger name="org.apache.ibatis" level="DEBUG">
<!--            <appender-ref ref="Console"/>-->
            <appender-ref ref="Console"/>
        </logger>
        <Logger name="java.sql.PreparedStatement" level="DEBUG" >
            <appender-ref ref="Console"/>
        </Logger>
        <logger name="cn.flightfeather.supervision" level="INFO" includeLocation="true" additivity="false">
            <appender-ref ref="Console"/>
            <appender-ref ref="RollingFileInfo"/>
        </logger>
        <root level="all">
            <!--<appender-ref ref="Console"/>-->
<!--            <appender-ref ref="RollingFileInfo"/>-->
<!--            <appender-ref ref="RollingFileWarn"/>-->
            <appender-ref ref="Console"/>
            <appender-ref ref="RollingFileInfo"/>
            <appender-ref ref="RollingFileWarn"/>
            <appender-ref ref="RollingFileError"/>
        </root>
    </Loggers>
src/main/resources/mapper/ds1/EvaluationMapper.xml
@@ -57,6 +57,7 @@
    <result column="userId" jdbcType="VARCHAR" property="userId"/>
    <result column="userName" jdbcType="VARCHAR" property="userName"/>
    <result column="isEnable" jdbcType="BIT" property="isEnable"/>
    <result column="sceneIndex" property="sceneIndex" jdbcType="INTEGER" />
    <result column="sceneId" jdbcType="VARCHAR" property="sceneId"/>
    <result column="sceneName" jdbcType="VARCHAR" property="sceneName"/>
    <result column="pName" jdbcType="VARCHAR" property="pName"/>
@@ -73,6 +74,7 @@
    c.UI_GUID AS userId,
    c.UI_RealName AS userName,
    c.UI_IsEnable AS isEnable,
    b.S_Index AS sceneIndex,
    b.S_GUID AS sceneId,
    b.S_Name AS sceneName,
    b.S_ProvinceName AS pName,
src/main/resources/mapper/ds1/InspectionMapper.xml
@@ -8,34 +8,34 @@
    <id column="I_GUID" property="guid" jdbcType="VARCHAR" />
    <result column="ST_GUID" property="stguid" jdbcType="VARCHAR" />
    <result column="S_GUID" property="sguid" jdbcType="VARCHAR" />
    <result column="I_ScenseName" property="iScensename" jdbcType="VARCHAR" />
    <result column="I_ScenseAddress" property="iScenseaddress" jdbcType="VARCHAR" />
    <result column="I_IsTogether" property="iIstogether" jdbcType="BIT" />
    <result column="I_EntourageT" property="iEntouraget" jdbcType="VARCHAR" />
    <result column="I_EntourageWX" property="iEntouragewx" jdbcType="VARCHAR" />
    <result column="I_Entourage" property="iEntourage" jdbcType="VARCHAR" />
    <result column="I_ExecutionStartTime" property="iExecutionstarttime" jdbcType="TIMESTAMP" />
    <result column="I_ExecutionEndTime" property="iExecutionendtime" jdbcType="TIMESTAMP" />
    <result column="I_ProblemCount" property="iProblemcount" jdbcType="INTEGER" />
    <result column="I_IsRechecked" property="iIsrechecked" jdbcType="BIT" />
    <result column="I_RecheckCount" property="iRecheckcount" jdbcType="INTEGER" />
    <result column="I_PromissedNum" property="iPromissednum" jdbcType="INTEGER" />
    <result column="I_ChangedNum" property="iChangednum" jdbcType="INTEGER" />
    <result column="I_IsChanged" property="iIschanged" jdbcType="BIT" />
    <result column="I_IsRvaluated" property="iIsrvaluated" jdbcType="BIT" />
    <result column="I_isPromissed" property="iIspromissed" jdbcType="BIT" />
    <result column="I_PromissedTime" property="iPromissedtime" jdbcType="TIMESTAMP" />
    <result column="I_PromissedUserGUID" property="iPromisseduserguid" jdbcType="VARCHAR" />
    <result column="I_PromissedUserName" property="iPromissedusername" jdbcType="VARCHAR" />
    <result column="I_PromissedUserRealName" property="iPromisseduserrealname" jdbcType="VARCHAR" />
    <result column="I_PromissedWay" property="iPromissedway" jdbcType="VARCHAR" />
    <result column="I_PromissedDeadline" property="iPromisseddeadline" jdbcType="TIMESTAMP" />
    <result column="I_PromissBookPath" property="iPromissbookpath" jdbcType="VARCHAR" />
    <result column="I_SignPath" property="iSignpath" jdbcType="VARCHAR" />
    <result column="I_Extension1" property="iExtension1" jdbcType="VARCHAR" />
    <result column="I_Extension2" property="iExtension2" jdbcType="VARCHAR" />
    <result column="I_Extension3" property="iExtension3" jdbcType="VARCHAR" />
    <result column="I_Remark" property="iRemark" jdbcType="VARCHAR" />
    <result column="I_ScenseName" property="scensename" jdbcType="VARCHAR" />
    <result column="I_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR" />
    <result column="I_IsTogether" property="istogether" jdbcType="BIT" />
    <result column="I_EntourageT" property="entouraget" jdbcType="VARCHAR" />
    <result column="I_EntourageWX" property="entouragewx" jdbcType="VARCHAR" />
    <result column="I_Entourage" property="entourage" jdbcType="VARCHAR" />
    <result column="I_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP" />
    <result column="I_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP" />
    <result column="I_ProblemCount" property="problemcount" jdbcType="INTEGER" />
    <result column="I_IsRechecked" property="isrechecked" jdbcType="BIT" />
    <result column="I_RecheckCount" property="recheckcount" jdbcType="INTEGER" />
    <result column="I_PromissedNum" property="promissednum" jdbcType="INTEGER" />
    <result column="I_ChangedNum" property="changednum" jdbcType="INTEGER" />
    <result column="I_IsChanged" property="ischanged" jdbcType="BIT" />
    <result column="I_IsRvaluated" property="isrvaluated" jdbcType="BIT" />
    <result column="I_isPromissed" property="ispromissed" jdbcType="BIT" />
    <result column="I_PromissedTime" property="promissedtime" jdbcType="TIMESTAMP" />
    <result column="I_PromissedUserGUID" property="promisseduserguid" jdbcType="VARCHAR" />
    <result column="I_PromissedUserName" property="promissedusername" jdbcType="VARCHAR" />
    <result column="I_PromissedUserRealName" property="promisseduserrealname" jdbcType="VARCHAR" />
    <result column="I_PromissedWay" property="promissedway" jdbcType="VARCHAR" />
    <result column="I_PromissedDeadline" property="promisseddeadline" jdbcType="TIMESTAMP" />
    <result column="I_PromissBookPath" property="promissbookpath" jdbcType="VARCHAR" />
    <result column="I_SignPath" property="signpath" jdbcType="VARCHAR" />
    <result column="I_Extension1" property="extension1" jdbcType="VARCHAR" />
    <result column="I_Extension2" property="extension2" jdbcType="VARCHAR" />
    <result column="I_Extension3" property="extension3" jdbcType="VARCHAR" />
    <result column="I_Remark" property="remark" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
src/main/resources/mapper/ds1/SubtaskMapper.xml
@@ -1,185 +1,247 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper" >
  <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Subtask" >
    <!--
      WARNING - @mbg.generated
    -->
    <id column="ST_GUID" property="stguid" jdbcType="VARCHAR" />
    <result column="T_GUID" property="tguid" jdbcType="VARCHAR" />
    <result column="TS_GUID" property="tsguid" jdbcType="VARCHAR" />
    <result column="ST_name" property="name" jdbcType="VARCHAR" />
    <result column="ST_Priority" property="priority" jdbcType="BIT" />
    <result column="ST_TypeNo" property="typeno" jdbcType="TINYINT" />
    <result column="ST_Type" property="type" jdbcType="VARCHAR" />
    <result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR" />
    <result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR" />
    <result column="ST_CityCode" property="citycode" jdbcType="VARCHAR" />
    <result column="ST_CityName" property="cityname" jdbcType="VARCHAR" />
    <result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR" />
    <result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR" />
    <result column="ST_TownCode" property="towncode" jdbcType="VARCHAR" />
    <result column="ST_TownName" property="townname" jdbcType="VARCHAR" />
    <result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR" />
    <result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR" />
    <result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR" />
    <result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR" />
    <result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP" />
    <result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP" />
    <result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR" />
    <result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR" />
    <result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR" />
    <result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP" />
    <result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP" />
    <result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP" />
    <result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR" />
    <result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR" />
    <result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR" />
    <result column="ST_Status" property="status" jdbcType="VARCHAR" />
    <result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER" />
    <result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR" />
    <result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR" />
    <result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR" />
    <result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR" />
    <result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP" />
    <result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR" />
    <result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR" />
    <result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR" />
    <result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR" />
    <result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP" />
    <result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR" />
    <result column="ST_Extension1" property="extension1" jdbcType="VARCHAR" />
    <result column="ST_Extension2" property="extension2" jdbcType="VARCHAR" />
    <result column="ST_Extension3" property="extension3" jdbcType="VARCHAR" />
    <result column="ST_Remark" property="remark" jdbcType="VARCHAR" />
  </resultMap>
  <resultMap id="SubtaskSearchResultVo" type="cn.flightfeather.supervision.lightshare.vo.SubtaskSearchResultVo">
    <result column="subTaskId" property="subTaskId" jdbcType="VARCHAR" />
    <result column="districtName" property="districtName" jdbcType="VARCHAR" />
    <result column="townName" property="townName" jdbcType="VARCHAR" />
    <result column="sceneId" property="sceneId" jdbcType="VARCHAR" />
    <result column="sceneName" property="sceneName" jdbcType="VARCHAR" />
    <result column="sceneTypeId" property="sceneTypeId" jdbcType="TINYINT" />
    <result column="sceneType" property="sceneType" jdbcType="VARCHAR" />
    <result column="sceneAddress" property="sceneAddress" jdbcType="VARCHAR" />
    <result column="planStartTime" property="planStartTime" jdbcType="TIMESTAMP" />
    <result column="planEndTime" property="planEndTime" jdbcType="TIMESTAMP" />
    <result column="status" property="status" jdbcType="VARCHAR" />
    <result column="path" property="path" jdbcType="VARCHAR" />
  </resultMap>
  <resultMap id="SubTaskSearchResultVo2" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSearchResultVo2">
    <result column="subTaskId" property="subTaskId" jdbcType="VARCHAR" />
    <result column="districtName" property="districtName" jdbcType="VARCHAR" />
    <result column="townName" property="townName" jdbcType="VARCHAR" />
    <result column="sceneId" property="sceneId" jdbcType="VARCHAR" />
    <result column="sceneName" property="sceneName" jdbcType="VARCHAR" />
    <result column="sceneTypeId" property="sceneTypeId" jdbcType="TINYINT" />
    <result column="sceneType" property="sceneType" jdbcType="VARCHAR" />
    <result column="sceneAddress" property="sceneAddress" jdbcType="VARCHAR" />
    <result column="planStartTime" property="planStartTime" jdbcType="TIMESTAMP" />
    <result column="planEndTime" property="planEndTime" jdbcType="TIMESTAMP" />
    <result column="status" property="status" jdbcType="VARCHAR" />
    <result column="path" property="path" jdbcType="VARCHAR" />
    <result column="problemId" property="problemId" jdbcType="VARCHAR" />
    <result column="problemName" property="problemName" jdbcType="VARCHAR" />
      <result column="problemCode" property="problemCode" jdbcType="VARCHAR" />
    <result column="longitude" property="longitude" jdbcType="DECIMAL" />
    <result column="latitude" property="latitude" jdbcType="DECIMAL" />
    <result column="location" property="location" jdbcType="VARCHAR" />
    <result column="rectification" property="rectification" jdbcType="BIT" />
    <result column="rectificationTime" property="rectificationTime" jdbcType="TIMESTAMP" />
    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="mGuid" property="mGuid" jdbcType="VARCHAR" />
    <result column="mExtension1" property="mExtension1" jdbcType="VARCHAR" />
    <result column="isChanged" property="isChanged" jdbcType="BIT" />
  </resultMap>
    <resultMap id="SubtaskVoMap" type="cn.flightfeather.supervision.lightshare.vo.SubtaskVo" >
        <id column="ST_GUID" property="stguid" jdbcType="VARCHAR" />
        <result column="T_GUID" property="tguid" jdbcType="VARCHAR" />
        <result column="TS_GUID" property="tsguid" jdbcType="VARCHAR" />
        <result column="ST_name" property="name" jdbcType="VARCHAR" />
        <result column="ST_Priority" property="priority" jdbcType="BIT" />
        <result column="ST_TypeNo" property="typeno" jdbcType="TINYINT" />
        <result column="ST_Type" property="type" jdbcType="VARCHAR" />
        <result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR" />
        <result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR" />
        <result column="ST_CityCode" property="citycode" jdbcType="VARCHAR" />
        <result column="ST_CityName" property="cityname" jdbcType="VARCHAR" />
        <result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR" />
        <result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR" />
        <result column="ST_TownCode" property="towncode" jdbcType="VARCHAR" />
        <result column="ST_TownName" property="townname" jdbcType="VARCHAR" />
        <result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR" />
        <result column="S_TypeID" property="scenseTypeId" jdbcType="VARCHAR" />
        <result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR" />
        <result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR" />
        <result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR" />
        <result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP" />
        <result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP" />
        <result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR" />
        <result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR" />
        <result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR" />
        <result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP" />
        <result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP" />
        <result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP" />
        <result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR" />
        <result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR" />
        <result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR" />
        <result column="ST_Status" property="status" jdbcType="VARCHAR" />
        <result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER" />
        <result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR" />
        <result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR" />
        <result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR" />
        <result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR" />
        <result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP" />
        <result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR" />
        <result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR" />
        <result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR" />
        <result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR" />
        <result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP" />
        <result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR" />
        <result column="ST_Extension1" property="extension1" jdbcType="VARCHAR" />
        <result column="ST_Extension2" property="extension2" jdbcType="VARCHAR" />
        <result column="ST_Extension3" property="extension3" jdbcType="VARCHAR" />
        <result column="ST_Remark" property="remark" jdbcType="VARCHAR" />
<mapper namespace="cn.flightfeather.supervision.domain.ds1.mapper.SubtaskMapper">
    <resultMap id="BaseResultMap" type="cn.flightfeather.supervision.domain.ds1.entity.Subtask">
        <!--
          WARNING - @mbg.generated
        -->
        <id column="ST_GUID" property="stguid" jdbcType="VARCHAR"/>
        <result column="T_GUID" property="tguid" jdbcType="VARCHAR"/>
        <result column="TS_GUID" property="tsguid" jdbcType="VARCHAR"/>
        <result column="ST_name" property="name" jdbcType="VARCHAR"/>
        <result column="ST_Priority" property="priority" jdbcType="BIT"/>
        <result column="ST_TypeNo" property="typeno" jdbcType="TINYINT"/>
        <result column="ST_Type" property="type" jdbcType="VARCHAR"/>
        <result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR"/>
        <result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR"/>
        <result column="ST_CityCode" property="citycode" jdbcType="VARCHAR"/>
        <result column="ST_CityName" property="cityname" jdbcType="VARCHAR"/>
        <result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR"/>
        <result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR"/>
        <result column="ST_TownCode" property="towncode" jdbcType="VARCHAR"/>
        <result column="ST_TownName" property="townname" jdbcType="VARCHAR"/>
        <result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR"/>
        <result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR"/>
        <result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR"/>
        <result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR"/>
        <result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP"/>
        <result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP"/>
        <result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR"/>
        <result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR"/>
        <result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR"/>
        <result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP"/>
        <result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP"/>
        <result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP"/>
        <result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR"/>
        <result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR"/>
        <result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR"/>
        <result column="ST_Status" property="status" jdbcType="VARCHAR"/>
        <result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER"/>
        <result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR"/>
        <result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR"/>
        <result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR"/>
        <result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR"/>
        <result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP"/>
        <result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR"/>
        <result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR"/>
        <result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR"/>
        <result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR"/>
        <result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP"/>
        <result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR"/>
        <result column="ST_Extension1" property="extension1" jdbcType="VARCHAR"/>
        <result column="ST_Extension2" property="extension2" jdbcType="VARCHAR"/>
        <result column="ST_Extension3" property="extension3" jdbcType="VARCHAR"/>
        <result column="ST_Remark" property="remark" jdbcType="VARCHAR"/>
    </resultMap>
    <resultMap id="SubTaskSummary" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSummary" >
        <result column="ST_GUID" property="stGuid" jdbcType="VARCHAR" />
        <result column="ST_name" property="stName" jdbcType="VARCHAR" />
        <result column="ST_PlanStartTime" property="stPlanTime" jdbcType="TIMESTAMP" />
        <result column="ST_Status" property="stStatus" jdbcType="VARCHAR" />
        <result column="S_GUID" property="sceneId" jdbcType="VARCHAR" />
        <result column="S_Name" property="sceneName" jdbcType="VARCHAR" />
        <result column="S_Type" property="sceneType" jdbcType="VARCHAR" />
        <result column="I_GUID" property="insGuid" jdbcType="VARCHAR" />
        <result column="proNum" property="proNum" jdbcType="INTEGER" />
        <result column="changeNum" property="changeNum" jdbcType="INTEGER" />
        <result column="proCheckedNum" property="proCheckedNum" jdbcType="INTEGER" />
        <result column="changeCheckedNum" property="changeCheckedNum" jdbcType="INTEGER" />
    </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    ST_GUID, T_GUID, TS_GUID, ST_name, ST_Priority, ST_TypeNo, ST_Type, ST_ProvinceCode,
    ST_ProvinceName, ST_CityCode, ST_CityName, ST_DistrictCode, ST_DistrictName, ST_TownCode,
    ST_TownName, ST_ScenseName, ST_ScenseID, ST_ScenseAddress, ST_DeadLineType, ST_PlanStartTime,
    ST_PlanEndTime, ST_DeployerGUID, ST_DeployerUserName, ST_DeployerRealName, ST_DeployTime,
    ST_ExecutionStartTime, ST_ExecutionEndTime, ST_ExecutorGUIDs, ST_ExecutorUserNames,
    ST_ExecutorRealTimes, ST_Status, ST_NotifedCount, ST_RuleList, ST_AssessorGUID, ST_AssessorUserName,
    ST_AssessorRealName, ST_AssessTime, ST_AssessResult, ST_ThirdAssessorGUID, ST_ThirdAssessorUserName,
    ST_ThirdAssessorRealName, ST_ThirdAssessTime, ST_ThirdAssessResult, ST_Extension1,
    ST_Extension2, ST_Extension3, ST_Remark
  </sql>
    <sql id="Base_Column_List">
        <!--
          WARNING - @mbg.generated
        -->
        ST_GUID, T_GUID, TS_GUID, ST_name, ST_Priority, ST_TypeNo, ST_Type, ST_ProvinceCode,
        ST_ProvinceName, ST_CityCode, ST_CityName, ST_DistrictCode, ST_DistrictName, ST_TownCode,
        ST_TownName, ST_ScenseName, ST_ScenseID, ST_ScenseAddress, ST_DeadLineType, ST_PlanStartTime,
        ST_PlanEndTime, ST_DeployerGUID, ST_DeployerUserName, ST_DeployerRealName, ST_DeployTime,
        ST_ExecutionStartTime, ST_ExecutionEndTime, ST_ExecutorGUIDs, ST_ExecutorUserNames,
        ST_ExecutorRealTimes, ST_Status, ST_NotifedCount, ST_RuleList, ST_AssessorGUID, ST_AssessorUserName,
        ST_AssessorRealName, ST_AssessTime, ST_AssessResult, ST_ThirdAssessorGUID, ST_ThirdAssessorUserName,
        ST_ThirdAssessorRealName, ST_ThirdAssessTime, ST_ThirdAssessResult, ST_Extension1,
        ST_Extension2, ST_Extension3, ST_Remark
    </sql>
  <select id="getSubtask" resultMap="SubtaskSearchResultVo">
      SELECT
    <resultMap id="SubtaskSearchResultVo" type="cn.flightfeather.supervision.lightshare.vo.SubtaskSearchResultVo">
        <result column="subTaskId" property="subTaskId" jdbcType="VARCHAR"/>
        <result column="districtName" property="districtName" jdbcType="VARCHAR"/>
        <result column="townName" property="townName" jdbcType="VARCHAR"/>
        <result column="sceneId" property="sceneId" jdbcType="VARCHAR"/>
        <result column="sceneName" property="sceneName" jdbcType="VARCHAR"/>
        <result column="sceneTypeId" property="sceneTypeId" jdbcType="TINYINT"/>
        <result column="sceneType" property="sceneType" jdbcType="VARCHAR"/>
        <result column="sceneAddress" property="sceneAddress" jdbcType="VARCHAR"/>
        <result column="planStartTime" property="planStartTime" jdbcType="TIMESTAMP"/>
        <result column="planEndTime" property="planEndTime" jdbcType="TIMESTAMP"/>
        <result column="status" property="status" jdbcType="VARCHAR"/>
        <result column="path" property="path" jdbcType="VARCHAR"/>
    </resultMap>
    <resultMap id="SubTaskSearchResultVo2" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSearchResultVo2">
        <result column="subTaskId" property="subTaskId" jdbcType="VARCHAR"/>
        <result column="districtName" property="districtName" jdbcType="VARCHAR"/>
        <result column="townName" property="townName" jdbcType="VARCHAR"/>
        <result column="sceneId" property="sceneId" jdbcType="VARCHAR"/>
        <result column="sceneName" property="sceneName" jdbcType="VARCHAR"/>
        <result column="sceneTypeId" property="sceneTypeId" jdbcType="TINYINT"/>
        <result column="sceneType" property="sceneType" jdbcType="VARCHAR"/>
        <result column="sceneAddress" property="sceneAddress" jdbcType="VARCHAR"/>
        <result column="planStartTime" property="planStartTime" jdbcType="TIMESTAMP"/>
        <result column="planEndTime" property="planEndTime" jdbcType="TIMESTAMP"/>
        <result column="status" property="status" jdbcType="VARCHAR"/>
        <result column="path" property="path" jdbcType="VARCHAR"/>
        <result column="problemId" property="problemId" jdbcType="VARCHAR"/>
        <result column="problemName" property="problemName" jdbcType="VARCHAR"/>
        <result column="problemCode" property="problemCode" jdbcType="VARCHAR"/>
        <result column="longitude" property="longitude" jdbcType="DECIMAL"/>
        <result column="latitude" property="latitude" jdbcType="DECIMAL"/>
        <result column="location" property="location" jdbcType="VARCHAR"/>
        <result column="rectification" property="rectification" jdbcType="BIT"/>
        <result column="rectificationTime" property="rectificationTime" jdbcType="TIMESTAMP"/>
        <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP"/>
        <result column="mGuid" property="mGuid" jdbcType="VARCHAR"/>
        <result column="mExtension1" property="mExtension1" jdbcType="VARCHAR"/>
        <result column="isChanged" property="isChanged" jdbcType="BIT"/>
    </resultMap>
    <resultMap id="SubtaskVoMap" type="cn.flightfeather.supervision.lightshare.vo.SubtaskVo">
        <id column="ST_GUID" property="stguid" jdbcType="VARCHAR"/>
        <result column="T_GUID" property="tguid" jdbcType="VARCHAR"/>
        <result column="TS_GUID" property="tsguid" jdbcType="VARCHAR"/>
        <result column="ST_name" property="name" jdbcType="VARCHAR"/>
        <result column="ST_Priority" property="priority" jdbcType="BIT"/>
        <result column="ST_TypeNo" property="typeno" jdbcType="TINYINT"/>
        <result column="ST_Type" property="type" jdbcType="VARCHAR"/>
        <result column="ST_ProvinceCode" property="provincecode" jdbcType="VARCHAR"/>
        <result column="ST_ProvinceName" property="provincename" jdbcType="VARCHAR"/>
        <result column="ST_CityCode" property="citycode" jdbcType="VARCHAR"/>
        <result column="ST_CityName" property="cityname" jdbcType="VARCHAR"/>
        <result column="ST_DistrictCode" property="districtcode" jdbcType="VARCHAR"/>
        <result column="ST_DistrictName" property="districtname" jdbcType="VARCHAR"/>
        <result column="ST_TownCode" property="towncode" jdbcType="VARCHAR"/>
        <result column="ST_TownName" property="townname" jdbcType="VARCHAR"/>
        <result column="ST_ScenseName" property="scensename" jdbcType="VARCHAR"/>
        <result column="S_TypeID" property="scenseTypeId" jdbcType="VARCHAR"/>
        <result column="ST_ScenseID" property="scenseid" jdbcType="VARCHAR"/>
        <result column="ST_ScenseAddress" property="scenseaddress" jdbcType="VARCHAR"/>
        <result column="ST_DeadLineType" property="deadlinetype" jdbcType="VARCHAR"/>
        <result column="ST_PlanStartTime" property="planstarttime" jdbcType="TIMESTAMP"/>
        <result column="ST_PlanEndTime" property="planendtime" jdbcType="TIMESTAMP"/>
        <result column="ST_DeployerGUID" property="deployerguid" jdbcType="VARCHAR"/>
        <result column="ST_DeployerUserName" property="deployerusername" jdbcType="VARCHAR"/>
        <result column="ST_DeployerRealName" property="deployerrealname" jdbcType="VARCHAR"/>
        <result column="ST_DeployTime" property="deploytime" jdbcType="TIMESTAMP"/>
        <result column="ST_ExecutionStartTime" property="executionstarttime" jdbcType="TIMESTAMP"/>
        <result column="ST_ExecutionEndTime" property="executionendtime" jdbcType="TIMESTAMP"/>
        <result column="ST_ExecutorGUIDs" property="executorguids" jdbcType="VARCHAR"/>
        <result column="ST_ExecutorUserNames" property="executorusernames" jdbcType="VARCHAR"/>
        <result column="ST_ExecutorRealTimes" property="executorrealtimes" jdbcType="VARCHAR"/>
        <result column="ST_Status" property="status" jdbcType="VARCHAR"/>
        <result column="ST_NotifedCount" property="notifedcount" jdbcType="INTEGER"/>
        <result column="ST_RuleList" property="rulelist" jdbcType="VARCHAR"/>
        <result column="ST_AssessorGUID" property="stAssessorguid" jdbcType="VARCHAR"/>
        <result column="ST_AssessorUserName" property="assessorusername" jdbcType="VARCHAR"/>
        <result column="ST_AssessorRealName" property="assessorrealname" jdbcType="VARCHAR"/>
        <result column="ST_AssessTime" property="assesstime" jdbcType="TIMESTAMP"/>
        <result column="ST_AssessResult" property="assessresult" jdbcType="VARCHAR"/>
        <result column="ST_ThirdAssessorGUID" property="thirdassessorguid" jdbcType="VARCHAR"/>
        <result column="ST_ThirdAssessorUserName" property="thirdassessorusername" jdbcType="VARCHAR"/>
        <result column="ST_ThirdAssessorRealName" property="thirdassessorrealname" jdbcType="VARCHAR"/>
        <result column="ST_ThirdAssessTime" property="thirdassesstime" jdbcType="TIMESTAMP"/>
        <result column="ST_ThirdAssessResult" property="thirdassessresult" jdbcType="VARCHAR"/>
        <result column="ST_Extension1" property="extension1" jdbcType="VARCHAR"/>
        <result column="ST_Extension2" property="extension2" jdbcType="VARCHAR"/>
        <result column="ST_Extension3" property="extension3" jdbcType="VARCHAR"/>
        <result column="ST_Remark" property="remark" jdbcType="VARCHAR"/>
    </resultMap>
    <resultMap id="SubTaskSummary" type="cn.flightfeather.supervision.lightshare.vo.SubTaskSummary">
        <result column="ST_GUID" property="stGuid" jdbcType="VARCHAR"/>
        <result column="ST_name" property="stName" jdbcType="VARCHAR"/>
        <result column="ST_PlanStartTime" property="stPlanTime" jdbcType="TIMESTAMP"/>
        <result column="ST_Status" property="stStatus" jdbcType="VARCHAR"/>
        <result column="S_GUID" property="sceneId" jdbcType="VARCHAR"/>
        <result column="S_Name" property="sceneName" jdbcType="VARCHAR"/>
        <result column="S_TypeID" property="sceneTypeId" jdbcType="TINYINT"/>
        <result column="S_Type" property="sceneType" jdbcType="VARCHAR"/>
        <result column="S_Location" property="location" jdbcType="VARCHAR"/>
        <result column="S_Longitude" property="longitude" jdbcType="DECIMAL"/>
        <result column="S_Latitude" property="latitude" jdbcType="DECIMAL"/>
        <result column="S_Index" property="sceneIndex" jdbcType="INTEGER"/>
        <result column="I_GUID" property="insGuid" jdbcType="VARCHAR"/>
        <result column="proNum" property="proNum" jdbcType="INTEGER"/>
        <result column="changeNum" property="changeNum" jdbcType="INTEGER"/>
        <result column="proCheckedNum" property="proCheckedNum" jdbcType="INTEGER"/>
        <result column="changeCheckedNum" property="changeCheckedNum" jdbcType="INTEGER"/>
        <association property="subtask" resultMap="BaseResultMap"/>
        <association property="inspection"
                     resultMap="cn.flightfeather.supervision.domain.ds1.mapper.InspectionMapper.BaseResultMap"/>
        <association property="scene"
                     resultMap="cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper.BaseResultMap"/>
    </resultMap>
    <sql id="Sub_Task_Summary_Column_List">
        SELECT
        a.*,
        b.*,
        c.*,
        SUM(d.PL_GUID is NOT null) AS proNum,
        SUM(d.PL_IsChanged = TRUE) AS changeNum,
        SUM(d.PL_Extension3 != 'unCheck') AS proCheckedNum,
        SUM(
        d.PL_Extension3 = 'change_pass' || d.PL_Extension3 = 'change_fail'
        ) AS changeCheckedNum
        FROM
        tm_t_subtask AS a
        LEFT JOIN sm_t_scense AS b ON a.ST_ScenseID = b.S_GUID
        LEFT JOIN im_t_inspection AS c ON a.ST_GUID = c.ST_GUID
        LEFT JOIN im_t_problemlist AS d ON a.ST_GUID = d.ST_GUID
    </sql>
    <!-- è¡Œæ”¿åŒºåˆ’条件 -->
    <sql id="Where_Area">
        <if test="provincecode != null">
            AND ${tableAlias}.ST_ProvinceCode = #{provincecode}
        </if>
        <if test="provincename != null">
            AND ${tableAlias}.ST_ProvinceName = #{provincename}
        </if>
        <if test="citycode != null">
            AND ${tableAlias}.ST_CityCode = #{citycode}
        </if>
        <if test="cityname != null">
            AND ${tableAlias}.ST_CityName = #{cityname}
        </if>
        <if test="districtcode != null">
            AND ${tableAlias}.ST_DistrictCode = #{districtcode}
        </if>
        <if test="districtname != null">
            AND ${tableAlias}.ST_DistrictName = #{districtname}
        </if>
        <if test="towncode != null">
            AND ${tableAlias}.ST_TownCode = #{towncode}
        </if>
        <if test="townname != null">
            AND ${tableAlias}.ST_TownName = #{townname}
        </if>
    </sql>
    <!-- ä»»åŠ¡è®¡åˆ’æ—¶é—´æ¡ä»¶ -->
    <sql id="Where_Plan_Time">
        <if test="starttime != null">
            AND ${tableAlias}.ST_PlanStartTime >= #{starttime}
        </if>
        <if test="endtime != null">
            AND ${tableAlias}.ST_PlanStartTime &lt;= #{endtime}
        </if>
    </sql>
    <select id="getSubtask" resultMap="SubtaskSearchResultVo">
        SELECT
        a.ST_GUID as 'subTaskId',
        a.ST_DistrictName as 'districtName',
        b.S_TownName as 'townName',
@@ -192,19 +254,19 @@
        a.ST_PlanEndTime as 'planEndTime',
        a.ST_Status as 'status',
        c.I_Extension1 as 'path'
      FROM
        FROM
        tm_t_subtask AS a
        LEFT JOIN sm_t_scense AS b ON a.ST_ScenseID = b.S_GUID
        LEFT JOIN im_t_inspection AS c ON a.ST_GUID = c.ST_GUID
        LEFT JOIN ea_t_evaluation AS d ON a.ST_GUID = d.ST_GUID
      WHERE
        WHERE
        a.ST_DistrictCode = #{param1}
        AND a.ST_PlanStartTime >= #{param2}
        AND a.ST_PlanEndTime  &lt;= #{param3}
      <if test="param4 != null">
        AND b.S_TypeID = #{param4}
      </if>
  </select>
        AND a.ST_PlanEndTime &lt;= #{param3}
        <if test="param4 != null">
            AND b.S_TypeID = #{param4}
        </if>
    </select>
    <select id="getSubtask2" resultMap="SubTaskSearchResultVo2">
        SELECT
        a.ST_GUID as 'subTaskId',
@@ -228,8 +290,8 @@
        d.PL_IsChanged as 'rectification',
        d.PL_ChangedTime as 'rectificationTime',
        (CASE WHEN d.PL_IsChanged IS FALSE THEN d.PL_Time
          WHEN d.PL_ChangedTime IS  NULL THEN d.PL_Time
          ELSE d.PL_ChangedTime END ) as 'updateTime',
        WHEN d.PL_ChangedTime IS NULL THEN d.PL_Time
        ELSE d.PL_ChangedTime END ) as 'updateTime',
        e.MF_GUID as 'mGuid',
        e.MF_Extension1 as 'mExtension1',
        e.MF_IsChanged as 'isChanged'
@@ -258,7 +320,6 @@
        AND d.PL_Extension3 IS NOT NULL
        ORDER BY updateTime
    </select>
    <select id="selectByTopTask" resultMap="SubtaskVoMap"><![CDATA[
        select * from tm_t_subtask as a left join sm_t_scense as b on a.ST_ScenseID = b.S_GUID
        where a.ST_PlanStartTime >=#{param2} and a.ST_PlanEndTime <= #{param3} and a.T_GUID = #{param1}]]>
@@ -266,7 +327,6 @@
            and b.S_TypeID = #{param4}
        </if>
    </select>
    <select id="selectByTopTask2" resultMap="BaseResultMap">
        select * from tm_t_subtask as a left join sm_t_scense as b on a.ST_ScenseID = b.S_GUID
        where a.T_GUID = #{param1}
@@ -274,7 +334,6 @@
            and b.S_TypeID = #{param2}
        </if>
    </select>
    <select id="getSummary" resultMap="SubTaskSummary">
        SELECT
        a.ST_GUID,
@@ -283,7 +342,12 @@
        a.ST_Status,
        b.S_GUID,
        b.S_Name,
        b.S_TypeID,
        b.S_Type,
        b.S_Location,
        b.S_Longitude,
        b.S_Latitude,
        b.S_Index,
        c.I_GUID,
        SUM(d.PL_GUID is NOT null) AS proNum,
        SUM(d.PL_IsChanged = TRUE) AS changeNum,
@@ -305,7 +369,6 @@
        GROUP BY
        a.ST_GUID
    </select>
    <select id="getSummaryByScene" resultMap="SubTaskSummary">
        SELECT
        a.ST_GUID,
@@ -337,7 +400,20 @@
        a.ST_GUID
        ORDER BY a.ST_PlanStartTime DESC
    </select>
    <select id="getSummaryByArea" resultMap="SubTaskSummary">
        <include refid="Sub_Task_Summary_Column_List"/>
        <where>
            <include refid="Where_Area">
                <property name="tableAlias" value="a"/>
            </include>
            <include refid="Where_Plan_Time">
                <property name="tableAlias" value="a"/>
            </include>
        </where>
        GROUP BY
        a.ST_GUID
        ORDER BY a.ST_PlanStartTime DESC
    </select>
    <select id="findSubTasksByProType" resultMap="BaseResultMap">
        SELECT
        a.*
src/test/kotlin/cn/flightfeather/supervision/business/autooutput/AopEvaluationTest.kt
@@ -9,6 +9,7 @@
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig
import cn.flightfeather.supervision.business.autooutput.score.AopCreditCode
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.repository.SubTaskRep
import cn.flightfeather.supervision.lightshare.service.SearchService
import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo
import org.junit.Test
@@ -48,18 +49,21 @@
    @Autowired
    lateinit var jsWhDataAnalysis: JSWhDataAnalysis
    @Autowired
    lateinit var subTaskRep: SubTaskRep
    /**
     * é™å®‰å·¥åœ°è‡ªè¯„
     */
    @Test
    fun test1() {
        val taskId = "tTbZIUg7nQJ1MRgE"
        val taskId = "P7hsgDedyN9XLrbt"
        val districtCode = "310106"
        val year = 2023
        val month = 12
        val year = 2024
        val month = 6
        val sceneType = Constant.SceneType.TYPE1.value.toInt()
        jaCsDataAnalysis.setResource(taskId, sceneType, year, month)
        jaCsDataAnalysis.execute(0.124)
        jaCsDataAnalysis.execute()
        aopEvaluation.executeByTopTask(taskId, sceneType)
@@ -78,19 +82,19 @@
        val taskId = "88wgq9l5gm9cUMg1"
        val districtCode = "310104"
        val districtName = "徐汇区"
        val year = 2023
        val month = 11
        val year = 2024
        val month = 5
        val sceneType = Constant.SceneType.TYPE5.value.toInt()
        xhFuDataAnalysis.setResource(taskId, sceneType, year, month)
        xhFuDataAnalysis.execute()
        aopEvaluation.executeByTopTask(taskId, sceneType)
        val mode = 9
        searchService.writeToFile(ExcelConfigVo(
            taskId,
            districtCode = districtCode,
            sceneType = sceneType), mode)
//        xhFuDataAnalysis.setResource(taskId, sceneType, year, month)
//        xhFuDataAnalysis.execute()
//
//        aopEvaluation.executeByTopTask(taskId, sceneType)
//
//        val mode = 9
//        searchService.writeToFile(ExcelConfigVo(
//            taskId,
//            districtCode = districtCode,
//            sceneType = sceneType), mode)
        aopCreditCode.execute(AopDataConfig(
            year = year,
            month = month,
@@ -137,4 +141,10 @@
            districtCode = districtCode,
            sceneType = sceneType), mode)
    }
    @Test
    fun aopSubtask() {
        val s = subTaskRep.findOne("yMRHdPg7e4i8M6aB")
        aopEvaluation.executeBySubTask(s!!)
    }
}
src/test/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrlTest.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,53 @@
package cn.flightfeather.supervision.business.bgtask
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import org.junit.Test
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.io.BufferedReader
import java.io.InputStreamReader
import java.time.LocalDate
@RunWith(SpringRunner::class)
@ExtendWith(SpringExtension::class)
@SpringBootTest
class AopTaskCtrlTest {
    @Autowired
    lateinit var aopTaskCtrl: AopTaskCtrl
    @Autowired
    lateinit var taskRep: TaskRep
    @Test
    fun startEvaluation() {
        val time = LocalDate.of(2024, 6, 23).atStartOfDay()
        aopTaskCtrl.startEvaluation(aopTaskCtrl.getArea(time, "310106", "静安区", Constant.SceneType.TYPE1))
    }
    @Test
    fun startNewTask(){
        val time = LocalDate.of(2024, 6, 23).atStartOfDay()
        aopTaskCtrl.startNewTask(aopTaskCtrl.getArea(time, "310106", "静安区", Constant.SceneType.TYPE1))
        val reader = BufferedReader(InputStreamReader(System.`in`))
        reader.readLine()
    }
    @Test
    fun foo1() {
        val time = LocalDate.of(2024, 6, 23).atStartOfDay()
        val t1 = taskRep.findOneTask(aopTaskCtrl.getArea(time, "310106", "静安区", Constant.SceneType.TYPE1))
        val t2 = taskRep.findOneTask(aopTaskCtrl.getArea(time, "310104", "徐汇区", Constant.SceneType.TYPE5))
        val t3 = taskRep.findOneTask(aopTaskCtrl.getArea(time, "310116", "金山区", Constant.SceneType.TYPE1))
        val t4 = taskRep.findOneTask(aopTaskCtrl.getArea(time, "310116", "金山区", Constant.SceneType.TYPE2))
        val t5 = taskRep.findOneTask(aopTaskCtrl.getArea(time, "310116", "金山区", Constant.SceneType.TYPE3))
        println(t5)
    }
}
src/test/kotlin/cn/flightfeather/supervision/business/bgtask/JinAnScoreTaskCtrlTest.kt
@@ -18,8 +18,8 @@
    @Test
    fun startTask() {
        var time = LocalDateTime.of(2024, 2, 1, 0, 0, 0)
        repeat(3) {
        var time = LocalDateTime.of(2024, 5, 1, 0, 0, 0)
        repeat(1) {
            jinAnScoreTaskCtrl.startTaskJinAn(time)
            time = time.plusMonths(1)
        }
src/test/kotlin/cn/flightfeather/supervision/business/datafetch/FetchNightConstructionTest.kt
ÎļþÃû´Ó src/test/kotlin/cn/flightfeather/supervision/datafetch/FetchNightConstructionTest.kt ÐÞ¸Ä
@@ -1,8 +1,7 @@
package cn.flightfeather.supervision.datafetch
package cn.flightfeather.supervision.business.datafetch
import cn.flightfeather.supervision.SupervisionApplication
import org.junit.Test
import org.junit.jupiter.api.Assertions.*
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
src/test/kotlin/cn/flightfeather/supervision/business/location/LocationRoadNearbyTest.kt
@@ -45,8 +45,13 @@
//            LocationRoadNearby.BasePlace("吕青路-朱吕公路-朱平公路", Pair(121.136318,30.833325), Pair(121.148624,30.836094)),
//            LocationRoadNearby.BasePlace("泖湾支路-吕青路-朱平公路", Pair(121.155048,30.835229), Pair(121.148659,30.829861)),
            LocationRoadNearby.BasePlace("徐汇上师大", Pair(121.416643,31.163531), Pair(121.416643,31.163531)),
            LocationRoadNearby.BasePlace("徐汇上师大", Pair(121.419384,31.161433), Pair(121.419384,31.161433)),
            LocationRoadNearby.BasePlace("静安监测站国控点", Pair(121.429439, 31.223632), Pair(121.429439, 31.223632)),
            LocationRoadNearby.BasePlace("金山大道2000号", Pair(121.3404, 30.744262), Pair(121.3404, 30.744262)),
            LocationRoadNearby.BasePlace("仙霞站", Pair(121.394775, 31.203982), Pair(121.419384,31.161433)),
        )
        locationRoadNearby.searchList(bList, 2000.0)
        listOf(500.0, 1000.0, 2000.0, 3000.0).forEach {
            locationRoadNearby.searchList(bList, it)
        }
    }
}
src/test/kotlin/cn/flightfeather/supervision/business/subtask/TaskTest.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package cn.flightfeather.supervision.business.subtask
import cn.flightfeather.supervision.business.bgtask.TaskFinishEvaluation
import cn.flightfeather.supervision.business.bgtask.TaskFinishSubtask
import org.junit.Test
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
@RunWith(SpringRunner::class)
@ExtendWith(SpringExtension::class)
@SpringBootTest
class TaskTest {
    @Autowired
    lateinit var taskFinishSubtask: TaskFinishSubtask
    @Autowired
    lateinit var taskFinishEvaluation: TaskFinishEvaluation
    @Test
    fun handle() {
        taskFinishSubtask.handle()
    }
    @Test
    fun handle2() {
        taskFinishEvaluation.handle()
    }
}
src/test/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SubTaskRepTest.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.junit.Test
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 SubTaskRepTest {
    @Autowired
    lateinit var subTaskRep: SubTaskRep
    @Test
    fun findSummary() {
        val res = subTaskRep.findSummary(AreaVo().apply {
            provincecode = "31"
            provincename = "上海市"
            citycode = "3100"
            cityname = "上海市"
            districtcode = "310116"
            districtname = "金山区"
            starttime = LocalDateTime.of(2024, 7, 5, 0, 0, 0, 0)
            endtime = LocalDateTime.of(2024, 7, 6, 0, 0, 0, 0)
        })
        println(res)
    }
}