| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementPriceManagement; |
| | | import com.ruoyi.procurementrecord.service.ProcurementPriceManagementService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "采购价格管理-查询") |
| | | public R<?> listPage(Page page, ProcurementPriceManagement procurementPriceManagement){ |
| | | public AjaxResult listPage(Page page, ProcurementPriceManagement procurementPriceManagement){ |
| | | IPage<ProcurementPriceManagement> result = procurementPriceManagementService.listPage(page, procurementPriceManagement); |
| | | return R.ok(result); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @Log(title = "新增采购价格管理", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @Operation(summary = "采购价格管理-添加") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<?> add(@RequestBody ProcurementPriceManagement procurementPriceManagement){ |
| | | public AjaxResult add(@RequestBody ProcurementPriceManagement procurementPriceManagement){ |
| | | boolean result = procurementPriceManagementService.save(procurementPriceManagement); |
| | | return result ? R.ok() : R.fail(); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @Log(title = "修改采购价格管理", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/update") |
| | | @Operation(summary = "采购价格管理-修改") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<?> update(@RequestBody ProcurementPriceManagement procurementPriceManagement){ |
| | | public AjaxResult update(@RequestBody ProcurementPriceManagement procurementPriceManagement){ |
| | | boolean result = procurementPriceManagementService.updateById(procurementPriceManagement); |
| | | return result ? R.ok() : R.fail(); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @Log(title = "删除采购价格管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "采购价格管理-删除") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<?> delete(@RequestBody List<Long> ids){ |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if (ids == null || ids.isEmpty()) { |
| | | return R.fail("请传入要删除的ID"); |
| | | return AjaxResult.error("请传入要删除的ID"); |
| | | } |
| | | boolean result = procurementPriceManagementService.removeByIds(ids); |
| | | return result ? R.ok() : R.fail(); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * 导出 |
| | | * @param response |
| | | */ |
| | | @Log(title = "导出采购价格管理", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | procurementPriceManagementService.export(response); |