123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- package com.ruoyi.sim.controller;
- import java.util.List;
- import javax.servlet.http.HttpServletResponse;
- import com.ruoyi.sim.service.impl.SeatService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- 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.ruoyi.common.annotation.Log;
- import com.ruoyi.common.core.controller.BaseController;
- import com.ruoyi.common.core.domain.AjaxResult;
- import com.ruoyi.common.enums.BusinessType;
- import com.ruoyi.sim.domain.Seat;
- import com.ruoyi.common.utils.poi.ExcelUtil;
- import com.ruoyi.common.core.page.TableDataInfo;
- /**
- * 座Controller
- *
- * @author tom
- * @date 2024-12-13
- */
- @RestController
- @RequestMapping("/sim/seat")
- @Api("座Controller")
- public class SeatController extends BaseController {
- @Autowired
- private SeatService seatService;
- /**
- * 查询座列表
- */
- // @PreAuthorize("@ss.hasPermi('sim:seat:list')")
- @GetMapping("/list")
- public TableDataInfo list(Seat seat) {
- startPage();
- List<Seat> list = seatService.selectSeatList(seat);
- return getDataTable(list);
- }
- /**
- * 查询全部座列表
- */
- // @PreAuthorize("@ss.hasPermi('sim:seat:list')")
- @GetMapping("/listAll")
- // @ApiOperation("[老师][轮询]查询全部座列表")
- public TableDataInfo listAll() {
- Seat seat = new Seat();
- startPage();
- List<Seat> list = seatService.selectSeatList(seat);
- return getDataTable(list);
- }
- /**
- * 导出座列表
- */
- // @PreAuthorize("@ss.hasPermi('sim:seat:export')")
- // @Log(title = "座", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, Seat seat) {
- List<Seat> list = seatService.selectSeatList(seat);
- ExcelUtil<Seat> util = new ExcelUtil<Seat>(Seat.class);
- util.exportExcel(response, list, "座数据");
- }
- /**
- * 获取座详细信息
- */
- // @PreAuthorize("@ss.hasPermi('sim:seat:query')")
- @GetMapping(value = "/{seatId}")
- public AjaxResult getInfo(@PathVariable("seatId") Long seatId) {
- return success(seatService.selectSeatBySeatId(seatId));
- }
- /**
- * 新增座
- */
- // @PreAuthorize("@ss.hasPermi('sim:seat:add')")
- // @Log(title = "座", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody Seat seat) {
- return toAjax(seatService.insertSeat(seat));
- }
- /**
- * 修改座
- */
- // @PreAuthorize("@ss.hasPermi('sim:seat:edit')")
- // @Log(title = "座", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody Seat seat) {
- return toAjax(seatService.updateSeat(seat));
- }
- /**
- * 删除座
- */
- // @PreAuthorize("@ss.hasPermi('sim:seat:remove')")
- // @Log(title = "座", businessType = BusinessType.DELETE)
- @DeleteMapping("/{seatIds}")
- public AjaxResult remove(@PathVariable Long[] seatIds) {
- return toAjax(seatService.deleteSeatBySeatIds(seatIds));
- }
- // -------------------------------- tom add --------------------------------
- @GetMapping("/listAllEnable")
- @ApiOperation("获取所有没有被禁用的座列表")
- public AjaxResult listAllEnable() {
- return seatService.listAllEnableAj();
- }
- }
|