Commit 84181606 authored by data爬虫-冯 军凯's avatar data爬虫-冯 军凯

黑名单添加内部渠道和三方数据源黑名单等级更新功能

parent 88c90840
...@@ -33,45 +33,49 @@ public class BlackListUpdateThreeEleServiceImpl implements IBlackListUpdateThree ...@@ -33,45 +33,49 @@ public class BlackListUpdateThreeEleServiceImpl implements IBlackListUpdateThree
for (int i = 0; i < blackListQueryTidbVo0s.size(); i++) { for (int i = 0; i < blackListQueryTidbVo0s.size(); i++) {
BlackListQueryTidbVo0 blackListQueryTidbVo0 = blackListQueryTidbVo0s.get(i); try{
List<BlackListQueryTidbVo0> query = blackListJdbcTemplate.query(String.format(Constant.SQL.BLACK_LIST_NEW_QUERY_BY_IDNO_OR_PHONENO_SQL, blackListQueryTidbVo0.getPhoneNo(), blackListQueryTidbVo0.getIdNo()), new BeanPropertyRowMapper<>(BlackListQueryTidbVo0.class)); BlackListQueryTidbVo0 blackListQueryTidbVo0 = blackListQueryTidbVo0s.get(i);
List<BlackListQueryTidbVo0> query = blackListJdbcTemplate.query(String.format(Constant.SQL.BLACK_LIST_NEW_QUERY_BY_IDNO_OR_PHONENO_SQL, blackListQueryTidbVo0.getPhoneNo(), blackListQueryTidbVo0.getIdNo()), new BeanPropertyRowMapper<>(BlackListQueryTidbVo0.class));
for (int j = 0; j < query.size(); j++) { for (int j = 0; j < query.size(); j++) {
BlackListQueryTidbVo0 blackListQueryTidbVo01 = query.get(j); BlackListQueryTidbVo0 blackListQueryTidbVo01 = query.get(j);
if (StringUtils.isAnyBlank(blackListQueryTidbVo01.getUuid(), blackListQueryTidbVo01.getName(), blackListQueryTidbVo01.getPhoneNo(), blackListQueryTidbVo01.getIdNo())) { if (StringUtils.isAnyBlank(blackListQueryTidbVo01.getUuid(), blackListQueryTidbVo01.getName(), blackListQueryTidbVo01.getPhoneNo(), blackListQueryTidbVo01.getIdNo())) {
if (StringUtils.isBlank(blackListQueryTidbVo01.getUuid()) && StringUtils.isNotBlank(blackListQueryTidbVo0.getUuid())) { if (StringUtils.isBlank(blackListQueryTidbVo01.getUuid()) && StringUtils.isNotBlank(blackListQueryTidbVo0.getUuid())) {
blackListQueryTidbVo01.setUuid(blackListQueryTidbVo0.getUuid()); blackListQueryTidbVo01.setUuid(blackListQueryTidbVo0.getUuid());
} }
if (StringUtils.isBlank(blackListQueryTidbVo01.getName()) && StringUtils.isNotBlank(blackListQueryTidbVo0.getName())) { if (StringUtils.isBlank(blackListQueryTidbVo01.getName()) && StringUtils.isNotBlank(blackListQueryTidbVo0.getName())) {
blackListQueryTidbVo01.setName(blackListQueryTidbVo0.getName()); blackListQueryTidbVo01.setName(blackListQueryTidbVo0.getName());
} }
if (StringUtils.isBlank(blackListQueryTidbVo01.getPhoneNo()) && StringUtils.isNotBlank(blackListQueryTidbVo0.getPhoneNo())) { if (StringUtils.isBlank(blackListQueryTidbVo01.getPhoneNo()) && StringUtils.isNotBlank(blackListQueryTidbVo0.getPhoneNo())) {
blackListQueryTidbVo01.setPhoneNo(blackListQueryTidbVo0.getPhoneNo()); blackListQueryTidbVo01.setPhoneNo(blackListQueryTidbVo0.getPhoneNo());
} }
if (StringUtils.isBlank(blackListQueryTidbVo01.getIdNo()) && StringUtils.isNotBlank(blackListQueryTidbVo0.getIdNo())) { if (StringUtils.isBlank(blackListQueryTidbVo01.getIdNo()) && StringUtils.isNotBlank(blackListQueryTidbVo0.getIdNo())) {
blackListQueryTidbVo01.setIdNo(blackListQueryTidbVo0.getIdNo()); blackListQueryTidbVo01.setIdNo(blackListQueryTidbVo0.getIdNo());
} }
List<BlackListQueryTidbVo0> blackListQueryTidbVo0sByUniqueKey = blackListJdbcTemplate.query(String.format(Constant.SQL.BLACK_LIST_NEW_QUERY_BY_UNIQUE_KEY_SQL, List<BlackListQueryTidbVo0> blackListQueryTidbVo0sByUniqueKey = blackListJdbcTemplate.query(String.format(Constant.SQL.BLACK_LIST_NEW_QUERY_BY_UNIQUE_KEY_SQL,
blackListQueryTidbVo0.getPhoneNo(), blackListQueryTidbVo0.getName(), blackListQueryTidbVo0.getIdNo(), blackListQueryTidbVo01.getType()), new BeanPropertyRowMapper<>(BlackListQueryTidbVo0.class)); blackListQueryTidbVo0.getPhoneNo(), blackListQueryTidbVo0.getName(), blackListQueryTidbVo0.getIdNo(), blackListQueryTidbVo01.getType()), new BeanPropertyRowMapper<>(BlackListQueryTidbVo0.class));
if (CollectionUtils.isNotEmpty(blackListQueryTidbVo0sByUniqueKey)) { if (CollectionUtils.isNotEmpty(blackListQueryTidbVo0sByUniqueKey)) {
blackListQueryTidbVo01.setUpdatedAt(new Timestamp(System.currentTimeMillis())); blackListQueryTidbVo01.setUpdatedAt(new Timestamp(System.currentTimeMillis()));
blackListJdbcTemplate.update(String.format(Constant.SQL.BLACK_LIST_NEW_UPDATE_DISABLE_BY_RECORD_ID_SQL, blackListQueryTidbVo01.getUpdatedAt(), blackListQueryTidbVo01.getId())); blackListJdbcTemplate.update(String.format(Constant.SQL.BLACK_LIST_NEW_UPDATE_DISABLE_BY_RECORD_ID_SQL, blackListQueryTidbVo01.getUpdatedAt(), blackListQueryTidbVo01.getId()));
} else { } else {
blackListJdbcTemplate.update(String.format(Constant.SQL.BLACK_LIST_NEW_UPDATE_THREE_ELE_SQL, blackListQueryTidbVo0.getUuid(), blackListQueryTidbVo0.getName(), blackListQueryTidbVo0.getPhoneNo(), blackListQueryTidbVo0.getIdNo(), blackListQueryTidbVo01.getId())); blackListJdbcTemplate.update(String.format(Constant.SQL.BLACK_LIST_NEW_UPDATE_THREE_ELE_SQL, blackListQueryTidbVo0.getUuid(), blackListQueryTidbVo0.getName(), blackListQueryTidbVo0.getPhoneNo(), blackListQueryTidbVo0.getIdNo(), blackListQueryTidbVo01.getId()));
}
} }
}
if(type.equals(Constant.PARAM.BLACK_LIST_INNER_PART)){ if(type.equals(Constant.PARAM.BLACK_LIST_INNER_PART)){
BlackListUtils.getOrUpdateBlackListLevel(blackListQueryTidbVo0, Constant.PARAM.BLACK_LIST_INNER_PART); BlackListUtils.getOrUpdateBlackListLevel(blackListQueryTidbVo0, Constant.PARAM.BLACK_LIST_INNER_PART);
blackListJdbcTemplate.update(String.format(Constant.SQL.BLACK_LIST_NEW_UPDATE_BLACK_LIST_LEVEL_SQL, blackListQueryTidbVo0.getBlackLevel(), blackListQueryTidbVo0.getId())); blackListJdbcTemplate.update(String.format(Constant.SQL.BLACK_LIST_NEW_UPDATE_BLACK_LIST_LEVEL_SQL, blackListQueryTidbVo0.getBlackLevel(), blackListQueryTidbVo0.getId()));
}
} }
}catch(Exception e){
log.error("更新黑名单三要素异常{} ", type, e);
} }
} }
......
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