From b446560ccc97aedde9917db2273c6c6fb8b71acb Mon Sep 17 00:00:00 2001 From: ludc Date: 星期日, 14 一月 2024 17:05:29 +0800 Subject: [PATCH] 277:参照配置界面,关于包含条件,同一个字段具备多个包含条件时,需要重新设置一下界面更改一下后端查询接口 --- 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