Commit 0d4b688a by zhangkb

修改导入写入报告的地方

parent 2b84693d
......@@ -69,7 +69,7 @@ public class ImportLog implements Serializable {
public String generateReport() {
int failNum = totalNum - successIds.size();
String firstPart = String.format("总共导入:%s条, 成功条数为:%s, 失败条数为:%s", totalNum, successIds.size(), failNum);
if (failNum >= 0) {
if (failNum > 0) {
firstPart += "<br>";
firstPart += errorMsgSb.toString();
}
......
......@@ -280,10 +280,10 @@ public class TagFileService {
importLog.setHasFailNum(!excelImportResult.getFailList().isEmpty() || hasOtherFail);
importLog.setTotalNum(excelImportResult.getList().size() + excelImportResult.getFailList().size());
importLog.setSuccessIds(successIds);
importLog.setReport(importLog.generateReport());
} catch (Exception e) {
importLog.appendErrorMsg(e.getCause().getMessage());
} finally {
importLog.setReport(importLog.generateReport());
importLog.setEndTime(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
importLog.setHasFinish(true);
mongoOperations.save(importLog);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment