This commit is contained in:
YunaiV
2026-05-31 20:00:48 +08:00

View File

@ -22,7 +22,6 @@ import org.springframework.context.annotation.Import;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime;
@ -162,7 +161,7 @@ public class BrokerageRecordServiceImplTest extends BaseDbUnitTest {
ProductSkuRespDTO sku = new ProductSkuRespDTO(); ProductSkuRespDTO sku = new ProductSkuRespDTO();
sku.setPrice(1000); sku.setPrice(1000);
when(productSkuApi.getSkuListBySpuId(ListUtil.of(1L))).thenReturn(List.of(sku)); when(productSkuApi.getSkuListBySpuId(ListUtil.of(1L))).thenReturn(ListUtil.of(sku));
// 调用 // 调用
AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 1L); AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 1L);
@ -190,7 +189,7 @@ public class BrokerageRecordServiceImplTest extends BaseDbUnitTest {
ProductSkuRespDTO sku = new ProductSkuRespDTO(); ProductSkuRespDTO sku = new ProductSkuRespDTO();
sku.setPrice(1000); sku.setPrice(1000);
sku.setFirstBrokeragePrice(0); sku.setFirstBrokeragePrice(0);
when(productSkuApi.getSkuListBySpuId(ListUtil.of(2L))).thenReturn(List.of(sku)); when(productSkuApi.getSkuListBySpuId(ListUtil.of(2L))).thenReturn(ListUtil.of(sku));
// 调用 // 调用
AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 2L); AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 2L);
@ -221,7 +220,7 @@ public class BrokerageRecordServiceImplTest extends BaseDbUnitTest {
ProductSkuRespDTO fixedBrokerageSku = new ProductSkuRespDTO(); ProductSkuRespDTO fixedBrokerageSku = new ProductSkuRespDTO();
fixedBrokerageSku.setPrice(2000); fixedBrokerageSku.setPrice(2000);
fixedBrokerageSku.setFirstBrokeragePrice(200); fixedBrokerageSku.setFirstBrokeragePrice(200);
when(productSkuApi.getSkuListBySpuId(ListUtil.of(3L))).thenReturn(List.of(nullBrokerageSku, fixedBrokerageSku)); when(productSkuApi.getSkuListBySpuId(ListUtil.of(3L))).thenReturn(ListUtil.of(nullBrokerageSku, fixedBrokerageSku));
// 调用 // 调用
AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 3L); AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 3L);
@ -245,7 +244,7 @@ public class BrokerageRecordServiceImplTest extends BaseDbUnitTest {
ProductSpuRespDTO spu = new ProductSpuRespDTO(); ProductSpuRespDTO spu = new ProductSpuRespDTO();
spu.setSubCommissionType(true); spu.setSubCommissionType(true);
when(productSpuApi.getSpu(4L)).thenReturn(spu); when(productSpuApi.getSpu(4L)).thenReturn(spu);
when(productSkuApi.getSkuListBySpuId(ListUtil.of(4L))).thenReturn(List.of()); when(productSkuApi.getSkuListBySpuId(ListUtil.of(4L))).thenReturn(ListUtil.of());
// 调用 // 调用
AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 4L); AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 4L);