123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- package com.ruoyi.project.pssr.controller;
- import java.util.List;
- 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.framework.aspectj.lang.annotation.Log;
- import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
- import com.ruoyi.project.pssr.domain.TPssrPipe;
- import com.ruoyi.project.pssr.service.ITPssrPipeService;
- import com.ruoyi.framework.web.controller.BaseController;
- import com.ruoyi.framework.web.domain.AjaxResult;
- import com.ruoyi.common.utils.poi.ExcelUtil;
- import com.ruoyi.framework.web.page.TableDataInfo;
- /**
- * 管道Controller
- *
- * @author ssy
- * @date 2024-09-18
- */
- @RestController
- @RequestMapping("/pssr/pipe")
- public class TPssrPipeController extends BaseController
- {
- @Autowired
- private ITPssrPipeService tPssrPipeService;
- /**
- * 查询管道列表
- */
- @PreAuthorize("@ss.hasPermi('pssr:pipe:list')")
- @GetMapping("/list")
- public TableDataInfo list(TPssrPipe tPssrPipe)
- {
- startPage();
- List<TPssrPipe> list = tPssrPipeService.selectTPssrPipeList(tPssrPipe);
- return getDataTable(list);
- }
- /**
- * 导出管道列表
- */
- @PreAuthorize("@ss.hasPermi('pssr:pipe:export')")
- @Log(title = "管道", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult export(TPssrPipe tPssrPipe)
- {
- List<TPssrPipe> list = tPssrPipeService.selectTPssrPipeList(tPssrPipe);
- ExcelUtil<TPssrPipe> util = new ExcelUtil<TPssrPipe>(TPssrPipe.class);
- return util.exportExcel(list, "pipe");
- }
- /**
- * 获取管道详细信息
- */
- @PreAuthorize("@ss.hasPermi('pssr:pipe:query')")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id)
- {
- return AjaxResult.success(tPssrPipeService.selectTPssrPipeById(id));
- }
- /**
- * 新增管道
- */
- @PreAuthorize("@ss.hasPermi('pssr:pipe:add')")
- @Log(title = "管道", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody TPssrPipe tPssrPipe)
- {
- return toAjax(tPssrPipeService.insertTPssrPipe(tPssrPipe));
- }
- /**
- * 修改管道
- */
- @PreAuthorize("@ss.hasPermi('pssr:pipe:edit')")
- @Log(title = "管道", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody TPssrPipe tPssrPipe)
- {
- return toAjax(tPssrPipeService.updateTPssrPipe(tPssrPipe));
- }
- /**
- * 删除管道
- */
- @PreAuthorize("@ss.hasPermi('pssr:pipe:remove')")
- @Log(title = "管道", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
- {
- return toAjax(tPssrPipeService.deleteTPssrPipeByIds(ids));
- }
- }
|