src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt
@@ -4,7 +4,7 @@
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.lightshare.service.*
import cn.flightfeather.supervision.lightshare.vo.InspectionVo
import cn.flightfeather.supervision.lightshare.vo.ProblemlistVo
import cn.flightfeather.supervision.lightshare.vo.ProblemListVo
import cn.flightfeather.supervision.lightshare.vo.ScenseVo
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
@@ -16,7 +16,7 @@
 * @author riku
 * Date: 2020/8/7
 */
@Deprecated("2024.9.25 此自动评分舍弃")
@Component
class AutoScore2 {
@@ -40,9 +40,9 @@
    @Autowired
    lateinit var itemevaluationService: ItemevaluationService
    private var problems: ArrayList<ProblemlistVo> = ArrayList()
    private var problems: ArrayList<ProblemListVo> = ArrayList()
    private var allRules: ArrayList<Evaluationsubrule> = ArrayList()
    private var allRules = listOf<Evaluationsubrule2>()
    private var inspection = InspectionVo()
@@ -81,12 +81,12 @@
        if (evaluationrule === null) return
        this.evaluationrule = evaluationrule
        //获取对应的具体评分细则
        allRules = autoScore.evaluationsubruleService.findByRuleId(evaluationrule.guid!!) as ArrayList<Evaluationsubrule>
        allRules = autoScore.evaluationsubruleService.findByRuleId(evaluationrule.guid!!)
        //获取巡查信息
        inspection = autoScore.inspectionService.findBySubTaskID(subtask.stguid!!)
        val titleRule = Evaluationsubrule()
        val titleRule = Evaluationsubrule2()
        val titleOptionRange = ArrayList<Int>()
        val titleIsGood = true
@@ -106,7 +106,7 @@
     * @param rule 当前评分项
     * @param maxScore 父项的最大分
     */
    fun autoGeneration(rule: Evaluationsubrule, maxScore: Int): Int? {
    fun autoGeneration(rule: Evaluationsubrule2, maxScore: Int): Int? {
        val nextSubRules = getSubRulesByFatherId(allRules, rule.guid)
        //无子项的最小评分项,给出得分
@@ -139,7 +139,7 @@
    }
    //填写详细评分项的分数
    fun writeScore4th(rule: Evaluationsubrule, maxScore: Int): Pair<Int, Boolean> {
    fun writeScore4th(rule: Evaluationsubrule2, maxScore: Int): Pair<Int, Boolean> {
        problems.forEach {
            if (it.guid != null) {
@@ -153,8 +153,8 @@
    }
    //按照父id查找子评分项
    fun getSubRulesByFatherId(rules: ArrayList<Evaluationsubrule>, fatherId: String?): List<Evaluationsubrule> {
        val subRules = mutableListOf<Evaluationsubrule>()
    fun getSubRulesByFatherId(rules: List<Evaluationsubrule2>, fatherId: String?): List<Evaluationsubrule2> {
        val subRules = mutableListOf<Evaluationsubrule2>()
        rules.forEach {
            if (it.fatherid == fatherId
                    || (fatherId.isNullOrBlank() && it.fatherid.isNullOrBlank())) {
@@ -166,7 +166,7 @@
    }
    //创建单项评分对象
    fun createNewChildScore(subRule: Evaluationsubrule, score: Int, isSelected: Boolean): Int? {
    fun createNewChildScore(subRule: Evaluationsubrule2, score: Int, isSelected: Boolean): Int? {
        val itemevaluation = Itemevaluation()
        itemevaluation.ieguid = UUIDGenerator.generate16ShortUUID()
        itemevaluation.iguid = inspection.guid
@@ -218,7 +218,7 @@
    }
    //获取总分
    fun getTotalPoint(rules: ArrayList<Evaluationsubrule>, fatherId: String?): Int {
    fun getTotalPoint(rules: List<Evaluationsubrule2>, fatherId: String?): Int {
        val rules1 = getSubRulesByFatherId(rules, fatherId)
        var point = 0
        rules1.forEach {