Merge remote-tracking branch 'origin/test' into dev

This commit is contained in:
2026-09-03 11:34:52 +08:00
4 changed files with 8 additions and 9 deletions
@@ -191,15 +191,13 @@ public class MeasurementBatchService {
: requestedMode == null ? findDefaultCoefficientRule(command.tenantId(), customerId) : null; : requestedMode == null ? findDefaultCoefficientRule(command.tenantId(), customerId) : null;
String coefficientMode = coefficientRule != null ? "MULTIPLY" : requestedMode; String coefficientMode = coefficientRule != null ? "MULTIPLY" : requestedMode;
boolean useDimensionRule = "ADD".equals(coefficientMode); 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(); BigDecimal addition = weighted.edgeAdditionCm();
boolean hasMatchedAddition = useDimensionRule && weighted.boxType() != null; boolean hasMatchedAddition = useDimensionRule && weighted.boxType() != null;
BigDecimal outerLength = hasMatchedAddition ? weighted.outerLengthCm() : source.lengthCm(); // ADD 只从匹配箱规取得加边值,外尺寸仍以本次实测尺寸为基准,
BigDecimal outerWidth = hasMatchedAddition ? weighted.outerWidthCm() : source.widthCm(); // 不能把箱规边界尺寸当成本次货物的实际外尺寸。
BigDecimal outerHeight = hasMatchedAddition ? weighted.outerHeightCm() : source.heightCm(); 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 boolean hasOuterOverride = source.outerLengthCm() != null
|| source.outerWidthCm() != null || source.outerWidthCm() != null
|| source.outerHeightCm() != null; || source.outerHeightCm() != null;
@@ -15,7 +15,7 @@ paths:
- name: customerId - name: customerId
in: query in: query
required: false required: false
schema: {type: integer, format: int64, minimum: 1} schema: {type: string, pattern: '^[1-9][0-9]*$'}
- {name: ruleCode, in: query, schema: {type: string, maxLength: 50}} - {name: ruleCode, in: query, schema: {type: string, maxLength: 50}}
responses: responses:
'200': '200':
@@ -484,7 +484,7 @@ class FbaPricingServiceTest {
// 试算重复用例的摘要由服务算法固定;其余用例在首次调用后才返回该记录。 // 试算重复用例的摘要由服务算法固定;其余用例在首次调用后才返回该记录。
value.setRequestHash("FEE_SEND".equals(operation) value.setRequestHash("FEE_SEND".equals(operation)
? "3be2051b9bc4c06a163cb3099fd7b3f828b51307cc54d3cfc232c11353c61046" ? "3be2051b9bc4c06a163cb3099fd7b3f828b51307cc54d3cfc232c11353c61046"
: "8aa8a9861d4cac0c6001bb902754c152c6211ba57e1fad9160b1caef651e3d65"); : "1b874a4f469151f236aa6086835f3cac22cca5cb4a1b90444f08b27b76e8a3c4");
return value; return value;
} }
@@ -52,6 +52,7 @@ import static org.mockito.Mockito.when;
class InboundMeasurementServiceTest { class InboundMeasurementServiceTest {
@MockBean private InboundMeasurementRepository repository; @MockBean private InboundMeasurementRepository repository;
@MockBean private MeasurementBatchService batchService; @MockBean private MeasurementBatchService batchService;
@MockBean private FbaMasterDataService fbaMasterDataService;
@MockBean private OrderCargoClient orderCargoClient; @MockBean private OrderCargoClient orderCargoClient;
@MockBean private MeasurementImageClient imageClient; @MockBean private MeasurementImageClient imageClient;
@MockBean private WarehousePalletLocationClient warehousePallets; @MockBean private WarehousePalletLocationClient warehousePallets;