|  | @@ -1124,50 +1124,53 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public void pushMessage(String musicGroupId, String classGroupIds) throws IOException {
 | 
	
		
			
				|  |  | +    public int pushMessage(String musicGroupId, String classGroupIds) throws IOException {
 | 
	
		
			
				|  |  |          MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  | -        if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
 | 
	
		
			
				|  |  | -            List<HighClassGroupDto> highClassGroup = classGroupDao.findHighClassGroup(musicGroupId, classGroupIds);
 | 
	
		
			
				|  |  | -            Set<ClassGroupTypeEnum> classGroupTypeSet = highClassGroup.stream().map(HighClassGroupDto::getType).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | -            String HighClassGroupSubjectIds = highClassGroup.stream().filter(e -> e.getType().equals(ClassGroupTypeEnum.HIGH)).map(HighClassGroupDto::getSubjectIdList).collect(Collectors.joining(","));
 | 
	
		
			
				|  |  | -            String HighOnlineClassGroupSubjectIds = highClassGroup.stream().filter(e -> e.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)).map(HighClassGroupDto::getMemo).collect(Collectors.joining(","));
 | 
	
		
			
				|  |  | -            if (!HighClassGroupSubjectIds.isEmpty() && !HighOnlineClassGroupSubjectIds.isEmpty()) {
 | 
	
		
			
				|  |  | -                HighClassGroupSubjectIds += "," + HighOnlineClassGroupSubjectIds;
 | 
	
		
			
				|  |  | -            } else {
 | 
	
		
			
				|  |  | -                HighClassGroupSubjectIds += HighOnlineClassGroupSubjectIds;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            String[] subjectIds = HighClassGroupSubjectIds.split(",");
 | 
	
		
			
				|  |  | +        if (musicGroup.getOwnershipType() == null || musicGroup.getOwnershipType() != CooperationOrgan.OwnershipType.OWN) {
 | 
	
		
			
				|  |  | +            throw new BizException("三方乐团,不推送报名信息");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        List<HighClassGroupDto> highClassGroup = classGroupDao.findHighClassGroup(musicGroupId, classGroupIds);
 | 
	
		
			
				|  |  | +        Set<ClassGroupTypeEnum> classGroupTypeSet = highClassGroup.stream().map(HighClassGroupDto::getType).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | +        String HighClassGroupSubjectIds = highClassGroup.stream().filter(e -> e.getType().equals(ClassGroupTypeEnum.HIGH)).map(HighClassGroupDto::getSubjectIdList).collect(Collectors.joining(","));
 | 
	
		
			
				|  |  | +        String HighOnlineClassGroupSubjectIds = highClassGroup.stream().filter(e -> e.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)).map(HighClassGroupDto::getMemo).collect(Collectors.joining(","));
 | 
	
		
			
				|  |  | +        if (!HighClassGroupSubjectIds.isEmpty() && !HighOnlineClassGroupSubjectIds.isEmpty()) {
 | 
	
		
			
				|  |  | +            HighClassGroupSubjectIds += "," + HighOnlineClassGroupSubjectIds;
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            HighClassGroupSubjectIds += HighOnlineClassGroupSubjectIds;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            List<StudentRegistration> students = new ArrayList<>();
 | 
	
		
			
				|  |  | -            if (classGroupTypeSet.contains(ClassGroupTypeEnum.HIGH)) {
 | 
	
		
			
				|  |  | -                List<StudentRegistration> noHighClassGroupStudents = studentRegistrationService.findMusicGroupStuNoClassType(musicGroupId, ClassGroupTypeEnum.HIGH, null);
 | 
	
		
			
				|  |  | -                students.addAll(noHighClassGroupStudents);
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            if (classGroupTypeSet.contains(ClassGroupTypeEnum.HIGH_ONLINE)) {
 | 
	
		
			
				|  |  | -                List<StudentRegistration> noHighOnlineClassGroupStudents = studentRegistrationService.findMusicGroupStuNoClassType(musicGroupId, ClassGroupTypeEnum.HIGH_ONLINE, null);
 | 
	
		
			
				|  |  | -                students.addAll(noHighOnlineClassGroupStudents);
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | +        String[] subjectIds = HighClassGroupSubjectIds.split(",");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        List<StudentRegistration> students = new ArrayList<>();
 | 
	
		
			
				|  |  | +        if (classGroupTypeSet.contains(ClassGroupTypeEnum.HIGH)) {
 | 
	
		
			
				|  |  | +            List<StudentRegistration> noHighClassGroupStudents = studentRegistrationService.findMusicGroupStuNoClassType(musicGroupId, ClassGroupTypeEnum.HIGH, null);
 | 
	
		
			
				|  |  | +            students.addAll(noHighClassGroupStudents);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (classGroupTypeSet.contains(ClassGroupTypeEnum.HIGH_ONLINE)) {
 | 
	
		
			
				|  |  | +            List<StudentRegistration> noHighOnlineClassGroupStudents = studentRegistrationService.findMusicGroupStuNoClassType(musicGroupId, ClassGroupTypeEnum.HIGH_ONLINE, null);
 | 
	
		
			
				|  |  | +            students.addAll(noHighOnlineClassGroupStudents);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            Map<Integer, String> studentMap = new HashMap<>();
 | 
	
		
			
				|  |  | -            for (StudentRegistration student : students) {
 | 
	
		
			
				|  |  | -                if(!Arrays.asList(subjectIds).contains(student.getActualSubjectId().toString())){
 | 
	
		
			
				|  |  | -                    continue;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                studentMap.put(student.getUserId(), student.getUserId().toString());
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            if (studentMap.size() == 0) {
 | 
	
		
			
				|  |  | -                return;
 | 
	
		
			
				|  |  | +        Map<Integer, String> studentMap = new HashMap<>();
 | 
	
		
			
				|  |  | +        for (StudentRegistration student : students) {
 | 
	
		
			
				|  |  | +            if (!Arrays.asList(subjectIds).contains(student.getActualSubjectId().toString())) {
 | 
	
		
			
				|  |  | +                continue;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            studentMap.put(student.getUserId(), student.getUserId().toString());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            String baseURL = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
 | 
	
		
			
				|  |  | -            String url = baseURL + "/#/smallRegister?musicGroupId=" + musicGroupId;
 | 
	
		
			
				|  |  | -            String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
 | 
	
		
			
				|  |  | -            sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE,
 | 
	
		
			
				|  |  | -                    studentMap, null, 0, "5?" + url, "STUDENT", musicGroup.getName(), HttpUtil.getSortUrl(url), serverPhone);
 | 
	
		
			
				|  |  | +        if (studentMap.size() == 0) {
 | 
	
		
			
				|  |  | +            throw new BizException("开启报名失败,没有可推送的学生");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        String baseURL = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
 | 
	
		
			
				|  |  | +        String url = baseURL + "/#/smallRegister?musicGroupId=" + musicGroupId;
 | 
	
		
			
				|  |  | +        String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
 | 
	
		
			
				|  |  | +        sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE,
 | 
	
		
			
				|  |  | +                studentMap, null, 0, "5?" + url, "STUDENT", musicGroup.getName(), HttpUtil.getSortUrl(url), serverPhone);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        return studentMap.size();
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  //    @Override
 |