From 1a677d2b4a4bc615602f8c2a22bc07ec1356e5be Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 16 十月 2025 17:39:06 +0800
Subject: [PATCH] 2025.10.16 1. 根据全局响应增强器GlobalResponseAdvice,将原先的BaseResPack接口包装函数统一去除; 2. 新增三种类型的数据产品数据库实体 3. 新增典型问题场景清单中间数据产品接口
---
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt
index 492dbbe..c26f05b 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ScenseServiceImpl.kt
@@ -329,6 +329,7 @@
when (typeId.toString()) {
Constant.SceneType.TYPE1.value -> {
val subScene = Gson().fromJson(sceneDetailStr.subScene, SceneConstructionSite::class.java)
+ subScene.csUpdateTime = Date()
if (subScene.getsGuid() != null) {
val record = sceneConstructionSiteMapper.selectByPrimaryKey(subScene.getsGuid())
isUpdate = record != null
@@ -411,17 +412,22 @@
return locationRoadNearby.searchByRadius(Pair(lng, lat), radius)
}
- override fun importSceneInfo(file: MultipartFile): Boolean {
- val f = ByteArrayInputStream(file.bytes)
+ override fun importSceneInfo(files: Array<MultipartFile>): Boolean {
+ if (files.isEmpty()) throw BizException("鏈纭笂浼犳枃浠讹紝鎺ュ彛璋冪敤閿欒")
+
+ val f = ByteArrayInputStream(files[0].bytes)
val scenes = sceneImport.readFromFile(f)
+ if (scenes.isEmpty()) throw BizException("鏂囦欢鍐呭涓虹┖")
// 鏌ユ壘鍦烘櫙鍚嶇О鏄惁閲嶅
- val names = scenes.map { it.name }
+ val names = scenes.map { it.scense?.name }
sceneRep.findSceneList(names).map { it?.name }.ifNotEmpty {
val str = this.joinToString("锛�")
throw BizException("瀛樺湪閲嶅鍦烘櫙锛屽涓嬶細${str}")
}
scenes.forEach {
- createOneScene(it)
+ it.scense ?: return@forEach
+ createOneScene(it.scense!!)
+ sceneRep.insertOrUpdateSubScene(it.scense!!.typeid?.toInt(), it.scense!!.guid, it.subScene)
}
return true
}
--
Gitblit v1.9.3