From aed297a5fbc8df9dab01b28da21f872ee546b43c Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期一, 13 十月 2025 16:15:11 +0800
Subject: [PATCH] 2025.10.13 1. 统一调整controller层的返回类型,通过添加全局响应增强器GlobalResponseAdvice来管理返回结果; 2. 新增mybatis-generator自定义插件,实现给数据库实体entity自动添加swagger注解@ApiModel和@ApiModelProperty
---
src/main/kotlin/cn/flightfeather/supervision/common/utils/ExcelUtil.kt | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/main/kotlin/cn/flightfeather/supervision/common/utils/ExcelUtil.kt b/src/main/kotlin/cn/flightfeather/supervision/common/utils/ExcelUtil.kt
index 7bd1347..abfda36 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/common/utils/ExcelUtil.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/common/utils/ExcelUtil.kt
@@ -36,6 +36,7 @@
class MyHeader(
var name: String,
val type: CellType,
+ val ignore: Boolean = false
)
private fun cellTypeName(type: CellType): String = when (type) {
@@ -74,8 +75,8 @@
iterator.forEach {
// 妫�鏌ュ綋鍓嶈姣忎釜鍗曞厓鏍肩被鍨嬫槸鍚︿笌琛ㄥご瀹氫箟鍖归厤
headers.forEachIndexed { i, h ->
- val t = it.getCell(i + 1).cellType
- if (t != CellType.BLANK || t != h.type) {
+ val t = it.getCell(i)?.cellType ?: CellType.BLANK
+ if (t != CellType.BLANK && !h.ignore && t != h.type) {
throw BizException("绗�${it.rowNum + 1}琛岋紝绗�${i + 1}鍒楀崟鍏冩牸鏍煎紡閿欒锛屽簲璇ヤ负${cellTypeName(h.type)}")
}
}
@@ -84,7 +85,7 @@
}
/**
- * 鑷姩澶勭悊琛屽悎骞舵暟鎹�
+ * 鍐欏叆excel
*/
fun write(heads: List<Array<Any>>, contents: MutableList<Array<Any>>, workbook: HSSFWorkbook, sheetName: String
= "sheet1") {
@@ -274,7 +275,7 @@
}
/**
- * 鑷姩澶勭悊琛屽悎骞舵暟鎹�
+ * 鍐欏叆excel
*/
fun write2(out: OutputStream, heads: List<Array<Any>>, contents: MutableList<Array<Any>>, sheetName: String = "sheet1") {
--
Gitblit v1.9.3