| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.procurementrecord.pojo.GasTankWarning; |
| | | import com.ruoyi.procurementrecord.service.GasTankWarningService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | @RestController |
| | | @RequestMapping("/gasTankWarning") |
| | | @AllArgsConstructor |
| | | public class GasTankWarningController extends BaseController { |
| | | public class GasTankWarningController { |
| | | private GasTankWarningService gasTankWarningService; |
| | | |
| | | @GetMapping("/listPage") |
| | | public R<?> listPage(Page page, GasTankWarning gasTankWarning) { |
| | | return R.ok(gasTankWarningService.listPage(page, gasTankWarning)); |
| | | public AjaxResult listPage(Page page, GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.listPage(page, gasTankWarning)); |
| | | } |
| | | |
| | | @Log(title = "新增气瓶预警", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public R<?> add(@RequestBody GasTankWarning gasTankWarning) { |
| | | return R.ok(gasTankWarningService.save(gasTankWarning)); |
| | | public AjaxResult add(@RequestBody GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.save(gasTankWarning)); |
| | | } |
| | | |
| | | @Log(title = "修改气瓶预警", businessType = BusinessType.UPDATE) |
| | | @PostMapping("update") |
| | | public R<?> update(@RequestBody GasTankWarning gasTankWarning) { |
| | | return R.ok(gasTankWarningService.updateById(gasTankWarning)); |
| | | public AjaxResult update(@RequestBody GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.updateById(gasTankWarning)); |
| | | } |
| | | |
| | | @Log(title = "删除气瓶预警", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("delete") |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return R.fail("请传入要删除的ID"); |
| | | return R.ok(gasTankWarningService.removeByIds(ids)); |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID"); |
| | | return AjaxResult.success(gasTankWarningService.removeByIds(ids)); |
| | | } |
| | | |
| | | //导出 |
| | | @Log(title = "导出气瓶预警", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, @RequestParam(name = "ids", required = false) List<Long> ids) { |
| | | gasTankWarningService.export(response, ids); |