From 1bcc66b7b44825fbc68ab7aa158f28e4fff74569 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 21 十一月 2023 09:49:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/poi/util/ExcelUtil.java |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/poi/util/ExcelUtil.java b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/poi/util/ExcelUtil.java
index 7272b62..2540662 100644
--- a/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/poi/util/ExcelUtil.java
+++ b/Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/poi/util/ExcelUtil.java
@@ -524,6 +524,7 @@
 				if (ed.isMerged() && (ed.getRowTo() > ed.getRow() || ed.getColTo() > ed.getCol())) {
 					mergedDataList.add(ed);
 				}
+				// TODO: 淇敼缂栧彿鍒椾负鏂囨湰
 				if("id".equalsIgnoreCase(ed.getObjCode())){
 					//CellStyle textStyle = workbook.createCellStyle();
 					HSSFDataFormat format = (HSSFDataFormat)sheet.getWorkbook().createDataFormat();
@@ -942,7 +943,7 @@
 
 									Map<Integer, String> rowDataMap = new HashMap();
 
-									for(int columnIndex = 0; columnIndex < rowDataSet.getLastCellNum(); ++columnIndex) {
+									for(int columnIndex = 0; columnIndex < sheetDataSet.getColName().size(); ++columnIndex) {
 										Cell cell = rowDataSet.getCell(columnIndex);
 										Object value = getCellValue(cell, evaluator);
 										String title = colsNameIndexMap.containsKey(columnIndex) ? (String)colsNameIndexMap.get(columnIndex) : "";
@@ -1024,14 +1025,17 @@
 											} else {
 												rowDataMap.put(columnIndex, VciBaseUtil.getStringValueFromObject(value));
 											}
-										} else if (!isDataSet && thisField != null && excelColumn != null) {
-											if (!excelColumn.nullable()) {
-												throw new VciBaseException("cellValueCanNotNull", new String[]{title, rowIndex + 1 + ""});
-											}
+										} else {
+											if (!isDataSet && thisField != null && excelColumn != null) {
+												if (!excelColumn.nullable()) {
+													throw new VciBaseException("cellValueCanNotNull", new String[]{title, rowIndex + 1 + ""});
+												}
 
-											if (StringUtil.isNotBlank(excelColumn.regExg())) {
-												throw new VciBaseException("cellValueCanNotNullForReg", new String[]{title, rowIndex + 1 + ""});
+												if (StringUtil.isNotBlank(excelColumn.regExg())) {
+													throw new VciBaseException("cellValueCanNotNullForReg", new String[]{title, rowIndex + 1 + ""});
+												}
 											}
+											rowDataMap.put(columnIndex, VciBaseUtil.getStringValueFromObject(value));
 										}
 									}
 

--
Gitblit v1.9.3