From 196bb14112448857a885e32dc4149e308e00b01a Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 15 八月 2024 11:57:15 +0800
Subject: [PATCH] 2024.8.15 各项修正

---
 src/main/kotlin/cn/flightfeather/supervision/domain/enumeration/NotificationType.kt |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/enumeration/NotificationType.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/enumeration/NotificationType.kt
index 5b14e94..0a73cf4 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/domain/enumeration/NotificationType.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/domain/enumeration/NotificationType.kt
@@ -7,12 +7,36 @@
 enum class NotificationType(val value: Int, val des: String) {
     System(1, "绯荤粺閫氱煡"),
     Work(2, "宸ヤ綔閫氱煡"),
-    Alarm(3, "璀︽姤淇℃伅")
+    Alarm(3, "璀︽姤淇℃伅");
+
+    companion object {
+        fun getByValue(value1: Int) = when (value1) {
+            System.value -> System.des
+            Work.value -> Work.des
+            Alarm.value -> Alarm.des
+            else -> ""
+        }
+    }
+
 }
 
 enum class WorkSubType(val value: Int, val des: String) {
+    All(0, "鍏ㄩ儴"),
     Requirement(1, "宸ヤ綔瑕佹眰"),
     Law(2, "鎵ф硶閫氱煡"),
     Supervision(3, "鐩戠閫氱煡"),
-    Meeting(4, "浼氳閫氱煡")
+    Meeting(4, "浼氳閫氱煡");
+
+    companion object {
+        fun getByValue(value1: Int, value2: Int) = when (value1) {
+            NotificationType.Work.value -> when (value2) {
+                Requirement.value -> Requirement.des
+                Law.value -> Law.des
+                Supervision.value -> Supervision.des
+                Meeting.value -> Meeting.des
+                else -> All.des
+            }
+            else -> NotificationType.getByValue(value1)
+        }
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3