From 0516cba27e632f20efac2752787f38f0c87baafa Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期三, 25 九月 2024 09:24:05 +0800 Subject: [PATCH] 1. 新增自动评估添加和更新接口 --- src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt b/src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt index b60edbc..f718ce3 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/AutoScore2.kt +++ b/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 @@ } //鎸夌収鐖秈d鏌ユ壘瀛愯瘎鍒嗛」 - 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 { -- Gitblit v1.9.3