package cn.flightfeather.supervision.common.score.item
|
|
import cn.flightfeather.supervision.common.score.Info
|
import cn.flightfeather.supervision.common.score.ScoreItem
|
import cn.flightfeather.supervision.domain.entity.Commitment
|
import cn.flightfeather.supervision.domain.entity.Evaluation
|
import cn.flightfeather.supervision.domain.mapper.CommitmentMapper
|
import cn.flightfeather.supervision.domain.mapper.EvaluationMapper
|
import cn.flightfeather.supervision.infrastructure.utils.DateUtil
|
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.stereotype.Component
|
import tk.mybatis.mapper.entity.Example
|
import java.time.LocalDateTime
|
import java.time.ZoneId
|
import java.util.*
|
import javax.annotation.PostConstruct
|
|
@Component
|
class ScoreItem_12: ScoreItem() {
|
companion object {
|
private lateinit var instance: ScoreItem_12
|
}
|
|
@PostConstruct
|
fun init() {
|
instance = this
|
}
|
|
@Autowired
|
lateinit var commitmentMapper: CommitmentMapper
|
|
@Autowired
|
lateinit var evaluationMapper: EvaluationMapper
|
|
override var id: String = ""
|
|
override var name: String="企业信用自评(在线、一月一次)"
|
|
override var maxScore: Int = 10
|
|
override fun calScore(): Pair<Int, Int> {
|
return if (condition2()) {
|
Pair(2, minScore)
|
} else if (condition3()) {
|
Pair(1, maxScore / 2)
|
} else {
|
Pair(0, maxScore)
|
}
|
}
|
|
/**
|
* 季度内全无自评的 -10分
|
*/
|
private fun condition2(): Boolean {
|
// val period = "${info.year}/$sMonth-$eMonth"
|
// val e = evaluationMapper.selectByExample(Example(Evaluation::class.java).apply {
|
// createCriteria().andEqualTo("iguid", info.userId)
|
// .andEqualTo("ertype", 0)
|
// .andEqualTo("scensename", period)
|
// })
|
// return e.isEmpty()
|
// FIXME: 2021/4/26 自评暂时不扣分
|
return false
|
}
|
|
/**
|
* 季度内仅有1-2月按时自评 -5分
|
*/
|
private fun condition3(): Boolean {
|
return false
|
}
|
}
|