package cn.flightfeather.supervision.business.bgtask
|
|
import cn.flightfeather.supervision.business.autooutput.score.construction.JAScore
|
import cn.flightfeather.supervision.common.executor.BackgroundTaskCtrl
|
import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep
|
import cn.flightfeather.supervision.lightshare.vo.AreaVo
|
import org.springframework.stereotype.Component
|
import java.time.LocalDateTime
|
|
/**
|
* 静安区50分制评分转换任务
|
*/
|
@Component
|
class JinAnScoreTaskCtrl(
|
private val backgroundTaskCtrl: BackgroundTaskCtrl,
|
private val jaScore: JAScore,
|
private val evaluationRep: EvaluationRep
|
) {
|
|
/**
|
* 静安工地分数转换任务
|
*/
|
fun startTaskJinAn(startTime: LocalDateTime) {
|
startTask("31", "3100", "310106", startTime)
|
}
|
|
fun startTask(pCode: String, cCode: String, dCode: String, startTime: LocalDateTime) {
|
val areaVo = AreaVo().apply {
|
provincecode = pCode
|
citycode = cCode
|
districtcode = dCode
|
starttime = startTime
|
scensetypeid = "1"
|
}
|
evaluationRep.findAutoScore(areaVo)?.forEach {
|
it?.let {
|
it.evaluation?.let { e-> jaScore.toDb(e, it.isEnable) }
|
}
|
}
|
}
|
}
|