Commit 86e05bce by zhangkb

标签元数据导入添加日志打印

parent 82de7a05
...@@ -12,6 +12,8 @@ import java.util.stream.Collectors; ...@@ -12,6 +12,8 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction; import org.springframework.data.domain.Sort.Direction;
...@@ -42,6 +44,8 @@ import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler; ...@@ -42,6 +44,8 @@ import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler;
@Service @Service
public class TagFileService { public class TagFileService {
private Logger logger = LoggerFactory.getLogger(TagFileService.class);
@Autowired @Autowired
private MongoOperations mongoOperations; private MongoOperations mongoOperations;
...@@ -260,7 +264,7 @@ public class TagFileService { ...@@ -260,7 +264,7 @@ public class TagFileService {
importLog.setTotalNum(excelImportResult.getList().size() + excelImportResult.getFailList().size()); importLog.setTotalNum(excelImportResult.getList().size() + excelImportResult.getFailList().size());
importLog.setSuccessIds(successIds); importLog.setSuccessIds(successIds);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.error("异常:",e);
importLog.appendErrorMsg(e.getMessage()); importLog.appendErrorMsg(e.getMessage());
} finally { } finally {
importLog.setReport(importLog.generateReport()); importLog.setReport(importLog.generateReport());
......
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