Authored by wujiexiang

fixbug NullException

... ... @@ -232,9 +232,8 @@ public class SellerService {
//下个周期
SellerOrderStatsEntry nextStatsEntry = SellerOrderStatsEntry.builder().sellerUid(uid).skupType(SkupType.IN_STOCK).build();
SellerOrderStatsConfiguration nextStatsConfig = statsConfigurationManager.getStatsConfig(nextStatsEntry);
Pair<Integer, Integer> nextValidityTimeTuple = nextStatsConfig.getStatsUnit().nextPeriodTimeTuple(nextStatsConfig.getStatsPeriod(), nextStatsConfig.getStatsPeriod());
//设置查询时间为下个周期的开始时间
nextStatsEntry.setTime(nextValidityTimeTuple.getKey());
nextStatsEntry.setTime(nextStatsConfig.getStatsUnit().nextPeriodTimeTuple(nextStatsConfig.getStatsPeriod(), nextStatsConfig.getStatsPeriod()).getKey());
return (SellerPlatformServiceFee) statsConfigurationManager.getStatsProcessor(nextStatsConfig.getStatsProcessorName()).apply(nextStatsEntry, nextStatsConfig);
}
... ...
... ... @@ -11,8 +11,9 @@ import java.util.stream.Stream;
* Created by jiexiang.wu on 2019/7/22.
*/
public enum StatsUnit {
HOUR("H"), MONTH("M");
//便于测试
HOUR("H"),
MONTH("M");
private String unit;
... ...
... ... @@ -18,7 +18,12 @@ import java.util.List;
@ToString
public class SellerOrderStatsConfiguration implements StatsConfiguration {
public static SellerOrderStatsConfiguration emptyConfiguration = SellerOrderStatsConfiguration.builder().excludeUids(Lists.newArrayList()).statsProcessorName("emptyStatsProcessor").build();
public static SellerOrderStatsConfiguration emptyConfiguration = SellerOrderStatsConfiguration.builder()
.excludeUids(Lists.newArrayList())
.statsUnit(StatsUnit.MONTH)
.skupTypes(Lists.newArrayList())
.statsProcessorName("emptyStatsProcessor")
.build();
private String statsCode;
//排除的uid
... ...