|
@@ -1090,7 +1090,7 @@ public class RandomPaperServiceImpl implements RandomPaperService {
|
|
private List<Integer> getIndexList(Integer count){
|
|
private List<Integer> getIndexList(Integer count){
|
|
List<Integer> ret=new ArrayList<>();
|
|
List<Integer> ret=new ArrayList<>();
|
|
for (int i = 0; i < count; i++) {
|
|
for (int i = 0; i < count; i++) {
|
|
- ret.add(i);
|
|
|
|
|
|
+ ret.add(count);
|
|
}
|
|
}
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
@@ -1209,7 +1209,7 @@ public class RandomPaperServiceImpl implements RandomPaperService {
|
|
count = 0;
|
|
count = 0;
|
|
}
|
|
}
|
|
map.put(rpq.getKey(), count+1);
|
|
map.put(rpq.getKey(), count+1);
|
|
- redisClient.set(questionKey,rpq.getKey()+"-"+count, rpq, cacheTimeOut);
|
|
|
|
|
|
+ redisClient.set(questionKey,rpq.getKey()+"_"+count, rpq, cacheTimeOut);
|
|
}
|
|
}
|
|
rp.setQuestionMap(map);
|
|
rp.setQuestionMap(map);
|
|
|
|
|
|
@@ -1220,7 +1220,7 @@ public class RandomPaperServiceImpl implements RandomPaperService {
|
|
|
|
|
|
private RandomPaperQuestion getRandomPaperQuestionCacheById(String randomPaperId,String ckey,Integer index) {
|
|
private RandomPaperQuestion getRandomPaperQuestionCacheById(String randomPaperId,String ckey,Integer index) {
|
|
String questionKey = CacheConstants.CACHE_Q_RANDOM_PAPER_QUESTION + randomPaperId;
|
|
String questionKey = CacheConstants.CACHE_Q_RANDOM_PAPER_QUESTION + randomPaperId;
|
|
- String subKey=ckey+"-"+index;
|
|
|
|
|
|
+ String subKey=ckey+"_"+index;
|
|
// 从redis缓存中获取
|
|
// 从redis缓存中获取
|
|
RandomPaperQuestion rp = redisClient.get(questionKey,subKey, RandomPaperQuestion.class);
|
|
RandomPaperQuestion rp = redisClient.get(questionKey,subKey, RandomPaperQuestion.class);
|
|
if (rp != null) {
|
|
if (rp != null) {
|
|
@@ -1243,8 +1243,8 @@ public class RandomPaperServiceImpl implements RandomPaperService {
|
|
count = 0;
|
|
count = 0;
|
|
}
|
|
}
|
|
map.put(rpq.getKey(), count+1);
|
|
map.put(rpq.getKey(), count+1);
|
|
- redisClient.set(questionKey,rpq.getKey()+"-"+count, rpq, cacheTimeOut);
|
|
|
|
- if(subKey.equals(rpq.getKey()+"-"+count)) {
|
|
|
|
|
|
+ redisClient.set(questionKey,rpq.getKey()+"_"+count, rpq, cacheTimeOut);
|
|
|
|
+ if(subKey.equals(rpq.getKey()+"_"+count)) {
|
|
rp=rpq;
|
|
rp=rpq;
|
|
}
|
|
}
|
|
}
|
|
}
|