From 2ae8bf126599f68ba1ca721ff2acc1dd4461e9a5 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 12 九月 2023 11:05:47 +0800 Subject: [PATCH] 1. 整合了飞羽环境、徐汇油烟及金山扬尘两个数据库; 2. 优化重构自动评估模块逻辑; 3. 新增监测数据自动化统; 4. 将自动统计应用于自动评估中; --- src/main/kotlin/cn/flightfeather/supervision/business/storage/StAutoScore.kt | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/storage/StAutoScore.kt b/src/main/kotlin/cn/flightfeather/supervision/business/storage/StAutoScore.kt index 60e48b5..09c69a3 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/storage/StAutoScore.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/business/storage/StAutoScore.kt @@ -37,6 +37,7 @@ stScoreItem_1: StScoreItem_1, whScoreItem_1: WhScoreItem_1, whScoreItem_2: WhScoreItem_2, + val jinAnScore: JinAnScore, var sceneType: Constant.ScenseType = Constant.ScenseType.TYPE1, ) { companion object { @@ -144,8 +145,9 @@ private fun sceneGradeP(subtask: Subtask) { val info = itemGrade(subtask) - val result = totalGrade(info) ?: return + val result = totalGrade(info, subtask) ?: return toDb(info, result) +// jinAnScore.toDb(result.first, info) // addToFile(rows, info, result.first) // toFile() } @@ -155,7 +157,7 @@ getScoreItem() val info = itemGrade(subtask) - val result = totalGrade(info) ?: return + val result = totalGrade(info, subtask) ?: return addToFile(rows, info, result.first) } @@ -186,7 +188,15 @@ val scene = scenseMapper.selectByPrimaryKey(subtask.scenseid) val info = - Info(userInfo?.guid, tzUserId, subtask.scenseid, subtask.scensename, sceneType, subTask = subtask, sceneIndex = scene.index) + Info(userInfo?.guid, + tzUserId, + subtask.scenseid, + subtask.scensename, + sceneType, + subTask = subtask, + sceneIndex = scene.index, + online = scene.extension1 != "0" + ) /** 1. 鏍规嵁璇勫垎瑙勫垯瀵瑰簲鐨勯棶棰樿嚜鍔ㄥ垽鏂槸鍚︽墸鍒�***************************************************************/ // 鑾峰彇璇ユ宸℃煡浠诲姟涓嬬殑鎵�鏈夐棶棰� @@ -200,6 +210,7 @@ // 鍏蜂綋璇勫垎閫夐」 val subRule = r.second subRule.forEach { sr -> + // 瀛樺湪澶氫釜璇勫垎椤瑰拰鍚屼竴涓棶棰樺叧鑱旓紝鍥犳蹇呴』鍏ㄩ儴璇勫垎椤归兘鍒ゅ畾涓�閬� sr.problemlist?.split(",")?.forEach { pId -> if (pList.contains(pId)) { sr.extension1 = (0 - (sr.maxscore ?: 0)).toString() @@ -248,7 +259,7 @@ /** * 璁$畻鎬诲垎 */ - private fun totalGrade(info: Info): Pair<Evaluation, List<Itemevaluation>>? { + private fun totalGrade(info: Info, subtask: Subtask): Pair<Evaluation, List<Itemevaluation>>? { /** 4. 璁$畻鎬诲垎*************************************************************************/ val scene = scenseMapper.selectByPrimaryKey(info.subTask?.scenseid) ?: return null val inspection = inspectionMapper.selectByExample(Example(Inspection::class.java).apply { @@ -280,12 +291,12 @@ townname = scene.townname scensename = scene.name scenseaddress = scene.location - evaluatetime = Date() + evaluatetime = subtask.planstarttime evaluatorguid = "admin" evaluatorusername = "admin" evaluatorrealname = "admin" resultscorebef = (totalScore - abs(total)).toString() - createdate = Date() + createdate = subtask.planstarttime updatedate = Date() } } -- Gitblit v1.9.3