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

缓存reload fix

parent 9321b413
package cn.quantgroup.qgblservice.controller;
import cn.quantgroup.qgblservice.response.GlobalResponse;
import cn.quantgroup.qgblservice.service.IBlackListQueryManagerService;
import cn.quantgroup.qgblservice.service.IThirdPartBlackListManagerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -9,10 +14,38 @@ import org.springframework.web.bind.annotation.RestController;
* @Author fengjunkai
* @Date 2019-07-31 17:16
*/
@Slf4j
@RestController
@RequestMapping("/")
public class BlackListCacheManagerController {
@Autowired
private IThirdPartBlackListManagerService iThirdPartBlackListManagerService;
@Autowired
private IBlackListQueryManagerService iBlackListQueryManagerService;
@RequestMapping("/third_cache_reload")
public GlobalResponse reloadThirdCacheConfig(){
try{
iThirdPartBlackListManagerService.initThirdPartBlackListConfig();
log.info("更新三方数据源缓存配置成功");
return GlobalResponse.success("更新三方数据源缓存配置成功");
}catch(Exception e){
log.error("更新三方数据源缓存配置异常", e);
}
return GlobalResponse.error("更新三方数据源缓存配置失败");
}
@RequestMapping("/black_expire_reload")
public GlobalResponse reloadBlackExpire(){
try{
iBlackListQueryManagerService.initChannelBlackListExpireConfig();
log.info("更新有效期配置成功");
return GlobalResponse.success("更新有效期配置成功");
}catch(Exception e){
log.error("更新有效期配置异常", e);
}
return GlobalResponse.error("更新有效期配置失败");
}
}
......@@ -32,8 +32,4 @@ public class BlackListImportManagerJob {
}
public static void main(String[] args) {
}
}
......@@ -13,7 +13,7 @@ public enum BlackListType {
QUNAR("去哪儿黑名单", "3"),
COURT("法院黑名单", "4"),
OFF_LINE("线下黑名单", "5"),
XINYAN_CASH("新套现黑名单", "6"),
XINYAN_CASH("新套现黑名单", "6"),
PHONE_CASH("手机套现黑名单", "8"),
HUAN_QIU_BLACK_CARD("环球黑卡黑名单", "9"),
P2P("P2P黑名单", "101"),
......
......@@ -4,7 +4,6 @@ package cn.quantgroup.qgblservice.service;
* @Author fengjunkai
* @Date 2019-08-05 16:43
*/
@Deprecated
public interface IBlackListManagerService {
public void blackListRealTimeManagerByDay();
......
......@@ -9,5 +9,6 @@ import cn.quantgroup.qgblservice.response.GlobalResponse;
public interface IBlackListQueryManagerService {
public GlobalResponse queryBlackList(String uuid, String name, String phoneNo, String idCard, String type);
public void initChannelBlackListExpireConfig();
}
......@@ -9,5 +9,6 @@ import cn.quantgroup.qgblservice.response.GlobalResponse;
public interface IThirdPartBlackListManagerService {
public GlobalResponse saveThirdPartBlackList(String uuid, String name, String phoneNo, String idCard, String type);
public void initThirdPartBlackListConfig();
}
......@@ -49,7 +49,7 @@ public class BlackListManagerServiceImpl implements IBlackListManagerService {
List<BlackListQueryTidbVo0> blackListQueryTidbVo0s = new ArrayList<>();
Stopwatch stopwatch = Stopwatch.createStarted();
List<BlackListQueryTidbVo0> userLoanOverdue15DaysLists = xyqbJdbcTemplate.query(Constant.SQL.XYQB_QUERY_USER_LOAN_OVERDUE_15DAY_SQL, new BeanPropertyRowMapper<>(BlackListQueryTidbVo0.class));
log.info("每天执行查询15+逾期用户黑名单, result: {} , 耗时: {} ", JSON.toJSONString(userLoanOverdue15DaysLists), stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
log.info("每天执行查询15+逾期用户黑名单, resultSize: {} , 耗时: {} ", userLoanOverdue15DaysLists.size(), stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
for (int i = 0; i < userLoanOverdue15DaysLists.size(); i++) {
......
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