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

脏数据修复

parent 3c2575d2
......@@ -573,6 +573,8 @@ public class BaiHangFileReportService {
List<RepaymentInfoZhuDai> repaymentLoanInfos = null,recordList = new ArrayList<>(D3_INITIAL_CAPACITY);
List<String> reportList = new ArrayList<>(D3_INITIAL_CAPACITY);
reportList.add("#singleLoanRepayInfo");
//修复数据类型 : 还款状态确认时间取错,导致晚于下一期的还款状态确认时间
List<String> repairDataList_01 = Arrays.asList("AN000000192289736004493312");
Stopwatch sendWatch = Stopwatch.createStarted();
try {
Stopwatch queryStopwatch = Stopwatch.createStarted();
......@@ -583,6 +585,13 @@ public class BaiHangFileReportService {
for (int i = 0; i < repaymentLoanInfos.size(); i++) {
RepaymentInfoZhuDai repaymentLoanInfo = repaymentLoanInfos.get(i);
try {
if (repairDataList_01.contains(repaymentLoanInfo.getLoanId())) {
log.error("量化派助贷TO百行报送(D3)-还款记录处理脏数据: {}",repaymentLoanInfo.getLoanId());
//脏数据特殊处理,不修改业务库数据
Date realRepaymentDate = DateUtils.parseDate("yyyy-MM-dd'T'HH:mm:ss",repaymentLoanInfo.getRealRepaymentDate());
Date statusConfirmAtDate = org.apache.commons.lang3.time.DateUtils.addSeconds(realRepaymentDate,5);
repaymentLoanInfo.setStatusConfirmAt(DateUtils.formatDate(statusConfirmAtDate,"yyyy-MM-dd'T'HH:mm:ss"));
}
id = UUID.randomUUID().toString().replaceAll("-", "");
RepaymentInfoZhuDai record = new RepaymentInfoZhuDai();
BeanUtils.copyProperties(repaymentLoanInfo, record);
......
......@@ -1000,8 +1000,8 @@
left join xyqb.loan_account_ext c on a.loan_application_history_id=c.loan_id
left join xyqb.apply_quota_record d on c.order_no=d.order_no
left join (select a.loan_application_history_id,a.term_no
,sum(if(((a.repayment_status !=3 and (c.repayment_received_at is null or DATE_FORMAT(c.repayment_received_at,'%Y-%m-%d') = '2000-01-01')) or (a.repayment_status =3 and a.deadline &lt;= c.repayment_received_at)),if(b.loan_paid_at>='2018-01-01',g.principal+g.interest+g.service_fee,h.principle+h.interest+h.service_fee_per_term),0)) yqze
,min(if(((a.repayment_status !=3 and (c.repayment_received_at is null or DATE_FORMAT(c.repayment_received_at,'%Y-%m-%d') = '2000-01-01')) or (a.repayment_status =3 and a.deadline &lt;= c.repayment_received_at)),c.deadline,null)) min_deadline
,sum(if(((a.repayment_status !=3 and (c.repayment_received_at is null or DATE_FORMAT(c.repayment_received_at,'%Y-%m-%d') = '2000-01-01' or a.deadline &lt;= c.repayment_received_at)) or (a.repayment_status =3 and a.deadline &lt;= c.repayment_received_at)),if(b.loan_paid_at>='2018-01-01',g.principal+g.interest+g.service_fee,h.principle+h.interest+h.service_fee_per_term),0)) yqze
,min(if(((a.repayment_status !=3 and (c.repayment_received_at is null or DATE_FORMAT(c.repayment_received_at,'%Y-%m-%d') = '2000-01-01' or a.deadline &lt;= c.repayment_received_at)) or (a.repayment_status =3 and a.deadline &lt;= c.repayment_received_at)),c.deadline,null)) min_deadline
from xyqb.repayment_plan a
left join xyqb.loan_application_manifest_history b
on a.loan_application_history_id=b.loan_application_history_id and b.loan_paid_at >= #{startTime,jdbcType=VARCHAR} and b.loan_paid_at &lt; #{endTime,jdbcType=VARCHAR}
......
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