Commit 1a378fca authored by 郝彦辉's avatar 郝彦辉

sendBaiHangData百行自动报送工具优化

parent 21b300f2
......@@ -105,6 +105,8 @@ public class ManualToolService implements CommonSuperService {
String D2_url = "/manual/buquan/mainLoanInfoSend";
String D3_url = "/manual/buquan/mainRepaymentLoanInfo";
String cNameWhiteListFile = base_path+"/baihang/changedName_loanId_whiteList.txt";
if (StringUtils.isBlank(RSA_PRIVATEKEY)) {
resultMap.put("error","参数错误1");
return resultMap;
......@@ -198,6 +200,22 @@ public class ManualToolService implements CommonSuperService {
List<String> reqIDList = new ArrayList<>();
List<String> loanIdList = new ArrayList<String>();
//2020.05.22 第一次报完D2后,修改了姓名,导致D3中姓名和D2中不一致,百行回复这样的D3数据不用补报修复
Map<String, String> cNameLoanIdMap = new HashMap<>();
try{
List<String> changedNameList = ReadOrWriteTxt.readTxtList(cNameWhiteListFile);
if(changedNameList!=null && changedNameList.size()>0){
for (String context : changedNameList){
//LoanId|历史姓名|修改后姓名
String value = context.trim();
cNameLoanIdMap.put(value.split(",")[0], value);
}
}
}catch (Exception e){
log.error("读取报送D3时修改过姓名的用户loanId白名单异常!", e);
}
JSONArray jsonArray = JSONArray.parseArray(jsaonResult);
resultMsg.append("getReqIdByRemoteLog size=" + (jsonArray!=null ? jsonArray.size() : "null") );
for (int i = 0; i < jsonArray.size(); i++) {
......@@ -228,23 +246,44 @@ public class ManualToolService implements CommonSuperService {
log.info("RepaymentLoanInfoDbMapper getReqIdByRemoteLog reqID to D3:" + JSON.toJSONString(recordIdArray));
List<RepaymentLoanInfoLog> tmpLogList = repaymentLoanInfoDbMapper.findByD3RecordId(recordIdArray);
List<RepaymentInfoZhuDai> repaymentLoanInfoList = new ArrayList<>(tmpLogList.size());
int cNameSize = 0;
boolean lengthIs0 = (json_hk_D3.length()==0);
//List<RepaymentInfoZhuDai> repaymentLoanInfoList = new ArrayList<>(tmpLogList.size());
for (RepaymentLoanInfoLog logBean : tmpLogList) {
//查询d2使用
loanIdList.add(logBean.getLoanId());
RepaymentInfoZhuDai voBean = new RepaymentInfoZhuDai();
//添加了忽略username属性的赋值
//BeanUtils.copyProperties(book,book2,"username");
BeanUtils.copyProperties(logBean, voBean);
voBean.setOpCode("M");
if (voBean.getOverdueStatus() == null) {
voBean.setOverdueStatus("");
//如果不在白名单里
if(!cNameLoanIdMap.containsKey(logBean.getLoanId())){
//查询d2使用
loanIdList.add(logBean.getLoanId());
RepaymentInfoZhuDai voBean = new RepaymentInfoZhuDai();
//添加了忽略username属性的赋值
//BeanUtils.copyProperties(book,book2,"username");
BeanUtils.copyProperties(logBean, voBean);
voBean.setOpCode("M");
if (voBean.getOverdueStatus() == null) {
voBean.setOverdueStatus("");
}
//repaymentLoanInfoList.add(voBean);
if(lengthIs0){
lengthIs0 = false;
json_hk_D3.append(JSONObject.toJSONString(voBean));
}else{
json_hk_D3.append(char_n);
json_hk_D3.append(JSONObject.toJSONString(voBean));
}
}else{
cNameSize++;
log.info("用户报送D3时修改姓名, 跳过补报, WhiteList: {} ", cNameLoanIdMap.get(logBean.getLoanId()));
}
repaymentLoanInfoList.add(voBean);
}
resultMsg.append(" |D3 List size=" + repaymentLoanInfoList.size());
resultMsg.append(" |D3 List size=" + tmpLogList.size());
resultMsg.append(" |D3 修改姓名跳过=" + cNameSize);
boolean lengthIs0 = (json_hk_D3.length()==0);
/* boolean lengthIs0 = (json_hk_D3.length()==0);
for (RepaymentInfoZhuDai vo : repaymentLoanInfoList){
if(lengthIs0){
lengthIs0 = false;
......@@ -253,7 +292,7 @@ public class ManualToolService implements CommonSuperService {
json_hk_D3.append(char_n);
json_hk_D3.append(JSONObject.toJSONString(vo));
}
}
}*/
}
......@@ -3566,6 +3605,18 @@ public class ManualToolService implements CommonSuperService {
}
}
private static void buildSelectSql_hmd264() {
//`name`,`phone_no`,`id_no`,`type`
List<String> oldD3ReqIdFileList = ReadOrWriteTxt.readTxtList("E:\\桌面_工作\\黑名单项目\\20200317\\参数.txt");
System.out.println("开始,list Size="+oldD3ReqIdFileList.size());
for(String str:oldD3ReqIdFileList){
//599e2b99de5c4959890e65f302b810c9,5c536844-7c11-41de-ad77-6dce26115a5f,BaiRongSpecialList_c,1003,2018-10-20 00:00:00
String[] arry = str.trim().split(",");
String black_list_new = "select * from black_list_new b where b.`name`='"+arry[0]+"' and b.phone_no='"+arry[1]+"' and b.id_no='"+arry[2]+"' and b.type='"+arry[3]+"' UNION ";
System.out.printf(black_list_new + "\n");
}
System.out.println("结束,list Size="+oldD3ReqIdFileList.size());
}
public static void main(String[] args) {
......@@ -3584,7 +3635,7 @@ public class ManualToolService implements CommonSuperService {
// buildSelectInsert_hmd();
bairong_ziduab_build();
// bairong_ziduab_build();
}
......
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