|
|
@ -137,6 +137,17 @@ public class TopicResourceController {
|
|
|
|
sysTopicAndCourse.setId(IdUtil.randomUUID());
|
|
|
|
sysTopicAndCourse.setId(IdUtil.randomUUID());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (SysTopicAndCourse sysTopicAndCourse : list) {
|
|
|
|
|
|
|
|
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
|
|
|
|
|
|
|
|
example.createCriteria().andTopicIdEqualTo(sysTopicAndCourse.getTopicId())
|
|
|
|
|
|
|
|
.andOneIdEqualTo(sysTopicAndCourse.getOneId())
|
|
|
|
|
|
|
|
.andTwoIdEqualTo(sysTopicAndCourse.getTwoId())
|
|
|
|
|
|
|
|
.andThreeIdEqualTo(sysTopicAndCourse.getThreeId());
|
|
|
|
|
|
|
|
List<SysTopicAndCourse> sysTopicAndCourses = sysTopicAndCourseMapper.selectByExample(example);
|
|
|
|
|
|
|
|
if (sysTopicAndCourses != null && !sysTopicAndCourses.isEmpty()) {
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "该章节下已存在此题目!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
sysTopicAndCourseMapper.batchInsert(list);
|
|
|
|
sysTopicAndCourseMapper.batchInsert(list);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
@ -185,31 +196,6 @@ public class TopicResourceController {
|
|
|
|
List<SysObjectiveQuestionsDto> list = sysObjectiveQuestionMapper.getTopicByConfig(oneID, twoID, threeID, type, content);
|
|
|
|
List<SysObjectiveQuestionsDto> list = sysObjectiveQuestionMapper.getTopicByConfig(oneID, twoID, threeID, type, content);
|
|
|
|
PageInfo<SysObjectiveQuestionsDto> pageInfo = new PageInfo(list);
|
|
|
|
PageInfo<SysObjectiveQuestionsDto> pageInfo = new PageInfo(list);
|
|
|
|
return new ResultEntity<PageInfo<SysObjectiveQuestionsDto>>(pageInfo);
|
|
|
|
return new ResultEntity<PageInfo<SysObjectiveQuestionsDto>>(pageInfo);
|
|
|
|
// SysTopicAndCourseExample example = new SysTopicAndCourseExample();
|
|
|
|
|
|
|
|
// SysTopicAndCourseExample.Criteria criteria = example.createCriteria();
|
|
|
|
|
|
|
|
// if (StringUtils.isNotBlank(oneID)) {
|
|
|
|
|
|
|
|
// criteria.andOneIdEqualTo(oneID);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (StringUtils.isNotBlank(twoID)) {
|
|
|
|
|
|
|
|
// criteria.andTwoIdEqualTo(twoID);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (StringUtils.isNotBlank(threeID)) {
|
|
|
|
|
|
|
|
// criteria.andThreeIdEqualTo(threeID);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// List<SysTopicAndCourse> sysTopicAndCourses = sysTopicAndCourseMapper.selectByExample(example);
|
|
|
|
|
|
|
|
// List<String> collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getTopicId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
// SysObjectiveQuestionsExample example1 = new SysObjectiveQuestionsExample();
|
|
|
|
|
|
|
|
// SysObjectiveQuestionsExample.Criteria criteria1 = example1.createCriteria();
|
|
|
|
|
|
|
|
// if (StringUtils.isNotBlank(type)) {
|
|
|
|
|
|
|
|
// criteria1.andTypeEqualTo(type);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (StringUtils.isNotBlank(content)) {
|
|
|
|
|
|
|
|
// criteria1.andContentLike(content);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// criteria1.andObjectiveIdIn(collect);
|
|
|
|
|
|
|
|
// List<SysObjectiveQuestions> sysObjectiveQuestions = sysObjectiveQuestionMapper.selectByExample(example1);
|
|
|
|
|
|
|
|
// PageInfo pageInfo = PageUtil.pageHelper(sysObjectiveQuestions, index, size);
|
|
|
|
|
|
|
|
// return new ResultEntity<PageInfo<SysObjectiveQuestionsDto>>(pageInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|