From a5cdbf569067822e3232d2177b8a9aac1ed95b69 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期三, 29 五月 2024 17:32:00 +0800
Subject: [PATCH] 1. 修改自评逻辑中,问题整改的判断方式为已整改并且整改审核通过; 2. 新增评估详情获取接口;

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationsubruleServiceImpl.kt |   31 +++++++++++++++----------------
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationsubruleServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationsubruleServiceImpl.kt
index 2326646..e9d5732 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationsubruleServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationsubruleServiceImpl.kt
@@ -1,5 +1,6 @@
 package cn.flightfeather.supervision.lightshare.service.impl
 
+import cn.flightfeather.supervision.common.exception.BizException
 import cn.flightfeather.supervision.domain.ds1.entity.*
 import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationruleMapper
 import cn.flightfeather.supervision.domain.ds1.mapper.EvaluationsubruleMapper
@@ -58,12 +59,10 @@
     override fun getAutoScore(subTaskId: String): List<EvaluationVo> {
         //瀛愯鍒欓�愭潯寰楀垎
         val subRuleScores = evaluationRep.findItemEvaluation(subTaskId)
-        //鎬昏鍒檌d
-        val ruleId = mutableListOf<Evaluation>()
         //璇勫垎鎬昏鍒�
-        val rule = evaluationRuleRep.findAutoEvaluationRule(subTaskId)
+        val rule = evaluationRuleRep.findAutoEvaluationRule(subTaskId) ?: throw BizException("鏈壘鍒扮浉鍏宠嚜鍔ㄨ瘎浼拌鍒�")
         //鎬昏鍒欏搴旂殑璇勫垎瀛愯鍒�
-        val subRules = mutableListOf<Evaluationsubrule2>()
+        val subRules = evaluationRuleRep.findSubRule(rule.guid)
         //鏌ヨ缁撴灉
         val resultList = mutableListOf<EvaluationVo>()
 
@@ -72,10 +71,10 @@
             when (it.ertype) {
                 2 -> resultList.add(EvaluationVo().apply {
                     id = it.guid
-                    title1 = it.itemname
+                    title = it.itemname
                     scoreMode = it.extension1
                     gradeMode = it.extension2
-                    score = when (gradeMode) {
+                    maxScore = when (gradeMode) {
                         "minus_mode" -> it.minscore?.minus(it.maxscore ?: 0) ?: 0
                         "add_mode" -> it.maxscore ?: 0
                         else -> it.minscore?.minus(it.maxscore ?: 0) ?: 0
@@ -93,7 +92,7 @@
                 3 -> {
                     for (r in resultList) {
                         if (it.fatherid == r.id) {
-                            r.sub1.add(SubEvaluationVo().apply {
+                            r.subList.add(SubEvaluationVo().apply {
                                 id = it.guid
                                 title2 = it.itemname
                                 gradeMode = it.extension2
@@ -121,24 +120,24 @@
                     resultList.forEach{ r ->
                         //4绾х殑璇勪及椤圭洿鎺ラ檮灞炰簬2绾ц瘎浼伴」
                         if (r.id == it.fatherid) {
-                            if (r.sub1.isEmpty()) {
-                                r.sub1.add(SubEvaluationVo().apply {
+                            if (r.subList.isEmpty()) {
+                                r.subList.add(SubEvaluationVo().apply {
                                     placeholder = true
                                     id = it.guid
-                                    title2 = r.title1
-                                    score = r.score
+                                    title2 = r.title
+                                    score = r.maxScore
                                     gradeMode = r.gradeMode
                                     selectMode = r.selectMode
                                     group = _group++
                                 })
                             }
-                            r.sub1[0].sub2.add(ThirdEvaluationVo().apply {
+                            r.subList[0].sub2.add(ThirdEvaluationVo().apply {
                                 id = it.guid
                                 content = it.itemname
-                                score = when (r.sub1[0].gradeMode) {
-                                    "minus_mode" -> r.score.plus(it.maxscore ?: 0)
+                                score = when (r.subList[0].gradeMode) {
+                                    "minus_mode" -> r.maxScore.plus(it.maxscore ?: 0)
                                     "add_mode" -> it.maxscore ?: 0
-                                    else -> r.score.plus(it.maxscore ?: 0)
+                                    else -> r.maxScore.plus(it.maxscore ?: 0)
                                 }
                                 //濡傛灉鏈夊緱鍒嗚褰曪紝鍒欐敼鍙樼姸鎬佷负閫変腑
                                 for (s in subRuleScores) {
@@ -149,7 +148,7 @@
                                 }
                             })
                         } else {
-                            r.sub1.forEach { sr ->
+                            r.subList.forEach { sr ->
                                 if (sr.id == it.fatherid){
                                     sr.sub2.add(ThirdEvaluationVo().apply {
                                         id = it.guid

--
Gitblit v1.9.3