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/DataProductServiceImpl.kt | 27 +++++++++++++++++++++++++--
1 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProductServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProductServiceImpl.kt
index 63d3578..5441142 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProductServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProductServiceImpl.kt
@@ -7,6 +7,7 @@
import cn.flightfeather.supervision.business.report.file.ReportThree
import cn.flightfeather.supervision.business.report.file.ReportTwo
import cn.flightfeather.supervision.common.exception.BizException
+import cn.flightfeather.supervision.domain.ds1.mapper.DataProductMapper
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.service.DataProductService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
@@ -14,6 +15,7 @@
import cn.flightfeather.supervision.model.dataproduct.DataProdOption
import cn.flightfeather.supervision.model.dataproduct.PPListProbRecurrence
import cn.flightfeather.supervision.model.dataproduct.PPListProblemChange
+import org.springframework.beans.BeanUtils
import org.springframework.beans.factory.annotation.Value
import org.springframework.http.HttpHeaders
import org.springframework.http.MediaType
@@ -33,6 +35,7 @@
private val dbMapper: DbMapper,
@Value("\${filePath}") private val filePath: String,
private val reportTaskCtrl: ReportTaskCtrl,
+ private val dataProductMapper: DataProductMapper,
) : DataProductService {
override fun downloadProduct(
@@ -83,10 +86,30 @@
}
override fun problemChangeList(option: DataProdOption): List<PPListProblemChange> {
- TODO("Not yet implemented")
+ return dataProductMapper.problemChangeList(option)
}
override fun problemRecurrence(option: DataProdOption): List<PPListProbRecurrence> {
- TODO("Not yet implemented")
+ val res = mutableListOf<PPListProbRecurrence>()
+ problemChangeList(option).forEach {pcl ->
+ val r = res.find {
+ it.sceneName == pcl.sceneName && it.problemName == pcl.problemName
+ }
+ if (r == null) {
+ val probRec = PPListProbRecurrence()
+ BeanUtils.copyProperties(pcl, probRec)
+ probRec.apply {
+ proNum = 1
+ changeNum += pcl.changeSum
+ }
+ res.add(probRec)
+ } else {
+ r.apply {
+ proNum++
+ changeNum += pcl.changeSum
+ }
+ }
+ }
+ return res
}
}
\ No newline at end of file
--
Gitblit v1.9.3