| 
					
				 | 
			
			
				@@ -638,6 +638,12 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     studentRegistration.setPaymentStatus(PaymentStatusEnum.YES); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     studentPaymentOrder.setActualAmount(reduce); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     studentPaymentOrder.setPayTime(date); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Map<Integer, String> receivers = new HashMap<>(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    receivers.put(studentRegistration.getUserId(), studentRegistration.getParentsPhone()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_MUSIC_GROUP_ADD_STUDENT, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            receivers, null, 0, null, studentRegistration.getParentsName(), studentRegistration.getName(), musicGroup.getName(),HttpUtil.getSortUrl(studentApplyUrl)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 studentPaymentOrder.setExpectAmount(reduce); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //当前学员是否以前存在过当前乐团 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -653,13 +659,17 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     e.setPaymentOrderId(studentPaymentOrder.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetails); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Map<Integer, String> receivers = new HashMap<>(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                receivers.put(studentRegistration.getUserId(), studentRegistration.getParentsPhone()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (reduce == BigDecimal.ZERO) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_MUSIC_GROUP_ADD_STUDENT_FREE, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            receivers, null, 0, null, studentRegistration.getParentsName(), studentRegistration.getName(), musicGroup.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_MUSIC_GROUP_ADD_STUDENT, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            receivers, null, 0, null, studentRegistration.getParentsName(), studentRegistration.getName(), musicGroup.getName(),HttpUtil.getSortUrl(studentApplyUrl)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            studentRegistrationDao.updateCurrentClass(studentRegistration); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Map<Integer, String> receivers = new HashMap<>(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            receivers.put(studentRegistration.getUserId(), studentRegistration.getParentsPhone()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_MUSIC_GROUP_ADD_STUDENT, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    receivers, null, 0, null, studentRegistration.getParentsName(), studentRegistration.getName(), musicGroup.getName(),HttpUtil.getSortUrl(studentApplyUrl)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return userId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -670,7 +680,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //        List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //        List<ImGroupMember> imGroupMemberList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Integer classGroupId = classGroup.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ClassGroupRelation classGroupRelation = classGroupRelationService.findClassGroupRelation(classGroupId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //校验是否存在历史记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -688,35 +697,32 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             classGroupStudentMapper.setGroupType(GroupType.MUSIC); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             classGroupStudentMapperDao.insert(classGroupStudentMapper); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ClassGroupStudentMapper classGroupStudentMapperMix = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupRelation.getClassGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(classGroupStudentMapperMix != null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperMix.setStatus(ClassGroupStudentStatusEnum.NORMAL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperMix.setClassGroupId(classGroupRelation.getClassGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperDao.update(classGroupStudentMapperMix); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperMix = new ClassGroupStudentMapper(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperMix.setMusicGroupId(classGroup.getMusicGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperMix.setClassGroupId(classGroupRelation.getClassGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperMix.setUserId(userId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperMix.setCreateTime(nowDate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperMix.setStatus(ClassGroupStudentStatusEnum.NORMAL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperMix.setGroupType(GroupType.MUSIC); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            classGroupStudentMapperDao.insert(classGroupStudentMapperMix); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        imGroupMemberList.add(new ImGroupMember(userId.toString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //添加进IM群组 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ImGroupMember[] imGroupMembers = {new ImGroupMember(userId.toString())}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //2、班级人数调整 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         classGroupDao.updateClassStudentNum(classGroupId.longValue(), 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //3、学生加入新班级未开始课程 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //4、班级在合奏班、添加合奏课程 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if (classGroupRelation != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            //合奏班增加人数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ClassGroupRelation classGroupRelation = classGroupRelationService.findClassGroupRelation(classGroupId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(classGroupRelation != null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ClassGroupStudentMapper classGroupStudentMapperMix = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupRelation.getClassGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(classGroupStudentMapperMix != null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperMix.setStatus(ClassGroupStudentStatusEnum.NORMAL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperMix.setClassGroupId(classGroupRelation.getClassGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperDao.update(classGroupStudentMapperMix); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperMix = new ClassGroupStudentMapper(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperMix.setMusicGroupId(classGroup.getMusicGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperMix.setClassGroupId(classGroupRelation.getClassGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperMix.setUserId(userId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperMix.setCreateTime(nowDate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperMix.setStatus(ClassGroupStudentStatusEnum.NORMAL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperMix.setGroupType(GroupType.MUSIC); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                classGroupStudentMapperDao.insert(classGroupStudentMapperMix); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             classGroupDao.updateClassStudentNum(classGroupRelation.getClassGroupId().longValue(), 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             List<CourseSchedule> mixCourseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupRelation.getClassGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             courseScheduleList.addAll(mixCourseScheduleList); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -857,6 +863,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, map, null, 0, "1", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //push 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            map.put(studentPaymentOrder.getUserId(), studentPaymentOrder.getUserId().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, map, null, 0, "1", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount()); 
			 |