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

接口报送bug

parent e4b25a58
......@@ -137,8 +137,8 @@ public class ManualToolController {
}
@RequestMapping("/d2_saveLog")
public String d2_saveLog(String d2JsonFileName,String reqIdFileName,String no_reqId_start){
manualToolService.d2_saveLog(d2JsonFileName,reqIdFileName,no_reqId_start);
public String d2_saveLog(String d2JsonFileName,String reqIdFileName,String no_reqId_start, String isHaveRecordId){
manualToolService.d2_saveLog(d2JsonFileName,reqIdFileName,no_reqId_start,isHaveRecordId);
return "d2_saveLog调用结束";
}
......
......@@ -267,6 +267,7 @@ public class BaiHangZhuDaiService {
log.warn("比较还款总期数&账单日列表loanInfoReqId: {} , totalTerm: {} , targetRepaymentDayList is null!", loanInfoReqId, loanInfozd_tmp.getTotalTerm());
}
String relationID = loanInfozd_tmp.getRelationID();
if(relationID!=null){
if(relationID.length()>36){ //长度[1,36]
......
......@@ -1932,7 +1932,7 @@ public class ManualToolService implements CommonSuperService {
}
@Async
public void d2_saveLog(String d2JsonFileName,String reqIdFileName,String no_reqId_start) {
public void d2_saveLog(String d2JsonFileName,String reqIdFileName,String no_reqId_start, String isHaveRecordId) {
boolean haveReqID = false;
List<String> reqID_Str_List = null;
HashMap<String,String> reqID_Map = null;
......@@ -1966,6 +1966,11 @@ public class ManualToolService implements CommonSuperService {
no_reqId = Integer.parseInt(no_reqId_start);
}
boolean haveRecordId = false;
if(StringUtils.isNotEmpty(isHaveRecordId) && isHaveRecordId.equals("true")){
haveRecordId = true;
}
for(int i=0; i<d2JsonList.size(); i++){
String jsonStr = d2JsonList.get(i);
if(jsonStr.length()<30){
......@@ -1987,8 +1992,10 @@ public class ManualToolService implements CommonSuperService {
loanInfozd_tmp.setOrderID(finTechAgencyBusiness.getOrderID());
loanInfozd_tmp.setPreCreditLimit(finTechAgencyBusiness.getPreCreditLimit());
loanInfozd_tmp.setRecordId(loanInfozd_tmp.getReqID());
loanInfozd_tmp.setReqID(null);
if(!haveRecordId){
loanInfozd_tmp.setRecordId(loanInfozd_tmp.getReqID());
loanInfozd_tmp.setReqID(null);
}
if(haveReqID && reqID_Map.containsKey(loanInfozd_tmp.getRecordId())){
loanInfozd_tmp.setReqID(reqID_Map.get(loanInfozd_tmp.getRecordId()));
......@@ -2436,7 +2443,77 @@ public class ManualToolService implements CommonSuperService {
log.info("All newD3ReplaceReqId() end.");
}
public static void main(String[] args) {
private static void check_d2() {
try{
List<String> d2JsonList = ReadOrWriteTxt.readTxtList("D:\\用户目录\\Downloads\\d2_1226.tmp");
log.info("files d2JsonList size="+d2JsonList.size());
for(int i=0; i<d2JsonList.size(); i++){
String jsonStr = d2JsonList.get(i);
if(jsonStr.length()<30){
continue;
}
//LoanInfoZhuDaiVo loanInfo
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
//LoanInfoZhuDai loanInfozd_tmp = JSONObject.parseObject(jsonStr, LoanInfoZhuDai.class);
int totalTerm = jsonObject.getInteger("totalTerm");
String targetRepayDateList = jsonObject.getString("targetRepayDateList");
if(targetRepayDateList.split(",").length == totalTerm){
FileUtils.write(new File("D:\\用户目录\\Downloads\\ok_d2.txt"), jsonStr+"\n", "UTF-8", true);
}else{
log.error(jsonObject.getString("loanId") + "," + targetRepayDateList.split(",").length + "," + totalTerm);
FileUtils.write(new File("D:\\用户目录\\Downloads\\err_d2.txt"), jsonStr+"\n", "UTF-8", true);
}
}
log.info("All D2 LOG:保存放款记录结束");
}catch (Exception e){
log.error("处理放款记录异常!", e);
}
}
private static void build_reqID_recordId() {
try{
List<String> d2JsonList = ReadOrWriteTxt.readTxtList("D:\\用户目录\\Downloads\\日增日志\\d2_25.txt");
log.info("files d2JsonList size="+d2JsonList.size());
for(int i=0; i<d2JsonList.size(); i++){
String jsonStr = d2JsonList.get(i);
if(jsonStr.length()<30){
continue;
}
//LoanInfoZhuDaiVo loanInfo
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
jsonObject.put("recordId",jsonObject.getString("reqID"));
jsonObject.remove("reqID");
FileUtils.write(new File("D:\\用户目录\\Downloads\\日增日志\\log_d2_25.txt"), jsonObject.toJSONString()+"\n", "UTF-8", true);
/*LoanInfoZhuDai loanInfozd_tmp = JSONObject.parseObject(jsonStr, LoanInfoZhuDai.class);
int totalTerm = jsonObject.getInteger("totalTerm");
String targetRepayDateList = jsonObject.getString("targetRepayDateList");
if(targetRepayDateList.split(",").length == totalTerm){
FileUtils.write(new File("D:\\用户目录\\Downloads\\ok_d2.txt"), jsonStr+"\n", "UTF-8", true);
}else{
log.error(jsonObject.getString("loanId") + "," + targetRepayDateList.split(",").length + "," + totalTerm);
FileUtils.write(new File("D:\\用户目录\\Downloads\\err_d2.txt"), jsonStr+"\n", "UTF-8", true);
}*/
}
log.info("All D2 LOG:保存放款记录结束");
}catch (Exception e){
log.error("处理放款记录异常!", e);
}
}
public static void main(String[] args) {
// List<String> lineList = ReadOrWriteTxt.readTxtList("D:\\用户目录\\Downloads\\D2_M_01.txt");
// System.out.println("lineList:"+lineList.size());
// StringBuffer buff = new StringBuffer();
......@@ -2497,8 +2574,12 @@ public class ManualToolService implements CommonSuperService {
//build_20191225D3();
newReqId_to_oldReqId22();
}
//newReqId_to_oldReqId22();
//check_d2();
build_reqID_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