Commit 6c5f1c27 authored by 郝彦辉's avatar 郝彦辉

黑灰名单2020.04.23_02

parent cd983bf5
......@@ -780,7 +780,7 @@ public class BlackGreyListServiceImpl implements IBlackGreyListService {
//批量 逾期已还清黑名单>>转灰名单
if(blackListResults!=null && blackListResults.size() >0 ){
return blackToGreyListParallel.runMain(blackListResults);
return blackToGreyListParallel.removeBlackToGrey(blackListResults);
}
return null;
}
......
......@@ -59,10 +59,10 @@ public class BlackToGreyListParallel implements ParallelComputingProcess<BlackGr
//@Autowired
//private JdbcTemplate blackListJdbcTemplate;
public String runMain(List<BlackGreyListResult> tmpQueryList) {
public String removeBlackToGrey(List<BlackGreyListResult> tmpQueryList) {
long startProcess = System.currentTimeMillis();
int listSize = tmpQueryList.size();
log.info(log_inf+"-runMain黑名单转灰名单开始执行>>>>>, listSize: {} , SYS_CPU_COUNT: {} ", listSize, THREAD_COUNT);
log.info(log_inf+"-removeBlackToGrey黑名单转灰名单开始执行>>>>>, listSize: {} , SYS_CPU_COUNT: {} ", listSize, THREAD_COUNT);
try {
//并行框架---执行
......@@ -71,16 +71,16 @@ public class BlackToGreyListParallel implements ParallelComputingProcess<BlackGr
//并行框架执行结果
if (optSet.size() > 0) {//并行框架执行异常
log.info(log_inf + "-runMain黑名单转灰名单执行结束-部分失败, cost: {} <<<<<< process optSet size: {} , json: {} ", (System.currentTimeMillis()-startProcess), optSet.size(), JSONObject.toJSONString(optSet));
log.info(log_inf + "-removeBlackToGrey黑名单转灰名单执行结束-部分失败, cost: {} <<<<<< process optSet size: {} , json: {} ", (System.currentTimeMillis()-startProcess), optSet.size(), JSONObject.toJSONString(optSet));
} else {
//执行成功
log.info(log_inf + "-runMain黑名单转灰名单执行结束-成功, cost: {} <<<<<< process is OK!", (System.currentTimeMillis() - startProcess));
log.info(log_inf + "-removeBlackToGrey黑名单转灰名单执行结束-成功, cost: {} <<<<<< process is OK!", (System.currentTimeMillis() - startProcess));
}
String resMsgTemp = "总共 %d条, 执行成功 %d条, 失败 %d条;";
return String.format(resMsgTemp, listSize, listSize-optSet.size(), optSet.size());
} catch (Exception e) {
log.error(log_inf +"-runMain黑名单转灰名单执行异常.", e);
log.error(log_inf +"-removeBlackToGrey黑名单转灰名单执行异常.", e);
}
return "黑名单转灰名单执行异常";
}
......@@ -92,9 +92,12 @@ public class BlackToGreyListParallel implements ParallelComputingProcess<BlackGr
String dateName = ConstantBlackGrey.PARAM.DF_YMD.format(Calendar.getInstance().getTime());
int list_size = blackResultList.size();
long start = System.currentTimeMillis();
AtomicInteger remove_count = new AtomicInteger();
AtomicInteger err_count = new AtomicInteger();
AtomicInteger type_11 = new AtomicInteger();
AtomicInteger update_d_count = new AtomicInteger();
AtomicInteger update_r_count = new AtomicInteger();
int index = 0;
//blackResult r_id,uuid,black_type,types,reasons
......@@ -128,9 +131,9 @@ public class BlackToGreyListParallel implements ParallelComputingProcess<BlackGr
try {
in_overdue_Obj = xyqbJdbcTemplate.queryForObject(ConstantBlackGrey.SQL.XYQB_QUERY_XIANJINDAI_IS_PAYOFF, new Object[]{uuid}, Integer.class);
}catch (EmptyResultDataAccessException e){
log.error("查询[现金贷]逾期逾期黑名单是否已还清-查询xyqb异常, r_Id: {} , id: {} , uuid: {} , e: {} ", rId, detailsVo.getId(), uuid, e.toString());
log.error("查询(现金贷)逾期逾期黑名单是否已还清-查询xyqb异常, r_Id: {} , id: {} , uuid: {} , e: {} ", rId, detailsVo.getId(), uuid, e.toString());
}finally {
log.info("查询[现金贷]逾期逾期黑名单是否已还清-结束, r_Id: {} , id: {} , uuid: {} , in_overdue_Obj : {} ", rId, detailsVo.getId(), uuid, in_overdue_Obj!=null? in_overdue_Obj.toString(): "null");
log.info("查询(现金贷)逾期逾期黑名单是否已还清-结束, r_Id: {} , id: {} , uuid: {} , in_overdue_Obj : {} ", rId, detailsVo.getId(), uuid, in_overdue_Obj!=null? in_overdue_Obj.toString(): "null");
}
//修改结果表状态为10
updateDetailStatus10(in_overdue_Obj, detailsVo, "现金贷");
......@@ -145,9 +148,9 @@ public class BlackToGreyListParallel implements ParallelComputingProcess<BlackGr
try {
in_overdue_Obj = xyqbJdbcTemplate.queryForObject(ConstantBlackGrey.SQL.XYQB_QUERY_BAITIAO_IS_PAYOFF, new Object[]{uuid}, Integer.class);
}catch (EmptyResultDataAccessException e){
log.error("查询[白条]逾期逾期黑名单是否已还清-查询xyqb异常, r_Id: {} , id: {} , uuid: {} , e: {} ", rId, detailsVo.getId(), uuid, e.toString());
log.error("查询(白条)逾期逾期黑名单是否已还清-查询xyqb异常, r_Id: {} , id: {} , uuid: {} , e: {} ", rId, detailsVo.getId(), uuid, e.toString());
}finally {
log.info("查询[白条]逾期逾期黑名单是否已还清-结束, r_Id: {} , id: {} , uuid: {} , in_overdue_Obj : {} ", rId, detailsVo.getId(), uuid, in_overdue_Obj!=null? in_overdue_Obj.toString(): "null");
log.info("查询(白条)逾期逾期黑名单是否已还清-结束, r_Id: {} , id: {} , uuid: {} , in_overdue_Obj : {} ", rId, detailsVo.getId(), uuid, in_overdue_Obj!=null? in_overdue_Obj.toString(): "null");
}
//修改结果表状态为10
......@@ -164,9 +167,9 @@ public class BlackToGreyListParallel implements ParallelComputingProcess<BlackGr
try {
in_overdue_Obj = acsdbJdbcTemplate.queryForObject(ConstantBlackGrey.SQL.XYQB_QUERY_VCC_IS_PAYOFF, new Object[]{xyqbUser.getId()}, Integer.class);
}catch (EmptyResultDataAccessException e){
log.error("查询[VCC]逾期逾期黑名单是否已还清-查询xyqb异常, r_Id: {} , id: {} , uuid: {} , user_id: {} , e: {} ", rId, detailsVo.getId(), uuid, xyqbUser.getId(), e.toString());
log.error("查询(VCC)逾期逾期黑名单是否已还清-查询xyqb异常, r_Id: {} , id: {} , uuid: {} , user_id: {} , e: {} ", rId, detailsVo.getId(), uuid, xyqbUser.getId(), e.toString());
}finally {
log.info("查询[VCC]逾期逾期黑名单是否已还清-结束, r_Id: {} , id: {} , uuid: {} , user_id: {} , in_overdue_Obj : {} ", rId, detailsVo.getId(), uuid, xyqbUser.getId(), in_overdue_Obj!=null? in_overdue_Obj.toString(): "null");
log.info("查询(VCC)逾期逾期黑名单是否已还清-结束, r_Id: {} , id: {} , uuid: {} , user_id: {} , in_overdue_Obj : {} ", rId, detailsVo.getId(), uuid, xyqbUser.getId(), in_overdue_Obj!=null? in_overdue_Obj.toString(): "null");
}
//修改结果表状态为10
......@@ -210,6 +213,10 @@ public class BlackToGreyListParallel implements ParallelComputingProcess<BlackGr
detailUpdateParam.setWEqStatus(10);
detailUpdateParam.setWInType(Arrays.asList(ConstantBlackGrey.PARAM.BLACK_LIST_TYPES)); //('1','2','10')
int update_d = blackGreyListMapper.updateDetailsStatusByparams(detailUpdateParam);
if(update_d>0){
update_d_count.getAndAdd(update_d);
}
log.info("黑名单转灰名单-明细表修改状态结束, param: {} , update_d: {} ", JSON.toJSONString(detailUpdateParam), update_d);
//更新结果表
BlackGreyListResult updateResult = new BlackGreyListResult();
......@@ -220,29 +227,32 @@ public class BlackToGreyListParallel implements ParallelComputingProcess<BlackGr
if(reasonsList!=null){
updateResult.setReasons(JSON.toJSONString(reasonsList));
}
int update_r = blackGreyListMapper.updateBlackGreyListResult(updateResult);
if(update_d>0 && update_r>0){
remove_count.getAndIncrement();
if(update_r>0){
update_r_count.getAndAdd(update_r);
}
log.info("黑名单转灰名单-结果表修改状态结束, param: {} , update_d: {} ", JSON.toJSONString(updateResult), update_r);
}
}else {
err_count.getAndIncrement();
optSet.add("notFind:"+blackResult.getRId());
optSet.add("notFindDeatils:"+rId);
writeLogByName(ConstantBlackGrey.PARAM.SAVELOGPATH + dateName + ConstantBlackGrey.PARAM.SEPA + "error.log", "黑转灰时,结果表没有发现details>>"+blackResult.getRId());
}
} catch (Exception e) {
err_count.getAndIncrement();
optSet.add("ERR:" + blackResult.getRId());
optSet.add("ERR:" + rId);
log.error(log_inf + "黑名单转灰名单执行异常process() threadId:" + threadId, e);
}
}else {
err_count.getAndIncrement();
optSet.add("uuid空:" + rId);
log.error("查询逾期黑名单是否已还清-发现uuid为空, threadId_{} , r_Id: {} , uuid: {} , blackType: {} ", threadId, rId, uuid, blackResult.getBlackType());
}
}
log.info(log_inf + "黑名单转灰名单process处理结束CPU_{} , remove_count: {} , type_11: {} , 失败: {} , this_list_size: {} , 耗时: {} ", threadId, remove_count.get(), type_11.get(), err_count.get(), list_size, (System.currentTimeMillis()-start));
log.info(log_inf + "黑名单转灰名单process处理结束CPU_{} , this_list_size: {} , type_11: {} , update_r_count: {} , update_d_count: {} , 失败: {} , 耗时: {} ", threadId, list_size, type_11.get(), update_r_count.get(), update_d_count.get(), err_count.get(), (System.currentTimeMillis()-start));
}
......@@ -478,7 +488,7 @@ public class BlackToGreyListParallel implements ParallelComputingProcess<BlackGr
}
}
}catch (Exception e){
log.error("查询["+log_inf+"]逾期逾期黑名单是否已还清-修改结果表状态为10出现异常, r_Id: {} , id: {} ", rJoinDVo.getRId(), rJoinDVo.getId(), e);
log.error("查询("+log_inf+")逾期逾期黑名单是否已还清-修改结果表状态为10出现异常, r_Id: {} , id: {} ", rJoinDVo.getRId(), rJoinDVo.getId(), e);
}
return 0;
}
......
......@@ -94,10 +94,12 @@ public class UpdateBlackListOverdueDayParallel implements ParallelComputingProce
String dateName = ConstantBlackGrey.PARAM.DF_YMD.format(Calendar.getInstance().getTime());
int list_size = blackResultList.size();
AtomicInteger update_count = new AtomicInteger();
AtomicInteger ok_count = new AtomicInteger();
AtomicInteger err_count = new AtomicInteger();
AtomicInteger type_11 = new AtomicInteger();
AtomicInteger update_count = new AtomicInteger();
int index = 0;
for (BlackGreyListResult blackResult : blackResultList) {
//blackResult>>r_id,uuid,black_type
......@@ -135,15 +137,16 @@ public class UpdateBlackListOverdueDayParallel implements ParallelComputingProce
}
});
}catch (EmptyResultDataAccessException e){
log.error("查询[现金贷]黑名单逾期天数-查询xyqb异常, r_Id: {} , uuid: {} , id: {} e: {} ", rId, uuid, detailsVo.getId(), e.toString());
log.error("查询(现金贷)黑名单逾期天数-查询xyqb异常, r_Id: {} , uuid: {} , id: {} e: {} ", rId, uuid, detailsVo.getId(), e.toString());
}finally {
log.info("查询[现金贷]黑名单逾期天数-结束, r_Id: {} , uuid: {} , id: {} , overdueDays : {} ", rId, uuid, detailsVo.getId(), overdueDays!=null ? JSON.toJSONString(overdueDays):"null");
log.info("查询(现金贷)黑名单逾期天数-结束, r_Id: {} , uuid: {} , id: {} , overdueDays : {} ", rId, uuid, detailsVo.getId(), overdueDays!=null ? JSON.toJSONString(overdueDays):"null");
}
//修改逾期天数
int update = updateOverdueDay(overdueDays, detailsVo, "现金贷");
if(update>0){
details_is_update = true;
update_count.getAndAdd(update);
}
}
......@@ -161,15 +164,16 @@ public class UpdateBlackListOverdueDayParallel implements ParallelComputingProce
}
});
}catch (EmptyResultDataAccessException e){
log.error("查询[白条]黑名单逾期天数-查询xyqb异常, r_Id: {} , uuid: {} , id: {} e: {} ", rId, uuid, detailsVo.getId(), e.toString());
log.error("查询(白条)黑名单逾期天数-查询xyqb异常, r_Id: {} , uuid: {} , id: {} e: {} ", rId, uuid, detailsVo.getId(), e.toString());
}finally {
log.info("查询[白条]黑名单逾期天数-结束, r_Id: {} , uuid: {} , id: {} , overdueDays : {} ", rId, uuid, detailsVo.getId(), overdueDays!=null ? JSON.toJSONString(overdueDays):"null");
log.info("查询(白条)黑名单逾期天数-结束, r_Id: {} , uuid: {} , id: {} , overdueDays : {} ", rId, uuid, detailsVo.getId(), overdueDays!=null ? JSON.toJSONString(overdueDays):"null");
}
//修改逾期天数
int update = updateOverdueDay(overdueDays, detailsVo, "白条");
if(update>0){
details_is_update = true;
update_count.getAndAdd(update);
}
}
......@@ -190,21 +194,22 @@ public class UpdateBlackListOverdueDayParallel implements ParallelComputingProce
}
});
}catch (EmptyResultDataAccessException e){
log.error("查询[VCC]黑名单逾期天数-查询xyqb异常, r_Id: {} , uuid: {} , id: {} e: {} ", rId, uuid, detailsVo.getId(), e.toString());
log.error("查询(VCC)黑名单逾期天数-查询acsdb异常, r_Id: {} , uuid: {} , id: {} e: {} ", rId, uuid, detailsVo.getId(), e.toString());
}finally {
log.info("查询[VCC]黑名单逾期天数-结束, r_Id: {} , uuid: {} , id: {} , overdueDays : {} ", rId, uuid, detailsVo.getId(), overdueDays!=null ? JSON.toJSONString(overdueDays):"null");
log.info("查询(VCC)黑名单逾期天数-结束, r_Id: {} , uuid: {} , id: {} , overdueDays : {} ", rId, uuid, detailsVo.getId(), overdueDays!=null ? JSON.toJSONString(overdueDays):"null");
}
//修改逾期天数
int update = updateOverdueDay(overdueDays, detailsVo, "白条");
if(update>0){
details_is_update = true;
update_count.getAndAdd(update);
}
}
}else{
//if(detailsVo.getStatus()==0){
err_count.getAndIncrement();
optSet.add("otherType:"+blackResult.getRId());
optSet.add("otherType:"+rId);
writeLogByName(ConstantBlackGrey.PARAM.SAVELOGPATH + dateName + ConstantBlackGrey.PARAM.SEPA + "error.log", "更新逾期天数时,发现其他类别>>"+blackResult.getRId());
//}
}
......@@ -214,27 +219,28 @@ public class UpdateBlackListOverdueDayParallel implements ParallelComputingProce
if(details_is_update){
//更新结果表
updateResultUpdatedAt(blackResult.getRId());
update_count.getAndIncrement();
ok_count.getAndIncrement();
}
}else {
err_count.getAndIncrement();
optSet.add("notFind:"+blackResult.getRId());
optSet.add("notFindDeatils:"+rId);
writeLogByName(ConstantBlackGrey.PARAM.SAVELOGPATH + dateName + ConstantBlackGrey.PARAM.SEPA + "error.log", "更新逾期天数时,结果表没有发现details>>"+blackResult.getRId());
}
} catch (Exception e) {
optSet.add("ERR:" + blackResult.getRId());
err_count.getAndIncrement();
optSet.add("ERR:" + rId);
log.error(log_inf + "更新黑名单逾期天执行异常process() threadId:" + threadId, e);
}
}else {
err_count.getAndIncrement();
optSet.add("uuid空:" + rId);
log.error("查询黑名单逾期天-发现uuid为空, threadId_{} , r_Id: {} , uuid: {} , blackType: {} ", threadId, rId, uuid, blackResult.getBlackType());
}
}
log.info(log_inf + "更新黑名单逾期天数process处理结束CPU_{} , update_count: {} , type_11: {} , err_count: {} , this_list_size: {} , 耗时: {} ", threadId, update_count.get(), type_11.get(), err_count.get(), list_size, (System.currentTimeMillis()-start));
log.info(log_inf + "更新黑名单逾期天数process处理结束CPU_{} , this_list_size: {} , ok_count: {} , err_count: {} , type_11: {} , update_count: {} , 耗时: {} ", threadId, list_size, ok_count.get(), err_count.get(), type_11.get(), update_count.get(), (System.currentTimeMillis()-start));
}
......@@ -294,7 +300,7 @@ public class UpdateBlackListOverdueDayParallel implements ParallelComputingProce
return update;
}
} catch (Exception e) {
log.error("修改[" + log_inf + "]黑名单逾期天数-异常, r_Id: {} , id: {} , overdueDays: {} ", detailsVo.getRId(), detailsVo.getId(), overdueDays!=null?JSONObject.toJSONString(overdueDays):"null", e);
log.error("修改(" + log_inf + ")黑名单逾期天数-异常, r_Id: {} , id: {} , overdueDays: {} ", detailsVo.getRId(), detailsVo.getId(), overdueDays!=null?JSONObject.toJSONString(overdueDays):"null", e);
}
return 0;
}
......
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