|
|
@ -51,7 +51,6 @@ public class CourseTagManageController {
|
|
|
|
private SysObjectiveQuestionsMapper sysObjectiveQuestionsMapper;
|
|
|
|
private SysObjectiveQuestionsMapper sysObjectiveQuestionsMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ApiOperation("添加二级目录")
|
|
|
|
@ApiOperation("添加二级目录")
|
|
|
|
@PostMapping("insertSysTwoCatalog")
|
|
|
|
@PostMapping("insertSysTwoCatalog")
|
|
|
@ -143,12 +142,18 @@ public class CourseTagManageController {
|
|
|
|
//删除资源关系表
|
|
|
|
//删除资源关系表
|
|
|
|
SysResourceAndCourseExample example1 = new SysResourceAndCourseExample();
|
|
|
|
SysResourceAndCourseExample example1 = new SysResourceAndCourseExample();
|
|
|
|
example1.createCriteria().andTwoIdEqualTo(id);
|
|
|
|
example1.createCriteria().andTwoIdEqualTo(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SysResourceAndCourse> sysResourceAndCourses = sysResourceAndCourseMapper.selectByExample(example1);
|
|
|
|
|
|
|
|
List<String> resourceIds = sysResourceAndCourses.stream().map(SysResourceAndCourse::getResourceId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
sysResourceAndCourseMapper.deleteByExample(example1);
|
|
|
|
sysResourceAndCourseMapper.deleteByExample(example1);
|
|
|
|
|
|
|
|
|
|
|
|
//删除资源
|
|
|
|
//删除资源
|
|
|
|
|
|
|
|
if (!resourceIds.isEmpty()) {
|
|
|
|
SysResourceExample sysResourceExample = new SysResourceExample();
|
|
|
|
SysResourceExample sysResourceExample = new SysResourceExample();
|
|
|
|
sysResourceExample.createCriteria().andTwoTagEqualTo(id);
|
|
|
|
sysResourceExample.createCriteria().andResourceIdIn(resourceIds);
|
|
|
|
sysResourceMapper.deleteByExample(sysResourceExample);
|
|
|
|
sysResourceMapper.deleteByExample(sysResourceExample);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//删除题目关系表
|
|
|
|
//删除题目关系表
|
|
|
|
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
|
|
|
|
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
|
|
|
@ -159,27 +164,33 @@ public class CourseTagManageController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除案例题
|
|
|
|
//删除案例题
|
|
|
|
|
|
|
|
if (!topicIds.isEmpty()) {
|
|
|
|
SysCaseQuestionExample sysCaseQuestionExample = new SysCaseQuestionExample();
|
|
|
|
SysCaseQuestionExample sysCaseQuestionExample = new SysCaseQuestionExample();
|
|
|
|
sysCaseQuestionExample.createCriteria().andCaseIdIn(topicIds);
|
|
|
|
sysCaseQuestionExample.createCriteria().andCaseIdIn(topicIds);
|
|
|
|
sysCaseQuestionMapper.deleteByExample(sysCaseQuestionExample);
|
|
|
|
sysCaseQuestionMapper.deleteByExample(sysCaseQuestionExample);
|
|
|
|
|
|
|
|
|
|
|
|
//删除客观题
|
|
|
|
//删除客观题
|
|
|
|
SysObjectiveQuestionsExample sysObjectiveQuestionsExample =new SysObjectiveQuestionsExample();
|
|
|
|
SysObjectiveQuestionsExample sysObjectiveQuestionsExample = new SysObjectiveQuestionsExample();
|
|
|
|
sysObjectiveQuestionsExample.createCriteria().andObjectiveIdIn(topicIds);
|
|
|
|
sysObjectiveQuestionsExample.createCriteria().andObjectiveIdIn(topicIds);
|
|
|
|
sysObjectiveQuestionsMapper.deleteByExample(sysObjectiveQuestionsExample);
|
|
|
|
sysObjectiveQuestionsMapper.deleteByExample(sysObjectiveQuestionsExample);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
sysThreeCatalogMapper.deleteByPrimaryKey(id);
|
|
|
|
sysThreeCatalogMapper.deleteByPrimaryKey(id);
|
|
|
|
|
|
|
|
|
|
|
|
//删除资源关系表
|
|
|
|
//删除资源关系表
|
|
|
|
SysResourceAndCourseExample sysResourceAndCourseExample = new SysResourceAndCourseExample();
|
|
|
|
SysResourceAndCourseExample sysResourceAndCourseExample = new SysResourceAndCourseExample();
|
|
|
|
sysResourceAndCourseExample.createCriteria().andThreeIdEqualTo(id);
|
|
|
|
sysResourceAndCourseExample.createCriteria().andThreeIdEqualTo(id);
|
|
|
|
sysResourceAndCourseMapper.deleteByExample(sysResourceAndCourseExample);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SysResourceAndCourse> sysResourceAndCourses = sysResourceAndCourseMapper.selectByExample(sysResourceAndCourseExample);
|
|
|
|
|
|
|
|
List<String> resourceIds = sysResourceAndCourses.stream().map(SysResourceAndCourse::getResourceId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sysResourceAndCourseMapper.deleteByExample(sysResourceAndCourseExample);
|
|
|
|
//删除资源
|
|
|
|
//删除资源
|
|
|
|
|
|
|
|
if (!resourceIds.isEmpty()) {
|
|
|
|
SysResourceExample sysResourceExample = new SysResourceExample();
|
|
|
|
SysResourceExample sysResourceExample = new SysResourceExample();
|
|
|
|
sysResourceExample.createCriteria().andThreeTagEqualTo(id);
|
|
|
|
sysResourceExample.createCriteria().andResourceIdIn(resourceIds);
|
|
|
|
sysResourceMapper.deleteByExample(sysResourceExample);
|
|
|
|
sysResourceMapper.deleteByExample(sysResourceExample);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//删除题目关系表
|
|
|
|
//删除题目关系表
|
|
|
|
SysTopicAndCourseExample sysTopicAndCourseExample = new SysTopicAndCourseExample();
|
|
|
|
SysTopicAndCourseExample sysTopicAndCourseExample = new SysTopicAndCourseExample();
|
|
|
@ -191,15 +202,17 @@ public class CourseTagManageController {
|
|
|
|
sysTopicAndCourseMapper.deleteByExample(sysTopicAndCourseExample);
|
|
|
|
sysTopicAndCourseMapper.deleteByExample(sysTopicAndCourseExample);
|
|
|
|
|
|
|
|
|
|
|
|
//删除案例题
|
|
|
|
//删除案例题
|
|
|
|
|
|
|
|
if (!topicIds.isEmpty()) {
|
|
|
|
SysCaseQuestionExample sysCaseQuestionExample = new SysCaseQuestionExample();
|
|
|
|
SysCaseQuestionExample sysCaseQuestionExample = new SysCaseQuestionExample();
|
|
|
|
sysCaseQuestionExample.createCriteria().andCaseIdIn(topicIds);
|
|
|
|
sysCaseQuestionExample.createCriteria().andCaseIdIn(topicIds);
|
|
|
|
sysCaseQuestionMapper.deleteByExample(sysCaseQuestionExample);
|
|
|
|
sysCaseQuestionMapper.deleteByExample(sysCaseQuestionExample);
|
|
|
|
|
|
|
|
|
|
|
|
//删除客观题
|
|
|
|
//删除客观题
|
|
|
|
SysObjectiveQuestionsExample sysObjectiveQuestionsExample =new SysObjectiveQuestionsExample();
|
|
|
|
SysObjectiveQuestionsExample sysObjectiveQuestionsExample = new SysObjectiveQuestionsExample();
|
|
|
|
sysObjectiveQuestionsExample.createCriteria().andObjectiveIdIn(topicIds);
|
|
|
|
sysObjectiveQuestionsExample.createCriteria().andObjectiveIdIn(topicIds);
|
|
|
|
sysObjectiveQuestionsMapper.deleteByExample(sysObjectiveQuestionsExample);
|
|
|
|
sysObjectiveQuestionsMapper.deleteByExample(sysObjectiveQuestionsExample);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR, "删除失败,请联系管理员");
|
|
|
|
return new ResultEntity<>(HttpStatus.INTERNAL_SERVER_ERROR, "删除失败,请联系管理员");
|
|
|
@ -208,7 +221,6 @@ public class CourseTagManageController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ApiOperation("一级目录重新排序")
|
|
|
|
@ApiOperation("一级目录重新排序")
|
|
|
|
@PostMapping("setOneCatalogueRank")
|
|
|
|
@PostMapping("setOneCatalogueRank")
|
|
|
|