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/NightConstructionImpl.kt |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/NightConstructionImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/NightConstructionImpl.kt
index 4da12af..f91c310 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/NightConstructionImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/NightConstructionImpl.kt
@@ -18,17 +18,17 @@
         val userinfoMapper: UserinfoMapper
 ) : NightConstructionService {
 
-    override fun getRecord(cityCode: String?, districtCode: String, page: Int, perPage: Int): BaseResponse<List<NightConstruction?>> {
+    override fun getRecord(cityCode: String?, districtCode: String, page: Int, perPage: Int): Pair<DataHead, List<NightConstruction?>> {
         val p = PageHelper.startPage<NightConstruction>(page, perPage)
         val result = nightConstructionMapper.selectByExample(Example(NightConstruction::class.java).apply {
             createCriteria().andEqualTo("ncCityCode", cityCode ?: "3100")
                     .andEqualTo("ncDistrictCode", districtCode)
             orderBy("ncRead").orderBy("ncId").desc()
         })
-        return BaseResponse(true, head = DataHead(p.pageNum, p.pages, p.total), data = result)
+        return DataHead(p.pageNum, p.pages, p.total) to result
     }
 
-    override fun getNightWorkFile(userId: String, isRead: Boolean?, page: Int, perPage: Int): BaseResponse<List<NightConstruction?>> {
+    override fun getNightWorkFile(userId: String, isRead: Boolean?, page: Int, perPage: Int): Pair<DataHead, List<NightConstruction?>> {
         val userInfo = userinfoMapper.selectByPrimaryKey(userId)
         val p = PageHelper.startPage<NightConstruction>(page, perPage)
         val result = nightConstructionMapper.selectByExample(Example(NightConstruction::class.java).apply {
@@ -47,10 +47,10 @@
             orderBy("ncCreateTime").desc()
         })
 
-        return BaseResponse(true, head = DataHead(p.pageNum, p.pages), data = result)
+        return DataHead(p.pageNum, p.pages, p.total) to result
     }
 
-    override fun signFile(userId: String, fileNum: String, id: Int): BaseResponse<Int> {
+    override fun signFile(userId: String, fileNum: String, id: Int): Int {
         val record = nightConstructionMapper.selectByExample(Example(NightConstruction::class.java).apply {
             createCriteria().andEqualTo("ncId", id)
                     .andEqualTo("ncNum", fileNum)
@@ -59,9 +59,9 @@
         return if (record.isNotEmpty()) {
             record[0]?.ncRead = true
             val result = nightConstructionMapper.updateByPrimaryKey(record[0])
-            BaseResponse(true, data = result)
+            result
         } else {
-            BaseResponse(false, "澶滈棿璁稿彲璇佽褰曚笉瀛樺湪")
+            throw BizException("澶滈棿璁稿彲璇佽褰曚笉瀛樺湪")
         }
     }
 
@@ -73,7 +73,7 @@
         return record
     }
 
-    override fun getSummary(cityCode: String?, districtCode: String): BaseResponse<NightWorkSummary> {
+    override fun getSummary(cityCode: String?, districtCode: String): NightWorkSummary {
         val total = nightConstructionMapper.selectCountByExample(Example(NightConstruction::class.java).apply {
             createCriteria().andEqualTo("ncCityCode", cityCode ?: "3100")
                     .andEqualTo("ncDistrictCode", districtCode)
@@ -83,6 +83,6 @@
                     .andEqualTo("ncDistrictCode", districtCode)
                     .andEqualTo("ncRead", true)
         })
-        return BaseResponse(true, data = NightWorkSummary(total, signed))
+        return NightWorkSummary(total, signed)
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3