Commit 045a3689 authored by 郑建's avatar 郑建

文件报送手动模式

parent f1ae6c26
......@@ -45,7 +45,7 @@ public class QuantGroupZhuDaiReportToBaiHang {
// @Async
//@Scheduled(cron = "0 0 05 * * ?")
@Scheduled(cron = "0 0 03 * * ?")
// @Scheduled(cron = "0 0 03 * * ?")
public void startZhuDaiReport(){
if(increment()){
redisTemplate.expire(Constant.QG_ZHU_DAI_REPORT_LOCK_KEY, 10, TimeUnit.SECONDS);
......
......@@ -68,7 +68,7 @@ public class RoutineWorkTask {
public String BACKLOG_DELAY_DAY;
@Async
@Scheduled(cron = "0 0 18 * * ?")
// @Scheduled(cron = "0 0 18 * * ?")
public void downloadLog() {
//if (increment(ROUTINE_WORK_BH_LOCK_KEY_1)) {
// redisTemplate.expire(ROUTINE_WORK_BH_LOCK_KEY_1, 10, TimeUnit.SECONDS);
......@@ -160,7 +160,7 @@ public class RoutineWorkTask {
@Async
@Scheduled(cron = "0 10 18 * * ?")
// @Scheduled(cron = "0 10 18 * * ?")
public void sendBaoSong() {
//if (increment(ROUTINE_WORK_BH_LOCK_KEY_2)) {
// redisTemplate.expire(ROUTINE_WORK_BH_LOCK_KEY_2, 10, TimeUnit.SECONDS);
......
......@@ -1579,6 +1579,7 @@ public class BaiHangZhuDaiService {
AtomicInteger atomicInteger = new AtomicInteger();
Stopwatch sendWatch = Stopwatch.createStarted();
List<String> reportList = new ArrayList<>();
reportList.add("#singleLoanAccountInfo");
for (int i = 0; i < loanInfozdList.size(); i++) {
LoanInfoZhuDai loanInfo = loanInfozdList.get(i);
String id = "";
......@@ -1587,9 +1588,9 @@ public class BaiHangZhuDaiService {
List<String> targetRepaymentDayList = loanInfoMapper.findTargetRepaymentDayList(loanInfoReqId);
if (targetRepaymentDayList != null && targetRepaymentDayList.size() > 0) {
loanInfo.setTargetRepayDateList(String.join(",", targetRepaymentDayList));
log.info("比较还款总期数&账单日列表totalTerm=" + loanInfo.getTotalTerm() + ",targetRepaymentDayList size=" + targetRepaymentDayList.size());
// log.info("比较还款总期数&账单日列表totalTerm=" + loanInfo.getTotalTerm() + ",targetRepaymentDayList size=" + targetRepaymentDayList.size());
} else {
log.warn("比较还款总期数&账单日列表totalTerm=" + loanInfo.getTotalTerm() + ",targetRepaymentDayList is null.");
// log.warn("比较还款总期数&账单日列表totalTerm=" + loanInfo.getTotalTerm() + ",targetRepaymentDayList is null.");
}
UUID loanInfoId = UUID.randomUUID();
id = loanInfoId.toString().replaceAll("-", "");
......@@ -1597,7 +1598,7 @@ public class BaiHangZhuDaiService {
LoanInfoZhuDai record = new LoanInfoZhuDai();
BeanUtils.copyProperties(loanInfo, record);
record.setRecordId(id);
loanInfoDbMapper.saveLoanInfoRecordLog(record);
// loanInfoDbMapper.saveLoanInfoRecordLog(record);
} catch (Exception e) {
log.error("量化派助贷TO百行报送-放款申请保存记录失败", e);
}
......@@ -1607,11 +1608,12 @@ public class BaiHangZhuDaiService {
loanInfoVo.setFinTechAgencyBusiness(finTechAgencyBusiness);
loanInfoVo.setReqID(id);
loanInfoVo.setName(interfaceUploadClient(loanInfo.getName()));
loanInfoVo.setPid(interfaceUploadClient(loanInfo.getPid()));
loanInfoVo.setMobile(interfaceUploadClient(loanInfo.getMobile()));
loanInfoVo.setName(tuomin(loanInfo.getName()));
loanInfoVo.setPid(tuomin(loanInfo.getPid()));
loanInfoVo.setMobile(tuomin(loanInfo.getMobile()));
if (DateUtils.parseDate("yyyy-MM-dd'T'hh:mm:ss",loanInfoVo.getIssueDate()).getTime() < DateUtils.parseDate("yyyy-MM-dd'T'hh:mm:ss",loanInfoVo.getAccountOpenDate()).getTime()){
loanInfoVo.setAccountOpenDate(loanInfoVo.getIssueDate());
loanInfoVo.setApplyDate(loanInfoVo.getIssueDate());
}
reportList.add(JSON.toJSONString(loanInfoVo));
// String resultStr = iHttpService.postBaiHang(baiHangLoanInfoUrl, getHeader(), JSON.toJSONString(loanInfoVo));
......@@ -1627,8 +1629,9 @@ public class BaiHangZhuDaiService {
log.error("量化派助贷TO百行报送-放款信息异常, recordId: {} , loanId: {} ", id, loanInfo.getLoanId(), e);
}
}
File file = new File("量子数科科技有限公司_D2_"+endTime.split("T")[0].replaceAll("-","")+"_"+UUID.randomUUID().toString()+".cry");
File file = new File("F:\\9_QFNEW\\baihang-report\\D3\\量子数科科技有限公司_D2_"+endTime.split("T")[0].replaceAll("-","")+"_0002"+".txt");
FileUtils.writeLines(file,reportList);
createFile(file.getName());
log.info("量化派助贷TO百行报送-放款申请完成, 实际大小: {} , 报送成功大小: {} , 耗时: {} ", loanInfozdList.size(), atomicInteger.get(), sendWatch.stop().elapsed(TimeUnit.MILLISECONDS));
} catch (Exception e) {
log.error("量化派助贷TO百行报送-异常", e);
......@@ -1636,8 +1639,9 @@ public class BaiHangZhuDaiService {
} else if ("D3".equalsIgnoreCase(type)) {
//非循环贷款贷后数据信息(D3)
List<String> reportList = new ArrayList<>();
for (int j = 0; j < 2; j++) {
List<String> reportList = new ArrayList<>();
reportList.add("#singleLoanRepayInfo");
Stopwatch sendWatch = Stopwatch.createStarted();
try {
List<RepaymentInfoZhuDai> repaymentLoanInfos = null;
......@@ -1673,9 +1677,9 @@ public class BaiHangZhuDaiService {
}
repaymentLoanInfo.setReqID(id);
repaymentLoanInfo.setPid(interfaceUploadClient(repaymentLoanInfo.getPid()));
repaymentLoanInfo.setName(interfaceUploadClient(repaymentLoanInfo.getName()));
repaymentLoanInfo.setMobile(interfaceUploadClient(repaymentLoanInfo.getMobile()));
repaymentLoanInfo.setName(tuomin(repaymentLoanInfo.getName()));
repaymentLoanInfo.setPid(tuomin(repaymentLoanInfo.getPid()));
repaymentLoanInfo.setMobile(tuomin(repaymentLoanInfo.getMobile()));
// String resultStr = iHttpService.postBaiHang(baiHangRepayMentLoanInfoUrl, getHeader(), JSON.toJSONString(repaymentLoanInfo));
// log.info("助贷还款用户报送结果, param: {} , resultStr: {} ", JSON.toJSONString(repaymentLoanInfo), resultStr);
// if (Objects.isNull(resultStr) || !"success".equalsIgnoreCase(JSON.parseObject(resultStr).getString("status"))) {
......@@ -1698,7 +1702,6 @@ public class BaiHangZhuDaiService {
log.error("量化派助贷TO百行报送-异常 J: {} , 开始时间: {} , 结束时间: {} ", j, starTime, endTime, e);
}
}
} else {
return "其他未知类型type=" + type;
}
......@@ -2452,5 +2455,13 @@ public class BaiHangZhuDaiService {
}
private static String tuomin(String s){
if (StringUtils.isNumeric(s) || s.contains("X") || s.contains("x")){
return s.substring(0,s.length()-4)+"0000";
}else {
return s.substring(0,1)+"零";
}
}
}
......@@ -91,7 +91,7 @@ public class BhFileCreditApiClient {
//设置压缩加密后的文件路径
response.setEncryptFilePath(req.getTargetFilePath());
//设置压缩加密后的文件名
response.setEncryptFileName(srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."))+"-V.cry");
response.setEncryptFileName(srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."))+"-R.cry");
//压缩文件
File encryptFile = new File(response.getEncryptFilePath()+ File.separator +response.getEncryptFileName());
if(encryptFile.exists()){
......
......@@ -38,13 +38,13 @@ public class BaihangReportApplicationTests {
@Test
public void testD2Repost(){
Stopwatch stopwatch = Stopwatch.createStarted();
D3();
D2();
log.info("跑了 {}",stopwatch.elapsed(TimeUnit.MILLISECONDS));
}
//2020-07-01
private void D2(){
String startTime = "2020-06-12",endTime = "2020-07-01";
String startTime = "2020-07-01",endTime = "2020-07-01";
Date startDate;
Date endDate = DateUtils.parseDate("yyyy-MM-dd",endTime);
while (endDate.getTime() < System.currentTimeMillis()){
......@@ -58,7 +58,7 @@ public class BaihangReportApplicationTests {
}
private void D3(){
String startTime = "2020-06-12",endTime = "2020-07-01";
String startTime = "2020-07-01",endTime = "2020-07-01";
Date startDate;
Date endDate = DateUtils.parseDate("yyyy-MM-dd",endTime);
while (endDate.getTime() < System.currentTimeMillis()){
......
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