package com.zhongzheng.controller.user; import java.util.List; import java.util.Arrays; import com.zhongzheng.modules.exam.vo.ExamApplyVo; import com.zhongzheng.modules.user.bo.*; import com.zhongzheng.modules.user.service.IUserExamGoodsService; import com.zhongzheng.modules.user.vo.UserExamGoodsVo; import lombok.RequiredArgsConstructor; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.zhongzheng.common.annotation.Log; import com.zhongzheng.common.core.controller.BaseController; import com.zhongzheng.common.core.domain.AjaxResult; import com.zhongzheng.common.enums.BusinessType; import com.zhongzheng.modules.user.vo.UserSubscribeVo; import com.zhongzheng.modules.user.service.IUserSubscribeService; import com.zhongzheng.common.utils.poi.ExcelUtil; import com.zhongzheng.common.core.page.TableDataInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; /** * 用户预约考试Controller * * @author ruoyi * @date 2021-12-07 */ @Api(value = "用户预约考试控制器", tags = {"用户预约考试管理"}) @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController @RequestMapping("/system/subscribe") public class UserSubscribeController extends BaseController { private final IUserSubscribeService iUserSubscribeService; private final IUserExamGoodsService iUserExamGoodsService; /** * 查询用户预约考试列表 */ @ApiOperation("查询用户预约考试列表") @PreAuthorize("@ss.hasPermi('system:subscribe:list')") @GetMapping("/list") public TableDataInfo listSubscribe(UserSubscribeQueryBo bo) { startPage(); List list = iUserSubscribeService.listSubscribe(bo); return getDataTable(list); } /** * 修改用户预约考试 */ @ApiOperation("批量取消预约,批量选考试登记状态,批量修改预约状态") @PreAuthorize("@ss.hasPermi('system:subscribe:edit')") @Log(title = "用户预约考试", businessType = BusinessType.UPDATE) @PostMapping("edit") public AjaxResult edit(@RequestBody UserSubscribeEditBo bo) { return toAjax(iUserSubscribeService.updateByEditBo(bo) ? 1 : 0); } /** * 修改用户预约考试 */ @ApiOperation("批量取消预约,批量选考试登记状态") @PreAuthorize("@ss.hasPermi('system:subscribe:edit')") @Log(title = "用户预约考试", businessType = BusinessType.UPDATE) @PostMapping() public AjaxResult editCertificate(@RequestBody List bo) { return toAjax(iUserSubscribeService.editCertificate(bo) ? 1 : 0); } /** * 查询用户下这个商品的考试次数,前培次数列表 */ @ApiOperation("查询用户下商品的考试次数,前培次数列表") @PreAuthorize("@ss.hasPermi('system:goods:list')") @GetMapping("/listUserExam") public TableDataInfo listUserExam(UserExamGoodsQueryBo bo) { startPage(); List list = iUserExamGoodsService.listUserExam(bo); return getDataTable(list); } /** * 查询详细商品考试次数,前培次数 */ @ApiOperation("查询详细商品考试次数,前培次数") @PreAuthorize("@ss.hasPermi('system:apply:query')") @GetMapping("/UserExam") public AjaxResult getUserExamInfo(UserExamGoodsQueryBo userExamGoodsQueryBo) { UserExamGoodsVo userExamGoodsVo = iUserExamGoodsService.getUserExamInfo(userExamGoodsQueryBo); return AjaxResult.success(userExamGoodsVo); } }