|
@@ -5,14 +5,19 @@ import com.zhongzheng.common.core.controller.BaseController;
|
|
|
import com.zhongzheng.common.core.domain.AjaxResult;
|
|
|
import com.zhongzheng.common.core.page.TableDataInfo;
|
|
|
import com.zhongzheng.common.enums.BusinessType;
|
|
|
+import com.zhongzheng.common.utils.ServletUtils;
|
|
|
+import com.zhongzheng.framework.web.service.WxTokenService;
|
|
|
import com.zhongzheng.modules.exam.bo.*;
|
|
|
import com.zhongzheng.modules.exam.service.IExamApplyGoodsService;
|
|
|
import com.zhongzheng.modules.exam.service.IExamApplyService;
|
|
|
import com.zhongzheng.modules.exam.service.IExamApplySiteService;
|
|
|
-import com.zhongzheng.modules.exam.vo.ExamApplySiteVo;
|
|
|
-import com.zhongzheng.modules.exam.vo.ExamApplyVo;
|
|
|
-import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
|
|
|
-import com.zhongzheng.modules.exam.vo.ExamUserApplyVo;
|
|
|
+import com.zhongzheng.modules.exam.vo.*;
|
|
|
+import com.zhongzheng.modules.user.bo.UserSubscribeAddBo;
|
|
|
+import com.zhongzheng.modules.user.bo.UserSubscribeEditBo;
|
|
|
+import com.zhongzheng.modules.user.bo.UserSubscribeQueryBo;
|
|
|
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
|
+import com.zhongzheng.modules.user.service.IUserSubscribeService;
|
|
|
+import com.zhongzheng.modules.user.vo.UserSubscribeVo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -40,12 +45,18 @@ public class ExamApplyController extends BaseController {
|
|
|
|
|
|
private final IExamApplyGoodsService iExamApplyGoodsService;
|
|
|
|
|
|
+ private final WxTokenService wxTokenService;
|
|
|
+
|
|
|
+ private final IUserSubscribeService iUserSubscribeService;
|
|
|
+
|
|
|
/**
|
|
|
* 获取考试安排详细信息
|
|
|
*/
|
|
|
@ApiOperation("点击预约报考按钮")
|
|
|
@GetMapping("/subscribe")
|
|
|
public AjaxResult<ExamUserApplyVo> subscribe(ExamApplyQueryBo bo) {
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
ExamUserApplyVo examUserApplyVo = iExamApplyService.subscribe(bo);
|
|
|
return AjaxResult.success(examUserApplyVo);
|
|
|
}
|
|
@@ -53,9 +64,11 @@ public class ExamApplyController extends BaseController {
|
|
|
/**
|
|
|
* 获取考试安排详细信息
|
|
|
*/
|
|
|
- @ApiOperation("预约报考下一步按钮 1 进入有前陪有考试地点得预约考试 2进入无前陪有考试地点预约考试 3无考试次数购买商品")
|
|
|
+ @ApiOperation("预约报考下一步按钮 1 进入有考陪有考试地点得预约考试 2进入无考陪有考试地点预约考试 3无考试次数购买商品")
|
|
|
@GetMapping("/subscribeNext")
|
|
|
public AjaxResult<Long> subscribeNext(ExamApplyQueryBo bo) {
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
Long count = iExamApplyService.subscribeNext(bo);
|
|
|
return AjaxResult.success(count);
|
|
|
}
|
|
@@ -64,12 +77,59 @@ public class ExamApplyController extends BaseController {
|
|
|
/**
|
|
|
* 获取考试安排详细信息
|
|
|
*/
|
|
|
-/* @ApiOperation("预约报考下一步按钮 1 进入有前陪有考试地点得预约考试 2进入无前陪有考试地点预约考试 3无考试次数购买商品")
|
|
|
- @GetMapping("/subscribeNext")
|
|
|
- public AjaxResult<Long> subscribeNext(ExamApplyQueryBo bo) {
|
|
|
- Long count = iExamApplyService.subscribeNext(bo);
|
|
|
+ @ApiOperation("获得考试的考试地点")
|
|
|
+ @GetMapping("/subscribeApplySite")
|
|
|
+ public AjaxResult<List<ExamUserApplySiteVo>> subscribeApplySite(ExamApplyQueryBo bo) {
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
+ List<ExamUserApplySiteVo> count = iExamApplyService.subscribeApplySite(bo);
|
|
|
+ return AjaxResult.success(count);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取考试安排详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获得考试的考培地点")
|
|
|
+ @GetMapping("/subscribeApplySiteTrain")
|
|
|
+ public AjaxResult<List<ExamUserApplySiteVo>> subscribeApplySiteTrain(ExamApplyQueryBo bo) {
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
+ List<ExamUserApplySiteVo> count = iExamApplyService.subscribeApplySiteTrain(bo);
|
|
|
return AjaxResult.success(count);
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 新增用户预约考试
|
|
|
+ */
|
|
|
+ @ApiOperation("新增用户预约考试")
|
|
|
+ @Log(title = "用户预约考试", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping()
|
|
|
+ public AjaxResult<Long> add(@RequestBody UserSubscribeAddBo bo) {
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
+ return AjaxResult.success(iUserSubscribeService.insertByAddBo(bo));
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询用户预约考试列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询报考数据列表")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo<UserSubscribeVo> listSubscribe(UserSubscribeQueryBo bo) {
|
|
|
+ startPage();
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
+ List<UserSubscribeVo> list = iUserSubscribeService.listSubscribe(bo);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改用户预约考试
|
|
|
+ */
|
|
|
+ @ApiOperation("修改用户预约考试")
|
|
|
+ @Log(title = "用户预约考试", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("edit")
|
|
|
+ public AjaxResult<Void> edit(@RequestBody UserSubscribeEditBo bo) {
|
|
|
+ return toAjax(iUserSubscribeService.updateByEditSingleBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
}
|