Commit 4ec30030 authored by 郝彦辉's avatar 郝彦辉

修改日志

parent bba4e5b1
...@@ -235,4 +235,16 @@ public class ExZhuDaiBaiHangReSendController { ...@@ -235,4 +235,16 @@ public class ExZhuDaiBaiHangReSendController {
} }
return baiHangZhuDaiService.zhuDaiStockStop(type,val); return baiHangZhuDaiService.zhuDaiStockStop(type,val);
} }
@RequestMapping("/test/bulidD3")
public String bulidD3(String type,String jsonFile) {
try{
return baiHangZhuDaiService.build_stockRepayMentInfoZhuDai(jsonFile);
}catch (Exception e){
log.error("bulidD3异常, {} , {} ", e.getMessage(), e);
return e.getMessage();
}
}
} }
...@@ -21,6 +21,7 @@ import cn.quantgroup.report.service.baihang.util.Base64; ...@@ -21,6 +21,7 @@ import cn.quantgroup.report.service.baihang.util.Base64;
import cn.quantgroup.report.service.baihang.util.TuoMinUtils; import cn.quantgroup.report.service.baihang.util.TuoMinUtils;
import cn.quantgroup.report.service.http.IHttpService; import cn.quantgroup.report.service.http.IHttpService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Stopwatch; import com.google.common.base.Stopwatch;
import com.google.gson.Gson; import com.google.gson.Gson;
...@@ -37,6 +38,7 @@ import org.springframework.stereotype.Service; ...@@ -37,6 +38,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.security.PublicKey; import java.security.PublicKey;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
...@@ -842,7 +844,7 @@ public class BaiHangZhuDaiService { ...@@ -842,7 +844,7 @@ public class BaiHangZhuDaiService {
if (type == 0) { if (type == 0) {
log.info("All还款整理结束, 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("All逾期理结束, 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");
} }
} }
...@@ -1386,11 +1388,51 @@ public class BaiHangZhuDaiService { ...@@ -1386,11 +1388,51 @@ public class BaiHangZhuDaiService {
System.out.println("starTime="+starTime+",endTime="+endTime); System.out.println("starTime="+starTime+",endTime="+endTime);
}*/ }*/
AtomicBoolean D2_Stop = new AtomicBoolean(false); /* AtomicBoolean D2_Stop = new AtomicBoolean(false);
System.out.println(D2_Stop.get()); System.out.println(D2_Stop.get());
D2_Stop.set(true); D2_Stop.set(true);
System.out.println(D2_Stop.get()); System.out.println(D2_Stop.get());*/
//构建D3
}
public String build_stockRepayMentInfoZhuDai(String jsonFile) throws IOException {
String sourceStr = FileUtils.readFileToString(new File(jsonFile), "utf-8");
JSONObject sourceJson = JSON.parseObject(sourceStr);
JSONArray recordsJsonArr = sourceJson.getJSONArray("RECORDS");
System.out.println("总条数:" + recordsJsonArr.size());
//RepaymentInfoZhuDai repaymentLoanInfo = new Gson().fromJson(repaymentLoanInfos.get(i), new TypeToken<RepaymentInfoZhuDai>(){}.getType());
//log.info("众信利民助贷模式TO百行手动报送还款数据单个数据, {}", JSON.toJSONString(repaymentLoanInfo));
String name = "";
if(jsonFile.lastIndexOf("/")!=-1){//linux
name = jsonFile.substring(jsonFile.lastIndexOf("/")+1, jsonFile.length());
}else{//windows
name = jsonFile.substring(jsonFile.lastIndexOf("\\")+1, jsonFile.length());
}
name = name.substring(0,name.lastIndexOf("."));
final String fileName = zl_file_path_name + name;
long log_stUtc = System.currentTimeMillis();
try {
for (int j = 0; j < recordsJsonArr.size(); j++) {
String tmpStr = recordsJsonArr.getJSONObject(j).toJSONString();
RepaymentInfoZhuDai repaymentInfo = new Gson().fromJson(tmpStr, new TypeToken<RepaymentInfoZhuDai>() {}.getType());
String id = UUID.randomUUID().toString().replaceAll("-", "");
repaymentInfo.setReqID(id);
FileUtils.write(new File(fileName + "_01.txt"), JSON.toJSONString(repaymentInfo) + "\r\n", "UTF-8", true);
//脱敏数据写一份
testTuoMinFileWrite(fileName + "_TEST_01.txt", "shoudongBuild", null, null, repaymentInfo);
}
} catch (Exception e) {
log.error("还款&逾期存量数据处理异常,", e);
} }
//打印日志
log.info("All还款||逾期整理结束, 大小: {} , 总耗时: {} ", recordsJsonArr.size(), ((System.currentTimeMillis() - log_stUtc) / 1000) + ".s");
return "百行-助贷还款整理结束";
}
} }
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