diff --git a/src/com/platform/service/impl/PreDataInfoServiceImpl.java b/src/com/platform/service/impl/PreDataInfoServiceImpl.java index bb279a1f..078c37fc 100644 --- a/src/com/platform/service/impl/PreDataInfoServiceImpl.java +++ b/src/com/platform/service/impl/PreDataInfoServiceImpl.java @@ -71,8 +71,8 @@ public class PreDataInfoServiceImpl implements IPreDataInfoService { public Map importExcel(List paths) throws Exception { Map errmap = new HashMap(); List errArea = new ArrayList(); - List errFile = new ArrayList(); - ArrayList rowErr = new ArrayList(); + List> errFile = new ArrayList>(); + List> rowErr = new ArrayList>(); // 待增加的 List all2Insert = new ArrayList(); //excel读出的 所有 @@ -89,7 +89,7 @@ public class PreDataInfoServiceImpl implements IPreDataInfoService { XSSFWorkbook workbook = null; File tmpf = new File(filePath + ".temp"); File f = new File(filePath); - String errMsg= "] 读取失败,请使用标准的excel模板,编辑后再导入"; + String errMsg= "读取失败,请使用标准的excel模板,编辑后再导入"; // file.temp 文件存在 if (tmpf.exists()) { //删除 file @@ -98,14 +98,20 @@ public class PreDataInfoServiceImpl implements IPreDataInfoService { } catch (Exception e) { log.error("["+filePath+ errMsg); log.error(e); - errFile.add("["+tmpf.getName()+errMsg); + Map map = new HashMap(); + map.put("name", tmpf.getName()); + map.put("value", errMsg); + errFile.add((HashMap) map); continue; } } else { if (!f.exists()) { log.error(filePath + ",文件 不存在!"); - errFile.add(f.getName()+ ",文件 不存在!"); + Map map = new HashMap(); + map.put("name", f.getName()); + map.put("value", "文件 不存在!"); + errFile.add((HashMap) map); continue; } else { @@ -114,7 +120,10 @@ public class PreDataInfoServiceImpl implements IPreDataInfoService { } catch (Exception e) { log.error("["+filePath+errMsg); log.error(e); - errFile.add("["+f.getName()+errMsg); + Map map = new HashMap(); + map.put("name", f.getName()); + map.put("value", errMsg); + errFile.add((HashMap) map); continue; } } @@ -157,7 +166,7 @@ public class PreDataInfoServiceImpl implements IPreDataInfoService { } if (errFile.size() > 0) { if (errmap.containsKey("err")) { - errFile.addAll((Collection) errmap.get("err")); + errFile.addAll( (Collection>) errmap.get("err")); } errmap.put("err",errFile); }