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