| | |
| | | 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.*; |
| | | |
| | |
| | | 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 |