| | |
| | | BigDecimal orderQty = salesLedgerProduct.getQuantity(); |
| | | salesLedgerProduct.setProductStockStatus(calculateProductStockStatus(stockedQty, orderQty)); |
| | | salesLedgerProduct.fillRemainingQuantity(); |
| | | ProductModel productModel = productModelMapper.selectById(salesLedgerProduct.getProductModelId()); |
| | | if (productModel == null) { |
| | | throw new ServiceException("新增销售台账失败,销售产品不存在"); |
| | | } |
| | | salesLedgerProduct.setUnit(productModel.getUnit()); |
| | | salesLedgerProductMapper.insert(salesLedgerProduct); |
| | | // 绑定产品额外加工 |
| | | // 清空销售产品绑定的加工 |