Commit 4e773793 authored by 郝彦辉's avatar 郝彦辉

黑灰名单结果表、明细表增加数据源2020.04.17

parent bc4f9ffb
...@@ -68,10 +68,11 @@ public class BlackListToolsManagerServiceImpl implements IBlackListToolsManagerS ...@@ -68,10 +68,11 @@ public class BlackListToolsManagerServiceImpl implements IBlackListToolsManagerS
private static Map<String, Integer> channelBlackListExpireConfigMap = new ConcurrentHashMap<>(); private static Map<String, Integer> channelBlackListExpireConfigMap = new ConcurrentHashMap<>();
private final int LIMIT = 10000;
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private final int LIMIT_1000 = 1000; private static int LIMIT = 10000;
private static int LIMIT_1000 = 1000;
private static int LIMIT_X = 1000;
@Autowired @Autowired
private IBlackGreyListService blackGreyListService; private IBlackGreyListService blackGreyListService;
...@@ -1254,27 +1255,32 @@ public class BlackListToolsManagerServiceImpl implements IBlackListToolsManagerS ...@@ -1254,27 +1255,32 @@ public class BlackListToolsManagerServiceImpl implements IBlackListToolsManagerS
int maxId = 0; int maxId = 0;
int BEGIN_ID = 0, startId = 0, endId = 0; int BEGIN_ID = 0, startId = 0, endId = 0;
try{ try{
String value_maxId = stringRedisTemplate.opsForValue().get("UPDATE_HUITOHEI_MAXID_TYPE1"); String value_maxId = stringRedisTemplate.opsForValue().get("UPDATE_HUITOHEI_P_MAXID");
if(StringUtils.isNotEmpty(value_maxId)){ if(StringUtils.isNotEmpty(value_maxId)){
maxId = Integer.parseInt(value_maxId); maxId = Integer.parseInt(value_maxId);
} }
String value_beginId = stringRedisTemplate.opsForValue().get("UPDATE_HUITOHEI_MAXID_BEGINID"); String value_beginId = stringRedisTemplate.opsForValue().get("UPDATE_HUITOHEI_P_BEGINID");
if(StringUtils.isNotEmpty(value_beginId)){ if(StringUtils.isNotEmpty(value_beginId)){
BEGIN_ID = Integer.parseInt(value_beginId); BEGIN_ID = Integer.parseInt(value_beginId);
} }
String value_limitX = stringRedisTemplate.opsForValue().get("UPDATE_HUITOHEI_P_LIMIT_X");
if(StringUtils.isNotEmpty(value_limitX)){
LIMIT_X = Integer.parseInt(value_limitX);
}
}catch (Exception e){ }catch (Exception e){
log.error("获取redis里值异常, key: {} ", "UPDATE_HUITOHEI_MAXID_TYPE1", e); log.error("获取redis里值异常, key: {} ", "UPDATE_HUITOHEI_MAXID_TYPE1", e);
} }
log.info("方法tmpBlackGreyToProduct()查询缓存, maxId : {} , BEGIN_ID : {} , startId : {} , endId: {} ", maxId, BEGIN_ID, startId, endId); log.info("方法tmpBlackGreyToProduct()查询缓存, maxId : {} , BEGIN_ID : {} , startId : {} , endId: {} , LIMIT_X : {} ", maxId, BEGIN_ID, startId, endId, LIMIT_X);
if(maxId<=0){ if(maxId<=0){
return; return;
} }
int totalQueryCount=0, totalOkCount = 0; int totalQueryCount=0, totalOkCount = 0;
int totalPage = (maxId-BEGIN_ID) /LIMIT_1000; int totalPage = (maxId-BEGIN_ID) / LIMIT_X;
if(( (maxId-BEGIN_ID)%LIMIT_1000)!=0){ if(( (maxId-BEGIN_ID)%LIMIT_X)!=0){
totalPage+=1; totalPage+=1;
} }
...@@ -1283,8 +1289,8 @@ public class BlackListToolsManagerServiceImpl implements IBlackListToolsManagerS ...@@ -1283,8 +1289,8 @@ public class BlackListToolsManagerServiceImpl implements IBlackListToolsManagerS
//startId = (page-1) * LIMIT_1000; //startId = (page-1) * LIMIT_1000;
//endId = page * LIMIT_1000; //endId = page * LIMIT_1000;
startId = BEGIN_ID + (page-1) * LIMIT_1000; startId = BEGIN_ID + (page-1) * LIMIT_X;
endId = startId + LIMIT_1000; endId = startId + LIMIT_X;
long thisPageStart= System.currentTimeMillis(); long thisPageStart= System.currentTimeMillis();
List<TmpBlackGreyList> tmpQueryList = null; List<TmpBlackGreyList> tmpQueryList = null;
......
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