qirong
2023-06-16 a902b3ea7d5ec9b73c9ab54d09a6ab23fd5acb35
src/main/java/com/mindskip/xzs/controller/admin/ExamPaperController.java
@@ -4,6 +4,7 @@
import com.mindskip.xzs.base.RestResponse;
import com.mindskip.xzs.domain.ExamPaper;
import com.mindskip.xzs.domain.ExamPaperSubject;
import com.mindskip.xzs.service.ExamPaperDepartmentService;
import com.mindskip.xzs.service.ExamPaperService;
import com.mindskip.xzs.service.ExamPaperSubjectService;
import com.mindskip.xzs.utility.DateTimeUtil;
@@ -23,11 +24,13 @@
    private final ExamPaperService examPaperService;
    private final ExamPaperSubjectService examPaperSubjectService;
    private final ExamPaperDepartmentService examPaperDepartmentService;
    @Autowired
    public ExamPaperController(ExamPaperService examPaperService, ExamPaperSubjectService examPaperSubjectService) {
    public ExamPaperController(ExamPaperService examPaperService, ExamPaperSubjectService examPaperSubjectService, ExamPaperDepartmentService examPaperDepartmentService) {
        this.examPaperService = examPaperService;
        this.examPaperSubjectService = examPaperSubjectService;
        this.examPaperDepartmentService = examPaperDepartmentService;
    }
    @RequestMapping(value = "/page", method = RequestMethod.POST)
@@ -76,6 +79,8 @@
        ExamPaper examPaper = examPaperService.selectById(id);
        examPaper.setDeleted(true);
        examPaperService.updateByIdFilter(examPaper);
        examPaperDepartmentService.removeByExamPaperId(id);
        examPaperSubjectService.removeByExamPaperId(id);
        return RestResponse.ok();
    }
}