|  | @@ -104,6 +104,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  |  	private SysMessageService sysMessageService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  | +	private SysMessageConfigDao sysMessageConfigDao;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public BaseDAO<String, MusicGroup> getDAO() {
 | 
	
		
			
				|  |  |          return musicGroupDao;
 | 
	
	
		
			
				|  | @@ -111,14 +114,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | -    public String createGroup(SubFeeSettingDto subFeeSettingDto, Integer userId) {
 | 
	
		
			
				|  |  | +    public String createGroup(SubFeeSettingDto subFeeSettingDto) throws Exception {
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if(sysUser == null){
 | 
	
		
			
				|  |  | +            throw new Exception("用户信息获取失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
 | 
	
		
			
				|  |  |          List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroups = subFeeSettingDto.getMusicGroupSubjectGoodsGroups();
 | 
	
		
			
				|  |  |          List<MusicGroupSubjectPlan> musicGroupSubjectPlans = subFeeSettingDto.getMusicGroupSubjectPlans();
 | 
	
		
			
				|  |  |          List<SubjectRegisterDto> subjectRegisters = subFeeSettingDto.getSubjectRegisters();
 | 
	
		
			
				|  |  |          String musicGroupId = idGeneratorService.generatorId() + "";
 | 
	
		
			
				|  |  |          musicGroup.setId(musicGroupId);
 | 
	
		
			
				|  |  | -        musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
 | 
	
		
			
				|  |  | +        musicGroup.setStatus(MusicGroupStatusEnum.DRAFT);
 | 
	
		
			
				|  |  |          // 保存乐团基本信息
 | 
	
		
			
				|  |  |          musicGroupDao.insert(musicGroup);
 | 
	
		
			
				|  |  |          // 保存乐团付费主体列表
 | 
	
	
		
			
				|  | @@ -166,7 +173,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |              musicGroupSubjectGoodsGroupDao.batchInsert(musicGroupSubjectGoodsGroups,musicGroupId);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          // 记录创建日志
 | 
	
		
			
				|  |  | -        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "提交建团申请", userId, ""));
 | 
	
		
			
				|  |  | +        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "保存乐团草稿", sysUser.getId(), ""));
 | 
	
		
			
				|  |  |          return musicGroupId;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -182,10 +189,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          //乐团状态是否正确
 | 
	
		
			
				|  |  |          MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  |          if(musicGroup != null){
 | 
	
		
			
				|  |  | -            if(musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT || musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT){
 | 
	
		
			
				|  |  | -                throw new Exception("乐团状态异常");
 | 
	
		
			
				|  |  | +            if(musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT || musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT_FAILED){
 | 
	
		
			
				|  |  | +                throw new Exception("当前乐团状态不支持此操作");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |              //记录日志信息
 | 
	
		
			
				|  |  |              musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"修改乐团计划声部、乐器",sysUser.getId(), JSONObject.toJSONString(subFeeSettingDto)));
 | 
	
		
			
				|  |  |              //删除原有的乐团声部规划
 | 
	
	
		
			
				|  | @@ -202,8 +208,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | -    public int updateExpectedStudentNum(List<UpdateExpectedNumDto> updateExpectedNumDtos) {
 | 
	
		
			
				|  |  | -        return musicGroupSubjectPlanDao.updateExpectedStudentNum(updateExpectedNumDtos);
 | 
	
		
			
				|  |  | +    public void updateExpectedStudentNum(List<UpdateExpectedNumDto> updateExpectedNumDtos) {
 | 
	
		
			
				|  |  | +        updateExpectedNumDtos.forEach(e->{
 | 
	
		
			
				|  |  | +            musicGroupSubjectPlanDao.updateExpectedStudentNum(e.getExpectedStudentNum(),e.getMusicGroupSubjectPlanId());
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
	
		
			
				|  | @@ -213,13 +221,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          if(sysUser == null){
 | 
	
		
			
				|  |  |              throw new Exception("用户信息获取失败");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  | -        if(musicGroup == null){
 | 
	
		
			
				|  |  | -            throw new Exception("乐团信息不存在");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if(musicGroup.getStatus() != MusicGroupStatusEnum.PREPARE){
 | 
	
		
			
				|  |  | -            throw new Exception("乐团状态异常");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        MusicGroup musicGroup = saveLog(musicGroupId,MusicGroupStatusEnum.PREPARE);
 | 
	
		
			
				|  |  |          //乐器采购清单是否确认
 | 
	
		
			
				|  |  |          Map<String,Object> param = new HashMap<>();
 | 
	
		
			
				|  |  |          param.put("musicGroupId",musicGroupId);
 | 
	
	
		
			
				|  | @@ -229,11 +231,62 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          //课酬是否确认
 | 
	
		
			
				|  |  |  //        courseScheduleTeacherSalaryDao.queryCount();
 | 
	
		
			
				|  |  | -        Date date = new Date();
 | 
	
		
			
				|  |  |          //记录操作日志
 | 
	
		
			
				|  |  |          musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"确认开团(筹备中 -> 进行中)",sysUser.getId(),""));
 | 
	
		
			
				|  |  |          musicGroup.setStatus(MusicGroupStatusEnum.PROGRESS);
 | 
	
		
			
				|  |  | +        musicGroupDao.update(musicGroup);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private MusicGroup saveLog(String musicGroupId,MusicGroupStatusEnum statusEnum) throws Exception {
 | 
	
		
			
				|  |  | +        Date date = new Date();
 | 
	
		
			
				|  |  | +        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  | +        if(musicGroup == null){
 | 
	
		
			
				|  |  | +            throw new Exception("乐团信息不存在");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if(musicGroup.getStatus() != statusEnum){
 | 
	
		
			
				|  |  | +            throw new Exception("当前乐团状态不支持此操作");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          musicGroup.setUpdateTime(date);
 | 
	
		
			
				|  |  | +        return musicGroup;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public void musicGroupAudit(String musicGroupId) throws Exception {
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if(sysUser == null){
 | 
	
		
			
				|  |  | +            throw new Exception("用户信息获取失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        MusicGroup musicGroup = saveLog(musicGroupId,MusicGroupStatusEnum.DRAFT);
 | 
	
		
			
				|  |  | +        //记录操作日志
 | 
	
		
			
				|  |  | +        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"提交审核(草稿 -> 审核中)",sysUser.getId(),""));
 | 
	
		
			
				|  |  | +        musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 | 
	
		
			
				|  |  | +        musicGroupDao.update(musicGroup);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public void musicGroupAuditFailed(String musicGroupId,String memo) throws Exception {
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if(sysUser == null){
 | 
	
		
			
				|  |  | +            throw new Exception("用户信息获取失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        MusicGroup musicGroup = saveLog(musicGroupId,MusicGroupStatusEnum.AUDIT);
 | 
	
		
			
				|  |  | +        //记录操作日志
 | 
	
		
			
				|  |  | +        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"审核失败(审核中 -> 审核失败)",sysUser.getId(),memo));
 | 
	
		
			
				|  |  | +        musicGroup.setMemo(memo);
 | 
	
		
			
				|  |  | +        musicGroup.setStatus(MusicGroupStatusEnum.AUDIT_FAILED);
 | 
	
		
			
				|  |  | +        musicGroupDao.update(musicGroup);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public void musicGroupAuditSuccess(String musicGroupId) throws Exception {
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if(sysUser == null){
 | 
	
		
			
				|  |  | +            throw new Exception("用户信息获取失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        MusicGroup musicGroup = saveLog(musicGroupId,MusicGroupStatusEnum.AUDIT);
 | 
	
		
			
				|  |  | +        //记录操作日志
 | 
	
		
			
				|  |  | +        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"审核失败(审核中 -> 报名中)",sysUser.getId(),""));
 | 
	
		
			
				|  |  | +        musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
 | 
	
		
			
				|  |  |          musicGroupDao.update(musicGroup);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -659,57 +712,64 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  |      public void updateBaseInfo(SubFeeSettingDto subFeeSettingDto) throws Exception {
 | 
	
		
			
				|  |  | -        MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
 | 
	
		
			
				|  |  | -        String musicGroupId = musicGroup.getId();
 | 
	
		
			
				|  |  | -        MusicGroup group = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  | -        if(group != null){
 | 
	
		
			
				|  |  | -            Date date = new Date();
 | 
	
		
			
				|  |  | -            List<Integer> months = subFeeSettingDto.getMonths();
 | 
	
		
			
				|  |  | -            //删除乐团相关付费周期
 | 
	
		
			
				|  |  | -            musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
 | 
	
		
			
				|  |  | -            if(months != null && months.size() > 0){
 | 
	
		
			
				|  |  | -                Integer num = musicGroupStudentFeeDao.countStudentNoPayNum(musicGroupId);
 | 
	
		
			
				|  |  | -                if(num > 0){
 | 
	
		
			
				|  |  | -                    throw new Exception("缴费周期更新失败,当前乐团有未缴费的学员");
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                //修改学员下次缴费日期
 | 
	
		
			
				|  |  | -                //获取当前月份
 | 
	
		
			
				|  |  | -                int currentMonth = Integer.parseInt(DateUtil.getMonth(date));
 | 
	
		
			
				|  |  | -                int nextMonth = currentMonth;
 | 
	
		
			
				|  |  | -                for (int i = 0;i < months.size();i++){
 | 
	
		
			
				|  |  | -                    if(i == months.size()-1 && months.get(i) <= currentMonth){
 | 
	
		
			
				|  |  | -                        nextMonth = months.get(0);
 | 
	
		
			
				|  |  | -                        break;
 | 
	
		
			
				|  |  | -                    }else if(months.get(i) > currentMonth){
 | 
	
		
			
				|  |  | -                        nextMonth = months.get(i);
 | 
	
		
			
				|  |  | -                        break;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                // 修改学员付费周期
 | 
	
		
			
				|  |  | -                Date nextPaymentDate = null;
 | 
	
		
			
				|  |  | -                if(nextMonth > currentMonth){
 | 
	
		
			
				|  |  | -                    nextPaymentDate = DateUtil.addMonths(date, nextMonth - currentMonth);
 | 
	
		
			
				|  |  | -                }else if(nextMonth < currentMonth) {
 | 
	
		
			
				|  |  | -                    nextPaymentDate = DateUtil.addMonths(date, 12 - currentMonth + nextMonth);
 | 
	
		
			
				|  |  | -                }else {
 | 
	
		
			
				|  |  | -                    nextPaymentDate = DateUtil.addMonths(date, 12);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId,nextPaymentDate);
 | 
	
		
			
				|  |  | -                //批量插入
 | 
	
		
			
				|  |  | -                musicGroupPaymentCalenderDao.batchAdd(months,musicGroupId);
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if(sysUser == null){
 | 
	
		
			
				|  |  | +            throw new Exception("用户信息获取失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        String musicGroupId = subFeeSettingDto.getMusicGroup().getId();
 | 
	
		
			
				|  |  | +        MusicGroup musicGroup = saveLog(musicGroupId,MusicGroupStatusEnum.DRAFT);
 | 
	
		
			
				|  |  | +        if(musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT_FAILED){
 | 
	
		
			
				|  |  | +            throw new Exception("当前乐团状态不支持此操作");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        Date date = new Date();
 | 
	
		
			
				|  |  | +        List<Integer> months = subFeeSettingDto.getMonths();
 | 
	
		
			
				|  |  | +        //删除乐团相关付费周期
 | 
	
		
			
				|  |  | +        musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
 | 
	
		
			
				|  |  | +        if(months != null && months.size() > 0){
 | 
	
		
			
				|  |  | +            Integer num = musicGroupStudentFeeDao.countStudentNoPayNum(musicGroupId);
 | 
	
		
			
				|  |  | +            if(num > 0){
 | 
	
		
			
				|  |  | +                throw new Exception("缴费周期更新失败,当前乐团有未缴费的学员");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            musicGroupDao.update(musicGroup);
 | 
	
		
			
				|  |  | -            //修改课程里面的教学点
 | 
	
		
			
				|  |  | -            if(!group.getSchoolId().equals(musicGroup.getSchoolId())){
 | 
	
		
			
				|  |  | -                courseScheduleDao.updateByMusicGroupId(musicGroupId,musicGroup.getSchoolId());
 | 
	
		
			
				|  |  | +            //修改学员下次缴费日期
 | 
	
		
			
				|  |  | +            //获取当前月份
 | 
	
		
			
				|  |  | +            int currentMonth = Integer.parseInt(DateUtil.getMonth(date));
 | 
	
		
			
				|  |  | +            int nextMonth = currentMonth;
 | 
	
		
			
				|  |  | +            for (int i = 0;i < months.size();i++){
 | 
	
		
			
				|  |  | +                if(i == months.size()-1 && months.get(i) <= currentMonth){
 | 
	
		
			
				|  |  | +                    nextMonth = months.get(0);
 | 
	
		
			
				|  |  | +                    break;
 | 
	
		
			
				|  |  | +                }else if(months.get(i) > currentMonth){
 | 
	
		
			
				|  |  | +                    nextMonth = months.get(i);
 | 
	
		
			
				|  |  | +                    break;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            // 删除乐团付费主体列表
 | 
	
		
			
				|  |  | -            musicGroupPaymentEntitiesDao.delByGroupId(musicGroupId);
 | 
	
		
			
				|  |  | -            //批量新增
 | 
	
		
			
				|  |  | -            if(subFeeSettingDto.getMusicGroupPaymentEntities() != null && subFeeSettingDto.getMusicGroupPaymentEntities().size() > 0){
 | 
	
		
			
				|  |  | -                musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(),musicGroupId);
 | 
	
		
			
				|  |  | +            // 修改学员付费周期
 | 
	
		
			
				|  |  | +            Date nextPaymentDate = null;
 | 
	
		
			
				|  |  | +            if(nextMonth > currentMonth){
 | 
	
		
			
				|  |  | +                nextPaymentDate = DateUtil.addMonths(date, nextMonth - currentMonth);
 | 
	
		
			
				|  |  | +            }else if(nextMonth < currentMonth) {
 | 
	
		
			
				|  |  | +                nextPaymentDate = DateUtil.addMonths(date, 12 - currentMonth + nextMonth);
 | 
	
		
			
				|  |  | +            }else {
 | 
	
		
			
				|  |  | +                nextPaymentDate = DateUtil.addMonths(date, 12);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId,nextPaymentDate);
 | 
	
		
			
				|  |  | +            //批量插入
 | 
	
		
			
				|  |  | +            musicGroupPaymentCalenderDao.batchAdd(months,musicGroupId);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        musicGroupDao.update(musicGroup);
 | 
	
		
			
				|  |  | +        //修改课程里面的教学点
 | 
	
		
			
				|  |  | +        if(!musicGroup.getSchoolId().equals(musicGroup.getSchoolId())){
 | 
	
		
			
				|  |  | +            courseScheduleDao.updateByMusicGroupId(musicGroupId,musicGroup.getSchoolId());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        // 删除乐团付费主体列表
 | 
	
		
			
				|  |  | +        musicGroupPaymentEntitiesDao.delByGroupId(musicGroupId);
 | 
	
		
			
				|  |  | +        //批量新增
 | 
	
		
			
				|  |  | +        if(subFeeSettingDto.getMusicGroupPaymentEntities() != null && subFeeSettingDto.getMusicGroupPaymentEntities().size() > 0){
 | 
	
		
			
				|  |  | +            musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(),musicGroupId);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        //记录操作日志
 | 
	
		
			
				|  |  | +        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"修改乐团基本信息数据",sysUser.getId(),JSONObject.toJSONString(subFeeSettingDto)));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
	
		
			
				|  | @@ -746,10 +806,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public MusicGroup openPay(String musicGroupId, String expireDate) {
 | 
	
		
			
				|  |  | -        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  | -        musicGroup.setStatus(MusicGroupStatusEnum.PAY);
 | 
	
		
			
				|  |  | +    public MusicGroup openPay(String musicGroupId, String expireDate) throws Exception {
 | 
	
		
			
				|  |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
	
		
			
				|  |  | +        if(sysUser == null){
 | 
	
		
			
				|  |  | +            throw new Exception("用户信息获取失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        MusicGroup musicGroup = saveLog(musicGroupId,MusicGroupStatusEnum.APPLY);
 | 
	
		
			
				|  |  | +        //记录操作日志
 | 
	
		
			
				|  |  | +        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"开启缴费(报名中 -->  缴费中)",sysUser.getId(),""));
 | 
	
		
			
				|  |  |          musicGroup.setApplyExpireDate(DateUtil.toDate(expireDate));
 | 
	
		
			
				|  |  | +        musicGroup.setStatus(MusicGroupStatusEnum.PAY);
 | 
	
		
			
				|  |  |          musicGroupDao.update(musicGroup);
 | 
	
		
			
				|  |  |          return musicGroup;
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -798,25 +864,20 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          if(sysUser == null){
 | 
	
		
			
				|  |  |              throw new Exception("用户信息获取失败");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        Date date = new Date();
 | 
	
		
			
				|  |  | -        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  | -        if(musicGroup == null){
 | 
	
		
			
				|  |  | -            throw new Exception("乐团信息不存在");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if(musicGroup.getStatus() != MusicGroupStatusEnum.PAY){
 | 
	
		
			
				|  |  | -            throw new Exception("乐团状态异常");
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        MusicGroup musicGroup = saveLog(musicGroupId,MusicGroupStatusEnum.PAY);
 | 
	
		
			
				|  |  |          //记录操作日志
 | 
	
		
			
				|  |  |          musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"确认开团(缴费中 -> 筹备中)",sysUser.getId(),""));
 | 
	
		
			
				|  |  |          musicGroup.setStatus(MusicGroupStatusEnum.PREPARE);
 | 
	
		
			
				|  |  | -        musicGroup.setUpdateTime(date);
 | 
	
		
			
				|  |  |          musicGroupDao.update(musicGroup);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          //给家长发送乐团基础训练课短信
 | 
	
		
			
				|  |  |          //获取所有乐团学员列表
 | 
	
		
			
				|  |  | -//        List<StudentRegistration> students = studentRegistrationService.queryStudentByMusicGroupId(musicGroupId);
 | 
	
		
			
				|  |  | +        List<StudentRegistration> students = studentRegistrationService.queryStudentByMusicGroupId(musicGroupId);
 | 
	
		
			
				|  |  |          //获取所有家长电话
 | 
	
		
			
				|  |  | -//        Set<String> parentsPhones = students.stream().map(StudentRegistration::getParentsPhone).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | -//        String content = sysConfigDao.findConfigValue(MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE.getCode());
 | 
	
		
			
				|  |  | -//        sysMessageService.batchSendMessage(MessageSender.YIMEI,"",content,parentsPhones,date,0,"");
 | 
	
		
			
				|  |  | +        Set<String> parentsPhones = students.stream().map(StudentRegistration::getParentsPhone).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | +        //获取对应家长的用户编号
 | 
	
		
			
				|  |  | +//        Map<Integer,String> userIds = MapUtil.convertMybatisMap(studentRegistrationService.findParentId(StringUtils.join(parentsPhones,",")));
 | 
	
		
			
				|  |  | +//        String content = sysMessageConfigDao.findContent(MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE.getCode());
 | 
	
		
			
				|  |  | +//        sysMessageService.batchSendMessage(MessageSender.YIMEI,"",content,userIds,date,0,"");
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  }
 |