| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean addstockInventory(StockInventoryDto stockInventoryDto) { |
| | | //新增入库记录再添加库存 |
| | | // 更新产品入库状态 |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(stockInventoryDto.getSalesLedgerProductId()); |
| | | if (salesLedgerProduct == null) { |
| | | throw new ServiceException("入库失败,销售产品不存在"); |
| | | // 更新订单产品入库状态(仅当传入了产品行ID时) |
| | | if (stockInventoryDto.getSalesLedgerProductId() != null) { |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(stockInventoryDto.getSalesLedgerProductId()); |
| | | if (salesLedgerProduct == null) { |
| | | throw new ServiceException("入库失败,销售产品不存在"); |
| | | } |
| | | salesLedgerProduct.setProductStockStatus(1); |
| | | salesLedgerProductMapper.updateById(salesLedgerProduct); |
| | | } |
| | | salesLedgerProduct.setProductStockStatus(1); |
| | | salesLedgerProductMapper.updateById(salesLedgerProduct); |
| | | |
| | | StockInRecordDto stockInRecordDto = new StockInRecordDto(); |
| | | stockInRecordDto.setRecordId(stockInventoryDto.getRecordId()); |