From 8c15c9cc0d6474ed77e313258f9b09f7f2d6366e Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期三, 17 九月 2025 17:29:47 +0800
Subject: [PATCH] 2025.9.17 1. 新增数据产品接口

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/DataProductServiceImpl.kt |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 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 6d56e50..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,10 +7,15 @@
 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
 import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo
+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
@@ -30,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(
@@ -78,4 +84,32 @@
             return true
         }
     }
+
+    override fun problemChangeList(option: DataProdOption): List<PPListProblemChange> {
+        return dataProductMapper.problemChangeList(option)
+    }
+
+    override fun problemRecurrence(option: DataProdOption): List<PPListProbRecurrence> {
+        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