package cn.flightfeather.supervision.common.score.item
|
|
import cn.flightfeather.supervision.common.score.ScoreItem
|
import cn.flightfeather.supervision.domain.mapper.BaseInfoMapper
|
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.stereotype.Component
|
import javax.annotation.PostConstruct
|
|
@Component
|
class ScoreItem_13: ScoreItem() {
|
companion object {
|
private lateinit var instance: ScoreItem_13
|
}
|
|
@Autowired
|
lateinit var baseInfoMapper: BaseInfoMapper
|
|
@PostConstruct
|
fun init() {
|
instance = this
|
}
|
|
override var id: String = ""
|
|
override var name: String="有无VOCs在线监测设备"
|
|
override var maxScore: Int = 5
|
|
override fun calScore(): Pair<Int, Int> {
|
// 额外项,符合的加分,不符合的不扣分
|
return if (condition1()) {
|
Pair(0, maxScore*2)
|
} else {
|
Pair(1, maxScore)
|
}
|
}
|
|
/**
|
* 有VOCs在线监测设备
|
* @return true 已安装;false 未安装
|
*/
|
private fun condition1(): Boolean {
|
val baseInfo = baseInfoMapper.selectByPrimaryKey(info.userId)
|
return if (baseInfo == null) {
|
false
|
} else {
|
!baseInfo.biExtension2.isNullOrBlank()
|
}
|
}
|
}
|