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/NightConstructionImpl.kt | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 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 12ad943..4da12af 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
@@ -1,5 +1,6 @@
package cn.flightfeather.supervision.lightshare.service.impl
+import cn.flightfeather.supervision.common.exception.BizException
import cn.flightfeather.supervision.domain.ds1.entity.NightConstruction
import cn.flightfeather.supervision.domain.ds1.mapper.NightConstructionMapper
import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper
@@ -24,7 +25,7 @@
.andEqualTo("ncDistrictCode", districtCode)
orderBy("ncRead").orderBy("ncId").desc()
})
- return BaseResponse(true, head = DataHead(p.pageNum, p.pages), data = result)
+ return BaseResponse(true, head = DataHead(p.pageNum, p.pages, p.total), data = result)
}
override fun getNightWorkFile(userId: String, isRead: Boolean?, page: Int, perPage: Int): BaseResponse<List<NightConstruction?>> {
@@ -64,6 +65,14 @@
}
}
+ override fun updateRecord(recordId: Int, userId: String?, sceneId: String?): NightConstruction {
+ val record = nightConstructionMapper.selectByPrimaryKey(recordId) ?: throw BizException("澶滈棿璁稿彲璇佽褰曚笉瀛樺湪")
+ record.ncUserId = userId
+ record.ncSceneId = sceneId
+ nightConstructionMapper.updateByPrimaryKey(record)
+ return record
+ }
+
override fun getSummary(cityCode: String?, districtCode: String): BaseResponse<NightWorkSummary> {
val total = nightConstructionMapper.selectCountByExample(Example(NightConstruction::class.java).apply {
createCriteria().andEqualTo("ncCityCode", cityCode ?: "3100")
--
Gitblit v1.9.3