From a51b72b7da792f8320cf50bb6ecce07574d4b146 Mon Sep 17 00:00:00 2001 From: lijinyu <3023846734@qq.com> Date: Mon, 31 Jul 2023 12:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=AE=A1=E7=90=86=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=8A=9F=E8=83=BD=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ModulexServiceImpl.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java index 520effd..4706413 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java @@ -401,13 +401,14 @@ public class ModulexServiceImpl extends ServiceImpl impl Cell cell = row.getCell(k); if(cell==null){ propertyNames.add(null); + }else { + FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); + DataFormatter formatter = new DataFormatter(); + //单元格不设置数字格式 + cell.setCellStyle(null); + String name = formatter.formatCellValue(cell,evaluator); + propertyNames.add(name); } - FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); - DataFormatter formatter = new DataFormatter(); - //单元格不设置数字格式 - cell.setCellStyle(null); - String name = formatter.formatCellValue(cell,evaluator); - propertyNames.add(name); } if(propertyNames.size()!=18 || !propertyNames.get(0).equals("上级模块名称") || !propertyNames.get(1).equals("项目名称") @@ -442,7 +443,11 @@ public class ModulexServiceImpl extends ServiceImpl impl Cell cell = row.getCell(k); String value=""; if(cell!=null){ - value = cell.getStringCellValue(); + FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); + DataFormatter formatter = new DataFormatter(); + //单元格不设置数字格式 + cell.setCellStyle(null); + value = formatter.formatCellValue(cell,evaluator); } switch (k){ case 0: @@ -504,7 +509,7 @@ public class ModulexServiceImpl extends ServiceImpl impl modulexVo.setVerisonStatus(value); break; case 17: - modulexVo.setVerison(value); + modulexVo.setVerison(value); break; default: message.put("isError", "true");