|
@@ -180,7 +180,9 @@ public class StockWaitServiceImpl extends ServiceImpl<StockWaitMapper, StockWait
|
|
|
//更新已入库数量 根据明细id
|
|
|
StockWaitDetails stockWaitDetails = stockWaitDetailsService.getOne(q->q.eq(StockWaitDetails::getStockWaitId,stockWaitDto.getId())
|
|
|
.or().eq(StockWaitDetails::getId,stockWaitDto.getId()));
|
|
|
- stockWaitDetails.setReceiptQuantity(stockWaitDetails.getReceiptQuantity().add(stockWaitDto.getQuantity()));
|
|
|
+ BigDecimal receiptQuantity = stockWaitDetails.getReceiptQuantity();
|
|
|
+ receiptQuantity = ObjectUtil.isEmpty(receiptQuantity) ? BigDecimal.ZERO : receiptQuantity;
|
|
|
+ stockWaitDetails.setReceiptQuantity(receiptQuantity.add(stockWaitDto.getQuantity()));
|
|
|
if (stockWaitDetails.getReceiptQuantity().compareTo(stockWaitDetails.getQuantity()) > 0) {
|
|
|
throw new ServiceException("入库数量+已入库数量不能大于待采购数量");
|
|
|
}
|
|
@@ -190,7 +192,8 @@ public class StockWaitServiceImpl extends ServiceImpl<StockWaitMapper, StockWait
|
|
|
StockJournal stockJournal = new StockJournal();
|
|
|
stockJournal.setOpType(byId.getType());
|
|
|
//根据待入库业务类型创建待出入库记录
|
|
|
- Integer businessType = stockWaitDto.getBusinessType();
|
|
|
+ StockWait stockWait = getById(stockWaitDetails.getStockWaitId());
|
|
|
+ Integer businessType = stockWait.getBusinessType();
|
|
|
if (StockWaitType.BORDER_OF_LINE_IN.getDetailType().equals(businessType)) {
|
|
|
//线边回仓库
|
|
|
stockJournal.setType(JournalType.BORDER_OF_LINE_IN.getDetailType());
|