From dc4f12f66685260ac357997680e5f3fe723c3c4a Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期五, 12 九月 2025 17:22:40 +0800 Subject: [PATCH] 2025.9.12 1. 新增监测设备和巡查场景信息的匹配功能 --- src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt | 121 ++++++++++++++++++++++++---------------- 1 files changed, 73 insertions(+), 48 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 e3b006b..8dbc046 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluationVo.kt @@ -1,55 +1,80 @@ package cn.flightfeather.supervision.lightshare.vo +import cn.flightfeather.supervision.common.utils.UUIDGenerator +import cn.flightfeather.supervision.domain.ds1.entity.* +import java.util.* + /** - * 璇勫垎瑙勫垯鍙婂緱鍒� + * 璇勪及鎬诲垎 + * @date 2024/9/24 + * @author feiyu02 */ -class EvaluationVo { - //瑙勫垯id - var id: String? = null - //瑙勫垯鎻忚堪 - var title1: String? = null - //鍒嗗�� - var score: Int = 0 - //鏄惁閫変腑 - var select: Boolean = false - //basic_score: 鍩虹鍒嗭紝蹇呴�夛紱addition_score锛氶檮鍔犲垎锛屽彲閫夛紱null锛氶粯璁ゅ熀纭�鍒� - var scoreMode: String? = "basic_score" - //minus_mode: 鍑忓垎妯″紡锛沘dd_mode锛氬姞鍒嗘ā寮忥紱null锛氫笉鍋氳瀹氾紝璇存槑鍏跺瓙椤逛笉鏄叿浣撶殑璇勪及缁嗗垯 - var gradeMode: String? = "minus_mode" - //single_mode: 鍗曢�夋ā寮忥紱multi_mode锛氬閫夋ā寮忥紱null锛氫笉鍋氳瀹氾紝璇存槑鍏跺瓙椤逛笉鏄叿浣撶殑璇勪及缁嗗垯 - var selectMode: String? = "single_mode" - //浜岀骇瀛愯鍒� - var sub1: MutableList<SubEvaluationVo> = mutableListOf() -} +class EvaluationVo : Evaluation() { -class SubEvaluationVo { - //鏈夋椂鍊欎竴绾х殑瑙勫垯涓嬮潰鐩存帴鏄笁绾ц鍒欙紝娌℃湁浜岀骇瑙勫垯锛屽洜姝ゆ鏃剁殑浜岀骇瑙勫垯鍙槸涓轰簡缁撴瀯瀹屾暣鎬ц�屽嚭鐜扮殑 - var placeholder: Boolean = false - //瑙勫垯id - var id: String? = null - //瑙勫垯鎻忚堪 - var title2: String? = null - //鍒嗗�� - var score: Int = 0 - //鏄惁閫変腑 - var select: Boolean = false - //minus_mode: 鍑忓垎妯″紡锛沘dd_mode锛氬姞鍒嗘ā寮忥紱 - var gradeMode: String? = "minus_mode" - //single_mode: 鍗曢�夋ā寮忥紱multi_mode锛氬閫夋ā寮忥紱 - var selectMode: String? = "single_mode" - //浜岀骇瑙勫垯鍒嗙粍 - var group: Int? = null - //涓夌骇瀛愯鍒� - var sub2: MutableList<ThirdEvaluationVo> = mutableListOf() -} + /** + * 鏇存柊寰楀垎 + */ + fun updateScore(score: Int) { -class ThirdEvaluationVo { - //瑙勫垯id - var id: String? = null - //瑙勫垯鎻忚堪 - var content: String? = null - //鍒嗗�� - var score: Int = 0 - //鏄惁閫変腑 - var select: Boolean = false + } + + companion object { + /** + * 鏂板涓�鏉¤嚜鍔ㄨ瘎鍒嗙殑鎬诲緱鍒嗚褰� + * @param inspection 宸℃煡璁板綍 + * @param subTask 宸℃煡瀛愪换鍔� + * @param scene 琚贰鏌ュ満鏅� + * @param rule 浣跨敤鐨勮瘎鍒嗚鍒� + * @param totalScore 鎬诲緱鍒� + */ + fun newAutoEvaluation( + inspection: Inspection?, subTask: Subtask?, scene: Scense, rule: Evaluationrule?, + totalScore: Int, + ) = newEvaluation(inspection, subTask, scene, rule, totalScore, Userinfo().apply { + guid = "admin" + acountname = "admin" + realname = "admin" + }) + + /** + * 鏂板涓�鏉¤瘎鍒嗙殑鎬诲緱鍒嗚褰� + * @param inspection 宸℃煡璁板綍 + * @param subTask 宸℃煡瀛愪换鍔� + * @param scene 琚贰鏌ュ満鏅� + * @param rule 浣跨敤鐨勮瘎鍒嗚鍒� + * @param totalScore 鎬诲緱鍒� + * @param userinfo 璇勪及鐢ㄦ埛 + */ + fun newEvaluation( + inspection: Inspection?, subTask: Subtask?, scene: Scense, + rule: Evaluationrule?, totalScore: Int, userinfo: Userinfo, + ) = Evaluation().apply { + guid = UUIDGenerator.generate16ShortUUID() + iguid = inspection?.guid + stguid = subTask?.stguid + sguid = subTask?.scenseid + scensetypeid = scene.typeid + scensetype = scene.type + subscensetypeid = scene.scensesubtypeid + subscensetype = scene.scensesubtype + ertype = rule?.ruletype?.toByte() + provincecode = scene.provincecode + provincename = scene.provincename + citycode = scene.citycode + cityname = scene.cityname + districtcode = scene.districtcode + districtname = scene.districtname + towncode = scene.towncode + townname = scene.townname + scensename = scene.name + scenseaddress = scene.location + evaluatetime = subTask?.planstarttime + evaluatorguid = userinfo.guid + evaluatorusername = userinfo.acountname + evaluatorrealname = userinfo.realname + resultscorebef = totalScore.toString() + createdate = subTask?.planstarttime + updatedate = Date() + } + } } \ No newline at end of file -- Gitblit v1.9.3