diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java index 0f44851..06f31d0 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java @@ -137,6 +137,11 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { 0 ); + // 校验库中数量是否足够 + if (baseKnifeList.size() < wmsOutPlanDetail.getPlannedQuantity()) { + throw new RuntimeException("库存数量不足以支持本次出库"); + } + // 更新出库计划明细 this.wmsOutPlanMapper.updateWmsOutPlanDetailRealQuantityAndDetailStateByWmsOutPlanDetailId( baseKnifeList.size(),