| | |
| | | import com.mindskip.xzs.base.RestResponse; |
| | | import com.mindskip.xzs.domain.ExamPaper; |
| | | import com.mindskip.xzs.domain.ExamPaperSubject; |
| | | import com.mindskip.xzs.domain.vo.ExamTemplatesVO; |
| | | import com.mindskip.xzs.domain.vo.PaperExcelVO; |
| | | import com.mindskip.xzs.domain.vo.UserVO; |
| | | import com.mindskip.xzs.service.ExamPaperDepartmentService; |
| | |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM; |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamResponseVM; |
| | | import lombok.SneakyThrows; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @RequestMapping(value = "/page", method = RequestMethod.POST) |
| | | public RestResponse<PageInfo<ExamResponseVM>> pageList(@RequestBody ExamPaperPageRequestVM model) { |
| | | model.setDeptIds(isDeptAdmin() ? getAdminDeptIds() : null); |
| | | model.setDeptIds(ObjectUtils.isNotEmpty(model.getDeptIds()) ? model.getDeptIds() : getAdminDeptIds()); |
| | | if (Objects.nonNull(model.getLevel())) { |
| | | model.setDeptIds(Collections.singletonList(model.getLevel())); |
| | | } |
| | |
| | | return RestResponse.ok("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 补考 |
| | | * @param model 数据 |
| | | * @return 操作结果 |
| | | */ |
| | | @RequestMapping(value = "/missExamByTemplateId", method = RequestMethod.POST) |
| | | public RestResponse<String> missExamByTemplateId(@RequestBody ExamTemplatesVO model) { |
| | | examPaperService.missExamByTemplateId(model); |
| | | return RestResponse.ok("操作成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/select/{id}", method = RequestMethod.POST) |
| | | public RestResponse<ExamPaperEditRequestVO> select(@PathVariable Integer id) { |
| | | ExamPaperEditRequestVO vm = examPaperService.examPaperToVM(id); |
| | |
| | | |
| | | @RequestMapping(value = "/selectStudent", method = RequestMethod.POST) |
| | | public RestResponse<PageInfo<UserVO>> selectStudent(@RequestBody UserVO userVO) { |
| | | return RestResponse.ok(examPaperService.selectStudent(userVO)); |
| | | List<Integer> adminDeptIds = getAdminDeptIds(); |
| | | return RestResponse.ok(examPaperService.selectStudent(userVO, adminDeptIds)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/queryCondition", method = RequestMethod.GET) |
| | | public RestResponse<List<ExamPaper>> queryCondition() { |
| | | return RestResponse.ok(examPaperService.queryCondition()); |
| | | } |
| | | } |