Authored by wujiexiang

Merge branch 'dev-seller-order-stat-6.9.9' into test6.9.9

@@ -81,7 +81,6 @@ public class SellerOrderStatsConfigCacheService { @@ -81,7 +81,6 @@ public class SellerOrderStatsConfigCacheService {
81 if (CollectionUtils.isEmpty(configurations)) { 81 if (CollectionUtils.isEmpty(configurations)) {
82 return Optional.ofNullable(null); 82 return Optional.ofNullable(null);
83 } 83 }
84 - Optional<SellerOrderStatsConfiguration> optional = configurations.stream().filter(config -> config.getOrderAttributes().contains(orderAttributes)).findFirst();  
85 - return optional; 84 + return configurations.stream().filter(config -> config.getOrderAttributes().contains(orderAttributes)).findFirst();
86 } 85 }
87 } 86 }
@@ -23,12 +23,12 @@ public class EmptyStatsProcessor implements StatsProcessor<SellerOrderStatsEntry @@ -23,12 +23,12 @@ public class EmptyStatsProcessor implements StatsProcessor<SellerOrderStatsEntry
23 23
24 @Override 24 @Override
25 public void accept(SellerOrderStatsEntry entry, SellerOrderStatsConfiguration configuration) { 25 public void accept(SellerOrderStatsEntry entry, SellerOrderStatsConfiguration configuration) {
26 - logger.info("emptyStatsProcessor accept entry:{},configuration:{},nothing to do", entry, configuration); 26 + logger.info("emptyStatsProcessor accept entry:{},nothing to do", entry);
27 } 27 }
28 28
29 @Override 29 @Override
30 public SellerPlatformServiceFee apply(SellerOrderStatsEntry entry, SellerOrderStatsConfiguration configuration) { 30 public SellerPlatformServiceFee apply(SellerOrderStatsEntry entry, SellerOrderStatsConfiguration configuration) {
31 - logger.info("emptyStatsProcessor apply entry:{},configuration:{},nothing to do", entry, configuration); 31 + logger.info("emptyStatsProcessor apply entry:{},nothing to do", entry);
32 return new SellerPlatformServiceFee(0, new PlatformServiceFeeDefinition()); 32 return new SellerPlatformServiceFee(0, new PlatformServiceFeeDefinition());
33 } 33 }
34 } 34 }
@@ -31,7 +31,7 @@ public class SellerOrderQuantityStatsProcessor implements StatsProcessor<SellerO @@ -31,7 +31,7 @@ public class SellerOrderQuantityStatsProcessor implements StatsProcessor<SellerO
31 31
32 @Override 32 @Override
33 public void accept(SellerOrderStatsEntry entry, SellerOrderStatsConfiguration configuration) { 33 public void accept(SellerOrderStatsEntry entry, SellerOrderStatsConfiguration configuration) {
34 - logger.info("[{}] sellerOrderQuantityStatsProcessor accept entry:{},configuration:{}", entry.getSellerUid(), entry, configuration); 34 + logger.info("[{}] sellerOrderQuantityStatsProcessor accept entry:{}", entry.getSellerUid(), entry);
35 35
36 Pair<Integer, Integer> timeTuple = configuration.getStatsUnit().nextPeriodTimeTuple(configuration.getStatsPeriod(), configuration.getStatsPeriod()); 36 Pair<Integer, Integer> timeTuple = configuration.getStatsUnit().nextPeriodTimeTuple(configuration.getStatsPeriod(), configuration.getStatsPeriod());
37 37
@@ -51,7 +51,7 @@ public class SellerOrderQuantityStatsProcessor implements StatsProcessor<SellerO @@ -51,7 +51,7 @@ public class SellerOrderQuantityStatsProcessor implements StatsProcessor<SellerO
51 51
52 @Override 52 @Override
53 public SellerPlatformServiceFee apply(SellerOrderStatsEntry entry, SellerOrderStatsConfiguration configuration) { 53 public SellerPlatformServiceFee apply(SellerOrderStatsEntry entry, SellerOrderStatsConfiguration configuration) {
54 - logger.info("[{}] sellerOrderQuantityStatsProcessor apply entry:{},configuration:{}", entry.getSellerUid(), entry, configuration); 54 + logger.info("[{}] sellerOrderQuantityStatsProcessor apply entry:{}", entry.getSellerUid(), entry);
55 SellerOrderStatsResult result = sellerOrderStatsResultMapper.selectStatsResult(entry.getSellerUid(), configuration.getStatsCode(), entry.getTime()); 55 SellerOrderStatsResult result = sellerOrderStatsResultMapper.selectStatsResult(entry.getSellerUid(), configuration.getStatsCode(), entry.getTime());
56 int quantity = (result != null) ? result.getQuantity() : 0; 56 int quantity = (result != null) ? result.getQuantity() : 0;
57 PlatformServiceFeeDefinition psfd = PlatformServiceFeeDefinition.convert(configuration.getActionParam()); 57 PlatformServiceFeeDefinition psfd = PlatformServiceFeeDefinition.convert(configuration.getActionParam());
@@ -4,6 +4,8 @@ import com.yohoufo.order.service.cache.SellerOrderStatsConfigCacheService; @@ -4,6 +4,8 @@ import com.yohoufo.order.service.cache.SellerOrderStatsConfigCacheService;
4 import com.yohoufo.order.service.stats.StatsConfigManager; 4 import com.yohoufo.order.service.stats.StatsConfigManager;
5 import com.yohoufo.order.service.stats.StatsProcessor; 5 import com.yohoufo.order.service.stats.StatsProcessor;
6 import com.yohoufo.order.service.stats.StatsProcessorRegistry; 6 import com.yohoufo.order.service.stats.StatsProcessorRegistry;
  7 +import com.yohoufo.order.utils.LoggerUtils;
  8 +import org.slf4j.Logger;
7 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
9 11
@@ -17,6 +19,8 @@ import java.util.Optional; @@ -17,6 +19,8 @@ import java.util.Optional;
17 @Service 19 @Service
18 public class SellerOrderStatsConfigurationManager implements StatsConfigManager<SellerOrderStatsEntry, SellerOrderStatsConfiguration> { 20 public class SellerOrderStatsConfigurationManager implements StatsConfigManager<SellerOrderStatsEntry, SellerOrderStatsConfiguration> {
19 21
  22 + private Logger logger = LoggerUtils.getSellerOrderLogger();
  23 +
20 private StatsProcessorRegistry registry = new StatsProcessorRegistry(); 24 private StatsProcessorRegistry registry = new StatsProcessorRegistry();
21 25
22 @Autowired 26 @Autowired
@@ -39,6 +43,7 @@ public class SellerOrderStatsConfigurationManager implements StatsConfigManager< @@ -39,6 +43,7 @@ public class SellerOrderStatsConfigurationManager implements StatsConfigManager<
39 Optional<SellerOrderStatsConfiguration> configurationOp = sellerOrderStatsConfigCacheService.findBy(statsEntry.getOrderAttribute()); 43 Optional<SellerOrderStatsConfiguration> configurationOp = sellerOrderStatsConfigCacheService.findBy(statsEntry.getOrderAttribute());
40 if (!configurationOp.isPresent() || configurationOp.get().getExcludeUids().stream().anyMatch(uid -> uid == statsEntry.getSellerUid())) { 44 if (!configurationOp.isPresent() || configurationOp.get().getExcludeUids().stream().anyMatch(uid -> uid == statsEntry.getSellerUid())) {
41 // 没有找到配置项或卖家被排除 45 // 没有找到配置项或卖家被排除
  46 + logger.info("stats config is null or seller is excluded for statsEntry:{}",statsEntry);
42 return SellerOrderStatsConfiguration.emptyConfiguration; 47 return SellerOrderStatsConfiguration.emptyConfiguration;
43 } 48 }
44 return configurationOp.get(); 49 return configurationOp.get();