|
@@ -1,9 +1,10 @@
|
|
|
package cn.com.qmth.examcloud.core.questions.service.impl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.math.RoundingMode;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
import java.util.Iterator;
|
|
@@ -17,7 +18,6 @@ import cn.com.qmth.examcloud.core.questions.base.enums.PaperStructType;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.boot.autoconfigure.info.ProjectInfoProperties.Build;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.CourseRepo;
|
|
@@ -93,7 +93,8 @@ public class GenPaperService {
|
|
|
}
|
|
|
Set<PaperDetailUnit> spareUnits = new HashSet<PaperDetailUnit>();
|
|
|
spareUnits.addAll(unitList);
|
|
|
- for (PaperDetailUnit unit : spareUnits) {
|
|
|
+
|
|
|
+ /*for (PaperDetailUnit unit : spareUnits) {
|
|
|
Question question = unit.getQuestion();
|
|
|
//根据questionId查询题库中大题来源
|
|
|
List<PaperDetailUnit> units = unitRepo.findByQuestion(question);
|
|
@@ -105,7 +106,21 @@ public class GenPaperService {
|
|
|
}
|
|
|
}
|
|
|
questions.add(question);
|
|
|
+ }*/
|
|
|
+
|
|
|
+ List<Question> oList = new ArrayList<Question>();
|
|
|
+ for (PaperDetailUnit unit : spareUnits) {
|
|
|
+ oList.add(unit.getQuestion());
|
|
|
+ }
|
|
|
+ List<PaperDetailUnit> oDetailUnits = unitRepo.findByQuestionIn(oList);
|
|
|
+ for(PaperDetailUnit oldUnit:oDetailUnits){
|
|
|
+ Paper paper = oldUnit.getPaper();
|
|
|
+ if(paper.getPaperType() == PaperType.IMPORT){
|
|
|
+ oldUnit.getQuestion().setQuesName(oldUnit.getPaperDetail().getName());
|
|
|
+ }
|
|
|
+ questions.add(oldUnit.getQuestion());
|
|
|
}
|
|
|
+
|
|
|
Collections.shuffle(questions);
|
|
|
int maxLoopCount = questions.size() * 2;
|
|
|
int selectCount = 0;
|