| | |
| | | |
| | | 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( |
| | | mutableListOf( |
| | |
| | | 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) |
| | | 1, dataSource.year, dataSource.month, dataSource.rowData.scene?.type ?: "", dataSource.area, tPros, |
| | | pDes, mainTPros, ExcelUtil.MyCell(per.toString(), isPercent = true) |
| | | ) |
| | | ) |
| | | } |
| | | } |
| | | } |