trade:物流费用计算,增加金额 divide 分拆逻辑

This commit is contained in:
YunaiV
2023-09-22 21:56:09 +08:00
parent 24111c1548
commit 7c4fbc63dc
3 changed files with 61 additions and 112 deletions

View File

@@ -91,7 +91,7 @@ public class TradeDeliveryPriceCalculatorTest extends BaseMockitoUnitTest {
item -> item.setFreeCount(20).setFreePrice(100));
// 准备 SP 运费模板数据
templateRespBO = randomPojo(DeliveryExpressTemplateRespBO.class,
item -> item.setChargeMode(DeliveryExpressChargeModeEnum.PIECE.getType())
item -> item.setChargeMode(DeliveryExpressChargeModeEnum.COUNT.getType())
.setCharge(chargeBO).setFree(freeBO));
}
@@ -144,11 +144,11 @@ public class TradeDeliveryPriceCalculatorTest extends BaseMockitoUnitTest {
// 断言SKU1
assertThat(resultBO.getItems().get(0))
.extracting("price", "count","discountPrice" ,"couponPrice", "pointPrice","deliveryPrice","payPrice")
.containsExactly(100, 2, 0, 0, 0, 1500, 1700);
.containsExactly(100, 2, 0, 0, 0, 500, 700);
// 断言SKU2
assertThat(resultBO.getItems().get(1))
.extracting("price", "count","discountPrice" ,"couponPrice", "pointPrice","deliveryPrice","payPrice")
.containsExactly(200, 10, 0, 0, 0, 1500, 3500);
.containsExactly(200, 10, 0, 0, 0, 2500, 4500);
// 断言SKU3 未选中
assertThat(resultBO.getItems().get(2))
.extracting("price", "count","discountPrice" ,"couponPrice", "pointPrice","deliveryPrice","payPrice")