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/service/impl/SearchServiceImpl.kt |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt
index c7be139..2a55953 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/SearchServiceImpl.kt
@@ -12,6 +12,7 @@
 import cn.flightfeather.supervision.domain.ds1.mapper.*
 import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep
 import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRuleRep
+import cn.flightfeather.supervision.domain.ds1.repository.SceneRep
 import cn.flightfeather.supervision.domain.ds2.mapper.LedgerRecordMapper
 import cn.flightfeather.supervision.domain.ds2.mapper.LedgerSubTypeMapper
 import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper
@@ -62,11 +63,10 @@
     val taskService: TaskService,
     private val evaluationRep: EvaluationRep,
     private val evaluationRuleRep: EvaluationRuleRep,
+    private val sceneRep: SceneRep,
     @Value("\${filePath}") var filePath: String,
     @Value("\${imgPath}") var imgPath: String,
 ) : SearchService {
-
-    private val dateUtil = DateUtil()
 
     override fun writeToFile(config: ExcelConfigVo, mode: Int) {
         val dbMapper = DbMapper(
@@ -256,7 +256,7 @@
         }
 
         //寤虹珛绗竴灞傜洰褰曪紝鍖呭惈鎵�鏈夌殑浠诲姟
-        val time = dateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss")
+        val time = DateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss")
         var basePath =
             Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + "temp" + File.separator + time
         var file = File(basePath)
@@ -349,7 +349,7 @@
     override fun downloadPic2(sceneType: Int, topTaskId: String, response: HttpServletResponse): HttpServletResponse {
         //寤虹珛绗竴灞傜洰褰曪紝鍖呭惈鎵�鏈夌殑浠诲姟
         val topTask = taskMapper.selectByPrimaryKey(topTaskId)
-        val time = dateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss")
+        val time = DateUtil.DateToString(Date(), "yyyy-MM-dd_HH-mm-ss")
         val basePath =
             Constant.DEFAULT_FILE_PATH + File.separator + "images" + File.separator + "temp" + File.separator + topTask.name
         val file = File(basePath)
@@ -370,7 +370,7 @@
 
                 //寤虹珛涓�涓瓙浠诲姟鏂囦欢澶�
                 var subTaskFilePath = "${basePath}${File.separator}(${
-                    dateUtil.DateToString(
+                    DateUtil.DateToString(
                         it.planstarttime,
                         DateUtil.DateStyle.YYYY_MM_DD_CN
                     )
@@ -560,15 +560,22 @@
     }
 
     override fun getScoreDetail(subTaskId: String): ScoreDetail {
+        //鍦烘櫙淇℃伅
+        val scene = sceneRep.findBySubTask(subTaskId)
+        //鎬诲垎
+        val evaluation = evaluationRep.findBySubtask(subTaskId)
         //瀛愯鍒欓�愭潯寰楀垎
         val subRuleScores = evaluationRep.findItemEvaluation(subTaskId)
+        if (subRuleScores.isEmpty()) throw BizException("鏃犺瘎浼拌褰�")
         //璇勫垎鎬昏鍒�
         val rule = evaluationRuleRep.findAutoEvaluationRule(subTaskId) ?: throw BizException("鏈壘鍒扮浉鍏宠嚜鍔ㄨ瘎浼拌鍒�")
         //鎬昏鍒欏搴旂殑璇勫垎瀛愯鍒�
         val subRules = evaluationRuleRep.findSubRule(rule.guid)
         //鏌ヨ缁撴灉
         val result = ScoreDetail()
+        result.status = if (scene?.extension1.equals("1")) "鍦ㄥ缓" else "瀹屽伐"
 
+        result.updateTime = evaluation?.updatedate
         subRules.forEach {
             it.ertype ?: return@forEach
             result.addDetail(result.details, it, it.ertype!! - 1, subRuleScores, true)

--
Gitblit v1.9.3