|
|
@ -43,6 +43,12 @@ public class CourseTagManageController {
|
|
|
|
private SysTopicAndCourseMapper sysTopicAndCourseMapper;
|
|
|
|
private SysTopicAndCourseMapper sysTopicAndCourseMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private SysResourceAndCourseMapper sysResourceAndCourseMapper;
|
|
|
|
private SysResourceAndCourseMapper sysResourceAndCourseMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SysResourceMapper sysResourceMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SysCaseQuestionMapper sysCaseQuestionMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SysObjectiveQuestionsMapper sysObjectiveQuestionsMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
@ -98,11 +104,11 @@ public class CourseTagManageController {
|
|
|
|
List<String> ids = sysResourceAndCourses.stream().map(SysResourceAndCourse::getId).collect(Collectors.toList());
|
|
|
|
List<String> ids = sysResourceAndCourses.stream().map(SysResourceAndCourse::getId).collect(Collectors.toList());
|
|
|
|
sysResourceAndCourseMapper.batchUpdateTwoName(ids, name);
|
|
|
|
sysResourceAndCourseMapper.batchUpdateTwoName(ids, name);
|
|
|
|
|
|
|
|
|
|
|
|
SysTopicAndCourseExample example1 =new SysTopicAndCourseExample();
|
|
|
|
SysTopicAndCourseExample example1 = new SysTopicAndCourseExample();
|
|
|
|
example1.createCriteria().andTwoIdEqualTo(id);
|
|
|
|
example1.createCriteria().andTwoIdEqualTo(id);
|
|
|
|
List<SysTopicAndCourse> sysTopicAndCourses = sysTopicAndCourseMapper.selectByExample(example1);
|
|
|
|
List<SysTopicAndCourse> sysTopicAndCourses = sysTopicAndCourseMapper.selectByExample(example1);
|
|
|
|
List<String> collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getId).collect(Collectors.toList());
|
|
|
|
List<String> collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getId).collect(Collectors.toList());
|
|
|
|
sysTopicAndCourseMapper.batchUpdateTwoName(collect,name);
|
|
|
|
sysTopicAndCourseMapper.batchUpdateTwoName(collect, name);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
SysThreeCatalog sysThreeCatalog = sysThreeCatalogMapper.selectByPrimaryKey(id);
|
|
|
|
SysThreeCatalog sysThreeCatalog = sysThreeCatalogMapper.selectByPrimaryKey(id);
|
|
|
@ -115,11 +121,11 @@ public class CourseTagManageController {
|
|
|
|
List<String> ids = sysResourceAndCourses.stream().map(SysResourceAndCourse::getId).collect(Collectors.toList());
|
|
|
|
List<String> ids = sysResourceAndCourses.stream().map(SysResourceAndCourse::getId).collect(Collectors.toList());
|
|
|
|
sysResourceAndCourseMapper.batchUpdateThreeName(ids, name);
|
|
|
|
sysResourceAndCourseMapper.batchUpdateThreeName(ids, name);
|
|
|
|
|
|
|
|
|
|
|
|
SysTopicAndCourseExample example1 =new SysTopicAndCourseExample();
|
|
|
|
SysTopicAndCourseExample example1 = new SysTopicAndCourseExample();
|
|
|
|
example1.createCriteria().andThreeIdEqualTo(id);
|
|
|
|
example1.createCriteria().andThreeIdEqualTo(id);
|
|
|
|
List<SysTopicAndCourse> sysTopicAndCourses = sysTopicAndCourseMapper.selectByExample(example1);
|
|
|
|
List<SysTopicAndCourse> sysTopicAndCourses = sysTopicAndCourseMapper.selectByExample(example1);
|
|
|
|
List<String> collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getId).collect(Collectors.toList());
|
|
|
|
List<String> collect = sysTopicAndCourses.stream().map(SysTopicAndCourse::getId).collect(Collectors.toList());
|
|
|
|
sysTopicAndCourseMapper.batchUpdateThreeName(collect,name);
|
|
|
|
sysTopicAndCourseMapper.batchUpdateThreeName(collect, name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "修改成功");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "修改成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -133,59 +139,87 @@ public class CourseTagManageController {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (type == 2) {
|
|
|
|
if (type == 2) {
|
|
|
|
sysTwoCatalogMapper.deleteByPrimaryKey(id);
|
|
|
|
sysTwoCatalogMapper.deleteByPrimaryKey(id);
|
|
|
|
//删除资源
|
|
|
|
//删除资源关系表
|
|
|
|
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.createCriteria().andResourceIdIn(resourceIds);
|
|
|
|
|
|
|
|
sysResourceMapper.deleteByExample(sysResourceExample);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除题目关系表
|
|
|
|
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
|
|
|
|
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
|
|
|
|
example.createCriteria().andTwoIdEqualTo(id);
|
|
|
|
example.createCriteria().andTwoIdEqualTo(id);
|
|
|
|
|
|
|
|
List<SysTopicAndCourse> topicAndCourseList = sysTopicAndCourseMapper.selectByExample(example);
|
|
|
|
|
|
|
|
List<String> topicIds = topicAndCourseList.stream().map(SysTopicAndCourse::getTopicId).collect(Collectors.toList());
|
|
|
|
sysTopicAndCourseMapper.deleteByExample(example);
|
|
|
|
sysTopicAndCourseMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除案例题
|
|
|
|
|
|
|
|
if (!topicIds.isEmpty()) {
|
|
|
|
|
|
|
|
SysCaseQuestionExample sysCaseQuestionExample = new SysCaseQuestionExample();
|
|
|
|
|
|
|
|
sysCaseQuestionExample.createCriteria().andCaseIdIn(topicIds);
|
|
|
|
|
|
|
|
sysCaseQuestionMapper.deleteByExample(sysCaseQuestionExample);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除客观题
|
|
|
|
|
|
|
|
SysObjectiveQuestionsExample sysObjectiveQuestionsExample = new SysObjectiveQuestionsExample();
|
|
|
|
|
|
|
|
sysObjectiveQuestionsExample.createCriteria().andObjectiveIdIn(topicIds);
|
|
|
|
|
|
|
|
sysObjectiveQuestionsMapper.deleteByExample(sysObjectiveQuestionsExample);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
sysThreeCatalogMapper.deleteByPrimaryKey(id);
|
|
|
|
sysThreeCatalogMapper.deleteByPrimaryKey(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除资源关系表
|
|
|
|
|
|
|
|
SysResourceAndCourseExample sysResourceAndCourseExample = new SysResourceAndCourseExample();
|
|
|
|
|
|
|
|
sysResourceAndCourseExample.createCriteria().andThreeIdEqualTo(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SysResourceAndCourse> sysResourceAndCourses = sysResourceAndCourseMapper.selectByExample(sysResourceAndCourseExample);
|
|
|
|
|
|
|
|
List<String> resourceIds = sysResourceAndCourses.stream().map(SysResourceAndCourse::getResourceId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sysResourceAndCourseMapper.deleteByExample(sysResourceAndCourseExample);
|
|
|
|
//删除资源
|
|
|
|
//删除资源
|
|
|
|
SysResourceAndCourseExample example1 = new SysResourceAndCourseExample();
|
|
|
|
if (!resourceIds.isEmpty()) {
|
|
|
|
example1.createCriteria().andThreeIdEqualTo(id);
|
|
|
|
SysResourceExample sysResourceExample = new SysResourceExample();
|
|
|
|
sysResourceAndCourseMapper.deleteByExample(example1);
|
|
|
|
sysResourceExample.createCriteria().andResourceIdIn(resourceIds);
|
|
|
|
|
|
|
|
sysResourceMapper.deleteByExample(sysResourceExample);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//删除题目
|
|
|
|
//删除题目关系表
|
|
|
|
SysTopicAndCourseExample example = new SysTopicAndCourseExample();
|
|
|
|
SysTopicAndCourseExample sysTopicAndCourseExample = new SysTopicAndCourseExample();
|
|
|
|
example.createCriteria().andThreeIdEqualTo(id);
|
|
|
|
sysTopicAndCourseExample.createCriteria().andThreeIdEqualTo(id);
|
|
|
|
sysTopicAndCourseMapper.deleteByExample(example);
|
|
|
|
|
|
|
|
sysThreeCatalogMapper.deleteByPrimaryKey(id);
|
|
|
|
List<SysTopicAndCourse> topicAndCourseList = sysTopicAndCourseMapper.selectByExample(sysTopicAndCourseExample);
|
|
|
|
|
|
|
|
List<String> topicIds = topicAndCourseList.stream().map(SysTopicAndCourse::getTopicId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sysTopicAndCourseMapper.deleteByExample(sysTopicAndCourseExample);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除案例题
|
|
|
|
|
|
|
|
if (!topicIds.isEmpty()) {
|
|
|
|
|
|
|
|
SysCaseQuestionExample sysCaseQuestionExample = new SysCaseQuestionExample();
|
|
|
|
|
|
|
|
sysCaseQuestionExample.createCriteria().andCaseIdIn(topicIds);
|
|
|
|
|
|
|
|
sysCaseQuestionMapper.deleteByExample(sysCaseQuestionExample);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除客观题
|
|
|
|
|
|
|
|
SysObjectiveQuestionsExample sysObjectiveQuestionsExample = new SysObjectiveQuestionsExample();
|
|
|
|
|
|
|
|
sysObjectiveQuestionsExample.createCriteria().andObjectiveIdIn(topicIds);
|
|
|
|
|
|
|
|
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, "删除失败,请联系管理员");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "删除成功");
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "删除成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// @AnonymousAccess
|
|
|
|
|
|
|
|
// @ApiOperation("排序")
|
|
|
|
|
|
|
|
// @PostMapping("setRank") //修改成LIST
|
|
|
|
|
|
|
|
// public ResultEntity<String> setRank(@ApiParam("一级传1/二级传2/三级传3") @RequestParam int type,
|
|
|
|
|
|
|
|
// @RequestParam String id,
|
|
|
|
|
|
|
|
// @RequestParam int rank) {
|
|
|
|
|
|
|
|
// if (type == 1) {
|
|
|
|
|
|
|
|
// SysOneCatalog sysOneCatalog = sysOneCatalogMapper.selectByPrimaryKey(id);
|
|
|
|
|
|
|
|
// sysOneCatalog.setSort(rank);
|
|
|
|
|
|
|
|
// sysOneCatalogMapper.updateByPrimaryKey(sysOneCatalog);
|
|
|
|
|
|
|
|
// return new ResultEntity<>(HttpStatus.OK, "排序成功");
|
|
|
|
|
|
|
|
// } else if (type == 2) {
|
|
|
|
|
|
|
|
// SysTwoCatalog sysTwoCatalog = sysTwoCatalogMapper.selectByPrimaryKey(id);
|
|
|
|
|
|
|
|
// sysTwoCatalog.setSort(rank);
|
|
|
|
|
|
|
|
// sysTwoCatalogMapper.updateByPrimaryKey(sysTwoCatalog);
|
|
|
|
|
|
|
|
// return new ResultEntity<>(HttpStatus.OK, "排序成功");
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// SysThreeCatalog sysThreeCatalog = sysThreeCatalogMapper.selectByPrimaryKey(id);
|
|
|
|
|
|
|
|
// sysThreeCatalog.setSort(rank);
|
|
|
|
|
|
|
|
// sysThreeCatalogMapper.updateByPrimaryKey(sysThreeCatalog);
|
|
|
|
|
|
|
|
// return new ResultEntity<>(HttpStatus.OK, "排序成功");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ApiOperation("一级目录重新排序")
|
|
|
|
@ApiOperation("一级目录重新排序")
|
|
|
|