|  | @@ -7,17 +7,19 @@ import com.ym.mec.biz.dal.dao.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.*;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.page.StudentVipGroupQueryInfo;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.page.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.CourseScheduleService;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.service.SysUserCashAccountService;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.VipGroupService;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.dal.BaseDAO;
 | 
	
		
			
				|  |  | +import com.ym.mec.common.entity.ImGroupMember;
 | 
	
		
			
				|  |  | +import com.ym.mec.common.entity.ImGroupModel;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.exception.BizException;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.page.PageInfo;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.service.impl.BaseServiceImpl;
 | 
	
		
			
				|  |  | +import com.ym.mec.im.ImFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.collection.MapUtil;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  import org.apache.commons.lang.StringUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
	
		
			
				|  | @@ -56,8 +58,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |      private StudentVipGroupPaymentDao studentVipGroupPaymentDao;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |  	private StudentApplyRefundsDao studentApplyRefundsDao;
 | 
	
		
			
				|  |  | -    @Autowired
 | 
	
		
			
				|  |  | -	private SysUserCashAccountDao sysUserCashAccountDao;
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  | +	private SysUserCashAccountService sysUserCashAccountService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |  	private SysUserCashAccountDetailDao sysUserCashAccountDetailDao;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
	
		
			
				|  | @@ -66,6 +70,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |  	private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +	private ImFeignService imFeignService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Override
 | 
	
		
			
				|  |  |  	public BaseDAO<Long, VipGroup> getDAO() {
 | 
	
	
		
			
				|  | @@ -95,8 +101,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |          //获取活动信息
 | 
	
		
			
				|  |  |          VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId().intValue());
 | 
	
		
			
				|  |  |  		VipGroupSalarySettlementDto vipGroupSalarySettlementDto = JSON.parseObject(vipGroupActivity.getSalarySettlementJson(), VipGroupSalarySettlementDto.class);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  |  		//生成vip课信息
 | 
	
		
			
				|  |  |  		VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto=vipGroup.getVipGroupApplyBaseInfo();
 | 
	
		
			
				|  |  |  		vipGroupApplyBaseInfoDto.setTotalPrice(countVipGroupPredictFee(vipGroupApplyBaseInfoDto,
 | 
	
	
		
			
				|  | @@ -122,6 +127,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  		vipGroupClassGroupMapper.setClassGroupId(classGroup.getId());
 | 
	
		
			
				|  |  |  		vipGroupClassGroupMapperDao.insert(vipGroupClassGroupMapper);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +		//创建融云班级群
 | 
	
		
			
				|  |  | +		// 指导老师加入群组
 | 
	
		
			
				|  |  | +		ImGroupMember[] imGroupMembers = { new ImGroupMember(vipGroup.getVipGroupApplyBaseInfo().getUserId().toString())};
 | 
	
		
			
				|  |  | +		// 创建群组
 | 
	
		
			
				|  |  | +		imFeignService.groupCreate(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  		//创建班级老师关联记录
 | 
	
		
			
				|  |  |  		ClassGroupTeacherMapper classGroupTeacherMapper=new ClassGroupTeacherMapper();
 | 
	
		
			
				|  |  |  		classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.BISHOP);
 | 
	
	
		
			
				|  | @@ -567,8 +578,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  		studentApplyRefundsDao.update(oldStudentApplyRefunds);
 | 
	
		
			
				|  |  |  		switch (studentApplyRefunds.getStatus()){
 | 
	
		
			
				|  |  |  			case PASS:
 | 
	
		
			
				|  |  | -				sysUserCashAccountDao.incrAccount(oldStudentApplyRefunds.getUserId(),oldStudentApplyRefunds.getActualAmount());
 | 
	
		
			
				|  |  | -				SysUserCashAccount sysUserCashAccount = sysUserCashAccountDao.get(studentApplyRefunds.getId().intValue());
 | 
	
		
			
				|  |  | +				sysUserCashAccountService.updateBalance(oldStudentApplyRefunds.getUserId(),oldStudentApplyRefunds.getActualAmount());
 | 
	
		
			
				|  |  | +				SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentApplyRefunds.getId().intValue());
 | 
	
		
			
				|  |  |  				SysUserCashAccountDetail sysUserCashAccountDetail=new SysUserCashAccountDetail();
 | 
	
		
			
				|  |  |  				sysUserCashAccountDetail.setUserId(studentApplyRefunds.getUserId());
 | 
	
		
			
				|  |  |  				sysUserCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
 | 
	
	
		
			
				|  | @@ -585,4 +596,29 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 | 
	
		
			
				|  |  |  				throw new BizException("审核状态错误!");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@Override
 | 
	
		
			
				|  |  | +	public PageInfo findVipGroupSalarys(VipGroupSalaryQueryInfo queryInfo) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    	if(Objects.isNull(queryInfo.getVipGroupId())){
 | 
	
		
			
				|  |  | +    		throw new BizException("请指定vip课程!");
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 | 
	
		
			
				|  |  | +		Map<String, Object> params = new HashMap<String, Object>();
 | 
	
		
			
				|  |  | +		MapUtil.populateMap(params, queryInfo);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		List dataList = null;
 | 
	
		
			
				|  |  | +		int count = courseScheduleTeacherSalaryDao.countVipGroupSalarys(params);
 | 
	
		
			
				|  |  | +		if (count > 0) {
 | 
	
		
			
				|  |  | +			pageInfo.setTotal(count);
 | 
	
		
			
				|  |  | +			params.put("offset", pageInfo.getOffset());
 | 
	
		
			
				|  |  | +			dataList = courseScheduleTeacherSalaryDao.findVipGroupSalarys(params);
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		if (count == 0) {
 | 
	
		
			
				|  |  | +			dataList = new ArrayList<>();
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		pageInfo.setRows(dataList);
 | 
	
		
			
				|  |  | +		return pageInfo;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  |  }
 |