模块管理导入功能交互

dev^2
lijinyu 1 year ago
parent a63d094450
commit a51b72b7da
  1. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java

@ -401,7 +401,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
Cell cell = row.getCell(k); Cell cell = row.getCell(k);
if(cell==null){ if(cell==null){
propertyNames.add(null); propertyNames.add(null);
} }else {
FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
DataFormatter formatter = new DataFormatter(); DataFormatter formatter = new DataFormatter();
//单元格不设置数字格式 //单元格不设置数字格式
@ -409,6 +409,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
String name = formatter.formatCellValue(cell,evaluator); String name = formatter.formatCellValue(cell,evaluator);
propertyNames.add(name); propertyNames.add(name);
} }
}
if(propertyNames.size()!=18 || !propertyNames.get(0).equals("上级模块名称") if(propertyNames.size()!=18 || !propertyNames.get(0).equals("上级模块名称")
|| !propertyNames.get(1).equals("项目名称") || !propertyNames.get(1).equals("项目名称")
|| !propertyNames.get(2).equals("中文名称") || !propertyNames.get(2).equals("中文名称")
@ -442,7 +443,11 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
Cell cell = row.getCell(k); Cell cell = row.getCell(k);
String value=""; String value="";
if(cell!=null){ 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){ switch (k){
case 0: case 0:

Loading…
Cancel
Save