| 
														
															@@ -1,5 +1,7 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 package com.ym.mec.student.controller; 
														 | 
														
														 | 
														
															 package com.ym.mec.student.controller; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.ym.mec.biz.dal.dto.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import com.ym.mec.biz.dal.entity.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.dal.enums.OrderTypeEnum; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.dal.enums.OrderTypeEnum; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.util.date.DateUtil; 
														 | 
														
														 | 
														
															 import com.ym.mec.util.date.DateUtil; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import io.swagger.annotations.Api; 
														 | 
														
														 | 
														
															 import io.swagger.annotations.Api; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -35,16 +37,6 @@ import com.ym.mec.biz.dal.dao.OrganizationDao; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.dal.dao.SysConfigDao; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.dal.dao.SysConfigDao; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.dal.dao.TeacherCourseStatisticsDao; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.dal.dao.TeacherCourseStatisticsDao; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.biz.dal.dto.LuckStatisDto; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.biz.dal.dto.OrderStatisDto; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.biz.dal.dto.PracticeGroupsDto; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.biz.dal.dto.VipBuyResultDto; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.biz.dal.dto.practiceGroupStatisDto; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.biz.dal.entity.Goods; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.biz.dal.entity.MusicGroup; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.biz.dal.entity.Organization; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.biz.dal.entity.SporadicChargeInfo; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-import com.ym.mec.biz.dal.entity.StudentPaymentOrder; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.dal.enums.DealStatusEnum; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.dal.enums.DealStatusEnum; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.dal.enums.GroupType; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.dal.enums.GroupType; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import com.ym.mec.biz.service.MusicGroupService; 
														 | 
														
														 | 
														
															 import com.ym.mec.biz.service.MusicGroupService; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -367,8 +359,8 @@ public class StudentOrderController extends BaseController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Date startTime = DateUtil.getFirstDayOfMonth(new Date()); 
														 | 
														
														 | 
														
															         Date startTime = DateUtil.getFirstDayOfMonth(new Date()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        List<PracticeGroupsDto> monthOrganBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_BUY,startTime); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_RENEW,startTime); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<PracticeGroupsDto> monthOrganBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_BUY, startTime); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_RENEW, startTime); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //List<PracticeGroupsDto> monthOrganBuyMoneys = courseScheduleEvaluateDao.getOrganNewPracticeGroupsOfMonth(OrderTypeEnum.PRACTICE_GROUP_BUY,startTime); 
														 | 
														
														 | 
														
															         //List<PracticeGroupsDto> monthOrganBuyMoneys = courseScheduleEvaluateDao.getOrganNewPracticeGroupsOfMonth(OrderTypeEnum.PRACTICE_GROUP_BUY,startTime); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getOrganNewPracticeGroupsOfMonth(OrderTypeEnum.PRACTICE_GROUP_RENEW,startTime); 
														 | 
														
														 | 
														
															         //List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getOrganNewPracticeGroupsOfMonth(OrderTypeEnum.PRACTICE_GROUP_RENEW,startTime); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -438,8 +430,8 @@ public class StudentOrderController extends BaseController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            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(); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            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(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 practiceGroupsDto.setBuyScale(scale); 
														 | 
														
														 | 
														
															                 practiceGroupsDto.setBuyScale(scale); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -455,7 +447,7 @@ public class StudentOrderController extends BaseController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Integer monthBuyNums = 0; 
														 | 
														
														 | 
														
															         Integer monthBuyNums = 0; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Integer monthRenewNums = 0; 
														 | 
														
														 | 
														
															         Integer monthRenewNums = 0; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         BigDecimal monthBuyMoney = BigDecimal.ZERO; 
														 | 
														
														 | 
														
															         BigDecimal monthBuyMoney = BigDecimal.ZERO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        BigDecimal monthRenewMoney= BigDecimal.ZERO; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        BigDecimal monthRenewMoney = BigDecimal.ZERO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Iterator<PracticeGroupsDto> iterator = practiceGroups.iterator(); 
														 | 
														
														 | 
														
															         Iterator<PracticeGroupsDto> iterator = practiceGroups.iterator(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         while (iterator.hasNext()) { 
														 | 
														
														 | 
														
															         while (iterator.hasNext()) { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -472,7 +464,7 @@ public class StudentOrderController extends BaseController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             renewNum += next.getRenewNums(); 
														 | 
														
														 | 
														
															             renewNum += next.getRenewNums(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             monthBuyNums += next.getMonthBuyNums(); 
														 | 
														
														 | 
														
															             monthBuyNums += next.getMonthBuyNums(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             monthRenewNums += next.getMonthRenewNums(); 
														 | 
														
														 | 
														
															             monthRenewNums += next.getMonthRenewNums(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-            monthBuyMoney  = monthBuyMoney.add(next.getMonthBuyMoney()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            monthBuyMoney = monthBuyMoney.add(next.getMonthBuyMoney()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             monthRenewMoney = monthRenewMoney.add(next.getMonthRenewMoney()); 
														 | 
														
														 | 
														
															             monthRenewMoney = monthRenewMoney.add(next.getMonthRenewMoney()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         practiceGroups = practiceGroups.stream().sorted(Comparator.comparingDouble(PracticeGroupsDto::getBuyScale).reversed()).collect(Collectors.toList()); 
														 | 
														
														 | 
														
															         practiceGroups = practiceGroups.stream().sorted(Comparator.comparingDouble(PracticeGroupsDto::getBuyScale).reversed()).collect(Collectors.toList()); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -490,11 +482,185 @@ public class StudentOrderController extends BaseController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         practiceGroupStatisDto.setMonthRenewNums(monthRenewNums); 
														 | 
														
														 | 
														
															         practiceGroupStatisDto.setMonthRenewNums(monthRenewNums); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         practiceGroupStatisDto.setMonthRenewMoney(monthRenewMoney); 
														 | 
														
														 | 
														
															         practiceGroupStatisDto.setMonthRenewMoney(monthRenewMoney); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        if(totalNum >0 ){ 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if (totalNum > 0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             BigDecimal scale = new BigDecimal(buyNum).multiply(new BigDecimal(100)).divide(new BigDecimal(totalNum), 2, BigDecimal.ROUND_HALF_UP); 
														 | 
														
														 | 
														
															             BigDecimal scale = new BigDecimal(buyNum).multiply(new BigDecimal(100)).divide(new BigDecimal(totalNum), 2, BigDecimal.ROUND_HALF_UP); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             practiceGroupStatisDto.setBuyScale(scale); 
														 | 
														
														 | 
														
															             practiceGroupStatisDto.setBuyScale(scale); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return succeed(practiceGroupStatisDto); 
														 | 
														
														 | 
														
															         return succeed(practiceGroupStatisDto); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @GetMapping("/getPracticeStatis") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    public HttpResponseResult getPracticeStatis() { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Organization> organs = organizationDao.findAllOrgans(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //除去禁止的体验人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> organTryNums = courseScheduleEvaluateDao.getTryNums(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> organPracticeTryNums = courseScheduleEvaluateDao.getPracticeTryNums(null); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> organVipTryNums = courseScheduleEvaluateDao.getVipTryNums(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String studentIds = organVipTryNums.stream().map(Practice4OrganDto::getStudentIds).collect(Collectors.joining(",")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> organPracticeAndVipTryNums = courseScheduleEvaluateDao.getPracticeTryNums(studentIds); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> practiceBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(new Date(), null, null); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> vipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(new Date(), null); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> practiceAndVipBuyNums = new ArrayList<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(vipBuyNums.size() >0 ) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            studentIds = vipBuyNums.stream().filter(practice4OrganDto -> practice4OrganDto.getOrganId() != null).map(Practice4OrganDto::getStudentIds).collect(Collectors.joining(",")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            practiceAndVipBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(new Date(), null, studentIds); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Date startTime = DateUtil.getFirstDayOfMonth(new Date()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //当月新增网管课人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<PracticeGroupsDto> monthOrganPracticeBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_BUY, startTime); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //当月新增VIP人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<PracticeGroupsDto> monthOrganVipBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.SMALL_CLASS_TO_BUY, startTime); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //当月续费人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_RENEW, startTime); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //本月总人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> nowMonthPracticeBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(startTime, null, null); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> nowMonthVipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(startTime, null); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> nowMonthPracticeAndVipBuyNums = new ArrayList<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(nowMonthVipBuyNums.size()>0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            studentIds = vipBuyNums.stream().filter(practice4OrganDto -> practice4OrganDto.getOrganId() != null).map(Practice4OrganDto::getStudentIds).collect(Collectors.joining(",")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            nowMonthPracticeAndVipBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(startTime, null, studentIds); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        //上月总人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        Date lastMonthStartTime = DateUtil.addMonths(startTime, -1); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> lastMonthPracticeBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(lastMonthStartTime, startTime, null); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> lastMonthVipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(lastMonthStartTime, startTime); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> lastMonthPracticeAndVipBuyNums = new ArrayList<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if(lastMonthVipBuyNums.size() >0) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            studentIds = vipBuyNums.stream().filter(practice4OrganDto -> practice4OrganDto.getOrganId() != null).map(Practice4OrganDto::getStudentIds).collect(Collectors.joining(",")); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            lastMonthPracticeAndVipBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(lastMonthStartTime, startTime, studentIds); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        List<Practice4OrganDto> practice4Organs = new ArrayList<>(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        for (Organization organ : organs) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            Practice4OrganDto practice4OrganDto = new Practice4OrganDto(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            practice4OrganDto.setOrganName(organ.getName()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            practice4OrganDto.setOrganId(organ.getId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //体验人数(除去禁止) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto organTryNum : organTryNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(organTryNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() + organTryNum.getTryNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //网管课体验人数(禁止) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto organPracticeTryNum : organPracticeTryNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(organPracticeTryNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() + organPracticeTryNum.getTryNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //vip课体验人数(禁止) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto organVipTryNum : organVipTryNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(organVipTryNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() + organVipTryNum.getTryNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //减去vip中在网管课的人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto organPracticeAndVipTryNum : organPracticeAndVipTryNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(organPracticeAndVipTryNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() - organPracticeAndVipTryNum.getTryNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //网管课转化人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto practiceBuyNum : practiceBuyNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(practiceBuyNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setPracticeNum(practiceBuyNum.getPracticeNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setTotalNum(practice4OrganDto.getTotalNum() + practiceBuyNum.getPracticeNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //VIP课转化人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto vipBuyNum : vipBuyNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(vipBuyNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setVipNum(vipBuyNum.getVipNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setTotalNum(practice4OrganDto.getTotalNum() + vipBuyNum.getVipNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto practiceAndVipBuyNum : practiceAndVipBuyNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(practiceAndVipBuyNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setVipNum(practice4OrganDto.getVipNum() - practiceAndVipBuyNum.getPracticeNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setTotalNum(practice4OrganDto.getTotalNum() - practiceAndVipBuyNum.getVipNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //当月新增网管课人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (PracticeGroupsDto monthOrganPracticeBuyMoney : monthOrganPracticeBuyMoneys) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(monthOrganPracticeBuyMoney.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setPractice4MonthNum(monthOrganPracticeBuyMoney.getBuyNums()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setTotalMoney(practice4OrganDto.getTotalMoney().add(monthOrganPracticeBuyMoney.getTotalMoney())); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //当月新增VIP课人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (PracticeGroupsDto monthOrganVipBuyMoney : monthOrganVipBuyMoneys) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(monthOrganVipBuyMoney.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setVip4MonthNum(monthOrganVipBuyMoney.getBuyNums()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setTotalMoney(practice4OrganDto.getTotalMoney().add(monthOrganVipBuyMoney.getTotalMoney())); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //当月续费人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (PracticeGroupsDto monthOrganRenewMoney : monthOrganRenewMoneys) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(monthOrganRenewMoney.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setRenew4MonthNum(monthOrganRenewMoney.getBuyNums()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setTotalMoney(practice4OrganDto.getTotalMoney().add(monthOrganRenewMoney.getTotalMoney())); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //同比上月增减人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto nowMonthPracticeBuyNum : nowMonthPracticeBuyNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(nowMonthPracticeBuyNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setChange4MonthNum(nowMonthPracticeBuyNum.getPracticeNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto nowMonthVipBuyNum : nowMonthVipBuyNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(nowMonthVipBuyNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setChange4MonthNum(practice4OrganDto.getChange4MonthNum() + nowMonthVipBuyNum.getVipNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto nowMonthPracticeAndVipBuyNum : nowMonthPracticeAndVipBuyNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(nowMonthPracticeAndVipBuyNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setChange4MonthNum(practice4OrganDto.getChange4MonthNum() - nowMonthPracticeAndVipBuyNum.getPracticeNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            //上月人数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto lastMonthPracticeBuyNum : lastMonthPracticeBuyNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(lastMonthPracticeBuyNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setChange4MonthNum(practice4OrganDto.getChange4MonthNum() - lastMonthPracticeBuyNum.getPracticeNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto lastMonthVipBuyNum : lastMonthVipBuyNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(lastMonthVipBuyNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setChange4MonthNum(practice4OrganDto.getChange4MonthNum() - lastMonthVipBuyNum.getVipNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            for (Practice4OrganDto lastMonthPracticeAndVipBuyNum : lastMonthPracticeAndVipBuyNums) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                if (organ.getId().equals(lastMonthPracticeAndVipBuyNum.getOrganId())) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    practice4OrganDto.setChange4MonthNum(practice4OrganDto.getChange4MonthNum() + lastMonthPracticeAndVipBuyNum.getPracticeNum()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    break; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            practice4Organs.add(practice4OrganDto); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        practice4Organs = practice4Organs.stream().sorted(Comparator.comparing(Practice4OrganDto::getTotalNum).reversed()).collect(Collectors.toList()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        return succeed(practice4Organs); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 } 
														 | 
														
														 | 
														
															 } 
														 |