Sfoglia il codice sorgente

质检-表单保存 excel根据坐标加载列 为空处理

LHB 5 mesi fa
parent
commit
924a5f7ea2

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -2282,7 +2282,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                             } else {
                                 Row row = sheet.getRow(y1 - 1);
                                 if (row != null) {
-                                    Cell cell = row.getCell(x1 - 1);
+                                    Cell cell = row.getCell(x1 - 1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
                                     if (cell != null || ObjectUtils.isNotEmpty(cell)) {
                                         short fontIndex = cell.getCellStyle().getFontIndex();
                                         Font fontAt = workbook.getFontAt(fontIndex);
@@ -2312,7 +2312,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
                     Row row = sheet.getRow(y1 - 1);
                     if (row != null) {
-                        Cell cell = row.getCell(x1 - 1);
+                        Cell cell = row.getCell(x1 - 1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
                         if (cell != null || ObjectUtils.isNotEmpty(cell)) {
                              // 获取单元格的现有值
                             String existingValue = cell.getStringCellValue();