feiyu02
2025-08-14 f373bbf83d9d2a7e5f96118d7dcd658c9fea8bc8
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)}")
                }
            }