package cn.flightfeather.supervision.business.fume.item
|
|
import cn.flightfeather.supervision.business.ScoreItem
|
import cn.flightfeather.supervision.domain.ds2.entity.Complaint
|
import cn.flightfeather.supervision.domain.ds2.mapper.ComplaintMapper
|
import org.springframework.beans.factory.annotation.Autowired
|
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_9: ScoreItem() {
|
companion object {
|
private lateinit var instance: ScoreItem_9
|
}
|
|
@PostConstruct
|
fun init() {
|
instance = this
|
}
|
|
@Autowired
|
lateinit var complaintMapper: ComplaintMapper
|
|
override var id: String = "mTre4cqan43BOW82"
|
|
override var name: String="信访投诉"
|
|
/**
|
* 季度内信访记录规格化导入
|
* 选项如下:
|
* 1.无信访、无投诉、监管配合积极
|
* 2.本季度发生单次区级信访投诉
|
* 3.本季度发生市级信访投诉或多次区级信访、投诉或监管不配合
|
*/
|
override fun otherProblem(size: Int): Int? {
|
val complaints = complaintMapper.selectByExample(Example(Complaint::class.java).apply {
|
createCriteria().andEqualTo("cpSceneid", info.tzUserId)
|
.andGreaterThanOrEqualTo("cpTime", info.sTime)
|
.andLessThan("cpTime", info.eTime)
|
})
|
|
var i = 2
|
if (condition2(complaints)) {
|
if (i > size - 1) i = size - 1
|
return i
|
} else if (condition1(complaints)) {
|
i = 1
|
if (i > size - 1) i = size - 1
|
return i
|
}
|
return null
|
}
|
|
/**
|
* @return true 本季度发生单次区级信访投诉
|
*/
|
private fun condition1(c: List<Complaint>): Boolean {
|
c.forEach {
|
if (it.cpExtension1 == "1") {
|
return true
|
}
|
}
|
return false
|
}
|
|
/**
|
* @return true 本季度发生市级信访投诉或多次区级信访、投诉或监管不配合
|
*/
|
private fun condition2(c: List<Complaint>): Boolean {
|
var count = 0
|
c.forEach {
|
if (it.cpExtension1 == "0") {
|
//发生市级信访投诉
|
return true
|
} else {
|
count++
|
}
|
}
|
return count > 1
|
}
|
}
|