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.ds1.entity.Problemlist
|
import org.springframework.stereotype.Component
|
import tk.mybatis.mapper.entity.Example
|
import java.time.LocalDate
|
import java.time.ZoneId
|
import java.time.format.DateTimeFormatter
|
import javax.annotation.PostConstruct
|
|
@Component
|
class ScoreItem_8: ScoreItem() {
|
companion object {
|
private lateinit var instance: ScoreItem_8
|
}
|
|
@PostConstruct
|
fun init() {
|
instance = this
|
}
|
|
// 豁免问题id列表,豁免不做评价的问题,其对应的整改也应该不再计算
|
private val exemptionItemIdList = mutableListOf<String?>()
|
|
override var id: String = "yAAn3zm6e2PenHeJ"
|
|
override var name: String="整改措施及效果"
|
|
/**
|
* 清空需要豁免的问题
|
*/
|
fun clear() {
|
exemptionItemIdList.clear()
|
}
|
|
/**
|
* 设置需要豁免的问题
|
*/
|
fun setExemptionProblem(
|
list: List<String>,
|
eList: MutableList<Pair<Evaluationsubrule2, MutableList<Evaluationsubrule2>>>
|
) {
|
eList.forEach {
|
if (list.contains(it.first.guid)) {
|
it.second.forEach {e ->
|
exemptionItemIdList.addAll(e.problemlist?.split(";") ?: emptyList())
|
}
|
}
|
}
|
}
|
|
fun setExemptionProblem(list: List<Evaluationsubrule2>) {
|
list.forEach {
|
exemptionItemIdList.addAll(it.problemlist?.split(";") ?: emptyList())
|
}
|
}
|
|
/**
|
* 执法检查汇总情况
|
* 选项如下:
|
* 1.全部按时整改并及时提交材料
|
* 2.问题部分整改或不及时提供材料
|
* 3.问题无整改
|
*/
|
override fun otherProblem(size: Int): Int? {
|
val p = problemlistMapper.selectByExample(Example(Problemlist::class.java).apply {
|
createCriteria().andEqualTo("sguid", info.sceneId)
|
.andGreaterThanOrEqualTo("time", info.sTime)
|
.andLessThan("time", info.eTime).apply {
|
if (exemptionItemIdList.isNotEmpty()) {
|
// FIXME: 2022/1/27 此处根据特殊要求,将【台账严重缺失或关键台账无效】和【台账少量缺失或未及时记录更新】两个问题剔除,不计算在整改率内
|
andNotIn("ptguid", exemptionItemIdList)
|
}
|
}
|
})
|
var i = 0
|
|
val total = p.size
|
var changed = 0
|
p.forEach {
|
if (it.ischanged == true) {
|
changed++
|
}
|
}
|
return when {
|
changed == 0 && total > 0 -> 2
|
changed < total -> 1
|
else -> 0
|
}
|
}
|
|
/**
|
* @return true 问题部分整改或不及时提供材料
|
*/
|
private fun condition1(): Boolean {
|
return false
|
}
|
|
/**
|
* @return true 问题无整改
|
*/
|
private fun condition2(): Boolean {
|
return false
|
}
|
}
|