|
|
@@ -18,7 +18,10 @@ import com.cyksj.mapper.manage.statistics.StreamingAccountDataMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.excel.ExcelAccountData;
|
|
|
import com.cyksj.model.manage.views.GroupsRelationView;
|
|
|
-import com.cyksj.model.views.*;
|
|
|
+import com.cyksj.model.views.BackgroundDataView;
|
|
|
+import com.cyksj.model.views.DistributeOrdersView;
|
|
|
+import com.cyksj.model.views.ExpiredAccountDataView;
|
|
|
+import com.cyksj.model.views.GoodsDonSkuView;
|
|
|
import com.cyksj.service.mange.CmsAccountService;
|
|
|
import com.cyksj.service.mange.statistics.StatisticsDataService;
|
|
|
import com.cyksj.service.order.OrderDonService;
|
|
|
@@ -170,6 +173,41 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
|
|
|
return expiredAccountDataViews;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public BackgroundDataView getTitleData() {
|
|
|
+ BackgroundDataView backgroundDataView = new BackgroundDataView();
|
|
|
+ Number waitingRegisterNum = beanSearcher.searchCount(RegisterOrderDon.class, MapUtils.builder()
|
|
|
+ .field(RegisterOrderDon::getStatus, RegisterOrderDon.Status.hasPayment.name()).op(Operator.Equal)
|
|
|
+ .onlySelect(RegisterOrderDon ::getId).build());
|
|
|
+ backgroundDataView.setWaitingRegisterNum(waitingRegisterNum.intValue());
|
|
|
+ Number errorRegisterNum = beanSearcher.searchCount(RegisterOrderDon.class, MapUtils.builder()
|
|
|
+ .field(RegisterOrderDon::getStatus, RegisterOrderDon.Status.error.name()).op(Operator.Equal)
|
|
|
+ .onlySelect(RegisterOrderDon ::getId)
|
|
|
+ .build());
|
|
|
+ backgroundDataView.setFailRegisterNum(errorRegisterNum.intValue());
|
|
|
+
|
|
|
+ //netflix
|
|
|
+ GoodsDonSkuView goodsDonSkuView = beanSearcher.searchFirst(GoodsDonSkuView.class, MapUtils.builder()
|
|
|
+ .field(GoodsDonSkuView::getGoodsTitle, "Netflix")
|
|
|
+ .field(GoodsDonSkuView::getSpecVal, "月付").op(Operator.Contain).build());
|
|
|
+ Long skuId = goodsDonSkuView.getSkuId();
|
|
|
+
|
|
|
+ Integer numOfMonthNetflix = groupsMapper.selectCount(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
+ .eq(GroupsTrips::getSkuId, skuId));
|
|
|
+ backgroundDataView.setNumOfMonthNetflix(numOfMonthNetflix);
|
|
|
+
|
|
|
+
|
|
|
+ Integer numOfMonthEmptyRelationNetflix = beanSearcher.searchCount(GroupsRelationView.class, MapUtils.builder()
|
|
|
+ .field(GroupsRelationView::getSkuId, skuId)
|
|
|
+ .field(GroupsRelationView::getUserId, 0)
|
|
|
+ .build()).intValue();
|
|
|
+ backgroundDataView.setNumOfMonthEmptyRelationNetflix(numOfMonthEmptyRelationNetflix);
|
|
|
+
|
|
|
+ Integer numOfMonthEmptyTripsNetflix = groupsMapper.selectEmptyNetfilxTrips(skuId);
|
|
|
+ backgroundDataView.setNumOfMonthEmptyTripsNetflix(numOfMonthEmptyTripsNetflix);
|
|
|
+ return backgroundDataView;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Result<String> updateRenewStatus(Integer relationId) {
|
|
|
GroupsRelation groupsRelation = groupsRelationMapper.selectById(relationId);
|
|
|
@@ -279,37 +317,8 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
|
|
|
//已到期主账号
|
|
|
List<Account> expiredAccounts = Optional.ofNullable(accountService.list(Wrappers.lambdaQuery(Account.class).le(Account::getExpiryTime, now))).orElse(new ArrayList<>());
|
|
|
backgroundDataView.setTotalExpiredAccountNum(expiredAccounts.size());
|
|
|
- Number waitingRegisterNum = beanSearcher.searchCount(RegisterOrderDon.class, MapUtils.builder()
|
|
|
- .field(RegisterOrderDon::getStatus, RegisterOrderDon.Status.hasPayment.name()).op(Operator.Equal)
|
|
|
- .onlySelect(RegisterOrderDon ::getId).build());
|
|
|
- backgroundDataView.setWaitingRegisterNum(waitingRegisterNum.intValue());
|
|
|
- Number errorRegisterNum = beanSearcher.searchCount(RegisterOrderDon.class, MapUtils.builder()
|
|
|
- .field(RegisterOrderDon::getStatus, RegisterOrderDon.Status.error.name()).op(Operator.Equal)
|
|
|
- .onlySelect(RegisterOrderDon ::getId)
|
|
|
- .build());
|
|
|
- backgroundDataView.setFailRegisterNum(errorRegisterNum.intValue());
|
|
|
//分销金额数据统计
|
|
|
distribute(backgroundDataView, startDate, endDate);
|
|
|
-
|
|
|
- //netflix
|
|
|
- GoodsDonSkuView goodsDonSkuView = beanSearcher.searchFirst(GoodsDonSkuView.class, MapUtils.builder()
|
|
|
- .field(GoodsDonSkuView::getGoodsTitle, "Netflix")
|
|
|
- .field(GoodsDonSkuView::getSpecVal, "月付").op(Operator.Contain).build());
|
|
|
- Long skuId = goodsDonSkuView.getSkuId();
|
|
|
-
|
|
|
- Integer numOfMonthNetflix = groupsMapper.selectCount(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
- .eq(GroupsTrips::getSkuId, skuId));
|
|
|
- backgroundDataView.setNumOfMonthNetflix(numOfMonthNetflix);
|
|
|
-
|
|
|
-
|
|
|
- Integer numOfMonthEmptyRelationNetflix = beanSearcher.searchCount(GroupsRelationView.class, MapUtils.builder()
|
|
|
- .field(GroupsRelationView::getSkuId, skuId)
|
|
|
- .field(GroupsRelationView::getUserId, 0)
|
|
|
- .build()).intValue();
|
|
|
- backgroundDataView.setNumOfMonthEmptyRelationNetflix(numOfMonthEmptyRelationNetflix);
|
|
|
-
|
|
|
- Integer numOfMonthEmptyTripsNetflix = groupsMapper.selectEmptyNetfilxTrips(skuId);
|
|
|
- backgroundDataView.setNumOfMonthEmptyTripsNetflix(numOfMonthEmptyTripsNetflix);
|
|
|
}
|
|
|
|
|
|
/**
|