From baf2cc2ce3dfd1235c012a3750132769fcd9ad2f Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 18 九月 2025 17:02:05 +0800 Subject: [PATCH] 2025.9.18 1. 联合前端调试数据产品接口(待完成) --- 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