修复头程测量与计费测试门禁

This commit is contained in:
2026-09-03 11:32:08 +08:00
parent a3715f618f
commit 757f6ef24f
4 changed files with 8 additions and 9 deletions
@@ -155,15 +155,13 @@ public class MeasurementBatchService {
: requestedMode == null ? findDefaultCoefficientRule(command.tenantId(), customerId) : null;
String coefficientMode = coefficientRule != null ? "MULTIPLY" : requestedMode;
boolean useDimensionRule = "ADD".equals(coefficientMode);
// The box-dimension strategy bills against the matched carton tier.
// This is important when a measured carton is smaller than a standard
// carton: use the configured outer dimensions, rather than adding the
// edge allowance to each measured side.
BigDecimal addition = weighted.edgeAdditionCm();
boolean hasMatchedAddition = useDimensionRule && weighted.boxType() != null;
BigDecimal outerLength = hasMatchedAddition ? weighted.outerLengthCm() : source.lengthCm();
BigDecimal outerWidth = hasMatchedAddition ? weighted.outerWidthCm() : source.widthCm();
BigDecimal outerHeight = hasMatchedAddition ? weighted.outerHeightCm() : source.heightCm();
// ADD 只从匹配箱规取得加边值,外尺寸仍以本次实测尺寸为基准,
// 不能把箱规边界尺寸当成本次货物的实际外尺寸。
BigDecimal outerLength = hasMatchedAddition ? source.lengthCm().add(addition) : source.lengthCm();
BigDecimal outerWidth = hasMatchedAddition ? source.widthCm().add(addition) : source.widthCm();
BigDecimal outerHeight = hasMatchedAddition ? source.heightCm().add(addition) : source.heightCm();
boolean hasOuterOverride = source.outerLengthCm() != null
|| source.outerWidthCm() != null
|| source.outerHeightCm() != null;