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/ProblemlistServiceImpl.kt |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
index d33ffe5..ccca225 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ProblemlistServiceImpl.kt
@@ -314,12 +314,12 @@
 
     override fun delete(id: String): Int = problemlistMapper.deleteByPrimaryKey(id)
 
-    override fun setDeleteStatus(id: String): BaseResponse<Int> {
+    override fun setDeleteStatus(id: String): Int {
         val p = problemlistMapper.selectByPrimaryKey(id)
 
         return when {
-            p.ischanged == true -> BaseResponse(false, "闂宸叉暣鏀癸紝鏃犳硶鍒犻櫎", data = 0)
-            p.extension3 != Constant.PROBLEM_UNCHECKED -> BaseResponse(false, "闂宸插鏍革紝鏃犳硶鍒犻櫎", data = 0)
+            p.ischanged == true -> throw BizException("闂宸叉暣鏀癸紝鏃犳硶鍒犻櫎")
+            p.extension3 != Constant.PROBLEM_UNCHECKED -> throw BizException("闂宸插鏍革紝鏃犳硶鍒犻櫎")
             else -> {
                 // 2021/4/25 灏嗗師鏉ョ殑娣诲姞鍒犻櫎鐘舵�佹敼涓虹洿鎺ュ垹闄�
 //                p.remark = Constant.PROBLEM_DELETED
@@ -333,7 +333,7 @@
                     inspection.problemcount = inspection.problemcount!! - 1
                     inspectionMapper.updateByPrimaryKey(inspection)
                 }
-                BaseResponse(true, "闂鍒犻櫎鎴愬姛", data = i)
+                i
             }
         }
     }
@@ -372,11 +372,11 @@
         remark: String,
         userId: String,
         userName: String,
-    ): BaseResponse<String> {
+    ): String {
         if (action !in 0..5) {
-            return BaseResponse(false, "闈炴硶鐨勬搷浣滄寚浠�")
+            throw BizException("闈炴硶鐨勬搷浣滄寚浠�")
         }
-        val p = problemlistMapper.selectByPrimaryKey(pId) ?: return BaseResponse(false, "闂涓嶅瓨鍦�")
+        val p = problemlistMapper.selectByPrimaryKey(pId) ?: throw BizException("闂涓嶅瓨鍦�")
         val subtask = p.stguid?.let { subTaskRep.findOne(it) }
         val response = BaseResponse<String>(true)
         var event = ""
@@ -485,15 +485,15 @@
                 bizLog.info(WorkStreamLogInfo(userId, userName, event))
             }
         }
-        return response
+        return if (response.success) "闂瀹℃牳鎴愬姛" else throw BizException(response.message)
     }
 
-    override fun newProblem(problem: String, files: Array<MultipartFile>): BaseResponse<String> {
+    override fun newProblem(problem: String, files: Array<MultipartFile>): String {
         //json杞琽bject
         val problemVo = ObjectMapper().readValue(problem, object : TypeReference<ProblemVo>() {})
 
-        val inspection = inspectionMapper.selectByPrimaryKey(problemVo.insGuid) ?: return BaseResponse(false, "宸℃煡璁板綍涓嶅瓨鍦�")
-        val scene = scenseMapper.selectByPrimaryKey(inspection.sguid) ?: return BaseResponse(false, "宸℃煡璁板綍瀵瑰簲鍦烘櫙涓嶅瓨鍦�")
+        val inspection = inspectionMapper.selectByPrimaryKey(problemVo.insGuid) ?: throw BizException("宸℃煡璁板綍涓嶅瓨鍦�")
+        val scene = scenseMapper.selectByPrimaryKey(inspection.sguid) ?: throw BizException("宸℃煡璁板綍瀵瑰簲鍦烘櫙涓嶅瓨鍦�")
         // 淇濆瓨闂
         val problemlist = ProblemListVo.newPro(inspection, problemVo, scene)
         problemlistMapper.insert(problemlist)
@@ -513,7 +513,7 @@
             bizLog.info(WorkStreamLogInfo(subtask?.executorguids, subtask?.executorrealtimes, event))
         }
 
-        return BaseResponse(true)
+        return "success"
     }
 
     override fun updateProblem(problem: ProblemListVo, deleteImg: List<String>, files: Array<MultipartFile>): String {
@@ -527,15 +527,15 @@
     }
 
 
-    override fun changeProblem(problemId: String, files: Array<MultipartFile>): BaseResponse<String> {
+    override fun changeProblem(problemId: String, files: Array<MultipartFile>): String {
         // 闂鍜岄棶棰樺浘鐗囧悎娉曟�ф鏌�
-        val p = problemlistMapper.selectByPrimaryKey(problemId) ?: return BaseResponse(false, "闂涓嶅瓨鍦�")
+        val p = problemlistMapper.selectByPrimaryKey(problemId) ?: throw BizException("闂涓嶅瓨鍦�")
         val mediaFiles = mediafileMapper.selectByExample(Example(Mediafile::class.java).apply {
             createCriteria().andEqualTo("businessguid", p.guid)
                 .andEqualTo("businesstypeid", 1)
                 .andEqualTo("ischanged", false)
         })
-        if (mediaFiles.isEmpty()) return BaseResponse(false, "闂涓嶅瓨鍦ㄦ垨宸叉暣鏀癸紝鏃犳硶閲嶅鏁存敼")
+        if (mediaFiles.isEmpty()) throw BizException("闂涓嶅瓨鍦ㄦ垨宸叉暣鏀癸紝鏃犳硶閲嶅鏁存敼")
 
         // 鏇存柊闂
         p.apply {
@@ -568,7 +568,7 @@
             }
         }
 
-        return BaseResponse(true)
+        return "success"
     }
 
     override fun updateChange(problemId: String, deleteImg: List<String>, files: Array<MultipartFile>): String {

--
Gitblit v1.9.3