From 2ae8bf126599f68ba1ca721ff2acc1dd4461e9a5 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期二, 12 九月 2023 11:05:47 +0800 Subject: [PATCH] 1. 整合了飞羽环境、徐汇油烟及金山扬尘两个数据库; 2. 优化重构自动评估模块逻辑; 3. 新增监测数据自动化统; 4. 将自动统计应用于自动评估中; --- src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt | 40 +++++++++++++++++++++++++++++++--------- 1 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt index 1eec3c3..a0982c3 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt @@ -9,12 +9,27 @@ override val templateName: String = "鏈堝害涓昏鎴栧吀鍨嬮棶棰樺垎鏋愯〃" override fun formatTable(summarys: MutableList<Summary>) { + //鎺掑悕闈犲墠鐨刴ax涓棶棰樿璁ゅ畾涓轰富瑕佹垨鍏稿瀷闂 val max = when (dataSource.config.sceneType.toString()) { Constant.ScenseType.TYPE1.value -> 5 else -> 4 } summarys.sortByDescending { it.count } + + var tPros = 0 + var mainTPros = 0 + var pDes = "" + for (i in summarys.indices) { + val it = summarys[i] + tPros += it.count + if (i < max) { + val lr = if (i > 0) "\n" else "" + mainTPros += it.count + pDes += "${lr}${i+1}銆�${it.proDes}" + } + } + var per = if (tPros == 0) .0 else mainTPros.toDouble() / tPros head.clear() head.add( @@ -41,16 +56,23 @@ ExcelUtil.MyCell("涓昏闂鍗犳瘮"), ) ) - for (i in summarys.indices) { - if (i >= max) break +// for (i in summarys.indices) { +// if (i >= max) break +// +// val s = summarys[i] +// contents.add( +// mutableListOf( +// i + 1, dataSource.year, dataSource.month, dataSource.rowData.scene?.type ?: "", dataSource.area, s.count, +// s.proDes, s.count, ExcelUtil.MyCell(s.countPer.toString(), isPercent = true) +// ) +// ) +// } - val s = summarys[i] - contents.add( - mutableListOf( - i + 1, dataSource.year, dataSource.month, dataSource.rowData.scene?.type ?: "", dataSource.area, s.count, - s.proDes, s.count, ExcelUtil.MyCell(s.countPer.toString(), isPercent = true) - ) + contents.add( + mutableListOf( + 1, dataSource.year, dataSource.month, dataSource.rowData.scene?.type ?: "", dataSource.area, tPros, + pDes, mainTPros, ExcelUtil.MyCell(per.toString(), isPercent = true) ) - } + ) } } \ No newline at end of file -- Gitblit v1.9.3