Commit d88911e5 authored by jiawei's avatar jiawei

/learningProject/delete 项目删除加上提示

parent 135817b1
...@@ -148,6 +148,10 @@ public class LearningProjectController extends BaseController { ...@@ -148,6 +148,10 @@ public class LearningProjectController extends BaseController {
public Map<String, Object> deleteLearningProject(@PathVariable("id") String id) { public Map<String, Object> deleteLearningProject(@PathVariable("id") String id) {
//按照王亭亭的要求 删除学习项目,不删除学习内容 所以注释掉下面一行代码 //按照王亭亭的要求 删除学习项目,不删除学习内容 所以注释掉下面一行代码
// this.learningContentService.remove(Wrappers.<LearningContent>lambdaUpdate().eq(LearningContent::getLearningProjectId, id)); // this.learningContentService.remove(Wrappers.<LearningContent>lambdaUpdate().eq(LearningContent::getLearningProjectId, id));
int count = this.learningContentService.count(Wrappers.<LearningContent>lambdaUpdate().eq(LearningContent::getLearningProjectId, id).last("LIMIT 1"));
if (count >= 1) {
return getFailResult("该项目已有关联学习内容,不能删除");
}
this.learningProjectService.removeById(id); this.learningProjectService.removeById(id);
return getSuccessResult(); return getSuccessResult();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment