| | |
| | | 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.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.pojo.InboundManagement; |
| | | import com.ruoyi.procurementrecord.service.InboundManagementService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "到货管理-查询") |
| | | public AjaxResult listPage(Page page, InboundManagement inboundManagement) { |
| | | public R<?> listPage(Page page, InboundManagement inboundManagement) { |
| | | IPage<InboundManagement> result = inboundManagementService.listPage(page, inboundManagement); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Operation(summary = "到货管理-添加") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody InboundManagement inboundManagement) { |
| | | public R<?> add(@RequestBody InboundManagement inboundManagement) { |
| | | inboundManagement.setArrivalTime(new Date()); |
| | | boolean result = inboundManagementService.save(inboundManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Operation(summary = "到货管理-修改") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody InboundManagement inboundManagement) { |
| | | public R<?> update(@RequestBody InboundManagement inboundManagement) { |
| | | boolean result = inboundManagementService.updateById(inboundManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "到货管理-删除") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请选择至少一条数据"); |
| | | public R<?> del(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return R.fail("请选择至少一条数据"); |
| | | boolean result = inboundManagementService.removeByIds(ids); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | } |