| | |
| | | import com.ycl.jxkg.domain.entity.ExamPaper; |
| | | import com.ycl.jxkg.domain.entity.ExamPaperQuestion; |
| | | import com.ycl.jxkg.domain.form.ExamPaperForm; |
| | | import com.ycl.jxkg.domain.question.TemplateQuestionDTO; |
| | | import com.ycl.jxkg.domain.vo.admin.paper.ExamPaperQuestionVO; |
| | | import com.ycl.jxkg.enums.ExamPaperTypeEnum; |
| | | import com.ycl.jxkg.enums.VisibilityEnum; |
| | | import com.ycl.jxkg.group.Add; |
| | | import com.ycl.jxkg.group.Update; |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController("AdminExamPaperController") |
| | |
| | | |
| | | @RequestMapping(value = "/page", method = RequestMethod.POST) |
| | | public Result<PageInfo<ExamResponseVO>> pageList(@RequestBody ExamPaperPageRequestVO model) { |
| | | PageInfo<ExamPaper> pageInfo = examPaperService.page(model); |
| | | PageInfo<ExamResponseVO> page = PageInfoHelper.copyMap(pageInfo, e -> { |
| | | ExamResponseVO vo = new ExamResponseVO(); |
| | | BeanUtils.copyProperties(e, vo); |
| | | vo.setVisibility(VisibilityEnum.valueOf(vo.getVisibility()).getCode()+""); |
| | | vo.setCreateTime(DateTimeUtil.dateFormat(e.getCreateTime())); |
| | | return vo; |
| | | }); |
| | | PageInfo<ExamResponseVO> page = examPaperService.page(model); |
| | | return Result.ok(page); |
| | | } |
| | | |
| | |
| | | } |
| | | form.setCreateUser(getCurrentUser().getId()); |
| | | form.setCreateTime(new Date()); |
| | | ExamPaper entity = ExamPaperForm.getEntityByForm(form,null); |
| | | examPaperService.save(entity); |
| | | examPaperService.addPaper(form); |
| | | return Result.ok(); |
| | | } |
| | | |
| | |
| | | if (!StringUtils.isBlank(form.getVisibility())) { |
| | | form.setVisibility(VisibilityEnum.fromCode(form.getVisibility()).getName()); |
| | | } |
| | | //TODO:修改联表里的分数 |
| | | ExamPaper entity = ExamPaperForm.getEntityByForm(form,null); |
| | | examPaperService.updateById(entity); |
| | | examPaperService.updateExamPaper(form); |
| | | return Result.ok(); |
| | | } |
| | | |