Merge branch 'dev-seller-order-stat-6.9.9' into test6.9.9
Showing
3 changed files
with
10 additions
and
5 deletions
@@ -232,9 +232,8 @@ public class SellerService { | @@ -232,9 +232,8 @@ public class SellerService { | ||
232 | //下个周期 | 232 | //下个周期 |
233 | SellerOrderStatsEntry nextStatsEntry = SellerOrderStatsEntry.builder().sellerUid(uid).skupType(SkupType.IN_STOCK).build(); | 233 | SellerOrderStatsEntry nextStatsEntry = SellerOrderStatsEntry.builder().sellerUid(uid).skupType(SkupType.IN_STOCK).build(); |
234 | SellerOrderStatsConfiguration nextStatsConfig = statsConfigurationManager.getStatsConfig(nextStatsEntry); | 234 | SellerOrderStatsConfiguration nextStatsConfig = statsConfigurationManager.getStatsConfig(nextStatsEntry); |
235 | - Pair<Integer, Integer> nextValidityTimeTuple = nextStatsConfig.getStatsUnit().nextPeriodTimeTuple(nextStatsConfig.getStatsPeriod(), nextStatsConfig.getStatsPeriod()); | ||
236 | //设置查询时间为下个周期的开始时间 | 235 | //设置查询时间为下个周期的开始时间 |
237 | - nextStatsEntry.setTime(nextValidityTimeTuple.getKey()); | 236 | + nextStatsEntry.setTime(nextStatsConfig.getStatsUnit().nextPeriodTimeTuple(nextStatsConfig.getStatsPeriod(), nextStatsConfig.getStatsPeriod()).getKey()); |
238 | return (SellerPlatformServiceFee) statsConfigurationManager.getStatsProcessor(nextStatsConfig.getStatsProcessorName()).apply(nextStatsEntry, nextStatsConfig); | 237 | return (SellerPlatformServiceFee) statsConfigurationManager.getStatsProcessor(nextStatsConfig.getStatsProcessorName()).apply(nextStatsEntry, nextStatsConfig); |
239 | } | 238 | } |
240 | 239 |
@@ -11,8 +11,9 @@ import java.util.stream.Stream; | @@ -11,8 +11,9 @@ import java.util.stream.Stream; | ||
11 | * Created by jiexiang.wu on 2019/7/22. | 11 | * Created by jiexiang.wu on 2019/7/22. |
12 | */ | 12 | */ |
13 | public enum StatsUnit { | 13 | public enum StatsUnit { |
14 | - | ||
15 | - HOUR("H"), MONTH("M"); | 14 | + //便于测试 |
15 | + HOUR("H"), | ||
16 | + MONTH("M"); | ||
16 | 17 | ||
17 | private String unit; | 18 | private String unit; |
18 | 19 |
@@ -18,7 +18,12 @@ import java.util.List; | @@ -18,7 +18,12 @@ import java.util.List; | ||
18 | @ToString | 18 | @ToString |
19 | public class SellerOrderStatsConfiguration implements StatsConfiguration { | 19 | public class SellerOrderStatsConfiguration implements StatsConfiguration { |
20 | 20 | ||
21 | - public static SellerOrderStatsConfiguration emptyConfiguration = SellerOrderStatsConfiguration.builder().excludeUids(Lists.newArrayList()).statsProcessorName("emptyStatsProcessor").build(); | 21 | + public static SellerOrderStatsConfiguration emptyConfiguration = SellerOrderStatsConfiguration.builder() |
22 | + .excludeUids(Lists.newArrayList()) | ||
23 | + .statsUnit(StatsUnit.MONTH) | ||
24 | + .skupTypes(Lists.newArrayList()) | ||
25 | + .statsProcessorName("emptyStatsProcessor") | ||
26 | + .build(); | ||
22 | 27 | ||
23 | private String statsCode; | 28 | private String statsCode; |
24 | //排除的uid | 29 | //排除的uid |
-
Please register or login to post a comment