From 30a53b41f09d2eefd33513a409d472c2166ba1ea Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期三, 10 一月 2024 17:35:03 +0800 Subject: [PATCH] 1. 新增自动评估相关数据源的检查接口 --- src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt | 70 +++++++++++++++++++++++++++++++++- 1 files changed, 67 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt b/src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt index 921170e..3068925 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt @@ -2,8 +2,12 @@ class Constant{ //鐢ㄦ埛 - enum class UserType(val text: String){ - ALLUSER("0")//鎵�鏈夌敤鎴� + enum class UserType(val value: Int, val des: String){ + ALL_USER(-1,"0"),//鎵�鏈夌敤鎴� + ADMIN(0, "绠$悊鍛�"), + INSIDER(1, "鍐呴儴浜哄憳"), + GOV(2, "鏀垮簻閮ㄩ棬"), + ENTERPRISE(3, "浼佷笟") } //瑙勮寖绫诲埆 enum class RuleType(val value: Byte, val text: String){ @@ -16,7 +20,7 @@ RUNINGSTATUS3("3","宸茬粨鏉�") } //鍦烘櫙绫诲瀷 - enum class ScenseType(val value: String, val text: String){ + enum class SceneType(val value: String, val text: String){ TYPE1("1","宸ュ湴"), TYPE2("2","鐮佸ご"), TYPE3("3","姘存偿鎼呮媽绔�"), TYPE4("4","宸ヤ笟浼佷笟"), TYPE5("5","椁愰ギ"), TYPE6("6","姹戒慨"), @@ -59,6 +63,66 @@ "99" -> TYPE99.text else -> "" } + + fun getByValue(value: String?) = when (value.toString()) { + "1" -> TYPE1 + "2" -> TYPE2 + "3" -> TYPE3 + "4" -> TYPE4 + "5" -> TYPE5 + "6" -> TYPE6 + "7" -> TYPE7 + "8" -> TYPE8 + "9" -> TYPE9 + "10" -> TYPE10 + "11" -> TYPE11 + "12" -> TYPE12 + "13" -> TYPE13 + "14" -> TYPE14 + "99" -> TYPE99 + else -> TYPE99 + } + } + } + + enum class SceneTypeTZ(val value: Int, val des: String) { + NoType(0, "鏃犵被鍨�"), + Restaurant(1, "椁愰ギ"), + Construction(2, "宸ュ湴"), + Wharf(3, "鐮佸ご"), + StorageYard(4, "鍫嗗満"), + MixingPlant(5, "鎼呮媽绔�"), + Industrial(6, "宸ヤ笟浼佷笟"), + VehicleRepair(7, "姹戒慨"), + Laboratory(8, "瀹為獙瀹�"), + MedicalInstitution(9, "鍖荤枟鏈烘瀯"); + + companion object { + fun getNameByValue(value: Int?): String = when (value) { + 0 -> NoType.des + 1 -> Restaurant.des + 2 -> Construction.des + 3 -> Wharf.des + 4 -> StorageYard.des + 5 -> MixingPlant.des + 6 -> Industrial.des + 7 -> VehicleRepair.des + 8 -> Laboratory.des + 9 -> MedicalInstitution.des + else -> NoType.des + } + + fun toPairList() = listOf( + Pair(Restaurant.value.toString(), Restaurant.des), + Pair(Construction.value.toString(), Construction.des), + Pair(Wharf.value.toString(), Wharf.des), + Pair(StorageYard.value.toString(), StorageYard.des), + Pair(MixingPlant.value.toString(), MixingPlant.des), + Pair(Industrial.value.toString(), Industrial.des), + Pair(VehicleRepair.value.toString(), VehicleRepair.des), + Pair(Laboratory.value.toString(), Laboratory.des), + Pair(MedicalInstitution.value.toString(), MedicalInstitution.des), + ) } } -- Gitblit v1.9.3