From 1a45c6fe9ea814e432cf90c0169be9b7d991a266 Mon Sep 17 00:00:00 2001
From: hcong <1050828145@qq.com>
Date: 星期二, 10 十二月 2024 13:51:00 +0800
Subject: [PATCH] 1. 新增 BaseExcel.kt 和 BaseTemplate.kt 的 toObject输出到对象方法 2. 新增 BaseTemplate 是否执行的状态属性 3. 在cn.flightfeather.supervision.business.report.bean包下新增 BaseTemplateResult.kt 结果对象抽象类 以及 ProAnalysisSummaryResult.kt 和 ProDetailSummaryResult.kt 对应实现:问题整改动态跟踪和分街镇问题整改分析的中间结果对象  注:除了问题整改动态跟踪和分街镇问题整改分析其他的汇总表对象中都没有对应中间结果对象,因此这里还有报错信息

---
 src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/XHFuDataAnalysis.kt |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/XHFuDataAnalysis.kt b/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/XHFuDataAnalysis.kt
index b4f9b26..32f4dcc 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/XHFuDataAnalysis.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/XHFuDataAnalysis.kt
@@ -25,7 +25,7 @@
     private val fumeSiteMapMapper: FumeSiteMapMapper,
     private val fumeDailyAnalysisMapper: FumeDailyAnalysisMapper,
     private val fumeExceptionDataMapper: FumeExceptionDataMapper,
-): AopDataAnalysis<FumeDailyAnalysis>(aopDbMapper, aopSceneTypeCheck, aopOutput) {
+) : AopDataAnalysis<FumeDailyAnalysis>(aopDbMapper, aopSceneTypeCheck, aopOutput) {
 
     // 娌圭儫鏁版嵁鏆傛棤鍖哄潎鍊肩殑璁$畻
     override fun districtAvg(source: AopDataSource?): Double? {
@@ -40,12 +40,20 @@
         return fumeSiteMaps.map { it?.xhDeviceCode }
     }
 
+    override fun getDeviceCode(data: FumeDailyAnalysis?): String? {
+        return data?.fumeDevId
+    }
+
     override fun fetchDataResources(evaluationScene: AopDataSource.EvaluationScene): List<List<FumeDailyAnalysis?>> {
         val deviceCodeList = getDeviceCodes(evaluationScene)
         val map = mutableMapOf<String?, MutableList<FumeDailyAnalysis?>>()
         fumeDailyAnalysisMapper.selectByExample(Example(FumeDailyAnalysis::class.java).apply {
             createCriteria().andBetween("fumeDate", evaluationScene.config?.startTime, evaluationScene.config?.endTime)
-                .andIn("fumeDevId", deviceCodeList)
+                .apply {
+                    if (deviceCodeList.isNotEmpty()) {
+                        andIn("fumeDevId", deviceCodeList)
+                    }
+                }
         }).forEach {
             if (!map.containsKey(it?.fumeDevId)) {
                 map[it?.fumeDevId] = mutableListOf()
@@ -66,7 +74,9 @@
         } else {
             val code = deviceCodeList[0]
             fumeExceptionDataMapper.selectByExample(Example(FumeExceptionData::class.java).apply {
-                createCriteria().andBetween("beginTime", evaluationScene.config?.startTime, evaluationScene.config?.endTime)
+                createCriteria().andBetween("beginTime",
+                    evaluationScene.config?.startTime,
+                    evaluationScene.config?.endTime)
                     .andEqualTo("devId", code)
                     .andEqualTo("exception", "鏁版嵁寮傚父")
                     .andEqualTo("exceptionType", "0")
@@ -122,7 +132,7 @@
     ): Double {
         var total = .0
         var count = 0
-        dataList.forEach {list ->
+        dataList.forEach { list ->
             list.forEach {
                 val noon = it?.noonOnlineRate?.removeSuffix("%")?.toDouble()?.div(100)
                 val night = it?.nightOnlineRate?.removeSuffix("%")?.toDouble()?.div(100)

--
Gitblit v1.9.3