|  | @@ -12,6 +12,7 @@ import com.ym.mec.biz.dal.dto.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.SysConfigService;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -421,21 +422,13 @@ public class StudentManageServiceImpl implements StudentManageService {
 | 
	
		
			
				|  |  |              return pageInfo;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          List<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toList());
 | 
	
		
			
				|  |  | -        if(queryInfo.getHasVip() != null){
 | 
	
		
			
				|  |  | +        if(queryInfo.getHasCourse() != null){
 | 
	
		
			
				|  |  |              //有剩余课程的学员
 | 
	
		
			
				|  |  | -            List<Integer> hasVipStudent = courseScheduleDao.findHasCourseStudent(userIds,"VIP");
 | 
	
		
			
				|  |  | -            if(queryInfo.getHasVip()){
 | 
	
		
			
				|  |  | -                userIds = hasVipStudent;
 | 
	
		
			
				|  |  | +            List<Integer> hasCourseStudent = courseScheduleDao.findHasCourseStudent(userIds,"VIP,PRACTICE");
 | 
	
		
			
				|  |  | +            if(queryInfo.getHasCourse()){
 | 
	
		
			
				|  |  | +                userIds = hasCourseStudent;
 | 
	
		
			
				|  |  |              }else {
 | 
	
		
			
				|  |  | -                userIds.removeAll(hasVipStudent);
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if(queryInfo.getHasPractice() != null && userIds.size() > 0){
 | 
	
		
			
				|  |  | -            List<Integer> hasPracticeStudent = courseScheduleDao.findHasCourseStudent(userIds,"PRACTICE");
 | 
	
		
			
				|  |  | -            if(queryInfo.getHasPractice()){
 | 
	
		
			
				|  |  | -                userIds = hasPracticeStudent;
 | 
	
		
			
				|  |  | -            }else {
 | 
	
		
			
				|  |  | -                userIds.removeAll(hasPracticeStudent);
 | 
	
		
			
				|  |  | +                userIds.removeAll(hasCourseStudent);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if(userIds.size() == 0){
 | 
	
	
		
			
				|  | @@ -464,11 +457,9 @@ public class StudentManageServiceImpl implements StudentManageService {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              List<Integer> collect = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
 | 
	
		
			
				|  |  | -            List<Integer> hasVipStudent = courseScheduleDao.findHasCourseStudent(collect,"VIP");
 | 
	
		
			
				|  |  | -            List<Integer> hasPracticeStudent = courseScheduleDao.findHasCourseStudent(collect,"PRACTICE");
 | 
	
		
			
				|  |  | +            List<Integer> hasCourseStudent = courseScheduleDao.findHasCourseStudent(collect,"VIP,PRACTICE");
 | 
	
		
			
				|  |  |              dataList.forEach(e->{
 | 
	
		
			
				|  |  | -                e.setHasVip(hasVipStudent.contains(e.getUserId()));
 | 
	
		
			
				|  |  | -                e.setHasPractice(hasPracticeStudent.contains(e.getUserId()));
 | 
	
		
			
				|  |  | +                e.setHasCourse(hasCourseStudent.contains(e.getUserId()));
 | 
	
		
			
				|  |  |                  e.setNoPaymentAmount(totalAmountMap.get(e.getUserId()));
 | 
	
		
			
				|  |  |              });
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -481,7 +472,7 @@ public class StudentManageServiceImpl implements StudentManageService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public Object musicGroupStudentsSum(String musicGroupId) {
 | 
	
		
			
				|  |  | -        Map<String, Object> resultMap = new HashMap<>(3);
 | 
	
		
			
				|  |  | +        Map<String, Object> resultMap = new HashMap<>(4);
 | 
	
		
			
				|  |  |          //乐团在读人数
 | 
	
		
			
				|  |  |          resultMap.put("studying", studentManageDao.countStudyNum(musicGroupId));
 | 
	
		
			
				|  |  |          //退团人数
 | 
	
	
		
			
				|  | @@ -490,25 +481,18 @@ public class StudentManageServiceImpl implements StudentManageService {
 | 
	
		
			
				|  |  |          resultMap.put("add", studentManageDao.countAddNum(musicGroupId));
 | 
	
		
			
				|  |  |          //未完成vip、网管课学员数量/该乐团在读学员人数*100%
 | 
	
		
			
				|  |  |          List<StudentRegistration> studentRegistrations = studentRegistrationDao.getMusicGroupStu(musicGroupId);
 | 
	
		
			
				|  |  | -        if(studentRegistrations.size() == 0){
 | 
	
		
			
				|  |  | -            resultMap.put("vipRate","0.00%");
 | 
	
		
			
				|  |  | -            resultMap.put("practiceRate","0.00%");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        List<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toList());
 | 
	
		
			
				|  |  | -        List<Integer> hasVipStudent = courseScheduleDao.findHasCourseStudent(userIds,"VIP");
 | 
	
		
			
				|  |  | -        double size = userIds.size()+0d;
 | 
	
		
			
				|  |  | -        if(hasVipStudent.size() == 0){
 | 
	
		
			
				|  |  | -            resultMap.put("vipRate","0.00%");
 | 
	
		
			
				|  |  | -        }else {
 | 
	
		
			
				|  |  | -            double d = (hasVipStudent.size() / size) * 100;
 | 
	
		
			
				|  |  | -            resultMap.put("vipRate",String.format("%.2f", d) + "%");
 | 
	
		
			
				|  |  | +        List<Integer> userIds = studentRegistrations.stream().filter(e -> e.getMusicGroupStatus() != StudentMusicGroupStatusEnum.QUIT).map(StudentRegistration::getUserId).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +        if(userIds.size() == 0){
 | 
	
		
			
				|  |  | +            resultMap.put("courseRate","0.00%");
 | 
	
		
			
				|  |  | +            return resultMap;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        List<Integer> hasPracticeStudent = courseScheduleDao.findHasCourseStudent(userIds,"PRACTICE");
 | 
	
		
			
				|  |  | -        if(hasPracticeStudent.size() == 0){
 | 
	
		
			
				|  |  | -            resultMap.put("practiceRate","0.00%");
 | 
	
		
			
				|  |  | +        List<Integer> hasCourseStudent = courseScheduleDao.findHasCourseStudent(userIds,"VIP,PRACTICE");
 | 
	
		
			
				|  |  | +        double size = userIds.size() + 0d;
 | 
	
		
			
				|  |  | +        if(hasCourseStudent.size() == 0){
 | 
	
		
			
				|  |  | +            resultMap.put("courseRate","0.00%");
 | 
	
		
			
				|  |  |          }else {
 | 
	
		
			
				|  |  | -            double d = (hasPracticeStudent.size() / size) * 100;
 | 
	
		
			
				|  |  | -            resultMap.put("practiceRate",String.format("%.2f", d) + "%");
 | 
	
		
			
				|  |  | +            double d = (hasCourseStudent.size() / size) * 100;
 | 
	
		
			
				|  |  | +            resultMap.put("courseRate",String.format("%.2f", d) + "%");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return resultMap;
 | 
	
		
			
				|  |  |      }
 |