| | |
| | | package cn.flightfeather.supervision.business.report.template |
| | | |
| | | 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: List<Summary>) { |
| | | summarys.sortedByDescending { it.count } |
| | | override fun formatTable(summarys: MutableList<Summary>) { |
| | | val max = when (dataSource.config.sceneType.toString()) { |
| | | Constant.ScenseType.TYPE1.value -> 5 |
| | | else -> 4 |
| | | } |
| | | |
| | | summarys.sortByDescending { it.count } |
| | | |
| | | head.clear() |
| | | head.add( |
| | |
| | | ) |
| | | ) |
| | | for (i in summarys.indices) { |
| | | if (i >= max) break |
| | | |
| | | val s = summarys[i] |
| | | contents.add( |
| | | mutableListOf( |
| | | i + 1, "", "", dataSource.rowData.scene?.type ?: "", "", s.count, |
| | | s.proDes, s.count, "${round(s.countPer * 1000) / 10}%" |
| | | 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) |
| | | ) |
| | | ) |
| | | } |