| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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; |
| | |
| | | return AjaxResult.success(gasTankWarningService.listPage(page, gasTankWarning)); |
| | | } |
| | | |
| | | @Log(title = "新增气瓶预警", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.save(gasTankWarning)); |
| | | } |
| | | |
| | | @Log(title = "修改气瓶预警", businessType = BusinessType.UPDATE) |
| | | @PostMapping("update") |
| | | public AjaxResult update(@RequestBody GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.updateById(gasTankWarning)); |
| | | } |
| | | |
| | | @Log(title = "删除气瓶预警", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("delete") |
| | | 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); |