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

更新黑名单三要素异常处理

parent 37bf8e7e
...@@ -4,6 +4,7 @@ import cn.quantgroup.qgblservice.constant.Constant; ...@@ -4,6 +4,7 @@ import cn.quantgroup.qgblservice.constant.Constant;
import cn.quantgroup.qgblservice.repository.mybatis.entity.tidb.BlackListQueryTidbVo0; import cn.quantgroup.qgblservice.repository.mybatis.entity.tidb.BlackListQueryTidbVo0;
import cn.quantgroup.qgblservice.service.IBlackListUpdateThreeEleService; import cn.quantgroup.qgblservice.service.IBlackListUpdateThreeEleService;
import cn.quantgroup.qgblservice.utils.blacklist.BlackListUtils; import cn.quantgroup.qgblservice.utils.blacklist.BlackListUtils;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -58,15 +59,19 @@ public class BlackListUpdateThreeEleServiceImpl implements IBlackListUpdateThree ...@@ -58,15 +59,19 @@ public class BlackListUpdateThreeEleServiceImpl implements IBlackListUpdateThree
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, try{
blackListQueryTidbVo0.getPhoneNo(), blackListQueryTidbVo0.getName(), blackListQueryTidbVo0.getIdNo(), blackListQueryTidbVo01.getType()), new BeanPropertyRowMapper<>(BlackListQueryTidbVo0.class)); 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));
if (CollectionUtils.isNotEmpty(blackListQueryTidbVo0sByUniqueKey)) {
blackListQueryTidbVo01.setUpdatedAt(new Timestamp(System.currentTimeMillis())); if (CollectionUtils.isNotEmpty(blackListQueryTidbVo0sByUniqueKey)) {
blackListJdbcTemplate.update(String.format(Constant.SQL.BLACK_LIST_NEW_UPDATE_DISABLE_BY_RECORD_ID_SQL, blackListQueryTidbVo01.getUpdatedAt(), blackListQueryTidbVo01.getId())); blackListQueryTidbVo01.setUpdatedAt(new Timestamp(System.currentTimeMillis()));
} else { blackListJdbcTemplate.update(String.format(Constant.SQL.BLACK_LIST_NEW_UPDATE_DISABLE_BY_RECORD_ID_SQL, blackListQueryTidbVo01.getUpdatedAt(), blackListQueryTidbVo01.getId()));
BlackListUtils.getOrUpdateBlackListLevel(blackListQueryTidbVo01, type); } else {
blackListJdbcTemplate.update(String.format(Constant.SQL.BLACK_LIST_NEW_UPDATE_THREE_ELE_AND_BLACK_LEVEL_SQL, blackListQueryTidbVo0.getUuid(), blackListQueryTidbVo0.getName(), blackListQueryTidbVo0.getPhoneNo(), blackListQueryTidbVo0.getIdNo(), blackListQueryTidbVo01.getId())); BlackListUtils.getOrUpdateBlackListLevel(blackListQueryTidbVo01, type);
blackListJdbcTemplate.update(String.format(Constant.SQL.BLACK_LIST_NEW_UPDATE_THREE_ELE_AND_BLACK_LEVEL_SQL, blackListQueryTidbVo0.getUuid(), blackListQueryTidbVo0.getName(), blackListQueryTidbVo0.getPhoneNo(), blackListQueryTidbVo0.getIdNo(), blackListQueryTidbVo01.getId()));
}
}catch(Exception e){
log.error("更新单条黑名单三要素异常, uploadData: {} , queryData: {} ", JSON.toJSONString(blackListQueryTidbVo01), JSON.toJSONString(blackListQueryTidbVo0), 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