From a425a9052ac345de1fe66343dc323174b8f24617 Mon Sep 17 00:00:00 2001 From: Joshi <3040996759@qq.com> Date: Tue, 2 Jun 2026 08:02:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(wms/coil):=20=E4=B8=BA=E9=95=80=E9=93=AC?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=B1=BB=E5=9E=8B=E8=B1=81=E5=85=8D=E5=88=86?= =?UTF-8?q?=E5=8D=B7=E5=87=80=E9=87=8D=E4=B8=8E=E8=A7=84=E6=A0=BC=E5=8E=9A?= =?UTF-8?q?=E5=BA=A6=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在钢卷分卷和批量分卷的业务逻辑中,当操作类型为501(镀铬)时,豁免以下校验: 1. 子卷净重不超过母卷净重的校验 2. 子卷规格厚度不超过母卷规格厚度的校验 3. 批量分卷时所有子卷总重不超过母卷净重的校验 调整前,所有分卷操作均强制进行净重和规格厚度校验;调整后,镀铬操作类型(501)可跳过这些校验,以适应镀铬产线的特殊业务场景。 --- .../impl/WmsMaterialCoilServiceImpl.java | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) 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() + "]"); + } } }