| | |
| | | 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.ExamPaperEditRequestVO; |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM; |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM; |
| | | import com.mindskip.xzs.viewmodel.admin.exam.ExamResponseVM; |
| | |
| | | |
| | | |
| | | @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++) { |
| | |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |