|
|
@ -84,11 +84,17 @@ public class QuManager {
|
|
|
|
qu.setCreateTime(new Date());
|
|
|
|
qu.setCreateTime(new Date());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
quService.saveOrUpdate(qu);
|
|
|
|
quService.saveOrUpdate(qu);
|
|
|
|
|
|
|
|
if(CollUtil.isEmpty(reqDTO.getAnswerList())){
|
|
|
|
|
|
|
|
throw new ServiceException("备选项列表不能为空");
|
|
|
|
|
|
|
|
}
|
|
|
|
if(CollUtil.isNotEmpty(reqDTO.getAnswerList())){
|
|
|
|
if(CollUtil.isNotEmpty(reqDTO.getAnswerList())){
|
|
|
|
List<ElQuAnswer> answerList = Convert.toList(ElQuAnswer.class, reqDTO.getAnswerList());
|
|
|
|
List<ElQuAnswer> answerList = Convert.toList(ElQuAnswer.class, reqDTO.getAnswerList());
|
|
|
|
answerList.forEach(elQuAnswer -> elQuAnswer.setQuId(qu.getId()));
|
|
|
|
answerList.forEach(elQuAnswer -> elQuAnswer.setQuId(qu.getId()));
|
|
|
|
quAnswerService.saveBatch(answerList);
|
|
|
|
quAnswerService.saveBatch(answerList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(CollUtil.isEmpty(reqDTO.getRepoIds())){
|
|
|
|
|
|
|
|
throw new ServiceException("题库列表不能为空");
|
|
|
|
|
|
|
|
}
|
|
|
|
if(CollUtil.isNotEmpty(reqDTO.getRepoIds())){
|
|
|
|
if(CollUtil.isNotEmpty(reqDTO.getRepoIds())){
|
|
|
|
List<ElQuRepo> list = new ArrayList<>();
|
|
|
|
List<ElQuRepo> list = new ArrayList<>();
|
|
|
|
reqDTO.getRepoIds().forEach(repoId->{
|
|
|
|
reqDTO.getRepoIds().forEach(repoId->{
|
|
|
|