feiyu02
2025-08-14 f373bbf83d9d2a7e5f96118d7dcd658c9fea8bc8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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) }
            }
        }
    }
}