From aed297a5fbc8df9dab01b28da21f872ee546b43c Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 13 十月 2025 16:15:11 +0800
Subject: [PATCH] 2025.10.13 1. 统一调整controller层的返回类型,通过添加全局响应增强器GlobalResponseAdvice来管理返回结果; 2. 新增mybatis-generator自定义插件,实现给数据库实体entity自动添加swagger注解@ApiModel和@ApiModelProperty
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DomainitemServiceImpl.kt | 73 +++++++++++++++++++++++++++++++++---
1 files changed, 67 insertions(+), 6 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DomainitemServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DomainitemServiceImpl.kt
index 62c497c..9baf7f1 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DomainitemServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DomainitemServiceImpl.kt
@@ -82,12 +82,12 @@
override fun getLocation(sceneType: Int): List<Domainitem> {
val lId = when (sceneType.toString()) {
- Constant.ScenseType.TYPE1.value -> Constant.INDUSTRY_LOCATION_ID
- Constant.ScenseType.TYPE2.value -> Constant.WHARF_LOCATION_ID
- Constant.ScenseType.TYPE14.value -> Constant.STORAGE_YARD_LOCATION_ID
- Constant.ScenseType.TYPE3.value -> Constant.MIX_LOCATION_ID
- Constant.ScenseType.TYPE5.value -> Constant.RESTAURANT_LOCATION_ID
- Constant.ScenseType.TYPE6.value -> Constant.Vehicle_LOCATION_ID
+ Constant.SceneType.TYPE1.value -> Constant.INDUSTRY_LOCATION_ID
+ Constant.SceneType.TYPE2.value -> Constant.WHARF_LOCATION_ID
+ Constant.SceneType.TYPE14.value -> Constant.STORAGE_YARD_LOCATION_ID
+ Constant.SceneType.TYPE3.value -> Constant.MIX_LOCATION_ID
+ Constant.SceneType.TYPE5.value -> Constant.RESTAURANT_LOCATION_ID
+ Constant.SceneType.TYPE6.value -> Constant.Vehicle_LOCATION_ID
else -> Constant.INDUSTRY_LOCATION_ID
}
@@ -96,4 +96,65 @@
orderBy("index")
})
}
+
+ override fun getTaskType(): List<Domainitem> {
+ return domainitemMapper.selectByExample(Example(Domainitem::class.java).apply {
+ createCriteria().andEqualTo("dcguid", Constant.DOMAIN_GUID_TASK_TYPE)
+ orderBy("index")
+ })
+ }
+
+ override fun getDeadlineType(): List<Domainitem> {
+ return domainitemMapper.selectByExample(Example(Domainitem::class.java).apply {
+ createCriteria().andEqualTo("dcguid", Constant.DOMAIN_GUID_TASK_DEADLINE_TYPE)
+ orderBy("index")
+ })
+ }
+
+ override fun getLevelType(): List<Domainitem> {
+ return domainitemMapper.selectByExample(Example(Domainitem::class.java).apply {
+ createCriteria().andEqualTo("dcguid", Constant.DOMAIN_GUID_TASK_LEVEL)
+ orderBy("index")
+ })
+ }
+
+ override fun getMediaFileType(sceneType: Int?): MutableMap<String?, String?> {
+ val res = mutableMapOf<String?, String?>()
+ val type = Constant.SceneType.getByValue(sceneType.toString())
+ when (type) {
+ // 宸ュ湴
+ Constant.SceneType.TYPE1 -> {
+ val domainItems = domainitemMapper.selectByExample(Example(Domainitem::class.java).apply {
+ createCriteria().andEqualTo("dcguid", Constant.MEDIA_FILE_TYPE_INDUSTRY)
+ orderBy("index")
+ })
+ domainItems.forEach { res[it.value] = it.text }
+ // 宸ュ湴涓殑浠绘剰鎷嶅寘鍚�滃父瑙勮褰曗�濈被鍨�
+ res[Constant.MediaFileType.RoutineRecord.value.toString()] = Constant.MediaFileType.RoutineRecord.des
+ return res
+ }
+ // 椁愰ギ
+ Constant.SceneType.TYPE5 -> {
+ val domainItems = domainitemMapper.selectByExample(Example(Domainitem::class.java).apply {
+ createCriteria().andEqualTo("dcguid", Constant.MEDIA_FILE_TYPE_RESTAURANT)
+ orderBy("index")
+ })
+ domainItems.forEach { res[it.value] = it.text }
+ // 椁愰ギ涓殑浠绘剰鎷嶅寘鍚�滃父瑙勮褰曗�濈被鍨�
+ res[Constant.MediaFileType.RoutineRecord.value.toString()] = Constant.MediaFileType.RoutineRecord.des
+ return res
+ }
+ // 鍏朵綑绫诲瀷鍦烘櫙锛屼娇鐢ㄩ粯璁ょ殑鍒嗙被
+ else -> {
+ listOf(
+ Constant.MediaFileType.Nameplate,
+ Constant.MediaFileType.MonitorDevice,
+ Constant.MediaFileType.RoutineRecord,
+ ).forEach {
+ res[it.value.toString()] = it.des
+ }
+ }
+ }
+ return res
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3