From 0057ef145ab05b6c34802deb4ff575f975b6283a Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期四, 16 五月 2024 18:19:15 +0800
Subject: [PATCH] feat:部门管理员功能权限控制
---
src/main/java/com/mindskip/xzs/controller/admin/EducationController.java | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/mindskip/xzs/controller/admin/EducationController.java b/src/main/java/com/mindskip/xzs/controller/admin/EducationController.java
index f57e9eb..d44d44b 100644
--- a/src/main/java/com/mindskip/xzs/controller/admin/EducationController.java
+++ b/src/main/java/com/mindskip/xzs/controller/admin/EducationController.java
@@ -3,8 +3,9 @@
import com.mindskip.xzs.base.BaseApiController;
import com.mindskip.xzs.base.RestResponse;
+import com.mindskip.xzs.domain.ExamPaperSubject;
import com.mindskip.xzs.domain.Subject;
-import com.mindskip.xzs.service.SubjectService;
+import com.mindskip.xzs.service.*;
import com.mindskip.xzs.utility.PageInfoHelper;
import com.mindskip.xzs.viewmodel.admin.education.SubjectEditRequestVM;
import com.mindskip.xzs.viewmodel.admin.education.SubjectPageRequestVM;
@@ -21,10 +22,18 @@
public class EducationController extends BaseApiController {
private final SubjectService subjectService;
+ private final QuestionSubjectService questionSubjectService;
+ private final ExamPaperSubjectService examPaperSubjectService;
+ private final ExamPaperDepartmentService examPaperDepartmentService;
+ private final ExamPaperService examPaperService;
@Autowired
- public EducationController(SubjectService subjectService) {
+ public EducationController(SubjectService subjectService, QuestionSubjectService questionSubjectService, ExamPaperSubjectService examPaperSubjectService, ExamPaperDepartmentService examPaperDepartmentService, ExamPaperService examPaperService) {
this.subjectService = subjectService;
+ this.questionSubjectService = questionSubjectService;
+ this.examPaperSubjectService = examPaperSubjectService;
+ this.examPaperDepartmentService = examPaperDepartmentService;
+ this.examPaperService = examPaperService;
}
@RequestMapping(value = "/subject/list", method = RequestMethod.POST)
@@ -64,6 +73,12 @@
Subject subject = subjectService.selectById(id);
subject.setDeleted(true);
subjectService.updateByIdFilter(subject);
+ questionSubjectService.removeSubjectId(id);
+ Integer[] ids = examPaperSubjectService.getBySubjectId(id)
+ .stream().map(ExamPaperSubject::getExamPaperId).toArray(Integer[]::new);
+ examPaperService.removeByIds(ids);
+ examPaperDepartmentService.removeByExamPaperIds(ids);
+ examPaperSubjectService.removeBySubjectId(id);
return RestResponse.ok();
}
}
--
Gitblit v1.8.0