package com.ruoyi.interchange.controller; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.interchange.domain.TbCoalMineSystem; import com.ruoyi.interchange.service.ITbCoalMineSystemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 煤矿系统管理Controller * * @author ruoyi * @date 2023-04-26 */ @RestController @RequestMapping("/interchange/system") public class TbCoalMineSystemController extends BaseController { @Autowired private ITbCoalMineSystemService tbCoalMineSystemService; /** * 查询煤矿系统管理列表 */ @PreAuthorize("@ss.hasPermi('interchange:system:list')") @GetMapping("/list") public TableDataInfo list(TbCoalMineSystem tbCoalMineSystem) { startPage(); List list = tbCoalMineSystemService.selectTbCoalMineSystemList(tbCoalMineSystem); return getDataTable(list); } /** * 导出煤矿系统管理列表 */ @PreAuthorize("@ss.hasPermi('interchange:system:export')") @Log(title = "煤矿系统管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TbCoalMineSystem tbCoalMineSystem) { List list = tbCoalMineSystemService.selectTbCoalMineSystemList(tbCoalMineSystem); ExcelUtil util = new ExcelUtil(TbCoalMineSystem.class); util.exportExcel(response, list, "煤矿系统管理数据"); } /** * 获取煤矿系统管理详细信息 */ @PreAuthorize("@ss.hasPermi('interchange:system:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(tbCoalMineSystemService.selectTbCoalMineSystemById(id)); } /** * 新增煤矿系统管理 */ @PreAuthorize("@ss.hasPermi('interchange:system:add')") @Log(title = "煤矿系统管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody TbCoalMineSystem tbCoalMineSystem) { return toAjax(tbCoalMineSystemService.insertTbCoalMineSystem(tbCoalMineSystem)); } /** * 修改煤矿系统管理 */ @PreAuthorize("@ss.hasPermi('interchange:system:edit')") @Log(title = "煤矿系统管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TbCoalMineSystem tbCoalMineSystem) { return toAjax(tbCoalMineSystemService.updateTbCoalMineSystem(tbCoalMineSystem)); } /** * 删除煤矿系统管理 */ @PreAuthorize("@ss.hasPermi('interchange:system:remove')") @Log(title = "煤矿系统管理", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(tbCoalMineSystemService.deleteTbCoalMineSystemByIds(ids)); } }