|  | @@ -74,8 +74,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private MusicGroupQuitDao musicGroupQuitDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +//    @Autowired
 | 
	
		
			
				|  |  | +//    private StudentRegistrationService studentRegistrationService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | -    private StudentRegistrationService studentRegistrationService;
 | 
	
		
			
				|  |  | +    private StudentRegistrationDao studentRegistrationDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private CourseScheduleDao courseScheduleDao;
 | 
	
	
		
			
				|  | @@ -146,7 +149,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |              List<StudentRegistration> studentRegistrationList = new ArrayList<>();
 | 
	
		
			
				|  |  |              subjectRegisters.forEach(e -> {
 | 
	
		
			
				|  |  |                      //原来乐团的注册学生
 | 
	
		
			
				|  |  | -                List<StudentRegistration> musicGroupStudentRegistrationList = studentRegistrationService.findStudentListByIdList(e.getRegisterIdList());
 | 
	
		
			
				|  |  | +                List<StudentRegistration> musicGroupStudentRegistrationList = studentRegistrationDao.findStudentListByIdList(e.getRegisterIdList());
 | 
	
		
			
				|  |  |                  for (StudentRegistration studentRegistration : musicGroupStudentRegistrationList) {
 | 
	
		
			
				|  |  |                      studentRegistration.setId(null);
 | 
	
		
			
				|  |  |                      studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.NORMAL);
 | 
	
	
		
			
				|  | @@ -163,7 +166,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |                      musicGroupSubjectPlan.setApplyStudentNum(e.getRegisterIdList().size());
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              });
 | 
	
		
			
				|  |  | -            studentRegistrationService.batchInsert(studentRegistrationList);
 | 
	
		
			
				|  |  | +            studentRegistrationDao.batchInsert(studentRegistrationList);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 保存乐团声部规划
 | 
	
	
		
			
				|  | @@ -324,12 +327,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 | 
	
		
			
				|  |  |      public boolean cancelMusicGroup(String musicGroupId) {
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if(sysUser == null){
 | 
	
		
			
				|  |  | +            throw new BizException("用户信息获取失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
 | 
	
		
			
				|  |  |          if (musicGroup == null) {
 | 
	
		
			
				|  |  |              throw new BizException("乐团找不到");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if (musicGroup.getStatus() == MusicGroupStatusEnum.APPLY || musicGroup.getStatus() == MusicGroupStatusEnum.PAY) {
 | 
	
		
			
				|  |  | +        if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS) {
 | 
	
		
			
				|  |  |              musicGroup.setStatus(MusicGroupStatusEnum.CANCELED);
 | 
	
		
			
				|  |  |              musicGroup.setUpdateTime(new Date());
 | 
	
		
			
				|  |  |              musicGroupDao.update(musicGroup);
 | 
	
	
		
			
				|  | @@ -354,13 +361,21 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |              sysUserCashAccountDetailService.addCashAccountDetail(order.getUserId(), order.getActualAmount(), SysUserCashAccountDetailService.MUSIC_GROUP
 | 
	
		
			
				|  |  |                      + musicGroupId, "", PlatformCashAccountDetailTypeEnum.REFUNDS, null, DealStatusEnum.SUCCESS, "取消乐团");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        //获取当前乐团所有已报名学员
 | 
	
		
			
				|  |  | +        List<StudentRegistration> registrations = studentRegistrationDao.findClassGroupStu(musicGroupId, null);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        //记录建团日志
 | 
	
		
			
				|  |  | +        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"取消乐团",sysUser.getId(),""));
 | 
	
		
			
				|  |  |          return true;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 | 
	
		
			
				|  |  |      public boolean pauseMusicGroup(String musicGroupId) {
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if(sysUser == null){
 | 
	
		
			
				|  |  | +            throw new BizException("用户信息获取失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  |          if (musicGroup == null) {
 | 
	
		
			
				|  |  |              throw new BizException("乐团找不到");
 | 
	
	
		
			
				|  | @@ -376,13 +391,17 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 清除下次缴费时间
 | 
	
		
			
				|  |  |          musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, null);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"暂停乐团",sysUser.getId(),""));
 | 
	
		
			
				|  |  |          return true;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 | 
	
		
			
				|  |  |      public boolean resumeMusicGroup(String musicGroupId) {
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if(sysUser == null){
 | 
	
		
			
				|  |  | +            throw new BizException("用户信息获取失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  |          if (musicGroup == null) {
 | 
	
		
			
				|  |  |              throw new BizException("乐团找不到");
 | 
	
	
		
			
				|  | @@ -398,12 +417,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 重新设置下次缴费时间
 | 
	
		
			
				|  |  |          musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId));
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"恢复乐团",sysUser.getId(),""));
 | 
	
		
			
				|  |  |          return true;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public boolean extensionPayment(String musicGroupId, Date expireDate) {
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if(sysUser == null){
 | 
	
		
			
				|  |  | +            throw new BizException("用户信息获取失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  |          if (musicGroup == null) {
 | 
	
		
			
				|  |  |              throw new BizException("乐团找不到");
 | 
	
	
		
			
				|  | @@ -422,7 +445,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          musicGroup.setPaymentExpireDate(expireDate);
 | 
	
		
			
				|  |  |          musicGroup.setUpdateTime(date);
 | 
	
		
			
				|  |  |          musicGroupDao.update(musicGroup);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"延长缴费",sysUser.getId(),""));
 | 
	
		
			
				|  |  |          return true;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -465,7 +488,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |                  classGroupStudentMapperDao.deleteStudentByMusicGroupId(musicGroupId, userId);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  // 判断乐器是否是租赁
 | 
	
		
			
				|  |  | -                StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
 | 
	
		
			
				|  |  | +                StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
 | 
	
		
			
				|  |  |                  if (studentRegistration == null) {
 | 
	
		
			
				|  |  |                      throw new BizException("用户注册信息不存在");
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -473,7 +496,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |                  studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.QUIT);
 | 
	
		
			
				|  |  |                  studentRegistration.setUpdateTime(date);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                studentRegistrationService.update(studentRegistration);
 | 
	
		
			
				|  |  | +                studentRegistrationDao.update(studentRegistration);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  Integer subjectId = studentRegistration.getActualSubjectId();
 | 
	
		
			
				|  |  |                  MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
 | 
	
	
		
			
				|  | @@ -516,15 +539,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          classGroupStudentMapperDao.deleteStudentByMusicGroupId(musicGroupId, userId);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          // 判断乐器是否是租赁
 | 
	
		
			
				|  |  | -        StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
 | 
	
		
			
				|  |  | +        StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
 | 
	
		
			
				|  |  |          if (studentRegistration == null) {
 | 
	
		
			
				|  |  |              throw new BizException("用户注册信息不存在");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          // 退团
 | 
	
		
			
				|  |  |          studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.QUIT);
 | 
	
		
			
				|  |  |          studentRegistration.setUpdateTime(date);
 | 
	
		
			
				|  |  | -        
 | 
	
		
			
				|  |  | -        studentRegistrationService.update(studentRegistration);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        studentRegistrationDao.update(studentRegistration);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          Integer subjectId = studentRegistration.getActualSubjectId();
 | 
	
		
			
				|  |  |          MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
 | 
	
	
		
			
				|  | @@ -875,7 +898,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          //给家长发送乐团基础训练课短信
 | 
	
		
			
				|  |  |          //获取所有乐团学员列表
 | 
	
		
			
				|  |  | -        List<StudentRegistration> students = studentRegistrationService.queryStudentByMusicGroupId(musicGroupId);
 | 
	
		
			
				|  |  | +        List<StudentRegistration> students = studentRegistrationDao.queryStudentByMusicGroupId(musicGroupId);
 | 
	
		
			
				|  |  |          //获取所有家长电话
 | 
	
		
			
				|  |  |          Set<String> parentsPhones = students.stream().map(StudentRegistration::getParentsPhone).collect(Collectors.toSet());
 | 
	
		
			
				|  |  |          //获取对应家长的用户编号
 |