| | |
| | | |
| | | 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.ProcurementPlan; |
| | | import com.ruoyi.procurementrecord.service.ProcurementPlanService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @RequestMapping("/listPage") |
| | | @Operation(summary = "采购计划-查询") |
| | | public R<?> listPage(Page page, ProcurementPlan procurementPlan){ |
| | | public AjaxResult listPage(Page page, ProcurementPlan procurementPlan){ |
| | | IPage<ProcurementPlan> result = procurementPlanService.listPage(page, procurementPlan); |
| | | return R.ok(result); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @Log(title = "新增采购计划", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @Operation(summary = "采购计划-添加") |
| | | public R<?> add(@RequestBody ProcurementPlan procurementPlan){ |
| | | public AjaxResult add(@RequestBody ProcurementPlan procurementPlan){ |
| | | boolean result = procurementPlanService.save(procurementPlan); |
| | | return result ? R.ok() : R.fail(); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @Log(title = "修改采购计划", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/update") |
| | | @Operation(summary = "采购计划-修改") |
| | | public R<?> update(@RequestBody ProcurementPlan procurementPlan){ |
| | | public AjaxResult update(@RequestBody ProcurementPlan procurementPlan){ |
| | | boolean result = procurementPlanService.updateById(procurementPlan); |
| | | return result ? R.ok() : R.fail(); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @Log(title = "删除采购计划", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "采购计划-删除") |
| | | public R<?> del(@RequestBody List<Long> ids){ |
| | | public AjaxResult del(@RequestBody List<Long> ids){ |
| | | boolean result = procurementPlanService.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) { |
| | | procurementPlanService.export(response); |