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.TPssrInstrumentTest; import com.ruoyi.project.pssr.service.ITPssrInstrumentTestService; 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/instrumentTest") public class TPssrInstrumentTestController extends BaseController { @Autowired private ITPssrInstrumentTestService tPssrInstrumentTestService; /** * 查询仪联锁测试列表 */ @PreAuthorize("@ss.hasPermi('pssr:instrumentTest:list')") @GetMapping("/list") public TableDataInfo list(TPssrInstrumentTest tPssrInstrumentTest) { startPage(); List list = tPssrInstrumentTestService.selectTPssrInstrumentTestList(tPssrInstrumentTest); return getDataTable(list); } /** * 导出仪联锁测试列表 */ @PreAuthorize("@ss.hasPermi('pssr:instrumentTest:export')") @Log(title = "仪联锁测试", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(TPssrInstrumentTest tPssrInstrumentTest) { List list = tPssrInstrumentTestService.selectTPssrInstrumentTestList(tPssrInstrumentTest); ExcelUtil util = new ExcelUtil(TPssrInstrumentTest.class); return util.exportExcel(list, "instrumentTest"); } /** * 获取仪联锁测试详细信息 */ @PreAuthorize("@ss.hasPermi('pssr:instrumentTest:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(tPssrInstrumentTestService.selectTPssrInstrumentTestById(id)); } /** * 新增仪联锁测试 */ @PreAuthorize("@ss.hasPermi('pssr:instrumentTest:add')") @Log(title = "仪联锁测试", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody TPssrInstrumentTest tPssrInstrumentTest) { return toAjax(tPssrInstrumentTestService.insertTPssrInstrumentTest(tPssrInstrumentTest)); } /** * 修改仪联锁测试 */ @PreAuthorize("@ss.hasPermi('pssr:instrumentTest:edit')") @Log(title = "仪联锁测试", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TPssrInstrumentTest tPssrInstrumentTest) { return toAjax(tPssrInstrumentTestService.updateTPssrInstrumentTest(tPssrInstrumentTest)); } /** * 删除仪联锁测试 */ @PreAuthorize("@ss.hasPermi('pssr:instrumentTest:remove')") @Log(title = "仪联锁测试", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(tPssrInstrumentTestService.deleteTPssrInstrumentTestByIds(ids)); } }