weiwenhai 6 anni fa
parent
commit
72a425673d

+ 7 - 3
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/GenPaperService.java

@@ -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;