feiyu02
2022-09-15 3e2159e45e12b2b8af058b68eafeaf082cf3fe85
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
73
74
75
76
77
78
package cn.flightfeather.supervision.common.score.item
 
import cn.flightfeather.supervision.common.score.ScoreItem
import cn.flightfeather.supervision.domain.mapper.LedgerRecordMapper
import cn.flightfeather.supervision.domain.mapper.LedgerSubTypeMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import javax.annotation.PostConstruct
 
/**
 * 季度内未在线提交环评审批文件,或无有效危废备案,即扣10分(危废相关台账缺失严重的,可认定为无正规环评审批文件,扣10分)
 */
@Component
class ScoreItem_2: ScoreItem() {
    companion object {
        private lateinit var instance: ScoreItem_2
    }
 
    @Autowired
    lateinit var ledgerRecordMapper: LedgerRecordMapper
 
    @Autowired
    lateinit var ledgerSubTypeMapper: LedgerSubTypeMapper
 
    @Autowired
    lateinit var scoreItem3: ScoreItem_3
 
    @Autowired
    lateinit var scoreItem4: ScoreItem_4
 
    @PostConstruct
    fun init() {
        instance = this
    }
 
    override var id: String = ""
 
    override var name: String="有无正规环评审批文件"
 
    override var maxScore: Int = 10
 
    override fun calScore(): Pair<Int, Int> =
            if (getFile()) {
                Pair(0, maxScore)
            } else {
                Pair(1, minScore)
            }
 
    private fun getFile(): Boolean {
//        sMonth = 2
//        // 找出汽修企业的危废类台账
//        val ledgerTypes = ledgerSubTypeMapper.selectByExample(Example(LedgerSubType::class.java).apply {
//            createCriteria().andEqualTo("lScenetype", info.sceneType.value)
//                .andLike("lsSubtypeid", "29%")
//        })
//        for (i in sMonth..eMonth) {
//            // TODO: 2021/3/9 找出当月用户提交的台账
//            val ledgers = ledgerRecordMapper.selectByExample(Example(LedgerRecord::class.java).apply {
//                createCriteria().andEqualTo("lrYear", info.year).andEqualTo("lrMonth", i)
//                    .andEqualTo("lrSubmitid", info.userId)
//            }).map {
//                it.lsSubtypeid
//            }
//            // TODO: 2021/3/9 比对
//            for (l in ledgerTypes) {
//                if (!ledgers.contains(l.lsSubtypeid)) {
//                    return false
//                }
//            }
//        }
        return true
 
        // FIXME: 2021/4/26 季度内台账不得分的,可认定为缺正规环评审批文件,扣10分 
//        val r3 = scoreItem3.execute(info)
//        val r4 = scoreItem4.execute(info)
//        return !(r3.second == 0 && r4.second == 0)
    }
}