Authored by wujiexiang

若匹配不到服务费配置,则服务费返回null

... ... @@ -50,7 +50,7 @@ public class SellerPlatformServiceFeeSupport {
SellerOrderStatsEntry currentStatsEntry = SellerOrderStatsEntry.builder()
.sellerUid(uid)
.skupType(skupType)
.time(com.yohoufo.common.utils.DateUtil.getCurrentTimeSecond())
.time(DateUtil.getCurrentTimeSecond())
.bidType(OrderConstant.NON_LIMIT_BID_TYPE)
.build();
SellerOrderStatsConfiguration currentStatsConfig = statsConfigurationManager.getStatsConfig(currentStatsEntry);
... ... @@ -96,12 +96,25 @@ public class SellerPlatformServiceFeeSupport {
public BigDecimal getPlatformServiceFeeRate(int uid, SkupType skupType) {
logger.info("[{}] in platformServiceFeeRate,skupType:{}", uid, skupType);
BigDecimal feeRate = null;
//查询当前周期的费用
SellerPlatformServiceFee sellerPlatformServiceFee = currentPeriod(uid, skupType);
//3.最终的费用
BigDecimal feeRate = sellerPlatformServiceFee.getFeeRate();
//当前的扣点服务
SellerOrderStatsEntry currentStatsEntry = SellerOrderStatsEntry.builder()
.sellerUid(uid)
.skupType(skupType)
.time(com.yohoufo.common.utils.DateUtil.getCurrentTimeSecond())
.bidType(OrderConstant.NON_LIMIT_BID_TYPE)
.build();
SellerOrderStatsConfiguration currentStatsConfig = statsConfigurationManager.getStatsConfig(currentStatsEntry);
//若当前查询的配置为空配置,返回null
if (currentStatsConfig != SellerOrderStatsConfiguration.emptyConfiguration) {
SellerOrderStatsResult statsResult = (SellerOrderStatsResult) statsConfigurationManager.getStatsProcessor(currentStatsConfig.getStatsProcessorName()).getResult(currentStatsEntry, currentStatsConfig);
if (Objects.isNull(statsResult)) {
statsResult = createEmptyStatsResult(uid, currentStatsConfig.getStatsCode());
}
//3.最终费率
feeRate = this.buildSellerPlatformServiceFee(uid, statsResult).getFeeRate();
}
logger.info("[{}] out platformServiceFeeRate:{}", uid, feeRate);
return feeRate;
}
... ...