feiyu02
2025-09-19 7cbe1610b87da19ed8a146a09b1117f92d9d3d98
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")