|
|
@@ -22,6 +22,9 @@ import com.cyksj.service.mange.statistics.StatisticsDataService;
|
|
|
import com.cyksj.service.order.OrderDonService;
|
|
|
import com.cyksj.service.user.UserService;
|
|
|
import com.cyksj.task.StatisticsDataScheduler;
|
|
|
+import com.ejlchina.searcher.BeanSearcher;
|
|
|
+import com.ejlchina.searcher.param.Operator;
|
|
|
+import com.ejlchina.searcher.util.MapUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -61,6 +64,8 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
|
|
|
|
|
|
private final GoodsDonSkuMapper goodsDonSkuMapper;
|
|
|
|
|
|
+ private final BeanSearcher beanSearcher;
|
|
|
+
|
|
|
@Override
|
|
|
public Result<BackgroundDataView> getStatisticsByCondition(Long startTime, Long endTime) {
|
|
|
BackgroundDataView backgroundDataView = new BackgroundDataView();
|
|
|
@@ -169,5 +174,14 @@ 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());
|
|
|
}
|
|
|
}
|