...
|
...
|
@@ -30,9 +30,9 @@ public class SellerOrderQuantityStatsProcessor implements StatsProcessor<SellerO |
|
|
|
|
|
@Override
|
|
|
public void accept(SellerOrderStatsEntry entry, SellerOrderStatsConfiguration configuration) {
|
|
|
logger.info("sellerOrderQuantityStatsProcessor accept entry:{},configuration:{}", entry, configuration);
|
|
|
logger.info("[{}] sellerOrderQuantityStatsProcessor accept entry:{},configuration:{}", entry.getSellerUid(), entry, configuration);
|
|
|
|
|
|
Pair<Integer, Integer> timeTuple = configuration.getStatsUnit().getValidityTimeTuple(configuration.getStatsPeriod(), configuration.getStatsPeriod());
|
|
|
Pair<Integer, Integer> timeTuple = configuration.getStatsUnit().nextPeriodTimeTuple(configuration.getStatsPeriod(), configuration.getStatsPeriod());
|
|
|
|
|
|
SellerOrderStatsResult quantityResult = new SellerOrderStatsResult();
|
|
|
quantityResult.setStatsCode(configuration.getStatsCode());
|
...
|
...
|
@@ -43,21 +43,20 @@ public class SellerOrderQuantityStatsProcessor implements StatsProcessor<SellerO |
|
|
|
|
|
int row = sellerOrderStatsResultMapper.insert(quantityResult);
|
|
|
if (row == 1) {
|
|
|
logger.info("stats process success");
|
|
|
logger.info("[{}] stats process success", entry.getSellerUid());
|
|
|
} else {
|
|
|
logger.info("stats process fail");
|
|
|
logger.info("[{}] stats process fail", entry.getSellerUid());
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public SellerPlatformServiceFee apply(SellerOrderStatsEntry entry, SellerOrderStatsConfiguration configuration) {
|
|
|
logger.info("sellerOrderQuantityStatsProcessor apply entry:{},configuration:{}", entry, configuration);
|
|
|
logger.info("[{}] sellerOrderQuantityStatsProcessor apply entry:{},configuration:{}", entry.getSellerUid(), entry, configuration);
|
|
|
SellerOrderStatsResult result = sellerOrderStatsResultMapper.selectStatsResult(entry.getSellerUid(), configuration.getStatsCode(), entry.getTime());
|
|
|
int quantity = (result != null) ? result.getQuantity() : 0;
|
|
|
PlatformServiceFeeDefinition psfd = PlatformServiceFeeDefinition.convert(configuration.getActionParam());
|
|
|
SellerPlatformServiceFee serviceFee = new SellerPlatformServiceFee(quantity, psfd);
|
|
|
logger.info("[{}] seller platform service statsResult:{}", entry.getSellerUid(),result);
|
|
|
logger.info("[{}] seller platform service statsResult:{}", entry.getSellerUid(), result);
|
|
|
return serviceFee;
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|