|
|
@ -119,6 +119,11 @@ public class LoadInventoryServiceImpl extends ServiceImpl<LoadInventoryMapper, L
|
|
|
|
if (inventory.getQtyOnHand().compareTo(loadQty)<0){
|
|
|
|
if (inventory.getQtyOnHand().compareTo(loadQty)<0){
|
|
|
|
throw new BaseException("上料数量不能大于剩余数量"+inventory.getQtyOnHand());
|
|
|
|
throw new BaseException("上料数量不能大于剩余数量"+inventory.getQtyOnHand());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//设备派工单组件是否包含
|
|
|
|
|
|
|
|
Integer bomComponent = loadInventoryMapper.findBomComponent(site, resrce, inventory.getItemBo());
|
|
|
|
|
|
|
|
if (bomComponent<1){
|
|
|
|
|
|
|
|
throw new BaseException("不是设备上产品需要的物料");
|
|
|
|
|
|
|
|
}
|
|
|
|
BigDecimal remainQty = inventory.getQtyOnHand().subtract(loadQty);
|
|
|
|
BigDecimal remainQty = inventory.getQtyOnHand().subtract(loadQty);
|
|
|
|
//扣减库存
|
|
|
|
//扣减库存
|
|
|
|
commonService.updateInventory(site,inventoryId,remainQty);
|
|
|
|
commonService.updateInventory(site,inventoryId,remainQty);
|
|
|
|