From 39e208b6b0482a25c77e53590087c02d9d937563 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期三, 20 七月 2022 09:04:48 +0800 Subject: [PATCH] 1. 巡查汇总报告功能编写完成 --- src/main/kotlin/cn/flightfeather/supervision/business/report/BaseCols.kt | 33 +++++++++++++++++++++++---------- 1 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/BaseCols.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/BaseCols.kt index c12a5cc..ae22382 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/BaseCols.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/business/report/BaseCols.kt @@ -20,13 +20,14 @@ //鐢熸垚涓�琛屽唴瀹� fun getOneRow(rowData: DataSource.RowData): List<Any> { - return if (rowData.noRecord()) { - val r = mutableListOf<String>() - repeat(heads.last().size) { r.add(("")) } - r - } else { - onOneRow(rowData) - } +// return if (rowData.noRecord()) { +// val r = mutableListOf<String>() +// repeat(heads.last().size) { r.add(("")) } +// r +// } else { +// onOneRow(rowData) +// } + return onOneRow(rowData) } abstract fun onOneRow(rowData: DataSource.RowData): List<Any> @@ -57,7 +58,12 @@ oldHeads.first().forEach { it.rowSpan++ } } val h = mutableListOf<ExcelUtil.MyCell>() - repeat(oldHeads.size) { h.add(ExcelUtil.MyCell("")) } + + var cols = 0 + oldHeads.last().forEach { + cols += it.colSpan + } + repeat(cols) { h.add(ExcelUtil.MyCell("")) } oldHeads.add(h) h } @@ -70,12 +76,19 @@ newHeads.first().forEach { it.rowSpan++ } } val h = mutableListOf<ExcelUtil.MyCell>() - repeat(newHeads.size) { h.add(ExcelUtil.MyCell("")) } + + var cols = 0 + newHeads.last().forEach { + cols += it.colSpan + } + repeat(cols) { h.add(ExcelUtil.MyCell("")) } newHeads.add(h) h } + } - oH.addAll(nH) + for (i in oldHeads.indices) { + oldHeads[i].addAll(newHeads[i]) } } } -- Gitblit v1.9.3