From f565fbc09724992d53ec6632c3e5d1de3325f328 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 11 一月 2024 17:33:44 +0800 Subject: [PATCH] 1. 调整返回接口的异常捕获类为自定义异常类; 2. 修改AreaVo类中时间参数的类型; 3. 新增文档生成任务类型,并新增文档后台生成任务逻辑; --- src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt | 43 ++++++++++++++++++++++++++++++++----------- 1 files changed, 32 insertions(+), 11 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..1de9b3d 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 @@ -3,18 +3,32 @@ import cn.flightfeather.supervision.business.report.DataSource import cn.flightfeather.supervision.common.utils.Constant import cn.flightfeather.supervision.common.utils.ExcelUtil -import kotlin.math.round class ProTypeRankMainSummary(dataSource: DataSource) : ProTypeRankSummary(dataSource) { override val templateName: String = "鏈堝害涓昏鎴栧吀鍨嬮棶棰樺垎鏋愯〃" override fun formatTable(summarys: MutableList<Summary>) { + //鎺掑悕闈犲墠鐨刴ax涓棶棰樿璁ゅ畾涓轰富瑕佹垨鍏稿瀷闂 val max = when (dataSource.config.sceneType.toString()) { - Constant.ScenseType.TYPE1.value -> 5 + Constant.SceneType.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 +55,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