Commit 762e934e authored by 郝彦辉's avatar 郝彦辉

修改日志输出

parent 4abe36b6
...@@ -109,6 +109,8 @@ public class BaiHangZhuDaiService { ...@@ -109,6 +109,8 @@ public class BaiHangZhuDaiService {
//测试环境报送,用户三要素需要脱敏 //测试环境报送,用户三要素需要脱敏
private static Map<String,String> testBaoSongUserInfoTuoMingMap = new ConcurrentHashMap<>(); private static Map<String,String> testBaoSongUserInfoTuoMingMap = new ConcurrentHashMap<>();
//联合贷产品上线时间,上线后才有数据
private static LocalDateTime liang_he_dai_start = LocalDateTime.parse("2019-10-25T00:00:00");
@PostConstruct @PostConstruct
public void init(){ public void init(){
...@@ -563,7 +565,7 @@ public class BaiHangZhuDaiService { ...@@ -563,7 +565,7 @@ public class BaiHangZhuDaiService {
while (true) { while (true) {
counter++; counter++;
if (erlyDate.plusDays(counter).compareTo(endDate) >= 0) { if (erlyDate.plusDays(counter).compareTo(endDate) > 0) {
break; break;
} }
...@@ -577,9 +579,13 @@ public class BaiHangZhuDaiService { ...@@ -577,9 +579,13 @@ public class BaiHangZhuDaiService {
List<ApplyLoanInfoZhuDai> applyLoanInfoList = applyLoanInfoMapper.findRealTimeApplyLoanZhuDai(timeRecord); List<ApplyLoanInfoZhuDai> applyLoanInfoList = applyLoanInfoMapper.findRealTimeApplyLoanZhuDai(timeRecord);
log.info("申请存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", applyLoanInfoList.size(), starTime, (queryWatch1.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s"); log.info("申请存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", applyLoanInfoList.size(), starTime, (queryWatch1.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s");
List<ApplyLoanInfoZhuDai> applyLoanInfosLh = null;
//联合贷产品上线时间,上线后才有数据
if(erlyDate.plusDays(counter-1).compareTo(liang_he_dai_start) >= 0){
Stopwatch queryWatch2 = Stopwatch.createStarted(); Stopwatch queryWatch2 = Stopwatch.createStarted();
List<ApplyLoanInfoZhuDai> applyLoanInfosLh = applyLoanInfoMapper.findRealTimeApplyLoanZhuDaiLh(); applyLoanInfosLh = applyLoanInfoMapper.findRealTimeApplyLoanZhuDaiLh();
log.info("申请存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", applyLoanInfosLh.size(), starTime, (queryWatch2.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s"); log.info("申请存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", applyLoanInfosLh.size(), starTime, (queryWatch2.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s");
}
if(applyLoanInfoList==null){ if(applyLoanInfoList==null){
applyLoanInfoList = new ArrayList<ApplyLoanInfoZhuDai>(); applyLoanInfoList = new ArrayList<ApplyLoanInfoZhuDai>();
...@@ -642,7 +648,7 @@ public class BaiHangZhuDaiService { ...@@ -642,7 +648,7 @@ public class BaiHangZhuDaiService {
log.info("开始>>百行-助贷放款存量数据整理, startDate : {} , noEndDate : {} ......",startDate,noEndDate); log.info("开始>>百行-助贷放款存量数据整理, startDate : {} , noEndDate : {} ......",startDate,noEndDate);
while (true) { while (true) {
counter++; counter++;
if (erlyDate.plusDays(counter).compareTo(endDate) >= 0) { if (erlyDate.plusDays(counter).compareTo(endDate) > 0) {
break; break;
} }
long sUtc1 = System.currentTimeMillis(); long sUtc1 = System.currentTimeMillis();
...@@ -655,9 +661,16 @@ public class BaiHangZhuDaiService { ...@@ -655,9 +661,16 @@ public class BaiHangZhuDaiService {
Stopwatch queryWatch1 = Stopwatch.createStarted(); Stopwatch queryWatch1 = Stopwatch.createStarted();
List<LoanInfoZhuDai> loanInfozdList = loanInfoMapper.findRealTimeLoanInfoZhuDai(timeRecord); List<LoanInfoZhuDai> loanInfozdList = loanInfoMapper.findRealTimeLoanInfoZhuDai(timeRecord);
log.info("放款存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", loanInfozdList.size(), starTime, (queryWatch1.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s"); log.info("放款存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", loanInfozdList.size(), starTime, (queryWatch1.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s");
List<LoanInfoZhuDai> loanInfozdListLh = null;
//联合贷产品上线时间,上线后才有数据
if(erlyDate.plusDays(counter-1).compareTo(liang_he_dai_start) >= 0){
Stopwatch queryWatch2 = Stopwatch.createStarted(); Stopwatch queryWatch2 = Stopwatch.createStarted();
List<LoanInfoZhuDai> loanInfozdListLh = loanInfoMapper.findRealTimeLoanInfoZhuDaiLh(); loanInfozdListLh = loanInfoMapper.findRealTimeLoanInfoZhuDaiLh();
log.info("放款存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", loanInfozdListLh.size(), starTime, (queryWatch2.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s"); log.info("放款存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", loanInfozdListLh.size(), starTime, (queryWatch2.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s");
}
if(loanInfozdList==null){ if(loanInfozdList==null){
loanInfozdList = new ArrayList<LoanInfoZhuDai>(); loanInfozdList = new ArrayList<LoanInfoZhuDai>();
} }
...@@ -743,7 +756,7 @@ public class BaiHangZhuDaiService { ...@@ -743,7 +756,7 @@ public class BaiHangZhuDaiService {
log.info("开始>>整理百行-助贷还款&逾期存量数据 startDate : {} , noEndDate : {} ......",startDate,noEndDate); log.info("开始>>整理百行-助贷还款&逾期存量数据 startDate : {} , noEndDate : {} ......",startDate,noEndDate);
while (true) { while (true) {
counter++; counter++;
if (erlyDate.plusDays(counter).compareTo(endDate) >= 0) { if (erlyDate.plusDays(counter).compareTo(endDate) > 0) {
break; break;
} }
List<RepaymentInfoZhuDai> repaymentInfoList = new ArrayList<>(); List<RepaymentInfoZhuDai> repaymentInfoList = new ArrayList<>();
...@@ -751,7 +764,7 @@ public class BaiHangZhuDaiService { ...@@ -751,7 +764,7 @@ public class BaiHangZhuDaiService {
String starTime = erlyDate.plusDays(counter-1).format(DateTimeFormatter.ISO_DATE); String starTime = erlyDate.plusDays(counter-1).format(DateTimeFormatter.ISO_DATE);
String endTime = erlyDate.plusDays(counter).format(DateTimeFormatter.ISO_DATE); String endTime = erlyDate.plusDays(counter).format(DateTimeFormatter.ISO_DATE);
log.info("整理百行-助贷还款&逾期 startTime: {} , endTime: {} ", starTime, endTime); log.info("整理百行-助贷还款&逾期 startTime: {} , endTime: {} ------------", starTime, endTime);
BaiHangTimeRecord timeRecord = BaiHangTimeRecord.builder().startTime(starTime).endTime(endTime).build(); BaiHangTimeRecord timeRecord = BaiHangTimeRecord.builder().startTime(starTime).endTime(endTime).build();
for (int type = 0; type < 2; type++) { for (int type = 0; type < 2; type++) {
...@@ -765,24 +778,25 @@ public class BaiHangZhuDaiService { ...@@ -765,24 +778,25 @@ public class BaiHangZhuDaiService {
repaymentInfoList = repaymentLoanInfoMapper.findRealTimeRepayMentInfo(timeRecord); repaymentInfoList = repaymentLoanInfoMapper.findRealTimeRepayMentInfo(timeRecord);
log.info("还款存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", repaymentInfoList.size(), starTime, (realTimeStopWatch1.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s"); log.info("还款存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", repaymentInfoList.size(), starTime, (realTimeStopWatch1.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s");
//联合贷产品上线时间,上线后才有数据
if(erlyDate.plusDays(counter-1).compareTo(liang_he_dai_start) >= 0){
Stopwatch realTimeStopWatch2 = Stopwatch.createStarted(); Stopwatch realTimeStopWatch2 = Stopwatch.createStarted();
repaymentLoanInfosLh = repaymentLoanInfoMapper.findRealTimeRepayMentInfoLh(timeRecord); repaymentLoanInfosLh = repaymentLoanInfoMapper.findRealTimeRepayMentInfoLh(timeRecord);
log.info("还款存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", repaymentLoanInfosLh.size(), starTime, (realTimeStopWatch2.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s"); log.info("还款存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", repaymentLoanInfosLh.size(), starTime, (realTimeStopWatch2.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s");
} else { }
/*if(erlyDate.plusDays(counter-1).compareTo(yq_start) >= 0){
Stopwatch stopwatch = Stopwatch.createStarted();
repaymentInfoList = repaymentLoanInfoMapper.queryStockRepayMentInfoOverdueZhuDai(timeRecord);
log.info("百行-助贷还款查询逾期结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} ", starTime, endTime, repaymentInfoList.size(), (stopwatch.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s");
}*/
} else {
Stopwatch realTimeOverdueStopWatch3 = Stopwatch.createStarted(); Stopwatch realTimeOverdueStopWatch3 = Stopwatch.createStarted();
repaymentInfoList = repaymentLoanInfoMapper.findRealTimeRepayMentOverdue(timeRecord); repaymentInfoList = repaymentLoanInfoMapper.findRealTimeRepayMentOverdue(timeRecord);
log.info("逾期存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", repaymentInfoList.size(), starTime, (realTimeOverdueStopWatch3.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s"); log.info("逾期存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", repaymentInfoList.size(), starTime, (realTimeOverdueStopWatch3.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s");
//联合贷产品上线时间,上线后才有数据
if(erlyDate.plusDays(counter-1).compareTo(liang_he_dai_start) >= 0){
Stopwatch realTimeOverdueStopWatch4 = Stopwatch.createStarted(); Stopwatch realTimeOverdueStopWatch4 = Stopwatch.createStarted();
repaymentLoanInfosLh = repaymentLoanInfoMapper.findRealTimeRepayMentOverdueLh(timeRecord); repaymentLoanInfosLh = repaymentLoanInfoMapper.findRealTimeRepayMentOverdueLh(timeRecord);
log.info("逾期存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", repaymentInfoList.size(), starTime, (realTimeOverdueStopWatch4.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s"); log.info("逾期存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} ", repaymentInfoList.size(), starTime, (realTimeOverdueStopWatch4.stop().elapsed(TimeUnit.MILLISECONDS)/1000)+".s");
} }
}
if(repaymentInfoList==null){ if(repaymentInfoList==null){
repaymentInfoList = new ArrayList<RepaymentInfoZhuDai>(); repaymentInfoList = new ArrayList<RepaymentInfoZhuDai>();
...@@ -803,14 +817,14 @@ public class BaiHangZhuDaiService { ...@@ -803,14 +817,14 @@ public class BaiHangZhuDaiService {
} }
} catch (Exception e) { } catch (Exception e) {
log.error("还款存量数据处理异常, startTime: {} , endTime: {} , type: {} ", starTime, endTime, type, e); log.error("还款&逾期存量数据处理异常, startTime: {} , endTime: {} , type: {} ", starTime, endTime, type, e);
} }
//打印日志 //打印日志
if (type == 0) { if (type == 0) {
log.info("还款整理结束, startTime: {} , endTime: {} , 大小: {} , 总耗时: {} ", starTime, endTime, repaymentInfoList.size(), ((System.currentTimeMillis()-log_stUtc)/1000)+".s"); log.info("All还款整理结束, startTime: {} , endTime: {} , 大小: {} , 总耗时: {} ", starTime, endTime, repaymentInfoList.size(), ((System.currentTimeMillis()-log_stUtc)/1000)+".s");
}else{ }else{
log.info("逾期理结束, startTime: {} , endTime: {} , 大小: {} , 总耗时: {} ", starTime, endTime, repaymentInfoList.size(), ((System.currentTimeMillis()-log_stUtc)/1000)+".s"); log.info("All逾期理结束, startTime: {} , endTime: {} , 大小: {} , 总耗时: {} ", starTime, endTime, repaymentInfoList.size(), ((System.currentTimeMillis()-log_stUtc)/1000)+".s");
} }
} }
...@@ -1318,4 +1332,22 @@ public class BaiHangZhuDaiService { ...@@ -1318,4 +1332,22 @@ public class BaiHangZhuDaiService {
} }
} }
/*public static void main(String[] args) {
LocalDateTime erlyDate = LocalDateTime.parse("2019-05-01T00:00:00");
LocalDateTime endDate = LocalDateTime.parse("2019-05-10T00:00:00");
int counter = 0;
while (true) {
counter++;
if (erlyDate.plusDays(counter).compareTo(endDate) > 0) {
break;
}
String starTime = erlyDate.plusDays(counter - 1).format(DateTimeFormatter.ISO_DATE);
String endTime = erlyDate.plusDays(counter).format(DateTimeFormatter.ISO_DATE);
System.out.println("starTime="+starTime+",endTime="+endTime);
}
}*/
} }
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