diff --git a/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java b/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java index fc218a0a..7018d87b 100644 --- a/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java +++ b/klp-wms/src/main/java/com/klp/service/impl/WmsMaterialCoilServiceImpl.java @@ -4994,21 +4994,22 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService { if (childCoilBo.getActualWarehouseId() != null) { validateActualWarehouseForAssign(childCoilBo.getActualWarehouseId(), null); } - - // 校验子卷净重不超过母卷 - if (childCoilBo.getNetWeight() != null && parentCoil.getNetWeight() != null) { - if (childCoilBo.getNetWeight().compareTo(parentCoil.getNetWeight()) > 0) { - throw new RuntimeException("子卷净重[" + childCoilBo.getNetWeight() + "]不能超过母卷净重[" + parentCoil.getNetWeight() + "]"); + if (pendingAction.getActionType() != 501 && childCoilBo.getActionType() != null) { + // 校验子卷净重不超过母卷 + if (childCoilBo.getNetWeight() != null && parentCoil.getNetWeight() != null) { + if (childCoilBo.getNetWeight().compareTo(parentCoil.getNetWeight()) > 0) { + throw new RuntimeException("子卷净重[" + childCoilBo.getNetWeight() + "]不能超过母卷净重[" + parentCoil.getNetWeight() + "]"); + } } - } - // 校验子卷规格厚度不超过母卷 - String childItemType = StringUtils.isNotBlank(childCoilBo.getItemType()) ? childCoilBo.getItemType() : parentCoil.getItemType(); - Long childItemId = childCoilBo.getItemId() != null ? childCoilBo.getItemId() : parentCoil.getItemId(); - BigDecimal parentSpecThickness = getSpecThickness(parentCoil.getItemType(), parentCoil.getItemId()); - BigDecimal childSpecThickness = getSpecThickness(childItemType, childItemId); - if (parentSpecThickness != null && childSpecThickness != null) { - if (childSpecThickness.compareTo(parentSpecThickness) > 0) { - throw new RuntimeException("子卷规格厚度[" + childSpecThickness + "]不能超过母卷规格厚度[" + parentSpecThickness + "]"); + // 校验子卷规格厚度不超过母卷 + String childItemType = StringUtils.isNotBlank(childCoilBo.getItemType()) ? childCoilBo.getItemType() : parentCoil.getItemType(); + Long childItemId = childCoilBo.getItemId() != null ? childCoilBo.getItemId() : parentCoil.getItemId(); + BigDecimal parentSpecThickness = getSpecThickness(parentCoil.getItemType(), parentCoil.getItemId()); + BigDecimal childSpecThickness = getSpecThickness(childItemType, childItemId); + if (parentSpecThickness != null && childSpecThickness != null) { + if (childSpecThickness.compareTo(parentSpecThickness) > 0) { + throw new RuntimeException("子卷规格厚度[" + childSpecThickness + "]不能超过母卷规格厚度[" + parentSpecThickness + "]"); + } } } @@ -5129,14 +5130,16 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService { .map(WmsMaterialCoil::getCurrentCoilNo) .collect(Collectors.toList()); - // 校验所有子卷总重不超过母卷净重 - if (parentCoil.getNetWeight() != null) { - BigDecimal totalChildWeight = childCoils.stream() - .map(WmsMaterialCoil::getNetWeight) - .filter(Objects::nonNull) - .reduce(BigDecimal.ZERO, BigDecimal::add); - if (totalChildWeight.compareTo(parentCoil.getNetWeight()) > 0) { - throw new RuntimeException("所有子卷总重[" + totalChildWeight + "]不能超过母卷净重[" + parentCoil.getNetWeight() + "]"); + if (pendingAction.getActionType() != 501) { + // 校验所有子卷总重不超过母卷净重 + if (parentCoil.getNetWeight() != null) { + BigDecimal totalChildWeight = childCoils.stream() + .map(WmsMaterialCoil::getNetWeight) + .filter(Objects::nonNull) + .reduce(BigDecimal.ZERO, BigDecimal::add); + if (totalChildWeight.compareTo(parentCoil.getNetWeight()) > 0) { + throw new RuntimeException("所有子卷总重[" + totalChildWeight + "]不能超过母卷净重[" + parentCoil.getNetWeight() + "]"); + } } }