package com.ruoyi.project.pssr.controller; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; import com.ruoyi.project.pssr.domain.TPssrSafetyBreath; import com.ruoyi.project.pssr.service.ITPssrSafetyBreathService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.List; /** * 安全设施-呼吸阀Controller * * @author ssy * @date 2024-09-18 */ @RestController @RequestMapping("/pssr/safetyBreath") public class TPssrSafetyBreathController extends BaseController { @Autowired private ITPssrSafetyBreathService tPssrSafetyBreathService; /** * 查询安全设施-呼吸阀列表 */ @PreAuthorize("@ss.hasPermi('pssr:safetyBreath:list')") @GetMapping("/list") public TableDataInfo list(TPssrSafetyBreath tPssrSafetyBreath) { startPage(); List list = tPssrSafetyBreathService.selectTPssrSafetyBreathList(tPssrSafetyBreath); return getDataTable(list); } /** * 导出安全设施-呼吸阀列表 */ @PreAuthorize("@ss.hasPermi('pssr:safetyBreath:export')") @Log(title = "安全设施-呼吸阀", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(TPssrSafetyBreath tPssrSafetyBreath) { List list = tPssrSafetyBreathService.selectTPssrSafetyBreathList(tPssrSafetyBreath); ExcelUtil util = new ExcelUtil(TPssrSafetyBreath.class); return util.exportExcel(list, "safetyBreath"); } /** * 获取安全设施-呼吸阀详细信息 */ @PreAuthorize("@ss.hasPermi('pssr:safetyBreath:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(tPssrSafetyBreathService.selectTPssrSafetyBreathById(id)); } /** * 新增安全设施-呼吸阀 */ @PreAuthorize("@ss.hasPermi('pssr:safetyBreath:add')") @Log(title = "安全设施-呼吸阀", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody TPssrSafetyBreath tPssrSafetyBreath) { tPssrSafetyBreath.setApproveStatus(0L); return toAjax(tPssrSafetyBreathService.insertTPssrSafetyBreath(tPssrSafetyBreath)); } /** * 修改安全设施-呼吸阀 */ @PreAuthorize("@ss.hasPermi('pssr:safetyBreath:edit')") @Log(title = "安全设施-呼吸阀", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TPssrSafetyBreath tPssrSafetyBreath) { return toAjax(tPssrSafetyBreathService.updateTPssrSafetyBreath(tPssrSafetyBreath)); } /** * 删除安全设施-呼吸阀 */ @PreAuthorize("@ss.hasPermi('pssr:safetyBreath:remove')") @Log(title = "安全设施-呼吸阀", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(tPssrSafetyBreathService.deleteTPssrSafetyBreathByIds(ids)); } }