From 6e1095e946997e406926c204ceeb5c820dbd07c1 Mon Sep 17 00:00:00 2001 From: Riku <risaku@163.com> Date: 星期二, 13 八月 2024 23:51:47 +0800 Subject: [PATCH] 1. 修复文件扩展名获取错误问题 2. 调试完善设备信息相关接口 --- 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