Commit 0c7340ab authored by 郝彦辉's avatar 郝彦辉

非联合贷-实时数据报送sql修改

parent c78fdc51
package cn.quantgroup.report.domain.baihang;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 放款用户信息
*
* @Author fengjunkai
* @Date 2019-03-26 14:49
*/
@Data
public class LoanInfo implements Serializable {
private static final long serialVersionUID = 7293591774673907983L;
private String reqID; //记录唯一ID
private String recordId;
private String opCode; //操作代码A-增加 M-修改
private String uploadTs; //记录生成时间 ISO 8601格式 LocalDateTime生成
private String name; //姓名
private String pid; //身份证好
private String mobile; //手机号
private String loanId; //贷款编号
private int guaranteeType; //贷款担保类型
private int loanPurpose; //借款用途
private String applyDate;// 贷款申请时间
private String accountOpenDate; //账户开立时间
private String issueDate; //贷款放款时间
private String dueDate; //贷款到期日期 YYYY-MM-DD
private BigDecimal loanAmount; //贷款金额
private int totalTerm; //还款总期数
private int targetRepayDateType; //账单日类型
private int termPeriod;//每期还款周期
private String firstRepaymentDate; //首次应还款日期 YYYY-MM-DD
private int gracePeriod; //宽限日
private String targetRepayDateList; //账单日列表
}
...@@ -44,4 +44,6 @@ public class LoanInfoZhuDai extends FinTechAgencyBusinessZhuDai implements Seria ...@@ -44,4 +44,6 @@ public class LoanInfoZhuDai extends FinTechAgencyBusinessZhuDai implements Seria
private String targetRepayDateList; //账单日列表 private String targetRepayDateList; //账单日列表
private String recordId;
} }
...@@ -38,5 +38,7 @@ public class RepaymentInfoZhuDai implements Serializable { ...@@ -38,5 +38,7 @@ public class RepaymentInfoZhuDai implements Serializable {
//businessOrgCreditCode 业务发生机构代码string Y/N //businessOrgCreditCode 业务发生机构代码string Y/N
private String recordId;
} }
package cn.quantgroup.report.domain.baihang;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 还款用户信息
*
* @Author fengjunkai
* @Date 2019-03-26 15:13
*/
@Data
public class RepaymentLoanInfo implements Serializable {
private static final long serialVersionUID = 8722959335665582382L;
private String reqID; //记录唯一标示
private String recordId;
private String opCode; //操作CODE a-增加 m-修改
private String uploadTs; //记录生成时间 ISO 8601
private String loanId; //贷款ID
private String name;
private String pid;
private String mobile;
private int termNo; //当前还款期数
private String termStatus; //本期还款状态
private String targetRepaymentDate; //本期应还款日 YYYY-MM-DD
private String realRepaymentDate; //实际还款日期ISO 8601
private BigDecimal plannedPayment; //本期计划应还款金额
private BigDecimal targetRepayment; //本期剩余应还款金额
private BigDecimal realRepayment; // 本次还款金额
private String overdueStatus; //当前逾期天数
private String statusConfirmAt;//本期还款状态确认时间
private BigDecimal overdueAmount; //当前逾期总金额
private BigDecimal remainingAmount; //贷款余额
private int loanStatus; //本笔贷款状态
}
...@@ -2,7 +2,6 @@ package cn.quantgroup.report.mapper.baihang; ...@@ -2,7 +2,6 @@ package cn.quantgroup.report.mapper.baihang;
import cn.quantgroup.report.domain.baihang.BaiHangTimeRecord; import cn.quantgroup.report.domain.baihang.BaiHangTimeRecord;
import cn.quantgroup.report.domain.baihang.LoanInfoVo; import cn.quantgroup.report.domain.baihang.LoanInfoVo;
import cn.quantgroup.report.domain.baihang.LoanInfo;
import cn.quantgroup.report.domain.baihang.LoanInfoZhuDai; import cn.quantgroup.report.domain.baihang.LoanInfoZhuDai;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -18,13 +17,13 @@ import java.util.List; ...@@ -18,13 +17,13 @@ import java.util.List;
public interface LoanInfoMapper { public interface LoanInfoMapper {
//报送实时放款数据(百行征信报送) //报送实时放款数据(百行征信报送)
List<LoanInfo> findLoanInfo(); List<LoanInfoZhuDai> findLoanInfo();
List<LoanInfo> findLoanInfoByTime(BaiHangTimeRecord baiHangTimeRecord); List<LoanInfoZhuDai> findLoanInfoByTime(BaiHangTimeRecord baiHangTimeRecord);
//根据loan_application_history_id查询最晚还款日 //根据loan_application_history_id查询最晚还款日
List<String> findTargetRepaymentDayList(String reqId); List<String> findTargetRepaymentDayList(String reqId);
List<LoanInfo> stockLoanInfo(); List<LoanInfoZhuDai> stockLoanInfo();
/** /**
......
package cn.quantgroup.report.mapper.baihang; package cn.quantgroup.report.mapper.baihang;
import cn.quantgroup.report.domain.baihang.*; import cn.quantgroup.report.domain.baihang.BaiHangName;
import cn.quantgroup.report.domain.baihang.BaiHangNameResult;
import cn.quantgroup.report.domain.baihang.BaiHangTimeRecord;
import cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
...@@ -15,13 +18,13 @@ import java.util.List; ...@@ -15,13 +18,13 @@ import java.util.List;
public interface RepaymentLoanInfoMapper { public interface RepaymentLoanInfoMapper {
//实时还款(百行征信报送) //实时还款(百行征信报送)
List<RepaymentLoanInfo> findRepayMentLoanInfo(BaiHangTimeRecord baiHangTimeRecord); List<RepaymentInfoZhuDai> findRepayMentLoanInfo(BaiHangTimeRecord baiHangTimeRecord);
//实时逾期还款(百行征信报送) //实时逾期还款(百行征信报送)
List<RepaymentLoanInfo> findRepayMentLoanInfoOverdue(BaiHangTimeRecord baiHangTimeRecord); List<RepaymentInfoZhuDai> findRepayMentLoanInfoOverdue(BaiHangTimeRecord baiHangTimeRecord);
List<RepaymentLoanInfo> findStockRepayMentLoanInfo(BaiHangTimeRecord baiHangTimeRecord); List<RepaymentInfoZhuDai> findStockRepayMentLoanInfo(BaiHangTimeRecord baiHangTimeRecord);
List<RepaymentLoanInfo> findStockRepayMentLoanInfoOverdue(BaiHangTimeRecord baiHangTimeRecord); List<RepaymentInfoZhuDai> findStockRepayMentLoanInfoOverdue(BaiHangTimeRecord baiHangTimeRecord);
BaiHangNameResult findName(BaiHangName baiHangName); BaiHangNameResult findName(BaiHangName baiHangName);
......
package cn.quantgroup.report.mapper.master; package cn.quantgroup.report.mapper.master;
import cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord; import cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord;
import cn.quantgroup.report.domain.baihang.LoanInfo; import cn.quantgroup.report.domain.baihang.LoanInfoZhuDai;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
...@@ -15,8 +15,8 @@ import java.util.List; ...@@ -15,8 +15,8 @@ import java.util.List;
@Repository @Repository
public interface LoanInfoDbMapper { public interface LoanInfoDbMapper {
void saveLoanInfoRecordLog(LoanInfo loanInfo); void saveLoanInfoRecordLog(LoanInfoZhuDai loanInfo);
List<LoanInfo> findAll(); List<LoanInfoZhuDai> findAll();
void updateCurrentRecordEnableFalce(BaiHangUpDateRecord baiHangUpDateRecord); void updateCurrentRecordEnableFalce(BaiHangUpDateRecord baiHangUpDateRecord);
} }
...@@ -2,7 +2,7 @@ package cn.quantgroup.report.mapper.master; ...@@ -2,7 +2,7 @@ package cn.quantgroup.report.mapper.master;
import cn.quantgroup.report.domain.baihang.BaiHangRepayment; import cn.quantgroup.report.domain.baihang.BaiHangRepayment;
import cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord; import cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord;
import cn.quantgroup.report.domain.baihang.RepaymentLoanInfo; import cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai;
import cn.quantgroup.report.domain.baihang.RepaymentLoanInfoVo; import cn.quantgroup.report.domain.baihang.RepaymentLoanInfoVo;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -17,13 +17,13 @@ import java.util.List; ...@@ -17,13 +17,13 @@ import java.util.List;
@Repository @Repository
public interface RepaymentLoanInfoDbMapper { public interface RepaymentLoanInfoDbMapper {
void saveRepaymentLoanInfoLog(RepaymentLoanInfo repaymentLoanInfo); void saveRepaymentLoanInfoLog(RepaymentInfoZhuDai repaymentLoanInfo);
List<RepaymentLoanInfo> findAll(); List<RepaymentInfoZhuDai> findAll();
void updateCurrentRecordEnableFalse(BaiHangUpDateRecord baiHangUpDateRecord); void updateCurrentRecordEnableFalse(BaiHangUpDateRecord baiHangUpDateRecord);
RepaymentLoanInfo findLastOne(BaiHangRepayment baiHangRepayment); RepaymentInfoZhuDai findLastOne(BaiHangRepayment baiHangRepayment);
/** /**
......
...@@ -130,7 +130,7 @@ public class BaiHangService { ...@@ -130,7 +130,7 @@ public class BaiHangService {
*/ */
public void sendLoaInfoReportToBaiHang() { public void sendLoaInfoReportToBaiHang() {
AtomicInteger atomicInteger = new AtomicInteger(); AtomicInteger atomicInteger = new AtomicInteger();
List<LoanInfo> loanInfos = new ArrayList<>(); List<LoanInfoZhuDai> loanInfos = new ArrayList<>();
Stopwatch sendWatch = Stopwatch.createStarted(); Stopwatch sendWatch = Stopwatch.createStarted();
try{ try{
Stopwatch queryWatch = Stopwatch.createStarted(); Stopwatch queryWatch = Stopwatch.createStarted();
...@@ -138,7 +138,7 @@ public class BaiHangService { ...@@ -138,7 +138,7 @@ public class BaiHangService {
log.info("广达小贷TO百行放款申请报送开始, 大小: {} , 耗时: {} ", loanInfos.size(), queryWatch.stop().elapsed(TimeUnit.MILLISECONDS)); log.info("广达小贷TO百行放款申请报送开始, 大小: {} , 耗时: {} ", loanInfos.size(), queryWatch.stop().elapsed(TimeUnit.MILLISECONDS));
for (int i = 0; i < loanInfos.size(); i++) { for (int i = 0; i < loanInfos.size(); i++) {
LoanInfo loanInfo = loanInfos.get(i); LoanInfoZhuDai loanInfo = loanInfos.get(i);
String id = ""; String id = "";
try { try {
String loanInfoReqId = loanInfo.getReqID(); String loanInfoReqId = loanInfo.getReqID();
...@@ -188,7 +188,7 @@ public class BaiHangService { ...@@ -188,7 +188,7 @@ public class BaiHangService {
Stopwatch sendWatch = Stopwatch.createStarted(); Stopwatch sendWatch = Stopwatch.createStarted();
try { try {
List<RepaymentLoanInfo> repaymentLoanInfos = null; List<RepaymentInfoZhuDai> repaymentLoanInfos = null;
if (j == 0) { if (j == 0) {
Stopwatch realTimeStopWatch = Stopwatch.createStarted(); Stopwatch realTimeStopWatch = Stopwatch.createStarted();
repaymentLoanInfos = repaymentLoanInfoMapper.findRepayMentLoanInfo(BaiHangTimeRecord.builder().startTime(startTime).endTime(endTime).build()); repaymentLoanInfos = repaymentLoanInfoMapper.findRepayMentLoanInfo(BaiHangTimeRecord.builder().startTime(startTime).endTime(endTime).build());
...@@ -202,10 +202,10 @@ public class BaiHangService { ...@@ -202,10 +202,10 @@ public class BaiHangService {
AtomicInteger atomicInteger = new AtomicInteger(); AtomicInteger atomicInteger = new AtomicInteger();
for (int i = 0; i < repaymentLoanInfos.size(); i++) { for (int i = 0; i < repaymentLoanInfos.size(); i++) {
RepaymentLoanInfo repaymentLoanInfo = repaymentLoanInfos.get(i); RepaymentInfoZhuDai repaymentLoanInfo = repaymentLoanInfos.get(i);
String id = ""; String id = "";
try { try {
RepaymentLoanInfo repaymentLoanInfo1 = repaymentLoanInfoDbMapper.findLastOne(BaiHangRepayment.builder().loanId(repaymentLoanInfo.getLoanId()).termNo(repaymentLoanInfo.getTermNo()).build()); RepaymentInfoZhuDai repaymentLoanInfo1 = repaymentLoanInfoDbMapper.findLastOne(BaiHangRepayment.builder().loanId(repaymentLoanInfo.getLoanId()).termNo(repaymentLoanInfo.getTermNo()).build());
if (j > 0 && Objects.nonNull(repaymentLoanInfo1)) { if (j > 0 && Objects.nonNull(repaymentLoanInfo1)) {
log.info("广达小贷TO百行征信报送实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} ", startTime, endTime, JSON.toJSONString(repaymentLoanInfo1)); log.info("广达小贷TO百行征信报送实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} ", startTime, endTime, JSON.toJSONString(repaymentLoanInfo1));
continue; continue;
...@@ -252,7 +252,7 @@ public class BaiHangService { ...@@ -252,7 +252,7 @@ public class BaiHangService {
log.info("百行征信报送放款数据, {}", JSON.toJSONString(handLoanInfos)); log.info("百行征信报送放款数据, {}", JSON.toJSONString(handLoanInfos));
for(int i=0;i<handLoanInfos.size();i++){ for(int i=0;i<handLoanInfos.size();i++){
LoanInfo loanInfo = new Gson().fromJson(handLoanInfos.get(i), new TypeToken<LoanInfo>(){}.getType()); LoanInfoZhuDai loanInfo = new Gson().fromJson(handLoanInfos.get(i), new TypeToken<LoanInfoZhuDai>(){}.getType());
log.info("百行征信报送放款数据单个数据, {}", JSON.toJSONString(loanInfo)); log.info("百行征信报送放款数据单个数据, {}", JSON.toJSONString(loanInfo));
String loanInfoReqId = loanInfo.getReqID(); String loanInfoReqId = loanInfo.getReqID();
...@@ -282,7 +282,7 @@ public class BaiHangService { ...@@ -282,7 +282,7 @@ public class BaiHangService {
List<String> repaymentLoanInfos = FileUtils.readLines(new File(baihangHandD3DataUrl), "utf-8"); List<String> repaymentLoanInfos = FileUtils.readLines(new File(baihangHandD3DataUrl), "utf-8");
log.info("百行征信报送还款数据, {}", JSON.toJSONString(repaymentLoanInfos)); log.info("百行征信报送还款数据, {}", JSON.toJSONString(repaymentLoanInfos));
for(int i=0;i<repaymentLoanInfos.size();i++){ for(int i=0;i<repaymentLoanInfos.size();i++){
RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(repaymentLoanInfos.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType()); RepaymentInfoZhuDai repaymentLoanInfo = new Gson().fromJson(repaymentLoanInfos.get(i), new TypeToken<RepaymentInfoZhuDai>(){}.getType());
log.info("百行征信报送还款数据单个数据, {}", JSON.toJSONString(repaymentLoanInfo)); log.info("百行征信报送还款数据单个数据, {}", JSON.toJSONString(repaymentLoanInfo));
try { try {
repaymentLoanInfoDbMapper.saveRepaymentLoanInfoLog(repaymentLoanInfo); repaymentLoanInfoDbMapper.saveRepaymentLoanInfoLog(repaymentLoanInfo);
...@@ -328,9 +328,9 @@ public class BaiHangService { ...@@ -328,9 +328,9 @@ public class BaiHangService {
//http 存量放款数据报送 //http 存量放款数据报送
public void stockLoanInfo() { public void stockLoanInfo() {
List<LoanInfo> loanInfos = loanInfoMapper.stockLoanInfo(); List<LoanInfoZhuDai> loanInfos = loanInfoMapper.stockLoanInfo();
for (int i = 0; i < loanInfos.size(); i++) { for (int i = 0; i < loanInfos.size(); i++) {
LoanInfo loanInfo = loanInfos.get(i); LoanInfoZhuDai loanInfo = loanInfos.get(i);
String id = ""; String id = "";
try { try {
String loanInfoReqId = loanInfo.getReqID(); String loanInfoReqId = loanInfo.getReqID();
...@@ -360,7 +360,7 @@ public class BaiHangService { ...@@ -360,7 +360,7 @@ public class BaiHangService {
if (erlyDate.plusDays(counter + 1).compareTo(endDate) >= 0) { if (erlyDate.plusDays(counter + 1).compareTo(endDate) >= 0) {
break; break;
} }
List<RepaymentLoanInfo> repaymentLoanInfos = new ArrayList<>(); List<RepaymentInfoZhuDai> repaymentLoanInfos = new ArrayList<>();
String starTime = erlyDate.plusDays(counter).format(DateTimeFormatter.ISO_DATE); String starTime = erlyDate.plusDays(counter).format(DateTimeFormatter.ISO_DATE);
String endTime = erlyDate.plusDays(counter + 1).format(DateTimeFormatter.ISO_DATE); String endTime = erlyDate.plusDays(counter + 1).format(DateTimeFormatter.ISO_DATE);
log.info("整理startTime: {} , endTime: {} ", starTime, endTime); log.info("整理startTime: {} , endTime: {} ", starTime, endTime);
...@@ -377,7 +377,7 @@ public class BaiHangService { ...@@ -377,7 +377,7 @@ public class BaiHangService {
log.info("查询逾期还款 startTime: {} , endTime: {} , 大小: {} , 耗时: {} ", starTime, endTime, repaymentLoanInfos.size(), stopwatch.stop().elapsed(TimeUnit.MILLISECONDS)); log.info("查询逾期还款 startTime: {} , endTime: {} , 大小: {} , 耗时: {} ", starTime, endTime, repaymentLoanInfos.size(), stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
} }
for (int j = 0; j < repaymentLoanInfos.size(); j++) { for (int j = 0; j < repaymentLoanInfos.size(); j++) {
RepaymentLoanInfo repaymentLoanInfo = repaymentLoanInfos.get(j); RepaymentInfoZhuDai repaymentLoanInfo = repaymentLoanInfos.get(j);
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190508/baihang_source_d3.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true); // FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190508/baihang_source_d3.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// FileUtils.write(new File("/vpants/shaun/risk-datasource/鹰潭市信江广达小额贷款股份有限公司_D3_2019050805310101_0001.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true); // FileUtils.write(new File("/vpants/shaun/risk-datasource/鹰潭市信江广达小额贷款股份有限公司_D3_2019050805310101_0001.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190529/xinjiangguangda_D3_2019052910580303_0001.txt"), JSON.toJSONString(repaymentLoanInfo) + "\r\n", true); FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190529/xinjiangguangda_D3_2019052910580303_0001.txt"), JSON.toJSONString(repaymentLoanInfo) + "\r\n", true);
......
...@@ -26,7 +26,7 @@ public class ReSendBaiHangService extends BaiHangService { ...@@ -26,7 +26,7 @@ public class ReSendBaiHangService extends BaiHangService {
*/ */
public void sendLoaInfoReportToBaiHang(String startTime, String endTime) { public void sendLoaInfoReportToBaiHang(String startTime, String endTime) {
AtomicInteger atomicInteger = new AtomicInteger(); AtomicInteger atomicInteger = new AtomicInteger();
List<LoanInfo> loanInfos = new ArrayList<>(); List<LoanInfoZhuDai> loanInfos = new ArrayList<>();
Stopwatch sendWatch = Stopwatch.createStarted(); Stopwatch sendWatch = Stopwatch.createStarted();
try{ try{
Stopwatch queryWatch = Stopwatch.createStarted(); Stopwatch queryWatch = Stopwatch.createStarted();
...@@ -34,7 +34,7 @@ public class ReSendBaiHangService extends BaiHangService { ...@@ -34,7 +34,7 @@ public class ReSendBaiHangService extends BaiHangService {
log.info("广达小贷TO百行放款申请报送开始, 大小: {} , 耗时: {} ", loanInfos.size(), queryWatch.stop().elapsed(TimeUnit.MILLISECONDS)); log.info("广达小贷TO百行放款申请报送开始, 大小: {} , 耗时: {} ", loanInfos.size(), queryWatch.stop().elapsed(TimeUnit.MILLISECONDS));
for (int i = 0; i < loanInfos.size(); i++) { for (int i = 0; i < loanInfos.size(); i++) {
LoanInfo loanInfo = loanInfos.get(i); LoanInfoZhuDai loanInfo = loanInfos.get(i);
String id = ""; String id = "";
try { try {
String loanInfoReqId = loanInfo.getReqID(); String loanInfoReqId = loanInfo.getReqID();
...@@ -78,7 +78,7 @@ public class ReSendBaiHangService extends BaiHangService { ...@@ -78,7 +78,7 @@ public class ReSendBaiHangService extends BaiHangService {
Stopwatch sendWatch = Stopwatch.createStarted(); Stopwatch sendWatch = Stopwatch.createStarted();
try { try {
List<RepaymentLoanInfo> repaymentLoanInfos = null; List<RepaymentInfoZhuDai> repaymentLoanInfos = null;
if (j == 0) { if (j == 0) {
Stopwatch realTimeStopWatch = Stopwatch.createStarted(); Stopwatch realTimeStopWatch = Stopwatch.createStarted();
repaymentLoanInfos = repaymentLoanInfoMapper.findRepayMentLoanInfo(BaiHangTimeRecord.builder().startTime(startTime).endTime(endTime).build()); repaymentLoanInfos = repaymentLoanInfoMapper.findRepayMentLoanInfo(BaiHangTimeRecord.builder().startTime(startTime).endTime(endTime).build());
...@@ -92,10 +92,10 @@ public class ReSendBaiHangService extends BaiHangService { ...@@ -92,10 +92,10 @@ public class ReSendBaiHangService extends BaiHangService {
AtomicInteger atomicInteger = new AtomicInteger(); AtomicInteger atomicInteger = new AtomicInteger();
for (int i = 0; i < repaymentLoanInfos.size(); i++) { for (int i = 0; i < repaymentLoanInfos.size(); i++) {
RepaymentLoanInfo repaymentLoanInfo = repaymentLoanInfos.get(i); RepaymentInfoZhuDai repaymentLoanInfo = repaymentLoanInfos.get(i);
String id = ""; String id = "";
try { try {
RepaymentLoanInfo repaymentLoanInfo1 = repaymentLoanInfoDbMapper.findLastOne(BaiHangRepayment.builder().loanId(repaymentLoanInfo.getLoanId()).termNo(repaymentLoanInfo.getTermNo()).build()); RepaymentInfoZhuDai repaymentLoanInfo1 = repaymentLoanInfoDbMapper.findLastOne(BaiHangRepayment.builder().loanId(repaymentLoanInfo.getLoanId()).termNo(repaymentLoanInfo.getTermNo()).build());
if (j > 0 && Objects.nonNull(repaymentLoanInfo1)) { if (j > 0 && Objects.nonNull(repaymentLoanInfo1)) {
log.info("广达小贷TO百行征信报送实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} ", startTime, endTime, JSON.toJSONString(repaymentLoanInfo1)); log.info("广达小贷TO百行征信报送实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} ", startTime, endTime, JSON.toJSONString(repaymentLoanInfo1));
continue; continue;
......
...@@ -648,8 +648,8 @@ public class ManualToolService implements CommonSuperService { ...@@ -648,8 +648,8 @@ public class ManualToolService implements CommonSuperService {
//修改D3中的reqID //修改D3中的reqID
/* DateFormat df_uploadTs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); DateFormat df_uploadTs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
int rr = 1009822900; int rr = 1009823900;
List<String> lineList = ReadOrWriteTxt.readTxtList("C:\\Users\\Administrator\\Desktop\\测试\\文件测试\\build\\tmp3.txt"); List<String> lineList = ReadOrWriteTxt.readTxtList("C:\\Users\\Administrator\\Desktop\\测试\\文件测试\\build\\tmp3.txt");
for(int i=0;i<lineList.size();i++){ for(int i=0;i<lineList.size();i++){
RepaymentInfoZhuDai repaymentLoanInfo = new Gson().fromJson(lineList.get(i), new TypeToken<RepaymentInfoZhuDai>(){}.getType()); RepaymentInfoZhuDai repaymentLoanInfo = new Gson().fromJson(lineList.get(i), new TypeToken<RepaymentInfoZhuDai>(){}.getType());
...@@ -657,21 +657,21 @@ public class ManualToolService implements CommonSuperService { ...@@ -657,21 +657,21 @@ public class ManualToolService implements CommonSuperService {
rr++; rr++;
String uploadTs = df_uploadTs.format(new Date()); String uploadTs = df_uploadTs.format(new Date());
repaymentLoanInfo.setReqID(rr+""); repaymentLoanInfo.setReqID(rr+"");
repaymentLoanInfo.setUploadTs(uploadTs.replace(" ","T")); //repaymentLoanInfo.setUploadTs(uploadTs.replace(" ","T"));
System.out.println(JSON.toJSONString(repaymentLoanInfo)); System.out.println(JSON.toJSONString(repaymentLoanInfo));
} }
System.err.println(rr);*/ System.err.println(rr);
//将D2中FinTechAgencyBusinessZhuDai变成树形结构 //将D2中FinTechAgencyBusinessZhuDai变成树形结构
List<String> lineD2List = ReadOrWriteTxt.readTxtList("C:\\Users\\Administrator\\Desktop\\测试\\文件测试\\build\\tmp2.txt"); /* List<String> lineD2List = ReadOrWriteTxt.readTxtList("C:\\Users\\Administrator\\Desktop\\测试\\文件测试\\build\\tmp2.txt");
for(int i=0;i<lineD2List.size();i++){ for(int i=0;i<lineD2List.size();i++){
LoanInfoZhuDaiVo loanInfo = JSONObject.parseObject(lineD2List.get(i), LoanInfoZhuDaiVo.class); LoanInfoZhuDaiVo loanInfo = JSONObject.parseObject(lineD2List.get(i), LoanInfoZhuDaiVo.class);
FinTechAgencyBusinessZhuDai finTechAgencyBusiness = JSONObject.parseObject(lineD2List.get(i), FinTechAgencyBusinessZhuDai.class); FinTechAgencyBusinessZhuDai finTechAgencyBusiness = JSONObject.parseObject(lineD2List.get(i), FinTechAgencyBusinessZhuDai.class);
loanInfo.setFinTechAgencyBusiness(finTechAgencyBusiness); loanInfo.setFinTechAgencyBusiness(finTechAgencyBusiness);
System.out.println(JSON.toJSONString(loanInfo)); System.out.println(JSON.toJSONString(loanInfo));
} }
System.err.println("build D2 finTechAgencyBusiness end."); System.err.println("build D2 finTechAgencyBusiness end.");*/
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="cn.quantgroup.report.mapper.baihang.LoanInfoMapper"> <mapper namespace="cn.quantgroup.report.mapper.baihang.LoanInfoMapper">
<resultMap id="LoanInfoResultMap" type="cn.quantgroup.report.domain.baihang.LoanInfo"> <resultMap id="LoanInfoResultMap" type="cn.quantgroup.report.domain.baihang.LoanInfoVo">
<result column="reqID" jdbcType="VARCHAR" property="reqID"/> <result column="reqID" jdbcType="VARCHAR" property="reqID"/>
<result column="opCode" jdbcType="VARCHAR" property="opCode"/> <result column="opCode" jdbcType="VARCHAR" property="opCode"/>
<result column="uploadTs" jdbcType="VARCHAR" property="uploadTs"/> <result column="uploadTs" jdbcType="VARCHAR" property="uploadTs"/>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!--实时逾期还款(百行征信报送)--> <!--实时逾期还款(百行征信报送)-->
<select id="findRepayMentLoanInfoOverdue" <select id="findRepayMentLoanInfoOverdue"
parameterType="cn.quantgroup.report.domain.baihang.BaiHangTimeRecord" parameterType="cn.quantgroup.report.domain.baihang.BaiHangTimeRecord"
resultType="cn.quantgroup.report.domain.baihang.RepaymentLoanInfo"> resultType="cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai">
select select
a.id reqID a.id reqID
,'A' opCode ,'A' opCode
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<!--实时还款(百行征信报送)--> <!--实时还款(百行征信报送)-->
<select id="findRepayMentLoanInfo" parameterType="cn.quantgroup.report.domain.baihang.BaiHangTimeRecord" <select id="findRepayMentLoanInfo" parameterType="cn.quantgroup.report.domain.baihang.BaiHangTimeRecord"
resultType="cn.quantgroup.report.domain.baihang.RepaymentLoanInfo"> resultType="cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai">
select select
a.id reqID a.id reqID
,'A' opCode ,'A' opCode
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="cn.quantgroup.report.mapper.master.LoanInfoDbMapper"> <mapper namespace="cn.quantgroup.report.mapper.master.LoanInfoDbMapper">
<resultMap id="LoanInfoResultMap" type="cn.quantgroup.report.domain.baihang.LoanInfo"> <resultMap id="LoanInfoResultMap" type="cn.quantgroup.report.domain.baihang.LoanInfoZhuDai">
<result column="recordId" jdbcType="VARCHAR" property="record_id"/> <result column="recordId" jdbcType="VARCHAR" property="record_id"/>
<result column="reqID" jdbcType="VARCHAR" property="req_id"/> <result column="reqID" jdbcType="VARCHAR" property="req_id"/>
<result column="opCode" jdbcType="VARCHAR" property="op_Code"/> <result column="opCode" jdbcType="VARCHAR" property="op_Code"/>
...@@ -26,19 +26,27 @@ ...@@ -26,19 +26,27 @@
<result column="gracePeriod" jdbcType="INTEGER" property="grace_period"/> <result column="gracePeriod" jdbcType="INTEGER" property="grace_period"/>
</resultMap> </resultMap>
<select id="saveLoanInfoRecordLog" parameterType="cn.quantgroup.report.domain.baihang.LoanInfo"> <select id="saveLoanInfoRecordLog" parameterType="cn.quantgroup.report.domain.baihang.LoanInfoZhuDai">
insert into loan_info (record_id, req_id, name, pid,mobile,op_Code,upload_ts,loan_id,guarantee_type,loan_purpose,apply_date,account_open_date, <!--
issue_date,due_date,loan_amount,total_term,target_repay_date_type,term_period,first_repayment_date,grace_period) insert into loan_info_zhudai (record_id, req_id, name, pid,mobile,op_Code,upload_ts,loan_id,guarantee_type,loan_purpose,apply_date,account_open_date,
VALUES (#{recordId},#{reqID},#{name},#{pid},#{mobile},#{opCode},#{uploadTs},#{loanId},#{guaranteeType},#{loanPurpose},#{applyDate} issue_date,due_date,loan_amount,total_term,target_repay_date_type,term_period,first_repayment_date,grace_period)
,#{accountOpenDate},#{issueDate},#{dueDate},#{loanAmount},#{totalTerm},#{targetRepayDateType},#{termPeriod},#{firstRepaymentDate},#{gracePeriod}) VALUES (#{recordId},#{reqID},#{name},#{pid},#{mobile},#{opCode},#{uploadTs},#{loanId},#{guaranteeType},#{loanPurpose},#{applyDate}
,#{accountOpenDate},#{issueDate},#{dueDate},#{loanAmount},#{totalTerm},#{targetRepayDateType},#{termPeriod},#{firstRepaymentDate},#{gracePeriod})*/
-->
insert into loan_info_zhudai (record_id, req_id, name, pid,mobile,op_Code,upload_ts,loan_id,guarantee_type,loan_purpose,apply_date,account_open_date,
issue_date,due_date,loan_amount,total_term,target_repay_date_type,term_period,first_repayment_date,grace_period,
institutional_funding_partner,institutional_funding_partner_id,institutional_funding_partner_loan_id,relation_id,order_id,pre_credit_limit)
VALUES (#{recordId},#{reqID},#{name},#{pid},#{mobile},#{opCode},#{uploadTs},#{loanId},#{guaranteeType},#{loanPurpose},#{applyDate},
#{accountOpenDate},#{issueDate},#{dueDate},#{loanAmount},#{totalTerm},#{targetRepayDateType},#{termPeriod},#{firstRepaymentDate},#{gracePeriod},
#{institutionalFundingPartner},#{institutionalFundingPartnerID},#{institutionalFundingPartnerLoanID},#{relationID},#{orderID},#{preCreditLimit})
</select> </select>
<update id="updateCurrentRecordEnableFalce" parameterType="cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord"> <update id="updateCurrentRecordEnableFalce" parameterType="cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord">
update loan_info set enable = #{enable, jdbcType=VARCHAR} where record_id = #{recordId, jdbcType=VARCHAR}; update loan_info_zhudai set enable = #{enable, jdbcType=VARCHAR} where record_id = #{recordId, jdbcType=VARCHAR};
</update> </update>
<select id="findAll" resultMap="LoanInfoResultMap"> <select id="findAll" resultMap="LoanInfoResultMap">
select * from loan_info where enable = false; select * from loan_info_zhudai where enable = false;
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="cn.quantgroup.report.mapper.master.RepaymentLoanInfoDbMapper"> <mapper namespace="cn.quantgroup.report.mapper.master.RepaymentLoanInfoDbMapper">
<resultMap id="RepaymetnLoanInfoResultMap" type="cn.quantgroup.report.domain.baihang.RepaymentLoanInfo"> <resultMap id="RepaymetnLoanInfoResultMap" type="cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai">
<result column="reqID" jdbcType="VARCHAR" property="req_id"/> <result column="reqID" jdbcType="VARCHAR" property="req_id"/>
<result column="recordId" jdbcType="VARCHAR" property="record_id"/> <result column="recordId" jdbcType="VARCHAR" property="record_id"/>
<result column="opCode" jdbcType="VARCHAR" property="op_code"/> <result column="opCode" jdbcType="VARCHAR" property="op_code"/>
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
</resultMap> </resultMap>
<select id="saveRepaymentLoanInfoLog" parameterType="cn.quantgroup.report.domain.baihang.RepaymentLoanInfo" resultType="cn.quantgroup.report.domain.baihang.RepaymentLoanInfo"> <select id="saveRepaymentLoanInfoLog" parameterType="cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai" resultType="cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai">
insert into insert into
repayment_loan_info repayment_loan_info_zhudai
(record_id,req_id ,name,pid ,mobile ,op_code ,upload_ts ,loan_id ,term_no ,term_status ,target_repayment_date ,real_repayment_date,planned_payment ,target_repayment,real_repayment ,overdue_amount,remaining_amount,overdue_status,loan_status,status_confirm_at) (record_id,req_id ,name,pid ,mobile ,op_code ,upload_ts ,loan_id ,term_no ,term_status ,target_repayment_date ,real_repayment_date,planned_payment ,target_repayment,real_repayment ,overdue_amount,remaining_amount,overdue_status,loan_status,status_confirm_at)
values (#{recordId, jdbcType=VARCHAR},#{reqID, jdbcType=VARCHAR},#{name, jdbcType=VARCHAR},#{pid, jdbcType=VARCHAR},#{mobile, jdbcType=VARCHAR},#{opCode, jdbcType=VARCHAR}, values (#{recordId, jdbcType=VARCHAR},#{reqID, jdbcType=VARCHAR},#{name, jdbcType=VARCHAR},#{pid, jdbcType=VARCHAR},#{mobile, jdbcType=VARCHAR},#{opCode, jdbcType=VARCHAR},
#{uploadTs, jdbcType=VARCHAR},#{loanId, jdbcType=VARCHAR},#{termNo, jdbcType=INTEGER},#{termStatus, jdbcType=INTEGER},#{targetRepaymentDate, jdbcType=VARCHAR},#{realRepaymentDate, jdbcType=VARCHAR}, #{uploadTs, jdbcType=VARCHAR},#{loanId, jdbcType=VARCHAR},#{termNo, jdbcType=INTEGER},#{termStatus, jdbcType=INTEGER},#{targetRepaymentDate, jdbcType=VARCHAR},#{realRepaymentDate, jdbcType=VARCHAR},
...@@ -65,21 +65,21 @@ ...@@ -65,21 +65,21 @@
</select> </select>
<update id="updateCurrentRecordEnableFalse" parameterType="cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord"> <update id="updateCurrentRecordEnableFalse" parameterType="cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord">
update repayment_loan_info set enable = #{enable, jdbcType=VARCHAR}, updated_at = CURRENT_TIMESTAMP() where record_id = #{recordId, jdbcType=VARCHAR}; update repayment_loan_info_zhudai set enable = #{enable, jdbcType=VARCHAR}, updated_at = CURRENT_TIMESTAMP() where record_id = #{recordId, jdbcType=VARCHAR};
</update> </update>
<select id="findAll" resultMap="RepaymetnLoanInfoResultMap"> <select id="findAll" resultMap="RepaymetnLoanInfoResultMap">
select * from repayment_loan_info where enable = false; select * from repayment_loan_info_zhudai where enable = false;
</select> </select>
<select id="findLastOne" parameterType="cn.quantgroup.report.domain.baihang.BaiHangRepayment" resultType="cn.quantgroup.report.domain.baihang.RepaymentLoanInfo"> <select id="findLastOne" parameterType="cn.quantgroup.report.domain.baihang.BaiHangRepayment" resultType="cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai">
select * from repayment_loan_info where loan_id = #{loanId} and term_no = #{termNo} limit 1; select * from repayment_loan_info_zhudai where loan_id = #{loanId} and term_no = #{termNo} limit 1;
</select> </select>
<!--根据日志中的reqID查询loan_id及还款信息 2019.09.25--> <!--根据日志中的reqID查询loan_id及还款信息 2019.09.25-->
<select id="findByRecordId" resultMap="RepaymentLoanInfoVoResultMapByBS"> <select id="findByRecordId" resultMap="RepaymentLoanInfoVoResultMapByBS">
SELECT * from repayment_loan_info SELECT * from repayment_loan_info_zhudai
WHERE op_code='A' and record_id IN WHERE op_code='A' and record_id IN
<foreach collection="array" item="recordId" index="index" open="(" close=")" separator=","> <foreach collection="array" item="recordId" index="index" open="(" close=")" separator=",">
#{recordId} #{recordId}
......
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