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

修复查询黑名单bug

parent a7531170
......@@ -80,7 +80,9 @@ public class BlackListQueryManagerServiceImpl implements IBlackListQueryManagerS
public List<BlackListQueryTidbVo0> getBlackListData(String queryBlackListSql, String queryUserIdSql, String uuid, String name, String phoneNo, String idNo, String type) {
Stopwatch stopwatch = Stopwatch.createStarted();
List<BlackListQueryTidbVo0> queryListBlackListByPhoneNos = blackListJdbcTemplate.query(queryBlackListSql, new BeanPropertyRowMapper<>(BlackListQueryTidbVo0.class));
log.info("用户黑名单查询结果, uuid: {} , name: {} , phoneNo: {} , idNo: {} , type: {} , result: {} ", uuid, name, phoneNo, idNo, type, JSON.toJSONString(queryListBlackListByPhoneNos));
List<Map<String, Object>> queryXyqbUserInfoByPhoneNo = xyqbUserJdbcTemplate.queryForList(queryUserIdSql);
log.info("用户userId查询结果, uuid: {} , name: {} , phoneNo: {} , idNo: {} , type: {} , result: {} ", uuid, name, phoneNo, idNo, type, JSON.toJSONString(queryXyqbUserInfoByPhoneNo));
if (CollectionUtils.isNotEmpty(queryListBlackListByPhoneNos)) {
List<BlackListQueryTidbVo0> blackListQueryTidbVo0s = new ArrayList<>();
......@@ -88,9 +90,9 @@ public class BlackListQueryManagerServiceImpl implements IBlackListQueryManagerS
Map<String, Object> userIdMap = queryXyqbUserInfoByPhoneNo.get(0);
List<Map<String, Object>> totalOverdueDaysList = xyqbJdbcTemplate.queryForList(String.format(Constant.SQL.XYQB_QUERY_USER_TOTAL_OVERDUE_SQL, userIdMap.get(Constant.PARAM.USER_ID)));
log.info("用户历史逾期总天数, uuid: {} , name: {} , phoneNo: {} , idNo: {} , type", uuid, name, phoneNo, idNo, type, JSON.toJSONString(totalOverdueDaysList));
log.info("用户历史逾期总天数, uuid: {} , name: {} , phoneNo: {} , idNo: {} , type: {} , result: {} ", uuid, name, phoneNo, idNo, type, JSON.toJSONString(totalOverdueDaysList));
List<Map<String, Object>> maxOverdueDaysList = xyqbJdbcTemplate.queryForList(String.format(Constant.SQL.XYQB_QUERY_USER_MAX_OVERDUE_SQL, userIdMap.get(Constant.PARAM.USER_ID)));
log.info("用户最大逾期天数, uuid: {} , name: {} , phoneNo: {} , idNo: {} , type", uuid, name, phoneNo, idNo, type, JSON.toJSONString(maxOverdueDaysList));
log.info("用户最大逾期天数, uuid: {} , name: {} , phoneNo: {} , idNo: {} , type: {} , result: {} ", uuid, name, phoneNo, idNo, type, JSON.toJSONString(maxOverdueDaysList));
queryListBlackListByPhoneNos.stream().filter(o -> Timestamp.valueOf(
LocalDateTime.now().minusYears(channelBlackListExpireConfigMap.get(o.getType())).format(DateTimeFormatter.ofPattern(Constant.DAYE_FORMAT.YYYY_MM_DD_HH_MM_SS))
......@@ -143,6 +145,7 @@ public class BlackListQueryManagerServiceImpl implements IBlackListQueryManagerS
public void initChannelBlackListExpireConfig() {
List<BlackListChannelExpireConfigVo0> queryBlackListChannelExpireConfigVo0List = blackListJdbcTemplate.query(Constant.SQL.BLACK_LIST_NEW_QUERY_CHANNEL_BLACK_LIST_EXPIRE_CONFIG_SQL, new BeanPropertyRowMapper<>(BlackListChannelExpireConfigVo0.class));
channelBlackListExpireConfigMap = queryBlackListChannelExpireConfigVo0List.stream().collect(Collectors.toMap(BlackListChannelExpireConfigVo0::getType, BlackListChannelExpireConfigVo0::getExpireTime));
log.info("加载渠道黑名单有效期配置完成, result: {} ", JSON.toJSONString(channelBlackListExpireConfigMap));
}
}
......@@ -5,6 +5,7 @@ import cn.quantgroup.qgblservice.model.blacklist.ThirdPartBlackListConfigVo0;
import cn.quantgroup.qgblservice.repository.mybatis.entity.tidb.BlackListQueryTidbVo0;
import cn.quantgroup.qgblservice.response.GlobalResponse;
import cn.quantgroup.qgblservice.service.IThirdPartBlackListManagerService;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -86,6 +87,8 @@ public class ThirdPartBlackListServiceImpl implements IThirdPartBlackListManager
List<ThirdPartBlackListConfigVo0> thirdPartBlackListConfigVo0s = blackListJdbcTemplate.query(Constant.SQL.BLACK_LIST_NEW_QUERY_THIRD_PART_BLACK_LIST_CONFIG_SQL, new BeanPropertyRowMapper<>(ThirdPartBlackListConfigVo0.class));
thirdPartBlackListCacheConfigMap = thirdPartBlackListConfigVo0s.stream().collect(Collectors.toMap(ThirdPartBlackListConfigVo0::getChannelType, ThirdPartBlackListConfigVo0::getType));
log.info("加载三方数据源黑名单配置完成, result: {} ", JSON.toJSONString(thirdPartBlackListCacheConfigMap));
}
}
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