|  | @@ -21,6 +21,7 @@ import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  import javax.annotation.Resource;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.*;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.enums.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.event.source.GroupEventSource;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.ArrayUtils;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
	
		
			
				|  | @@ -80,19 +81,6 @@ import com.ym.mec.biz.dal.entity.Subject;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.SubjectChange;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.SysUserCashAccount;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.SysUserCashAccountDetail;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.DealStatusEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.GoodsType;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.GroupType;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.ClassGroupService;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.ClassGroupStudentMapperService;
 | 
	
	
		
			
				|  | @@ -275,7 +263,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |      public StudentFeeDetailDto queryFeeDetail(Integer studentId, String musicGroupId) {
 | 
	
		
			
				|  |  |          StudentFeeDetailDto studentFeeDetailDto = new StudentFeeDetailDto();
 | 
	
		
			
				|  |  |          List<MusicalListDetailDto> musicalList = studentPaymentOrderDetailService.getMusicalListDetail(musicGroupId, studentId);
 | 
	
		
			
				|  |  | -        if(musicalList.size() <=0){
 | 
	
		
			
				|  |  | +        if (musicalList.size() <= 0) {
 | 
	
		
			
				|  |  |              return studentFeeDetailDto;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          MusicalListDetailDto detailDto = musicalList.get(0);
 | 
	
	
		
			
				|  | @@ -383,11 +371,11 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |          studentRegistration.setUpdateTime(date);
 | 
	
		
			
				|  |  |          studentRegistration.setUserId(sysUser.getId());
 | 
	
		
			
				|  |  |          studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.APPLY);
 | 
	
		
			
				|  |  | -        if(hasReg != null){
 | 
	
		
			
				|  |  | +        if (hasReg != null) {
 | 
	
		
			
				|  |  |              studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
 | 
	
		
			
				|  |  |              studentRegistration.setId(hasReg.getId());
 | 
	
		
			
				|  |  |              studentRegistrationDao.update(studentRegistration);
 | 
	
		
			
				|  |  | -        }else {
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  |              studentRegistrationDao.insert(studentRegistration);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -677,7 +665,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |              return null;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          SysUserCashAccount account = sysUserCashAccountDao.getLocked(userId);
 | 
	
		
			
				|  |  | -        registration.setBalance(account==null?BigDecimal.ZERO : account.getBalance());
 | 
	
		
			
				|  |  | +        registration.setBalance(account == null ? BigDecimal.ZERO : account.getBalance());
 | 
	
		
			
				|  |  |          registration.setTransferStudent(0);
 | 
	
		
			
				|  |  |          return registration;
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -841,30 +829,30 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | -    public void insertStudent(String studentIds,String oldMusicGroupId,String newMusicGroupId,Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect){
 | 
	
		
			
				|  |  | +    public void insertStudent(String studentIds, String oldMusicGroupId, String newMusicGroupId, Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect) {
 | 
	
		
			
				|  |  |          SysUser sysUser1 = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  |          //获取旧乐团学员注册信息
 | 
	
		
			
				|  |  | -        List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryByUserIdsAndMusicGroupId(studentIds,oldMusicGroupId);
 | 
	
		
			
				|  |  | +        List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryByUserIdsAndMusicGroupId(studentIds, oldMusicGroupId);
 | 
	
		
			
				|  |  |          List<StudentCourseFeeDetail> studentCourseFeeDetails = new ArrayList<>();
 | 
	
		
			
				|  |  |          BigDecimal amount = BigDecimal.ZERO;
 | 
	
		
			
				|  |  |          for (StudentRegistration studentRegistration : studentRegistrations) {
 | 
	
		
			
				|  |  |              List<MusicGroupPaymentCalenderStudentDetail> details = collect.get(studentRegistration.getUserId());
 | 
	
		
			
				|  |  | -            BigDecimal masterTotalPrice = details.stream().map(e->e.getCutAmount()).reduce(BigDecimal.ZERO, BigDecimal::add);
 | 
	
		
			
				|  |  | -            if(masterTotalPrice.doubleValue() > studentRegistration.getSurplusCourseFee().doubleValue()){
 | 
	
		
			
				|  |  | +            BigDecimal masterTotalPrice = details.stream().map(e -> e.getCutAmount()).reduce(BigDecimal.ZERO, BigDecimal::add);
 | 
	
		
			
				|  |  | +            if (masterTotalPrice.doubleValue() > studentRegistration.getSurplusCourseFee().doubleValue()) {
 | 
	
		
			
				|  |  |                  throw new BizException("用户信息发生变动,请重新提交");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            if(oldMusicGroupId == newMusicGroupId){
 | 
	
		
			
				|  |  | +            if (oldMusicGroupId == newMusicGroupId) {
 | 
	
		
			
				|  |  |                  continue;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(oldMusicGroupId),null, GroupType.MUSIC);
 | 
	
		
			
				|  |  | +            courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(oldMusicGroupId), null, GroupType.MUSIC);
 | 
	
		
			
				|  |  |              //记录课程余额消费日志
 | 
	
		
			
				|  |  | -            if(studentRegistration.getSurplusCourseFee().doubleValue() > 0d && masterTotalPrice.doubleValue() > 0d){
 | 
	
		
			
				|  |  | +            if (studentRegistration.getSurplusCourseFee().doubleValue() > 0d && masterTotalPrice.doubleValue() > 0d) {
 | 
	
		
			
				|  |  |                  StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
 | 
	
		
			
				|  |  | -                if(studentRegistration.getSurplusCourseFee().doubleValue() > masterTotalPrice.doubleValue()){
 | 
	
		
			
				|  |  | +                if (studentRegistration.getSurplusCourseFee().doubleValue() > masterTotalPrice.doubleValue()) {
 | 
	
		
			
				|  |  |                      amount = masterTotalPrice;
 | 
	
		
			
				|  |  |                      studentCourseFeeDetail.setAmount(masterTotalPrice.negate());
 | 
	
		
			
				|  |  |                      studentCourseFeeDetail.setSurplusCourseFee(studentRegistration.getSurplusCourseFee().subtract(masterTotalPrice));
 | 
	
		
			
				|  |  | -                }else {
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  |                      amount = studentRegistration.getSurplusCourseFee();
 | 
	
		
			
				|  |  |                      studentCourseFeeDetail.setAmount(studentRegistration.getSurplusCourseFee().negate());
 | 
	
		
			
				|  |  |                      studentCourseFeeDetail.setSurplusCourseFee(BigDecimal.ZERO);
 | 
	
	
		
			
				|  | @@ -881,7 +869,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |              //用户是否在主乐团
 | 
	
		
			
				|  |  |              StudentRegistration registration = studentRegistrationDao.getByPhoneAndMusicGroupId(newMusicGroupId, studentRegistration.getParentsPhone());
 | 
	
		
			
				|  |  |              if (registration != null) {
 | 
	
		
			
				|  |  | -                if(registration.getMusicGroupStatus() == StudentMusicGroupStatusEnum.NORMAL){
 | 
	
		
			
				|  |  | +                if (registration.getMusicGroupStatus() == StudentMusicGroupStatusEnum.NORMAL) {
 | 
	
		
			
				|  |  |                      orderFlag = false;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  //修改剩余课程余额
 | 
	
	
		
			
				|  | @@ -891,7 +879,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |                  registration.setUpdateTime(date);
 | 
	
		
			
				|  |  |                  registration.setSurplusCourseFee(registration.getSurplusCourseFee().add(amount));
 | 
	
		
			
				|  |  |                  studentRegistrationDao.update(registration);
 | 
	
		
			
				|  |  | -            }else {
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  |                  //生成学员乐团注册表
 | 
	
		
			
				|  |  |                  studentRegistration.setOrganId(musicGroupDao.get(newMusicGroupId).getOrganId());
 | 
	
		
			
				|  |  |                  studentRegistration.setSurplusCourseFee(amount);
 | 
	
	
		
			
				|  | @@ -902,11 +890,11 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |                  //增加报名学生数
 | 
	
		
			
				|  |  |                  musicGroupSubjectPlanService.addApplyStudentNum(newMusicGroupId, studentRegistration.getActualSubjectId(), 1);
 | 
	
		
			
				|  |  |                  //新增Fee表
 | 
	
		
			
				|  |  | -                MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(studentRegistration.getUserId(),newMusicGroupId);
 | 
	
		
			
				|  |  | -                if(musicGroupStudentFee == null){
 | 
	
		
			
				|  |  | +                MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(studentRegistration.getUserId(), newMusicGroupId);
 | 
	
		
			
				|  |  | +                if (musicGroupStudentFee == null) {
 | 
	
		
			
				|  |  |                      musicGroupStudentFee = new MusicGroupStudentFee(newMusicGroupId,
 | 
	
		
			
				|  |  | -                            studentRegistration.getUserId(), studentRegistration.getSubjectId(),BigDecimal.ZERO,
 | 
	
		
			
				|  |  | -                            null, studentRegistration.getTemporaryCourseFee(), studentRegistration.getPaymentStatus()==YES?PAID_COMPLETED:NON_PAYMENT);
 | 
	
		
			
				|  |  | +                            studentRegistration.getUserId(), studentRegistration.getSubjectId(), BigDecimal.ZERO,
 | 
	
		
			
				|  |  | +                            null, studentRegistration.getTemporaryCourseFee(), studentRegistration.getPaymentStatus() == YES ? PAID_COMPLETED : NON_PAYMENT);
 | 
	
		
			
				|  |  |                      musicGroupStudentFeeDao.insert(musicGroupStudentFee);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -916,7 +904,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |                  waitPayOrder.setStatus(DealStatusEnum.CLOSE);
 | 
	
		
			
				|  |  |                  studentPaymentOrderService.update(waitPayOrder);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            if(orderFlag){
 | 
	
		
			
				|  |  | +            if (orderFlag) {
 | 
	
		
			
				|  |  |                  //生成订单
 | 
	
		
			
				|  |  |                  StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
 | 
	
		
			
				|  |  |                  studentPaymentOrder.setUserId(registration.getUserId());
 | 
	
	
		
			
				|  | @@ -933,7 +921,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |                  studentPaymentOrderService.insert(studentPaymentOrder);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              //主班新增余额日志
 | 
	
		
			
				|  |  | -            if(amount.doubleValue() != 0d && masterTotalPrice.doubleValue() > 0d){
 | 
	
		
			
				|  |  | +            if (amount.doubleValue() != 0d && masterTotalPrice.doubleValue() > 0d) {
 | 
	
		
			
				|  |  |                  StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
 | 
	
		
			
				|  |  |                  studentCourseFeeDetail.setAmount(amount);
 | 
	
		
			
				|  |  |                  studentCourseFeeDetail.setSurplusCourseFee(registration.getSurplusCourseFee());
 | 
	
	
		
			
				|  | @@ -943,7 +931,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |                  studentCourseFeeDetails.add(studentCourseFeeDetail);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if(studentCourseFeeDetails.size() > 0){
 | 
	
		
			
				|  |  | +        if (studentCourseFeeDetails.size() > 0) {
 | 
	
		
			
				|  |  |              studentCourseFeeDetailDao.batchInsert(studentCourseFeeDetails);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -1435,7 +1423,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional
 | 
	
		
			
				|  |  |      public StudentRegistration updateStudent(StudentRegistration studentRegistration) {
 | 
	
		
			
				|  |  | -        if(StringUtils.isBlank(studentRegistration.getCertificateType())){
 | 
	
		
			
				|  |  | +        if (StringUtils.isBlank(studentRegistration.getCertificateType())) {
 | 
	
		
			
				|  |  |              studentRegistration.setCertificateType(CertificateTypeEnum.IDENTITY.getCode());
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          StudentRegistration student = get(studentRegistration.getId());
 | 
	
	
		
			
				|  | @@ -1447,9 +1435,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |          student.setIdCardNo(studentRegistration.getIdCardNo());
 | 
	
		
			
				|  |  |          student.setGender(studentRegistration.getGender());
 | 
	
		
			
				|  |  |          update(studentRegistration);
 | 
	
		
			
				|  |  | -        studentRegistrationDao.updateUser(student.getUserId(),student.getName(), student.getParentsName(), student.getIdCardNo(), student.getGender(),studentRegistration.getCertificateType());
 | 
	
		
			
				|  |  | +        studentRegistrationDao.updateUser(student.getUserId(), student.getName(), student.getParentsName(), student.getIdCardNo(), student.getGender(), studentRegistration.getCertificateType());
 | 
	
		
			
				|  |  |          // 添加用户电子签章账户
 | 
	
		
			
				|  |  | -        if(CertificateTypeEnum.IDENTITY.getCode().equals(studentRegistration.getCertificateType())){
 | 
	
		
			
				|  |  | +        if (CertificateTypeEnum.IDENTITY.getCode().equals(studentRegistration.getCertificateType())) {
 | 
	
		
			
				|  |  |              contractService.register(student.getUserId(), student.getParentsName(), student.getIdCardNo(), student.getParentsPhone());
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return student;
 | 
	
	
		
			
				|  | @@ -1637,10 +1625,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |          return amount;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -	@Override
 | 
	
		
			
				|  |  | -	public List<StudentMusicGroupDto> queryStudentMusicGroupInfo(Integer userId) {
 | 
	
		
			
				|  |  | -		return studentRegistrationDao.queryStudentMusicGroupInfo(userId);
 | 
	
		
			
				|  |  | -	}
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public List<StudentMusicGroupDto> queryStudentMusicGroupInfo(Integer userId) {
 | 
	
		
			
				|  |  | +        return studentRegistrationDao.queryStudentMusicGroupInfo(userId);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(rollbackFor = Exception.class)
 | 
	
	
		
			
				|  | @@ -1661,8 +1649,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |      public Boolean batchDelRegs(String musicGroupId, List<Integer> userIds) {
 | 
	
		
			
				|  |  |          List<StudentRegistration> registrations = studentRegistrationDao.findStudentListByUserIdList(musicGroupId, userIds);
 | 
	
		
			
				|  |  |          for (StudentRegistration registration : registrations) {
 | 
	
		
			
				|  |  | -            if(registration.getPaymentStatus().equals(PaymentStatusEnum.OPEN)||registration.getPaymentStatus().equals(PaymentStatusEnum.YES)){
 | 
	
		
			
				|  |  | -                throw new BizException(registration.getName()+"("+registration.getPaymentStatus().getDesc()+"),不能删除");
 | 
	
		
			
				|  |  | +            if (registration.getPaymentStatus().equals(PaymentStatusEnum.OPEN) || registration.getPaymentStatus().equals(PaymentStatusEnum.YES)) {
 | 
	
		
			
				|  |  | +                throw new BizException(registration.getName() + "(" + registration.getPaymentStatus().getDesc() + "),不能删除");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (registrations.size() <= 0) {
 | 
	
	
		
			
				|  | @@ -1690,6 +1678,41 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<StudentRegistration> getMusicGroupStuReBack(String musicGroupId) {
 | 
	
		
			
				|  |  |          courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(musicGroupId), null, GroupType.MUSIC);
 | 
	
		
			
				|  |  | -        return this.findMusicGroupStudent(musicGroupId,null);
 | 
	
		
			
				|  |  | +        return this.findMusicGroupStudent(musicGroupId, null);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public String checkRegOrPayStatus(String musicGroupId) {
 | 
	
		
			
				|  |  | +        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  | +        if (musicGroup.getStatus() == MusicGroupStatusEnum.PAY &&
 | 
	
		
			
				|  |  | +                musicGroup.getStatus() == MusicGroupStatusEnum.PREPARE &&
 | 
	
		
			
				|  |  | +                musicGroup.getStatus() == MusicGroupStatusEnum.PROGRESS) {
 | 
	
		
			
				|  |  | +            Date now = new Date();
 | 
	
		
			
				|  |  | +            MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroup.getId());
 | 
	
		
			
				|  |  | +            if (regCalender != null && regCalender.getDeadlinePaymentDate() != null) {
 | 
	
		
			
				|  |  | +                musicGroup.setPaymentExpireDate(regCalender.getDeadlinePaymentDate());
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if (musicGroup.getPaymentExpireDate() != null && DateUtil.daysBetween(musicGroup.getPaymentExpireDate(), now) > 1) {
 | 
	
		
			
				|  |  | +                return "乐团缴费时间已截止";
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        //储备中、进行中,乐团没有报名缴费项、有多批次缴费项不能缴费、有已上的课程不能缴费
 | 
	
		
			
				|  |  | +        if (musicGroup.getStatus() == MusicGroupStatusEnum.PREPARE &&
 | 
	
		
			
				|  |  | +                musicGroup.getStatus() == MusicGroupStatusEnum.PROGRESS) {
 | 
	
		
			
				|  |  | +            MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroup.getId());
 | 
	
		
			
				|  |  | +            if (regCalender == null) {
 | 
	
		
			
				|  |  | +                return "乐团没有报名缴费项";
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            List<Integer> musicGroupCalenderBatchNoTimes = musicGroupPaymentCalenderDao.getMusicGroupCalenderBatchNoTimes(musicGroup.getId());
 | 
	
		
			
				|  |  | +            if (musicGroupCalenderBatchNoTimes.size() > 1) {
 | 
	
		
			
				|  |  | +                return "乐团已建多批次缴费";
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            Integer hasStartCourseNum = courseScheduleDao.getMusicGroupHasStartCourseNum(musicGroup.getId());
 | 
	
		
			
				|  |  | +            if (hasStartCourseNum != null && hasStartCourseNum > 0) {
 | 
	
		
			
				|  |  | +                return "乐团已开课";
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return null;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  }
 |