riku
2022-06-09 9867f6d5c5bccfe52b878c344c536905dd6b309e
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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
    }
}