|
@@ -817,7 +817,30 @@ public class GenPaperService {
|
|
unitContexts.addAll(dc.getUnits());
|
|
unitContexts.addAll(dc.getUnits());
|
|
}
|
|
}
|
|
List<Paper> papers = (List<Paper>) paperRepo.findAll(genPaperDto.getPaperIds());
|
|
List<Paper> papers = (List<Paper>) paperRepo.findAll(genPaperDto.getPaperIds());
|
|
|
|
+ List<PaperDetailUnit> unitList = new ArrayList<PaperDetailUnit>();
|
|
for (Paper oldPaper : papers) {
|
|
for (Paper oldPaper : papers) {
|
|
|
|
+ //unitList.addAll(unitRepo.findByPaperOrderByNumber(oldPaper));
|
|
|
|
+ for(PaperDetailUnit paperDetailUnit:unitRepo.findByPaperOrderByNumber(oldPaper)){
|
|
|
|
+ unitList.add(paperDetailUnit);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Set<PaperDetailUnit> spareUnits = new HashSet<PaperDetailUnit>();
|
|
|
|
+ spareUnits.addAll(unitList);
|
|
|
|
+ for (PaperDetailUnit unit : spareUnits) {
|
|
|
|
+ Question question = unit.getQuestion();
|
|
|
|
+ //根据questionId查询题库中大题来源
|
|
|
|
+ List<PaperDetailUnit> units = unitRepo.findByQuestion(question);
|
|
|
|
+ for(PaperDetailUnit oldUnit:units){
|
|
|
|
+ Paper paper = oldUnit.getPaper();
|
|
|
|
+ if(paper.getPaperType() == PaperType.IMPORT){
|
|
|
|
+ question.setQuesName(oldUnit.getPaperDetail().getName());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ question.setPropertyGroup(bulidPropertyGroup(question));
|
|
|
|
+ questions.add(question);
|
|
|
|
+ }
|
|
|
|
+ /*for (Paper oldPaper : papers) {
|
|
List<PaperDetailUnit> unitList = unitRepo.findByPaperOrderByNumber(oldPaper);
|
|
List<PaperDetailUnit> unitList = unitRepo.findByPaperOrderByNumber(oldPaper);
|
|
for (PaperDetailUnit unit : unitList) {
|
|
for (PaperDetailUnit unit : unitList) {
|
|
Question question = unit.getQuestion();
|
|
Question question = unit.getQuestion();
|
|
@@ -826,7 +849,7 @@ public class GenPaperService {
|
|
questions.add(question);
|
|
questions.add(question);
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
Collections.shuffle(questions);
|
|
Collections.shuffle(questions);
|
|
int maxLoopCount = questions.size() * 2;
|
|
int maxLoopCount = questions.size() * 2;
|
|
int selectCount = 0;
|
|
int selectCount = 0;
|