liu
9 天以前 38d39b8c11096668d1a49eea84bbec298489d23e
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/returnissue/MesWmReturnIssueDetailServiceImpl.java
@@ -18,6 +18,8 @@
import java.math.BigDecimal;
import java.util.List;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
@@ -123,9 +125,10 @@
            if (stock == null) {
                throw exception(WM_MATERIAL_STOCK_NOT_EXISTS);
            }
            // 校验物料和批次一致
            // 校验物料一致:此处只比对物料,因为来源库存(线边/虚拟仓)与上架目标仓库本就不同属正常
            if (ObjUtil.notEqual(stock.getItemId(), reqVO.getItemId())) {
                throw exception(WM_MATERIAL_STOCK_SELECTION_MISMATCH);
                throw new ServiceException(WM_MATERIAL_STOCK_SELECTION_MISMATCH.getCode(),
                        "所选来源库存归属物料与当前退货物料不一致,请重新选择来源库存");
            }
            // 校验库存数量充足
            if (reqVO.getQuantity() != null && stock.getQuantity() != null