|
@@ -1,5 +1,6 @@
|
|
|
package com.ym.mec.student.controller;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -370,6 +371,8 @@ public class StudentOrderController extends BaseController {
|
|
|
List<PracticeGroupsDto> practiceGroupsFrees = courseScheduleEvaluateDao.getPracticeGroupsFree();
|
|
|
List<PracticeGroupsDto> practiceGroupsBuys = courseScheduleEvaluateDao.getPracticeGroupsBuy();
|
|
|
List<PracticeGroupsDto> practiceGroupsRenews = courseScheduleEvaluateDao.getPracticeGroupsRenew();
|
|
|
+ List<PracticeGroupsDto> monthOrganBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_BUY);
|
|
|
+ List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_RENEW);
|
|
|
|
|
|
List<PracticeGroupsDto> practiceGroups = new ArrayList<>();
|
|
|
for (Organization organ : organs) {
|
|
@@ -418,6 +421,23 @@ public class StudentOrderController extends BaseController {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ //当月新增金额和人数
|
|
|
+ for (PracticeGroupsDto monthOrganBuyMoney : monthOrganBuyMoneys) {
|
|
|
+ if (organ.getId().equals(monthOrganBuyMoney.getOrganId())) {
|
|
|
+ practiceGroupsDto.setMonthBuyMoney(monthOrganBuyMoney.getTotalMoney());
|
|
|
+ practiceGroupsDto.setMonthBuyNums(monthOrganBuyMoney.getBuyNums());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //当月续费金额和人数
|
|
|
+ for (PracticeGroupsDto monthOrganRenewMoney : monthOrganRenewMoneys) {
|
|
|
+ if (organ.getId().equals(monthOrganRenewMoney.getOrganId())) {
|
|
|
+ practiceGroupsDto.setMonthRenewNums(monthOrganRenewMoney.getBuyNums());
|
|
|
+ practiceGroupsDto.setMonthRenewMoney(monthOrganRenewMoney.getTotalMoney());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if(practiceGroupsDto.getTotalNums() >0 ){
|
|
|
double scale = new BigDecimal(practiceGroupsDto.getBuyNums()).multiply(new BigDecimal(100)).divide(new BigDecimal(practiceGroupsDto.getTotalNums()),2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
@@ -433,6 +453,10 @@ public class StudentOrderController extends BaseController {
|
|
|
Integer renewNum = 0;
|
|
|
Integer overNum = 0;
|
|
|
Integer reportNum = 0;
|
|
|
+ Integer monthBuyNums = 0;
|
|
|
+ Integer monthRenewNums = 0;
|
|
|
+ BigDecimal monthBuyMoney = BigDecimal.ZERO;
|
|
|
+ BigDecimal monthRenewMoney= BigDecimal.ZERO;
|
|
|
|
|
|
Iterator<PracticeGroupsDto> iterator = practiceGroups.iterator();
|
|
|
while (iterator.hasNext()) {
|
|
@@ -447,6 +471,10 @@ public class StudentOrderController extends BaseController {
|
|
|
buyNum += next.getBuyNums();
|
|
|
reportNum += next.getReportNums();
|
|
|
renewNum += next.getRenewNums();
|
|
|
+ monthBuyNums += next.getMonthBuyNums();
|
|
|
+ monthRenewNums += next.getMonthRenewNums();
|
|
|
+ monthBuyMoney = monthBuyMoney.add(next.getMonthBuyMoney());
|
|
|
+ monthRenewMoney = monthRenewMoney.add(next.getMonthRenewMoney());
|
|
|
}
|
|
|
practiceGroups = practiceGroups.stream().sorted(Comparator.comparingDouble(PracticeGroupsDto::getBuyScale).reversed()).collect(Collectors.toList());
|
|
|
|
|
@@ -458,6 +486,10 @@ public class StudentOrderController extends BaseController {
|
|
|
practiceGroupStatisDto.setRenewNum(renewNum);
|
|
|
practiceGroupStatisDto.setOverNum(overNum);
|
|
|
practiceGroupStatisDto.setReportNum(reportNum);
|
|
|
+ practiceGroupStatisDto.setMonthBuyNums(monthBuyNums);
|
|
|
+ practiceGroupStatisDto.setMonthBuyMoney(monthBuyMoney);
|
|
|
+ practiceGroupStatisDto.setMonthRenewNums(monthRenewNums);
|
|
|
+ practiceGroupStatisDto.setMonthRenewMoney(monthRenewMoney);
|
|
|
|
|
|
if(totalNum >0 ){
|
|
|
BigDecimal scale = new BigDecimal(buyNum).multiply(new BigDecimal(100)).divide(new BigDecimal(totalNum), 2, BigDecimal.ROUND_HALF_UP);
|