Commit ab0bc5dc authored by 陈宏杰's avatar 陈宏杰

及时存数据

parent e3b5ee78
......@@ -258,7 +258,6 @@ public class BaiHangFileReportService {
private String reportA1Refuse(String starTime, String endTime){
String encryptFileName = null;
List<ApplyLoanInfoZhuDai> recordList = new ArrayList<>(A1_INITIAL_CAPACITY);
List<ApplyLoanInfoZhuDai> zhuDaiLogList = null,applyLoanInfos = null;
List<String> reportList = new ArrayList<>();
try {
......@@ -281,10 +280,14 @@ public class BaiHangFileReportService {
reqId_log = applyLoanInfo.getReqID();
zhuDaiLogList = applyLoanInfoZhuDaiMapper.findByApplyId(applyLoanInfo.getApplyId());
if (CollectionUtils.isEmpty(zhuDaiLogList)) {
try {
record = new ApplyLoanInfoZhuDai();
BeanUtils.copyProperties(applyLoanInfo, record);
record.setRecordId(UUID.randomUUID().toString().replaceAll("-", ""));
recordList.add(record);
applyLoanInfoZhuDaiMapper.saveApplyLoanInfoZhuDaiLog(record);
} catch (Exception e) {
log.error("量化派助贷TO百行报送(A1Refuse)-贷款申请信息保存记录失败", e);
}
//邮箱有错误的就不传
if (!TuoMinUtils.checkEmail(applyLoanInfo.getEmailAddress())) {
applyLoanInfo.setEmailAddress(null);
......@@ -301,7 +304,6 @@ public class BaiHangFileReportService {
log.error("量化派助贷TO百行报送(A1Refuse)-贷款申请信息异常, reqId_log: {} ", reqId_log, e);
}
}
saveApplyLoanInfoZhuDai(recordList,starTime,endTime);
File file = new File(HOST_PATH+"量子数科科技有限公司_A1Re_"+fileNameReplaceAll(starTime.split("T")[0])+"_"+fileNameReplaceAll(endTime.split("T")[0])+"_"+String.format("%06d",new Random().nextInt(999999))+".txt");
FileUtils.writeLines(file,reportList);
if (reportList.size()<=1) {
......@@ -313,7 +315,7 @@ public class BaiHangFileReportService {
} catch (Exception e) {
log.error("量化派助贷TO百行报送(A1Refuse)-异常", e);
} finally {
clear(applyLoanInfos,recordList,reportList);
clear(applyLoanInfos,reportList);
}
return encryptFileName;
}
......
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