diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index f283ac5487..0b554c980e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -918,12 +918,21 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res * @throws IOException */ public void downLoadResults(HttpServletResponse response) throws IOException { - //public static final ThreadLocal>> errorRows = new ThreadLocal<>(); String fileName; - if (errorRows.get() == null || errorRows.get().size() == 0) { - fileName = "导入成功.xls"; - } else { + + // 判断是否有错误信息,以确定文件名 + boolean hasError = false; + Map> tableAndErrorRows = errorRows.get(); + for (Map.Entry> entry:tableAndErrorRows.entrySet()) { + if (entry.getValue().size() != 0) { + hasError = true; + } + } + + if (hasError) { fileName = "导入失败条目清单.xls"; + } else { + fileName = "导入成功.xls"; } response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); response.setHeader("content-Type", "application/vnd.ms-excel");