From f1e20b08fcc05d78e3d25921494f92f5b9ca49cf Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 16 五月 2024 17:19:40 +0800
Subject: [PATCH] 部门管理员权限
---
src/main/java/com/mindskip/xzs/controller/admin/ExamPaperController.java | 31 ++++++++++++++++++++++++-------
1 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/mindskip/xzs/controller/admin/ExamPaperController.java b/src/main/java/com/mindskip/xzs/controller/admin/ExamPaperController.java
index f07bf1c..9facf4a 100644
--- a/src/main/java/com/mindskip/xzs/controller/admin/ExamPaperController.java
+++ b/src/main/java/com/mindskip/xzs/controller/admin/ExamPaperController.java
@@ -1,11 +1,11 @@
package com.mindskip.xzs.controller.admin;
+import com.github.pagehelper.PageInfo;
import com.mindskip.xzs.base.BaseApiController;
import com.mindskip.xzs.base.RestResponse;
import com.mindskip.xzs.domain.ExamPaper;
import com.mindskip.xzs.domain.ExamPaperSubject;
import com.mindskip.xzs.domain.vo.PaperExcelVO;
-import com.mindskip.xzs.domain.vo.UserCountExcelVO;
import com.mindskip.xzs.service.ExamPaperDepartmentService;
import com.mindskip.xzs.service.ExamPaperService;
import com.mindskip.xzs.service.ExamPaperSubjectService;
@@ -13,10 +13,10 @@
import com.mindskip.xzs.utility.DateTimeUtil;
import com.mindskip.xzs.utility.PageInfoHelper;
import com.mindskip.xzs.utility.excel.ExcelUtils;
-import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM;
import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM;
+import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVO;
+import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM;
import com.mindskip.xzs.viewmodel.admin.exam.ExamResponseVM;
-import com.github.pagehelper.PageInfo;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -77,7 +77,7 @@
@RequestMapping(value = "/edit", method = RequestMethod.POST)
- public RestResponse<ExamPaperEditRequestVM> edit(@RequestBody @Valid ExamPaperEditRequestVM model) throws Exception {
+ public RestResponse<ExamPaperEditRequestVO> edit(@RequestBody @Valid ExamPaperEditRequestVM model) throws Exception {
Object[] obj = Arrays.stream(model.getUserIds()).sorted().distinct().toArray();
Integer[] userIds = new Integer[obj.length];
for(int i = 0;i<obj.length;i++) {
@@ -85,13 +85,25 @@
}
model.setUserIds(userIds);
ExamPaper examPaper = examPaperService.savePaperFromVM(model, getCurrentUser());
- ExamPaperEditRequestVM newVM = examPaperService.examPaperToVM(examPaper.getId());
+ ExamPaperEditRequestVO newVM = examPaperService.examPaperToVM(examPaper.getId());
+
return RestResponse.ok(newVM);
}
+ /**
+ * 琛ヨ��
+ * @param model 鏁版嵁
+ * @return 鎿嶄綔缁撴灉
+ */
+ @RequestMapping(value = "/missExam", method = RequestMethod.POST)
+ public RestResponse<String> missExam(@RequestBody ExamPaperEditRequestVM model) {
+ examPaperService.missExam(model);
+ return RestResponse.ok("鎿嶄綔鎴愬姛");
+ }
+
@RequestMapping(value = "/select/{id}", method = RequestMethod.POST)
- public RestResponse<ExamPaperEditRequestVM> select(@PathVariable Integer id) {
- ExamPaperEditRequestVM vm = examPaperService.examPaperToVM(id);
+ public RestResponse<ExamPaperEditRequestVO> select(@PathVariable Integer id) {
+ ExamPaperEditRequestVO vm = examPaperService.examPaperToVM(id);
return RestResponse.ok(vm);
}
@@ -111,4 +123,9 @@
List<PaperExcelVO> list = examPaperService.getPaperExcelById(id);
ExcelUtils.export(response,"涓汉缁冧範",list,PaperExcelVO.class);
}
+
+ @RequestMapping(value = "/list", method = RequestMethod.GET)
+ public RestResponse<List<ExamPaper>> list() {
+ return RestResponse.ok(examPaperService.list());
+ }
}
--
Gitblit v1.8.0