ReportErrorUtils.java
1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.lhcredit.common.utils;
import com.lhcredit.common.utils.spring.SpringUtils;
import com.lhcredit.project.business.bCreditReport.domain.BCreditReport;
import com.lhcredit.project.business.bCreditReport.mapper.BCreditReportMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.stream.Collectors;
@Component
@RestController
@RequestMapping("/web/reportErrorUtils")
public class ReportErrorUtils {
private static final String splitTag =";" ;
private static final boolean log = false;
public static Logger logger= LoggerFactory.getLogger(ReportErrorUtils.class);
public static void sout(String... errorMsg){
System.out.println(Arrays.stream(errorMsg).collect(Collectors.joining(",")));
}
public static void saveErrorMsg(BCreditReport bAutoReport, String... errorMsg ) {
//TODO
try{
BCreditReportMapper bean = SpringUtils.getBean(BCreditReportMapper.class);
BCreditReport report = bean.selectBCreditReportById(bAutoReport.getId());
String collect = Arrays.stream(errorMsg).collect(Collectors.joining(splitTag));
report.setErrorMsg(report.getErrorMsg()+"!###!"+collect);
bean.updateBCreditReport(report);
}catch (Exception e){
e.printStackTrace();
}
}
}