src/main/kotlin/cn/flightfeather/supervision/business/bgtask/AopTaskCtrl.kt
ÎļþÃû´Ó src/main/kotlin/cn/flightfeather/supervision/business/autooutput/AopTaskCtrl.kt ÐÞ¸Ä
@@ -1,9 +1,10 @@
package cn.flightfeather.supervision.business.autooutput
package cn.flightfeather.supervision.business.bgtask
import cn.flightfeather.supervision.business.autooutput.dataanalysis.*
import cn.flightfeather.supervision.business.autooutput.datasource.AopDataConfig
import cn.flightfeather.supervision.business.autooutput.score.AopCreditCode
import cn.flightfeather.supervision.business.autooutput.score.AopEvaluation
import cn.flightfeather.supervision.common.exception.ResponseErrorException
import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl
import cn.flightfeather.supervision.common.executor.BgTaskStatus
import cn.flightfeather.supervision.common.executor.BgTaskType
@@ -11,7 +12,6 @@
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.springframework.stereotype.Component
import java.time.LocalDate
/**
 * è‡ªåŠ¨è¯„ä¼°ä»»åŠ¡ç®¡ç†
@@ -45,10 +45,11 @@
        if (taskId != null) {
            val districtCode = areaVo.districtcode
            val districtName = areaVo.districtname
            val d = LocalDate.parse(areaVo.starttime)
//            val d = LocalDateTime.parse(areaVo.starttime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
            val d = areaVo.starttime ?: throw ResponseErrorException("自动评估任务必须设定时间")
            val year = d.year
            val month = d.monthValue
            val sceneType = areaVo.scensetypeid?.toInt() ?: throw IllegalStateException("场景类型未设置,无法评估")
            val sceneType = areaVo.scensetypeid?.toInt() ?: throw ResponseErrorException("场景类型未设置,无法评估")
            val id = "${BgTaskType.AUTO_SCORE.name}-${districtCode}-${sceneType}"
            val name = "${districtName}${Constant.SceneType.getDes(sceneType)}自动评分"
@@ -68,7 +69,7 @@
            }
            return bgTask.taskStatus
        } else {
            throw IllegalStateException("巡查总任务不存在,无法评估")
            throw ResponseErrorException("巡查总任务不存在,无法评估")
        }
    }