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
package cn.flightfeather.supervision.business.storage.item
 
import cn.flightfeather.supervision.business.ScoreItem
import cn.flightfeather.supervision.domain.ds1.entity.Problemlist
import org.springframework.stereotype.Component
import tk.mybatis.mapper.entity.Example
import javax.annotation.PostConstruct
 
/**
 * Date 2022/1/20 16:14
 * Created by feiyu
 * 码头
 */
@Component
class WhScoreItem_1:ScoreItem() {
 
    companion object {
        private lateinit var instance: WhScoreItem_1
    }
 
    @PostConstruct
    fun init() {
        instance = this
    }
 
    override var id: String = "mgvVEecYRV8xrnf2"
 
    override var name: String = "整改措施及效果"
 
    /**
     * 执法检查汇总情况
     * 选项如下:
     *      1.问题部分整改或不及时提供材料
     *      2.问题无整改
     */
    override fun otherProblem(size: Int): Int? {
        val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
            createCriteria().andEqualTo("stguid", info.subTask?.stguid)
//                .andGreaterThanOrEqualTo("time", info.sTime)
//                .andLessThan("time", info.eTime)
        })
        var i = 0
 
        val total = p.size
        var changed = 0
        p.forEach {
            if (it.ischanged == true) {
                changed++
            }
        }
        return when {
            changed == 0 && total > 0 -> 1
            changed < total -> 0
            else -> null
        }
    }
}