|
|
@@ -130,7 +130,7 @@ public class StatisticsDataScheduler {
|
|
|
StreamingAccountData streamingAccount = new StreamingAccountData();
|
|
|
streamingAccount.setAccountName(accountList.get(0).getTitle());
|
|
|
streamingAccount.setGoodsId(goodsId);
|
|
|
- streamingAccountDataStatistics(accountList, streamingAccount, StreamingAccountDataSave, yesZeroDate, thisZeroDate);
|
|
|
+ streamingAccountDataStatistics(goodsId, streamingAccount, StreamingAccountDataSave, yesZeroDate, thisZeroDate);
|
|
|
});
|
|
|
for (StreamingAccountData streamingAccountData : StreamingAccountDataSave) {
|
|
|
streamingAccountData.setStatisticsDate(yesZeroDate);
|
|
|
@@ -178,17 +178,18 @@ public class StatisticsDataScheduler {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param accounts 主账号
|
|
|
+ * @param goodsId 平台id
|
|
|
* @param streamingAccountData
|
|
|
* @param dataSave 入库实体集合
|
|
|
* @param yesZeroDate 昨日零时
|
|
|
* @param thisZeroDate 今日零时
|
|
|
*/
|
|
|
- private void streamingAccountDataStatistics(List<Account> accounts, StreamingAccountData streamingAccountData, List<StreamingAccountData> dataSave, Date yesZeroDate, Date thisZeroDate) {
|
|
|
- //主账号
|
|
|
- List<Long> accountIds = accounts.stream().map(Account::getId).collect(Collectors.toList());
|
|
|
- if (CollUtil.isNotEmpty(accountIds)) {
|
|
|
- List<OrderDon> orderDons = Optional.ofNullable(accountService.getNoAppleOneOrderDon(accountIds, yesZeroDate, thisZeroDate, noOrderStatus)).orElse(new ArrayList<>());
|
|
|
+ private void streamingAccountDataStatistics(Long goodsId, StreamingAccountData streamingAccountData, List<StreamingAccountData> dataSave, Date yesZeroDate, Date thisZeroDate) {
|
|
|
+ //规格
|
|
|
+ List<GoodsDonSku> list = Optional.ofNullable(goodsDonSkuService.list(Wrappers.lambdaQuery(GoodsDonSku.class).eq(GoodsDonSku::getGoodsId, goodsId).select(GoodsDonSku::getId))).orElse(new ArrayList<>());
|
|
|
+ List<Long> skuIds = list.stream().map(GoodsDonSku::getId).collect(Collectors.toList());
|
|
|
+ if (CollUtil.isNotEmpty(skuIds)) {
|
|
|
+ List<OrderDon> orderDons = Optional.ofNullable(accountService.getNoAppleOneOrderDon(skuIds, yesZeroDate, thisZeroDate, noOrderStatus)).orElse(new ArrayList<>());
|
|
|
//用户数
|
|
|
streamingAccountData.setNumOfUser(orderDons.stream().map(OrderDon::getUserId).collect(Collectors.toSet()).size());
|
|
|
getNumOfOrderByPayType(orderDons, streamingAccountData);
|