|
@@ -86,11 +86,14 @@ public class GenPaperService {
|
|
List<Paper> papers = (List<Paper>) paperRepo.findAll(genPaperDto.getPaperIds());
|
|
List<Paper> papers = (List<Paper>) paperRepo.findAll(genPaperDto.getPaperIds());
|
|
List<PaperDetailUnit> unitList = new ArrayList<PaperDetailUnit>();
|
|
List<PaperDetailUnit> unitList = new ArrayList<PaperDetailUnit>();
|
|
for (Paper oldPaper : papers) {
|
|
for (Paper oldPaper : papers) {
|
|
- unitList.addAll(unitRepo.findByPaperOrderByNumber(oldPaper));
|
|
|
|
|
|
+ //unitList.addAll(unitRepo.findByPaperOrderByNumber(oldPaper));
|
|
|
|
+ for(PaperDetailUnit paperDetailUnit:unitRepo.findByPaperOrderByNumber(oldPaper)){
|
|
|
|
+ unitList.add(paperDetailUnit);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
Set<PaperDetailUnit> spareUnits = new HashSet<PaperDetailUnit>();
|
|
Set<PaperDetailUnit> spareUnits = new HashSet<PaperDetailUnit>();
|
|
spareUnits.addAll(unitList);
|
|
spareUnits.addAll(unitList);
|
|
- for (PaperDetailUnit unit : unitList) {
|
|
|
|
|
|
+ for (PaperDetailUnit unit : spareUnits) {
|
|
Question question = unit.getQuestion();
|
|
Question question = unit.getQuestion();
|
|
//根据questionId查询题库中大题来源
|
|
//根据questionId查询题库中大题来源
|
|
List<PaperDetailUnit> units = unitRepo.findByQuestion(question);
|
|
List<PaperDetailUnit> units = unitRepo.findByQuestion(question);
|