|
@@ -116,12 +116,16 @@ public class GenPaperService {
|
|
|
questions.add(question);
|
|
|
}*/
|
|
|
|
|
|
- long start2 = System.currentTimeMillis();
|
|
|
+
|
|
|
List<Question> oList = new ArrayList<Question>();
|
|
|
for (PaperDetailUnit unit : spareUnits) {
|
|
|
oList.add(unit.getQuestion());
|
|
|
}
|
|
|
+ long start2 = System.currentTimeMillis();
|
|
|
List<PaperDetailUnit> oDetailUnits = unitRepo.findByQuestionIn(oList);
|
|
|
+ long total2 = (System.currentTimeMillis() - start2) / 1000;
|
|
|
+ log.debug("total2....."+total2);
|
|
|
+ long start4 = System.currentTimeMillis();
|
|
|
for(PaperDetailUnit oldUnit:oDetailUnits){
|
|
|
Paper paper = oldUnit.getPaper();
|
|
|
if(paper.getPaperType() == PaperType.IMPORT){
|
|
@@ -129,8 +133,8 @@ public class GenPaperService {
|
|
|
}
|
|
|
questions.add(oldUnit.getQuestion());
|
|
|
}
|
|
|
- long total2 = (System.currentTimeMillis() - start2) / 1000;
|
|
|
- log.debug("total2....."+total2);
|
|
|
+ long total4 = (System.currentTimeMillis() - start4) / 1000;
|
|
|
+ log.debug("循环耗时....."+total4);
|
|
|
Collections.shuffle(questions);
|
|
|
int maxLoopCount = questions.size() * 2;
|
|
|
int selectCount = 0;
|