riku
2022-06-17 3a5c011d9509d3bc0367921f463676c81ff2e374
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
package cn.flightfeather.supervision.business.fume.item
 
import cn.flightfeather.supervision.business.ScoreItem
import cn.flightfeather.supervision.domain.ds1.entity.Evaluation
import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationMapper
import cn.flightfeather.supervision.domain.ds2.mapper.BaseInfoMapper
import cn.flightfeather.supervision.domain.ds2.mapper.FumeMinuteValueMapper
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_1: ScoreItem() {
    companion object {
        private lateinit var instance: ScoreItem_1
    }
 
    @PostConstruct
    fun init() {
        instance = this
    }
 
    @Autowired
    lateinit var fumeMinuteValueMapper: FumeMinuteValueMapper
 
    @Autowired
    lateinit var baseInfoMapper: BaseInfoMapper
 
    override var id: String = "2COC44k7d9dlnR4c"
 
    override var name: String="油烟在线监测设备"
 
    /**
     * 选项如下:
     *      1.未安装油烟在线监测设备
     *      2.油烟在线设备安装不规范
     *      3.油烟在线监测设备未联网
     *      4.私自闲置停运/拆除设备
     */
    override fun otherProblem(size: Int): Int? {
        var i = 2
        if (i > size - 1) i = size - 1
        if (condition1()) {
            return i
        }
        return null
    }
 
    /**
     * @return false 徐汇区餐饮监管平台联网记录和在线率分析数据,确定联网且任一经营高峰在线率高于90%即不扣分
     *         true  其他情况均扣10分
     */
    private fun condition1(): Boolean {
        // 查询当前用户的油烟监测设备的数据在线率
        val userId = info.userId
        val baseInfo = baseInfoMapper.selectByPrimaryKey(userId)
 
        return false
    }
}