|  | @@ -845,9 +845,13 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
											
												
													
														|  |                  //修改原有乐团注册信息
 |  |                  //修改原有乐团注册信息
 | 
											
												
													
														|  |                  studentRegistrationDao.update(studentRegistration);
 |  |                  studentRegistrationDao.update(studentRegistration);
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | 
 |  | +            Boolean orderFlag = true;
 | 
											
												
													
														|  |              //用户是否在主乐团
 |  |              //用户是否在主乐团
 | 
											
												
													
														|  |              StudentRegistration registration = studentRegistrationDao.getByPhoneAndMusicGroupId(newMusicGroupId, studentRegistration.getParentsPhone());
 |  |              StudentRegistration registration = studentRegistrationDao.getByPhoneAndMusicGroupId(newMusicGroupId, studentRegistration.getParentsPhone());
 | 
											
												
													
														|  |              if (registration != null) {
 |  |              if (registration != null) {
 | 
											
												
													
														|  | 
 |  | +                if(registration.getMusicGroupStatus() != StudentMusicGroupStatusEnum.QUIT){
 | 
											
												
													
														|  | 
 |  | +                    orderFlag = false;
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  |                  //修改剩余课程余额
 |  |                  //修改剩余课程余额
 | 
											
												
													
														|  |                  Date date = new Date();
 |  |                  Date date = new Date();
 | 
											
												
													
														|  |                  registration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
 |  |                  registration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
 | 
											
										
											
												
													
														|  | @@ -874,6 +878,26 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
											
												
													
														|  |                      musicGroupStudentFeeDao.insert(musicGroupStudentFee);
 |  |                      musicGroupStudentFeeDao.insert(musicGroupStudentFee);
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | 
 |  | +            StudentPaymentOrder waitPayOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(registration.getUserId(), studentRegistration.getMusicGroupId(), DealStatusEnum.WAIT_PAY);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            if (waitPayOrder != null) {
 | 
											
												
													
														|  | 
 |  | +                waitPayOrder.setStatus(DealStatusEnum.CLOSE);
 | 
											
												
													
														|  | 
 |  | +                studentPaymentOrderService.update(waitPayOrder);
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +            //生成订单
 | 
											
												
													
														|  | 
 |  | +            StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setUserId(registration.getUserId());
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setGroupType(GroupType.MUSIC);
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setType(OrderTypeEnum.APPLY);
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setMusicGroupId(registration.getMusicGroupId());
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setClassGroupId(registration.getClassGroupId());
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setOrganId(registration.getOrganId());
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setRoutingOrganId(registration.getOrganId());
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setActualAmount(BigDecimal.ZERO);
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setPayTime(new Date());
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrder.setExpectAmount(BigDecimal.ZERO);
 | 
											
												
													
														|  | 
 |  | +            studentPaymentOrderService.insert(studentPaymentOrder);
 | 
											
												
													
														|  |              //主班新增余额日志
 |  |              //主班新增余额日志
 | 
											
												
													
														|  |              if(amount.doubleValue() != 0d && masterTotalPrice.doubleValue() > 0d){
 |  |              if(amount.doubleValue() != 0d && masterTotalPrice.doubleValue() > 0d){
 | 
											
												
													
														|  |                  StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
 |  |                  StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
 |