| | |
| | | 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.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | |
| | | * 回款登记分页查询 |
| | | */ |
| | | @GetMapping("/listPageSalesLedger") |
| | | public AjaxResult listPage(Page page, SalesLedgerProductDto salesLedgerProduct) { |
| | | public R<?> listPageSalesLedger(Page page, SalesLedgerProductDto salesLedgerProduct) { |
| | | IPage<SalesLedgerProductDto> list = salesLedgerProductService.listPage(page,salesLedgerProduct); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | |
| | | * 付款登记分页查询 |
| | | */ |
| | | @GetMapping("/listPagePurchaseLedger") |
| | | public AjaxResult listPagePurchaseLedger(Page page, SalesLedgerProductDto salesLedgerProduct) { |
| | | public R<?> listPagePurchaseLedger(Page page, SalesLedgerProductDto salesLedgerProduct) { |
| | | IPage<SalesLedgerProductDto> list = salesLedgerProductService.listPagePurchaseLedger(page,salesLedgerProduct); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | |
| | | * 查询产品信息列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SalesLedgerProduct salesLedgerProduct) { |
| | | public R<?> list(SalesLedgerProduct salesLedgerProduct) { |
| | | List<SalesLedgerProduct> list = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | if (CollUtil.isEmpty(list)) { |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | List<Long> productIds = list.stream().map(SalesLedgerProduct::getProductModelId).collect(Collectors.toList()); |
| | | List<SimpleReturnOrderGroupDto> groupListByProductIds = purchaseReturnOrderProductsMapper.getReturnOrderGroupListByProductIds(productIds); |
| | |
| | | item.setReturnQuality(returnQuality); |
| | | item.setAvailableQuality(item.getQuantity().subtract(returnQuality)); |
| | | }); |
| | | return AjaxResult.success(list); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 获取产品信息详细信息 |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | public R<?> getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(salesLedgerProductService.selectSalesLedgerProductById(id)); |
| | | return R.ok(salesLedgerProductService.selectSalesLedgerProductById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "产品信息", businessType = BusinessType.INSERT) |
| | | @PostMapping ("/addOrUpdateSalesLedgerProduct") |
| | | public AjaxResult add(@RequestBody SalesLedgerProduct salesLedgerProduct) |
| | | public R<?> add(@RequestBody SalesLedgerProduct salesLedgerProduct) |
| | | { |
| | | return toAjax(salesLedgerProductService.addOrUpdateSalesLedgerProduct(salesLedgerProduct)); |
| | | salesLedgerProductService.addOrUpdateSalesLedgerProduct(salesLedgerProduct); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "产品信息", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delProduct") |
| | | public AjaxResult remove(@RequestBody Long[] ids) |
| | | public R<?> remove(@RequestBody Long[] ids) |
| | | { |
| | | if (ids == null || ids.length == 0) { |
| | | return AjaxResult.error("请传入要删除的ID"); |
| | | return R.fail("请传入要删除的ID"); |
| | | } |
| | | return toAjax(salesLedgerProductService.deleteSalesLedgerProductByIds(ids)); |
| | | salesLedgerProductService.deleteSalesLedgerProductByIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | //根据产品id获取bom判断库存是否充足 |