|
@@ -234,14 +234,6 @@ public class DegreeServiceImpl extends ServiceImpl<DegreeMapper, Degree> impleme
|
|
|
return statistical;
|
|
|
}
|
|
|
|
|
|
- // 过滤出支付的订单
|
|
|
- registrations = registrations.stream().filter(o -> o.getStatus().equals(2)).collect(Collectors.toList());
|
|
|
-
|
|
|
-
|
|
|
- if (CollectionUtils.isEmpty(registrations)) {
|
|
|
- return statistical;
|
|
|
- }
|
|
|
-
|
|
|
// 用户ID集合
|
|
|
List<Integer> userIds = registrations.stream().map(DegreeRegistration::getUserId).collect(Collectors.toList());
|
|
|
statistical.setRegisterTotal(userIds.size());
|
|
@@ -249,31 +241,14 @@ public class DegreeServiceImpl extends ServiceImpl<DegreeMapper, Degree> impleme
|
|
|
statistical.setRegisterNum(new HashSet<>(userIds).size());
|
|
|
|
|
|
|
|
|
+ // 考级收入
|
|
|
+ BigDecimal degreeIncomeDecimal = degreeRegistrationDao.getDegreeIncomeDecimal(id);
|
|
|
|
|
|
- // 订单号集合
|
|
|
- List<String> orderNos = registrations.stream().map(DegreeRegistration::getOrderNo).collect(Collectors.toList());
|
|
|
-
|
|
|
- // 通过订单号查询订单
|
|
|
- List<StudentPaymentOrder> orderByOrderNos = studentPaymentOrderService.findOrderByOrderNos(orderNos);
|
|
|
- if (CollectionUtils.isEmpty(orderByOrderNos)) {
|
|
|
- return statistical;
|
|
|
- }
|
|
|
-
|
|
|
- // 订单ID集合
|
|
|
- List<Long> orderIds = orderByOrderNos.stream().map(StudentPaymentOrder::getId).collect(Collectors.toList());
|
|
|
-
|
|
|
- List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.getByOrderIdAndType(orderIds, OrderDetailTypeEnum.DEGREE_REGISTRATION);
|
|
|
-
|
|
|
- if (CollectionUtils.isEmpty(orderDetailList)) {
|
|
|
- return statistical;
|
|
|
- }
|
|
|
|
|
|
- // 总金额
|
|
|
- BigDecimal totalAmount = orderDetailList.stream().map(StudentPaymentOrderDetail::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ statistical.setDegreeIncome(degreeIncomeDecimal);
|
|
|
|
|
|
- statistical.setActualAmount(statistical.getActualAmount().add(totalAmount));
|
|
|
+ statistical.setActualAmount(statistical.getActualAmount().add(degreeIncomeDecimal));
|
|
|
|
|
|
- statistical.setDegreeIncome(statistical.getDegreeIncome().add(totalAmount));
|
|
|
|
|
|
return statistical;
|
|
|
}
|