feiyu02
2022-07-14 4c7e2d8f8d4a93f318ada0e728dbc370e7504e92
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
package cn.flightfeather.supervision.business.fume.item
 
import cn.flightfeather.supervision.business.ScoreItem
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule
import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2
import cn.flightfeather.supervision.domain.ds2.entity.LedgerRecord
import cn.flightfeather.supervision.domain.ds2.mapper.LedgerRecordMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import tk.mybatis.mapper.entity.Example
import javax.annotation.PostConstruct
 
@Component
class ScoreItem_3: ScoreItem() {
    companion object {
        private lateinit var instance: ScoreItem_3
    }
 
    @PostConstruct
    fun init() {
        instance = this
    }
 
    @Autowired
    lateinit var ledgerRecordMapper: LedgerRecordMapper
 
    override var id: String = "gxJgISevmhFuMJnE"
 
    override var name: String="油烟在线监测设备维护"
 
    /**
     * 在线台账中运维记录及时提交且确定联网且任一经营高峰在线率高于90%即不扣分,其他扣10分。
     * 选项如下:
     *      1.油烟监测设备未按期运维或运维频次不足(少于一季度一次)
     *      2.油烟监测设备运行异常(指示灯异常、部分模块不运行或缺失等)
     *      3.油烟监测设备未正常开启
     */
    override fun otherProblem(size: Int): Int? {
        var i = 0
        if (condition1()) {
            if (i > size - 1) i = size - 1
            return i
        } else if (condition2()) {
            i = 2
            if (i > size - 1) i = size - 1
            return i
        }
        return null
    }
 
    /**
     * @return false 在线台账中运维记录及时提交
     *         true  在线台账中运维记录未及时提交
     */
    private fun condition1(): Boolean {
//        val l = ledgerRecordMapper.selectByExample(Example(LedgerRecord::class.java).apply {
//            createCriteria().andEqualTo("lsSubtypeid", 2304)//设备运维记录
//                .andEqualTo("lrYear", info.year)
//                .andEqualTo("lrMonth", info.month)
//                .andEqualTo("lrSubmitid", info.tzUserId)
//        })
//        return l.size == 0
        return false
    }
 
    /**
     * @return false 确定联网且任一经营高峰在线率高于90%即不扣分
     *         true  其他扣10分
     */
    private fun condition2(): Boolean {
        return false
    }
}