From fe031e01cc1737c2f05a133fde7c36c7a2a7b4b4 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期三, 21 一月 2026 17:38:32 +0800
Subject: [PATCH] 2026.1.21 1. 新增完善台账复制逻辑
---
src/main/kotlin/cn/flightfeather/supervision/infrastructure/utils/ExcelUtil.kt | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/infrastructure/utils/ExcelUtil.kt b/src/main/kotlin/cn/flightfeather/supervision/infrastructure/utils/ExcelUtil.kt
index 6a3d664..4bc2b71 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/infrastructure/utils/ExcelUtil.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/infrastructure/utils/ExcelUtil.kt
@@ -22,19 +22,20 @@
/**
* 鑷姩澶勭悊琛屽悎骞舵暟鎹�
*/
- fun write2(heads: List<Array<String>>, contents: List<Array<Any>>, workbook: HSSFWorkbook, sheetName: String = "sheet1") {
+ fun write2(heads: List<Array<Any>>, contents: MutableList<Array<Any>>, workbook: HSSFWorkbook, sheetName: String = "sheet1") {
val sheet = workbook.createSheet(sheetName)
var rowIndex = 0
- heads.forEach {
- val rows = sheet.createRow(rowIndex)
- for (i in it.indices) {
- rows.createCell(i).setCellValue(it[i])
- }
- rowIndex++
- }
+// heads.forEach {
+// val rows = sheet.createRow(rowIndex)
+// for (i in it.indices) {
+// rows.createCell(i).setCellValue(it[i])
+// }
+// rowIndex++
+// }
+ contents.addAll(0, heads)
contents.forEach {
val maxRow = getMaxRows(it)
@@ -101,6 +102,7 @@
rows.createCell(col).setCellValue(c)
println("write1-2: ${c};($rowIndex, ${col})")
}
+ is Int -> rows.createCell(col).setCellValue(c.toDouble())
is Double -> rows.createCell(col).setCellValue(c)
is Boolean -> rows.createCell(col).setCellValue(c)
is Date -> rows.createCell(col).setCellValue(c)
@@ -151,6 +153,7 @@
rows.createCell(map.key).setCellValue(c)
println("write2-2: ${c};($_rowIndex, ${map.key})")
}
+ is Int -> rows.createCell(col).setCellValue(c.toDouble())
is Double -> rows.createCell(map.key).setCellValue(c)
is Boolean -> rows.createCell(map.key).setCellValue(c)
is Date -> rows.createCell(map.key).setCellValue(c)
--
Gitblit v1.9.3