ExamApplyController.java 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. package com.zhongzheng.controller.exam;
  2. import com.zhongzheng.common.annotation.Log;
  3. import com.zhongzheng.common.core.controller.BaseController;
  4. import com.zhongzheng.common.core.domain.AjaxResult;
  5. import com.zhongzheng.common.core.page.TableDataInfo;
  6. import com.zhongzheng.common.enums.BusinessType;
  7. import com.zhongzheng.common.utils.ServletUtils;
  8. import com.zhongzheng.framework.web.service.WxTokenService;
  9. import com.zhongzheng.modules.exam.bo.*;
  10. import com.zhongzheng.modules.exam.service.IExamApplyGoodsService;
  11. import com.zhongzheng.modules.exam.service.IExamApplyService;
  12. import com.zhongzheng.modules.exam.service.IExamApplySiteService;
  13. import com.zhongzheng.modules.exam.vo.*;
  14. import com.zhongzheng.modules.user.entity.ClientLoginUser;
  15. import io.swagger.annotations.Api;
  16. import io.swagger.annotations.ApiOperation;
  17. import lombok.RequiredArgsConstructor;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.security.access.prepost.PreAuthorize;
  20. import org.springframework.web.bind.annotation.*;
  21. import java.util.List;
  22. /**
  23. * 考试安排Controller
  24. *
  25. * @author ruoyi
  26. * @date 2021-12-07
  27. */
  28. @Api(value = "考试预约", tags = {"考试预约"})
  29. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  30. @RestController
  31. @RequestMapping("/apply")
  32. public class ExamApplyController extends BaseController {
  33. private final IExamApplyService iExamApplyService;
  34. private final IExamApplySiteService iExamApplySiteService;
  35. private final IExamApplyGoodsService iExamApplyGoodsService;
  36. private final WxTokenService wxTokenService;
  37. /**
  38. * 获取考试安排详细信息
  39. */
  40. @ApiOperation("点击预约报考按钮")
  41. @GetMapping("/subscribe")
  42. public AjaxResult<ExamUserApplyVo> subscribe(ExamApplyQueryBo bo) {
  43. ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
  44. bo.setUserId(loginUser.getUser().getUserId());
  45. ExamUserApplyVo examUserApplyVo = iExamApplyService.subscribe(bo);
  46. return AjaxResult.success(examUserApplyVo);
  47. }
  48. /**
  49. * 获取考试安排详细信息
  50. */
  51. @ApiOperation("预约报考下一步按钮 1 进入有考陪有考试地点得预约考试 2进入无考陪有考试地点预约考试 3无考试次数购买商品")
  52. @GetMapping("/subscribeNext")
  53. public AjaxResult<Long> subscribeNext(ExamApplyQueryBo bo) {
  54. ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
  55. bo.setUserId(loginUser.getUser().getUserId());
  56. Long count = iExamApplyService.subscribeNext(bo);
  57. return AjaxResult.success(count);
  58. }
  59. /**
  60. * 获取考试安排详细信息
  61. */
  62. @ApiOperation("获得考试的考试地点")
  63. @GetMapping("/subscribeApplySite")
  64. public AjaxResult<List<ExamUserApplySiteVo>> subscribeApplySite(ExamApplyQueryBo bo) {
  65. ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
  66. bo.setUserId(loginUser.getUser().getUserId());
  67. List<ExamUserApplySiteVo> count = iExamApplyService.subscribeApplySite(bo);
  68. return AjaxResult.success(count);
  69. }
  70. /**
  71. * 获取考试安排详细信息
  72. */
  73. @ApiOperation("获得考试的考培地点")
  74. @GetMapping("/subscribeApplySiteTrain")
  75. public AjaxResult<List<ExamUserApplySiteVo>> subscribeApplySiteTrain(ExamApplyQueryBo bo) {
  76. ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
  77. bo.setUserId(loginUser.getUser().getUserId());
  78. List<ExamUserApplySiteVo> count = iExamApplyService.subscribeApplySiteTrain(bo);
  79. return AjaxResult.success(count);
  80. }
  81. }