From 0516cba27e632f20efac2752787f38f0c87baafa Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期三, 25 九月 2024 09:24:05 +0800
Subject: [PATCH] 1. 新增自动评估添加和更新接口

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ItemEvaluationVo.kt |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ItemEvaluationVo.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ItemEvaluationVo.kt
new file mode 100644
index 0000000..8a56542
--- /dev/null
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ItemEvaluationVo.kt
@@ -0,0 +1,37 @@
+package cn.flightfeather.supervision.lightshare.vo
+
+import cn.flightfeather.supervision.business.autooutput.datasource.AopDataSource
+import cn.flightfeather.supervision.common.utils.UUIDGenerator
+import cn.flightfeather.supervision.domain.ds1.entity.Evaluationrule
+import cn.flightfeather.supervision.domain.ds1.entity.Inspection
+import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation
+import cn.flightfeather.supervision.domain.ds1.entity.Subtask
+import com.fasterxml.jackson.annotation.JsonInclude
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+class ItemEvaluationVo : Itemevaluation() {
+
+    companion object {
+        /**
+         * 鐢熸垚鏂扮殑涓�鏉¤瘎鍒嗚褰�
+         */
+        fun newItemEvaluation(
+            rule: Evaluationrule?, subTask: Subtask?, inspection: Inspection?,
+            itemRule: EvaluationSubRuleVo,
+        ) = Itemevaluation().apply {
+                ieguid = UUIDGenerator.generate16ShortUUID()
+                iguid = inspection?.guid
+                stguid = subTask?.stguid
+                sguid = subTask?.scenseid
+                sensename = subTask?.scensename
+                erguid = rule?.guid
+                rulename = rule?.rulename
+                ruletype = rule?.ruletype?.toInt()
+                ertype = itemRule.ertype
+                esrguid = itemRule.guid
+                name = itemRule.itemname
+                value = itemRule.score.toString()
+                extension1 = itemRule.selected.toString()
+            }
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.3