|
|
|
|
@ -422,7 +422,7 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
|
|
|
|
|
item -> copyStockOutItem(sourceItem, warehouseId, areaId));
|
|
|
|
|
BigDecimal palletCount = resolvePalletCount(pallet, sourceItem);
|
|
|
|
|
if (palletCount.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
|
|
throw exception(STOCK_OUT_PRODUCT_PALLET_COUNT_EMPTY, pallet.getPalletId());
|
|
|
|
|
throw exception(STOCK_OUT_PRODUCT_PALLET_COUNT_EMPTY, getPalletCodeOrId(pallet.getPalletId()));
|
|
|
|
|
}
|
|
|
|
|
palletTotalCount = palletTotalCount.add(palletCount);
|
|
|
|
|
targetItem.setCount(defaultZero(targetItem.getCount()).add(palletCount));
|
|
|
|
|
@ -440,6 +440,14 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
|
|
|
|
|
reqVO.setItems(normalizedItems);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Object getPalletCodeOrId(Long palletId) {
|
|
|
|
|
if (palletId == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
ErpPalletDO pallet = palletMapper.selectById(palletId);
|
|
|
|
|
return pallet != null && pallet.getCode() != null ? pallet.getCode() : palletId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ErpStockOutSaveReqVOItem copyStockOutItem(ErpStockOutSaveReqVOItem sourceItem, Long warehouseId, Long areaId) {
|
|
|
|
|
ErpStockOutSaveReqVOItem targetItem = BeanUtils.toBean(sourceItem, ErpStockOutSaveReqVOItem.class);
|
|
|
|
|
targetItem.setId(null);
|
|
|
|
|
|