Commit e9d185ba authored by 郝彦辉's avatar 郝彦辉

修改优化

parent 48eaf413
...@@ -704,6 +704,11 @@ public class BaiHangZhuDaiService { ...@@ -704,6 +704,11 @@ public class BaiHangZhuDaiService {
applyLoanInfo.setEmailAddress(null); applyLoanInfo.setEmailAddress(null);
} }
//2019.11.18
if(applyLoanInfo.getApplyDate()!=null){
applyLoanInfo.setUploadTs(applyLoanInfo.getApplyDate());//applyDate
}
FileUtils.write(new File(fileName+"_01.txt"), JSON.toJSONString(applyLoanInfo)+"\r\n", "UTF-8", true); FileUtils.write(new File(fileName+"_01.txt"), JSON.toJSONString(applyLoanInfo)+"\r\n", "UTF-8", true);
//脱敏数据写一份 //脱敏数据写一份
...@@ -830,10 +835,13 @@ public class BaiHangZhuDaiService { ...@@ -830,10 +835,13 @@ public class BaiHangZhuDaiService {
}else{ }else{
log.warn("比较还款总期数&账单日列表totalTerm="+loanInfoZhuDaiVo.getTotalTerm()+",targetRepaymentDayList is null."); log.warn("比较还款总期数&账单日列表totalTerm="+loanInfoZhuDaiVo.getTotalTerm()+",targetRepaymentDayList is null.");
} }
loanInfoZhuDaiVo.setReqID(id); loanInfoZhuDaiVo.setReqID(id);
//2019.11.18
if(loanInfoZhuDaiVo.getApplyDate()!=null){
loanInfoZhuDaiVo.setUploadTs(loanInfoZhuDaiVo.getIssueDate()); //issueDate
}
FileUtils.write(new File(fileName+"_01.txt"), JSON.toJSONString(loanInfoZhuDaiVo)+"\r\n", "UTF-8", true); FileUtils.write(new File(fileName+"_01.txt"), JSON.toJSONString(loanInfoZhuDaiVo)+"\r\n", "UTF-8", true);
//脱敏数据写一份 //脱敏数据写一份
...@@ -936,6 +944,17 @@ public class BaiHangZhuDaiService { ...@@ -936,6 +944,17 @@ public class BaiHangZhuDaiService {
RepaymentInfoZhuDai repaymentInfo = repaymentInfoList.get(j); RepaymentInfoZhuDai repaymentInfo = repaymentInfoList.get(j);
String id = UUID.randomUUID().toString().replaceAll("-", ""); String id = UUID.randomUUID().toString().replaceAll("-", "");
repaymentInfo.setReqID(id); repaymentInfo.setReqID(id);
//2019.11.18
// if("normal".equals(repaymentInfo.getTermStatus().trim()) ){
// repaymentInfo.setUploadTs(repaymentInfo.getRealRepaymentDate());////realRepaymentDate 实际还款时间
// }else {
// //overdue
// repaymentInfo.setUploadTs(repaymentInfo.getStatusConfirmAt());//statusConfirmAt还款状态确认时间
// }
//“还款状态确认时间”应早于等于记录生成时间(uploadTs)
repaymentInfo.setUploadTs(repaymentInfo.getStatusConfirmAt());
FileUtils.write(new File(fileName+"_01.txt"), JSON.toJSONString(repaymentInfo)+"\r\n", "UTF-8", true); FileUtils.write(new File(fileName+"_01.txt"), JSON.toJSONString(repaymentInfo)+"\r\n", "UTF-8", true);
//脱敏数据写一份 //脱敏数据写一份
......
...@@ -1013,12 +1013,12 @@ public class ManualToolService implements CommonSuperService { ...@@ -1013,12 +1013,12 @@ public class ManualToolService implements CommonSuperService {
for(int i=0; i< newJsonList.size(); i++){ for(int i=0; i< newJsonList.size(); i++){
System.out.println("Start:"+i); System.out.println("Start:"+i);
String strJson = newJsonList.get(i); String strJson = newJsonList.get(i);
if(strJson.length() < 30 ){//#applyInfo #singleLoanAccountInfo if(strJson.length() < 30 ){//#applyInfo
continue; continue;
} }
ApplyLoanInfoZhuDai applyInfo = new Gson().fromJson(strJson, new TypeToken<ApplyLoanInfoZhuDai>(){}.getType()); ApplyLoanInfoZhuDai applyInfo = new Gson().fromJson(strJson, new TypeToken<ApplyLoanInfoZhuDai>(){}.getType());
if(applyInfo.getApplyDate()!=null){ if(applyInfo.getApplyDate()!=null){
applyInfo.setUploadTs(applyInfo.getApplyDate());//applyDate applyInfo.setUploadTs(applyInfo.getApplyDate());//applyDate 信贷业务申请时间
} }
applyInfo.setOpCode("M"); applyInfo.setOpCode("M");
...@@ -1033,8 +1033,9 @@ public class ManualToolService implements CommonSuperService { ...@@ -1033,8 +1033,9 @@ public class ManualToolService implements CommonSuperService {
public static void buildD2_uploadTs(String newJsonFile, String oldJsonFile) { public static void buildD2_uploadTs(String newJsonFile, String oldJsonFile) {
newJsonFile = "D:\\用户目录\\Downloads\\生产数据\\uploadTs_M_201911181718\\new_lhp_D2_20170209_20191025_01.txt"; newJsonFile = "D:\\用户目录\\Downloads\\生产数据\\A_201911181719\\new_lhp_D2_20170209_20191025_01.txt";
String fileName = "D:\\用户目录\\Downloads\\生产数据\\uploadTs_M_201911181718\\new201911181720_D2_20170209_20191025_01.txt"; String fileName_A = "D:\\用户目录\\Downloads\\生产数据\\A_201911181719\\new201911191022_D2_01_A.txt";
String fileName_M = "D:\\用户目录\\Downloads\\生产数据\\A_201911181719\\new201911191022_D2_01_M.txt";
List<String> newJsonList = ReadOrWriteTxt.readTxtList(newJsonFile); List<String> newJsonList = ReadOrWriteTxt.readTxtList(newJsonFile);
System.out.println("newJsonList大小:"+newJsonList.size()); System.out.println("newJsonList大小:"+newJsonList.size());
...@@ -1042,18 +1043,31 @@ public class ManualToolService implements CommonSuperService { ...@@ -1042,18 +1043,31 @@ public class ManualToolService implements CommonSuperService {
for(int i=0; i< newJsonList.size(); i++){ for(int i=0; i< newJsonList.size(); i++){
System.out.println("Start:"+i); System.out.println("Start:"+i);
String strJson = newJsonList.get(i); String strJson = newJsonList.get(i);
if(strJson.length() < 30 ){//#applyInfo #singleLoanAccountInfo if(strJson.length() < 30 ){//#singleLoanAccountInfo
try {
FileUtils.write(new File(fileName_A), "#singleLoanAccountInfo\r\n", "UTF-8", true);
FileUtils.write(new File(fileName_M), "#singleLoanAccountInfo\r\n", "UTF-8", true);
} catch (IOException e) {
System.err.println("build data,"+e);
}
continue; continue;
} }
LoanInfoZhuDai loanInfozd_tmp = new Gson().fromJson(strJson, new TypeToken<LoanInfoZhuDai>(){}.getType());
if(loanInfozd_tmp.getApplyDate()!=null){ //LoanInfoZhuDai loanInfozd_tmp = new Gson().fromJson(strJson, new TypeToken<LoanInfoZhuDai>(){}.getType());
loanInfozd_tmp.setUploadTs(loanInfozd_tmp.getIssueDate()); //issueDate
LoanInfoZhuDaiVo loanInfozd_tmp = new Gson().fromJson(strJson, new TypeToken<LoanInfoZhuDaiVo>(){}.getType());
if(loanInfozd_tmp.getIssueDate ()!=null){
loanInfozd_tmp.setUploadTs(loanInfozd_tmp.getIssueDate()); //issueDate 贷款放款时间
} }
loanInfozd_tmp.setOpCode("M"); loanInfozd_tmp.setOpCode("A");
try { try {
FileUtils.write(new File(fileName), JSON.toJSONString(loanInfozd_tmp)+"\r\n", "UTF-8", true); FileUtils.write(new File(fileName_A), JSON.toJSONString(loanInfozd_tmp)+"\r\n", "UTF-8", true);
loanInfozd_tmp.setOpCode("M");
FileUtils.write(new File(fileName_M), JSON.toJSONString(loanInfozd_tmp)+"\r\n", "UTF-8", true);
} catch (IOException e) { } catch (IOException e) {
System.err.println("build data,"+e); System.err.println("build data,"+e);
} }
...@@ -1063,30 +1077,34 @@ public class ManualToolService implements CommonSuperService { ...@@ -1063,30 +1077,34 @@ public class ManualToolService implements CommonSuperService {
public static void buildD3_uploadTs(String newJsonFile, String oldJsonFile) { public static void buildD3_uploadTs(String newJsonFile, String oldJsonFile) {
newJsonFile = "D:\\用户目录\\Downloads\\生产数据\\uploadTs_M_201911181718\\bak1\\new_D3_01.txt"; newJsonFile = "D:\\用户目录\\Downloads\\生产数据\\A_201911181719\\201911181720_D3_04.txt";
String fileName = "D:\\用户目录\\Downloads\\生产数据\\uploadTs_M_201911181718\\new201911181720_D3_01.txt"; String fileName = "D:\\用户目录\\Downloads\\生产数据\\A_201911181719\\new201911191022_D3_04.txt";
List<String> newJsonList = ReadOrWriteTxt.readTxtList(newJsonFile); List<String> newJsonList = ReadOrWriteTxt.readTxtList(newJsonFile);
System.out.println("newJsonList大小:"+newJsonList.size()); System.out.println("newJsonList大小:"+newJsonList.size());
Map<String,String> new_uploadTs_Map = new HashMap<>(newJsonList.size());
for(int i=0; i< newJsonList.size(); i++){ for(int i=0; i< newJsonList.size(); i++){
System.out.println("Start:"+i); System.out.println("Start:"+i);
String strJson = newJsonList.get(i); String strJson = newJsonList.get(i);
if(strJson.length() < 30 ){//#applyInfo #singleLoanAccountInfo if(strJson.length() < 30 ){//#singleLoanRepayInfo
try {
FileUtils.write(new File(fileName), "#singleLoanRepayInfo\r\n", "UTF-8", true);
} catch (IOException e) {
System.err.println("build data,"+e);
}
continue; continue;
} }
RepaymentInfoZhuDai repaymentLoanInfo = new Gson().fromJson(strJson, new TypeToken<RepaymentInfoZhuDai>(){}.getType()); RepaymentInfoZhuDai repaymentLoanInfo = new Gson().fromJson(strJson, new TypeToken<RepaymentInfoZhuDai>(){}.getType());
/*if("normal".equals(repaymentLoanInfo.getTermStatus().trim()) ){
repaymentLoanInfo.setUploadTs(repaymentLoanInfo.getRealRepaymentDate());//realRepaymentDate 实际还款时间
if("normal".equals(repaymentLoanInfo.getTermStatus().trim()) ){
repaymentLoanInfo.setUploadTs(repaymentLoanInfo.getRealRepaymentDate());//realRepaymentDate
}else { }else {
//overdue //overdue
repaymentLoanInfo.setUploadTs(repaymentLoanInfo.getStatusConfirmAt());//statusConfirmAt repaymentLoanInfo.setUploadTs(repaymentLoanInfo.getStatusConfirmAt());//statusConfirmAt还款状态确认时间
} }
repaymentLoanInfo.setOpCode("M"); repaymentLoanInfo.setOpCode("M");*/
repaymentLoanInfo.setUploadTs(repaymentLoanInfo.getStatusConfirmAt());
repaymentLoanInfo.setOpCode("A");
try { try {
FileUtils.write(new File(fileName), JSON.toJSONString(repaymentLoanInfo)+"\r\n", "UTF-8", true); FileUtils.write(new File(fileName), JSON.toJSONString(repaymentLoanInfo)+"\r\n", "UTF-8", true);
...@@ -1094,11 +1112,36 @@ public class ManualToolService implements CommonSuperService { ...@@ -1094,11 +1112,36 @@ public class ManualToolService implements CommonSuperService {
System.err.println("build data,"+e); System.err.println("build data,"+e);
} }
} }
System.out.println("newJsonList大小:"+newJsonList.size());
System.err.println("build data buildD3_uploadTs end."); System.err.println("build data buildD3_uploadTs end.");
} }
public static void testMd5() {
String newJsonFile = "E:\\桌面_工作\\新阳Md5\\aa.txt";
String fileName = "E:\\桌面_工作\\新阳Md5\\aa_2.txt";
List<String> newJsonList = ReadOrWriteTxt.readTxtList(newJsonFile);
System.out.println("newJsonList大小:" + newJsonList.size());
for (int i = 0; i < newJsonList.size(); i++) {
System.out.println("Start:"+i);
String[] arr = newJsonList.get(i).split("[|]");
//loanId|name|pid|mobile
String msg = arr[0]+"\t";
msg+=MD5Util.getMd5(arr[1])+"\t";
msg+=MD5Util.getMd5(arr[2])+"\t";
msg+=MD5Util.getMd5(arr[3])+"\t";
try {
FileUtils.write(new File(fileName), msg+"\r\n", "UTF-8", true);
} catch (IOException e) {
System.err.println("build data,"+e);
}
}
}
public static void main(String[] args) { public static void main(String[] args) {
...@@ -1138,7 +1181,11 @@ public class ManualToolService implements CommonSuperService { ...@@ -1138,7 +1181,11 @@ public class ManualToolService implements CommonSuperService {
//buildA1_uploadTs(null,null); //buildA1_uploadTs(null,null);
//buildD2_uploadTs(null,null); //buildD2_uploadTs(null,null);
buildD3_uploadTs(null,null); // buildD3_uploadTs(null,null);
//testMd5();
} }
} }
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