| | |
| | | .type(procurementDto.getType()) |
| | | .warnNum(detail.getWarnNum()) |
| | | .unitPrice(detail.getUnitPrice()) |
| | | .totalPrice(detail.getInboundQuantity().multiply(detail.getUnitPrice())) |
| | | // .totalPrice(detail.getInboundQuantity().multiply(detail.getUnitPrice())) |
| | | .createTime(LocalDateTime.now()) |
| | | .createUser(loginUser.getUserId()) |
| | | .updateTime(LocalDateTime.now()) |
| | |
| | | .productModelId(detail.getProductModelId()) |
| | | .qualityInspectId(ObjectUtils.isNotNull(procurementDto.getQualityInspectId())?procurementDto.getQualityInspectId():0L); |
| | | this.save(procurementRecordBuilder.build()); |
| | | // 入库成功减掉采购数量 |
| | | // LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | // salesLedgerProductLambdaQueryWrapper.eq(SalesLedgerProduct::getId, detail.getId()); |
| | | // SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectOne(salesLedgerProductLambdaQueryWrapper); |
| | | // if(salesLedgerProduct == null){ |
| | | // throw new RuntimeException("未找到该商品"); |
| | | // } |
| | | // salesLedgerProduct.setQuantity(salesLedgerProduct.getQuantity().subtract(detail.getInboundQuantity())); |
| | | // salesLedgerProductMapper.updateById(salesLedgerProduct); |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | } |
| | | return procurementPageDtoCopyIPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<ProductModel> listPageProductionStock(Page page) { |
| | | ProductModel productModel = new ProductModel(); |
| | | IPage<ProductModel> iPage = productModelMapper.listPageProductModel(page, productModel); |
| | | iPage.getRecords().forEach(item -> { |
| | | item.setInboundNum(stockUtils.getStockQuantity(item.getId()).get("inboundNum")); |
| | | item.setOutboundNum(stockUtils.getStockQuantity(item.getId()).get("outboundNum")); |
| | | item.setStockQuantity(stockUtils.getStockQuantity(item.getId()).get("stockQuantity")); |
| | | }); |
| | | return iPage; |
| | | public IPage<ProductModel> listPageProductionStock(Page page, ProcurementPageDto dto) { |
| | | return productModelMapper.listPageProductionStock(page, dto); |
| | | } |
| | | |
| | | @Override |