123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- package com.zhongzheng.controller.mock;
- import com.zhongzheng.common.annotation.Log;
- 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.poi.ExcelUtil;
- import com.zhongzheng.modules.mock.bo.MockApplyAddBo;
- import com.zhongzheng.modules.mock.bo.MockApplyEditBo;
- import com.zhongzheng.modules.mock.bo.MockApplyQueryBo;
- import com.zhongzheng.modules.mock.service.IMockApplyService;
- import com.zhongzheng.modules.mock.vo.MockApplyVo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import lombok.RequiredArgsConstructor;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.web.bind.annotation.*;
- import java.util.Arrays;
- import java.util.List;
- /**
- * 模考安排Controller
- *
- * @author ruoyi
- * @date 2022-05-24
- */
- @Api(value = "模考安排控制器", tags = {"模考安排管理"})
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/mock/apply")
- public class MockApplyController extends BaseController {
- private final IMockApplyService iMockApplyService;
- /**
- * 查询模考安排列表
- */
- @ApiOperation("查询模考安排列表")
- @PreAuthorize("@ss.hasPermi('system:apply:list')")
- @GetMapping("/list")
- public TableDataInfo<MockApplyVo> list(MockApplyQueryBo bo) {
- startPage();
- List<MockApplyVo> list = iMockApplyService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 导出模考安排列表
- */
- @ApiOperation("导出模考安排列表")
- @PreAuthorize("@ss.hasPermi('system:apply:export')")
- @Log(title = "模考安排", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult<MockApplyVo> export(MockApplyQueryBo bo) {
- List<MockApplyVo> list = iMockApplyService.queryList(bo);
- ExcelUtil<MockApplyVo> util = new ExcelUtil<MockApplyVo>(MockApplyVo.class);
- return util.exportExcel(list, "模考安排");
- }
- /**
- * 获取模考安排详细信息
- */
- @ApiOperation("获取模考安排详细信息")
- @PreAuthorize("@ss.hasPermi('system:apply:query')")
- @GetMapping("/{applyId}")
- public AjaxResult<MockApplyVo> getInfo(@PathVariable("applyId" ) Long applyId) {
- return AjaxResult.success(iMockApplyService.queryById(applyId));
- }
- /**
- * 新增模考安排
- */
- @ApiOperation("新增模考安排")
- @PreAuthorize("@ss.hasPermi('system:apply:add')")
- @Log(title = "模考安排", businessType = BusinessType.INSERT)
- @PostMapping()
- public AjaxResult<Void> add(@RequestBody MockApplyAddBo bo) {
- return toAjax(iMockApplyService.insertByAddBo(bo) ? 1 : 0);
- }
- /**
- * 修改模考安排
- */
- @ApiOperation("修改模考安排")
- @PreAuthorize("@ss.hasPermi('system:apply:edit')")
- @Log(title = "模考安排", businessType = BusinessType.UPDATE)
- @PutMapping()
- public AjaxResult<Void> edit(@RequestBody MockApplyEditBo bo) {
- return toAjax(iMockApplyService.updateByEditBo(bo) ? 1 : 0);
- }
- /**
- * 删除模考安排
- */
- @ApiOperation("删除模考安排")
- @PreAuthorize("@ss.hasPermi('system:apply:remove')")
- @Log(title = "模考安排" , businessType = BusinessType.DELETE)
- @DeleteMapping("/{applyIds}")
- public AjaxResult<Void> remove(@PathVariable Long[] applyIds) {
- return toAjax(iMockApplyService.deleteWithValidByIds(Arrays.asList(applyIds), true) ? 1 : 0);
- }
- /**
- * 查询模考安排列表
- */
- @ApiOperation("查询模考安排列表")
- @PreAuthorize("@ss.hasPermi('system:apply:list')")
- @GetMapping("/listApply")
- public TableDataInfo<MockApplyVo> listApply(MockApplyQueryBo bo) {
- startPage();
- List<MockApplyVo> list = iMockApplyService.listApply(bo);
- return getDataTable(list);
- }
- }
|