feiyu02
2024-07-08 b212ef0208cb094f63ea8a239a1361f8e859c839
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
package cn.flightfeather.supervision.business.autooutput.score.construction
 
import cn.flightfeather.supervision.business.autooutput.score.ScoreItem
import cn.flightfeather.supervision.common.utils.Constant
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 CsScoreItem1: ScoreItem() {
 
    companion object {
        private lateinit var instance: CsScoreItem1
    }
 
    @PostConstruct
    fun init() {
        instance = this
    }
 
    override var id: String = "amSNTZfXs2XXR1td"
 
    override var name: String = "整改措施及效果"
 
    /**
     * 执法检查汇总情况
     * 选项如下:
     *      1.问题部分整改或不及时提供材料
     *      2.问题无整改
     */
    override fun otherProblem(size: Int): List<Int>? {
        val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
            createCriteria().andEqualTo("stguid", evaluationScene.subTask.value?.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 && it.extension3 == Constant.CHANGE_CHECK_PASS) {
                changed++
            }
        }
        return when {
            changed == 0 && total > 0 -> listOf(1)
            changed < total -> listOf(0)
            else -> null
        }
    }
}