From 6c7f45871b93ef26d353a5a3596701ac2f39ed9c Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期二, 10 九月 2024 17:48:27 +0800
Subject: [PATCH] 1. 新增问题更新接口

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt
index efd7cec..ca80a1d 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt
@@ -3,17 +3,27 @@
 import cn.flightfeather.supervision.domain.ds1.entity.Evaluationsubrule2
 import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation
 import com.fasterxml.jackson.annotation.JsonInclude
+import java.util.*
 
 /**
  * 璇勫垎瑙勫垯鍙婂緱鍒�
  */
 @JsonInclude(JsonInclude.Include.NON_NULL)
 class ScoreDetail {
+    // 宸ュ湴鐘舵�侊紙鍦ㄥ缓鎴栧畬宸ワ級
+    var status: String? = null
+
     // 鎬诲垎
     var totalScore: Int = 0
 
     // 寰楀垎
     var score: Int = 0
+
+    // 瑙勮寖鎬х瓑绾�
+    var grade: String? = null
+
+    // 鏇存柊鏃堕棿
+    var updateTime: Date? = null
 
     // 寰楀垎缁嗗垯
     var details = mutableListOf<ScoreItem>()
@@ -69,12 +79,27 @@
     fun calScore() {
         details.forEach {
             totalScore += it.maxScore
-            if (it.gradeMode == "minus_mode") {
-                score += (it.score + it.maxScore)
-            } else if (it.gradeMode == "add_mode") {
-                score += it.score
+            score += when (it.gradeMode) {
+                "minus_mode" -> {
+                    (it.score + it.maxScore)
+                }
+                "add_mode" -> {
+                    it.score
+                }
+                else -> {
+                    (it.score + it.maxScore)
+                }
             }
         }
+        grade = when {
+            score >= 95 -> "瑙勮寖"
+            // 鍩烘湰瑙勮寖(90..94)鍜岃鑼冿紙>=95锛�
+            score >= 90 -> "鍩烘湰瑙勮寖"
+            // 涓嶈鑼�
+            score >= 50 -> "涓嶈鑼�"
+            // 涓ラ噸涓嶈鑼�
+            else -> "涓ラ噸涓嶈鑼�"
+        }
     }
 }
 

--
Gitblit v1.9.3