| | |
| | | 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.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.service.StockInRecordService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | @Tag(name = "入库") |
| | | @RequestMapping("/stockInRecord") |
| | | @RequiredArgsConstructor |
| | | public class StockInRecordController { |
| | | public class StockInRecordController extends BaseController { |
| | | |
| | | private final StockInRecordService stockInRecordService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "生产入库-入库管理-列表", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "入库管理列表") |
| | | public AjaxResult listPage(Page page, StockInRecordDto stockInRecordDto) { |
| | | public R<?> listPage(Page page, StockInRecordDto stockInRecordDto) { |
| | | IPage<StockInRecordDto> result = stockInRecordService.listPage(page, stockInRecordDto); |
| | | return AjaxResult.success(result); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | | |
| | | @DeleteMapping("") |
| | | @Log(title = "入库管理-删除入库", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | public R<?> delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("请选择至少一条数据"); |
| | | return R.fail("请选择至少一条数据"); |
| | | } |
| | | return AjaxResult.success(stockInRecordService.batchDelete(ids)); |
| | | return R.ok(stockInRecordService.batchDelete(ids)); |
| | | } |
| | | |
| | | @DeleteMapping("/pending") |
| | | @Log(title = "入库管理-删除待审批入库", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "删除待审批的入库记录") |
| | | public R<?> deletePending(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return R.fail("请选择至少一条数据"); |
| | | } |
| | | return R.ok(stockInRecordService.batchDeletePending(ids)); |
| | | } |
| | | |
| | | @PostMapping("/exportStockInRecord") |
| | |
| | | stockInRecordService.exportStockInRecord(response,stockInRecordDto); |
| | | } |
| | | |
| | | @PostMapping("/approve") |
| | | @Log(title = "入库管理-审批入库", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "批量审批入库记录") |
| | | public R<?> approve(@RequestBody StockInRecordDto approveDto) { |
| | | if(CollectionUtils.isEmpty(approveDto.getIds())){ |
| | | return R.fail("请选择至少一条数据"); |
| | | } |
| | | stockInRecordService.batchApprove(approveDto.getIds(), approveDto.getApprovalStatus()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |