|  | @@ -1,14 +1,60 @@
 | 
	
		
			
				|  |  |  package com.ym.mec.biz.service.impl;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.*;
 | 
	
		
			
				|  |  | +import java.math.BigDecimal;
 | 
	
		
			
				|  |  | +import java.util.ArrayList;
 | 
	
		
			
				|  |  | +import java.util.Calendar;
 | 
	
		
			
				|  |  | +import java.util.Collections;
 | 
	
		
			
				|  |  | +import java.util.Date;
 | 
	
		
			
				|  |  | +import java.util.List;
 | 
	
		
			
				|  |  | +import java.util.Map;
 | 
	
		
			
				|  |  | +import java.util.Set;
 | 
	
		
			
				|  |  | +import java.util.stream.Collectors;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  | +import org.springframework.transaction.annotation.Propagation;
 | 
	
		
			
				|  |  | +import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import com.ym.mec.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.ChargeTypeDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.MusicGroupDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.MusicGroupPaymentEntitiesDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.MusicGroupQuitDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.MusicGroupSubjectGoodsGroupDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.SchoolDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.TeacherDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.BasicUserDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.MusicCardDto;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dto.MusicGroupsDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.enums.*;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.ApprovalStatus;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MusicGroup;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MusicGroupPaymentEntities;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MusicGroupQuit;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.StudentRegistration;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.enums.DealStatusEnum;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.MusicGroupService;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.service.PayService;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.service.StudentRegistrationService;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.service.SysUserCashAccountDetailService;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.SysUserCashAccountService;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.dal.BaseDAO;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.entity.ImGroupMember;
 | 
	
	
		
			
				|  | @@ -19,13 +65,6 @@ import com.ym.mec.common.service.IdGeneratorService;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.service.impl.BaseServiceImpl;
 | 
	
		
			
				|  |  |  import com.ym.mec.im.ImFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.collection.MapUtil;
 | 
	
		
			
				|  |  | -import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | -import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  | -import org.springframework.transaction.annotation.Propagation;
 | 
	
		
			
				|  |  | -import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -import java.util.*;
 | 
	
		
			
				|  |  | -import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  @Service
 | 
	
		
			
				|  |  |  public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
 | 
	
	
		
			
				|  | @@ -55,16 +94,28 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  |  	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 | 
	
		
			
				|  |  | -	
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  |  	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 | 
	
		
			
				|  |  | -	
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  |  	private StudentPaymentOrderDao studentPaymentOrderDao;
 | 
	
		
			
				|  |  | -	
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  |  	private SysUserCashAccountService sysUserCashAccountService;
 | 
	
		
			
				|  |  | -	
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  | +	private SysUserCashAccountDetailService sysUserCashAccountDetailService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  | +	private MusicGroupQuitDao musicGroupQuitDao;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  | +	private StudentRegistrationService studentRegistrationService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  | +	private PayService payService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	@Override
 | 
	
		
			
				|  |  |  	public BaseDAO<String, MusicGroup> getDAO() {
 | 
	
		
			
				|  |  |  		return musicGroupDao;
 | 
	
	
		
			
				|  | @@ -77,7 +128,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  		List<MusicGroupPaymentEntities> musicGroupPaymentEntities = subFeeSettingDto.getMusicGroupPaymentEntities();
 | 
	
		
			
				|  |  |  		List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroups = subFeeSettingDto.getMusicGroupSubjectGoodsGroups();
 | 
	
		
			
				|  |  |  		List<MusicGroupSubjectPlan> musicGroupSubjectPlans = subFeeSettingDto.getMusicGroupSubjectPlans();
 | 
	
		
			
				|  |  | -		String musicGroupId = idGeneratorService.generatorId()+"";
 | 
	
		
			
				|  |  | +		String musicGroupId = idGeneratorService.generatorId() + "";
 | 
	
		
			
				|  |  |  		musicGroup.setId(musicGroupId);
 | 
	
		
			
				|  |  |  		// 保存乐团基本信息
 | 
	
		
			
				|  |  |  		musicGroupDao.insert(musicGroup);
 | 
	
	
		
			
				|  | @@ -114,7 +165,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  			musicGroupSubjectGoodsGroupDao.insert(e);
 | 
	
		
			
				|  |  |  		});
 | 
	
		
			
				|  |  |  		// 新增聊天群
 | 
	
		
			
				|  |  | -//			ImGroupModel imGroupModel = new ImGroupModel(musicGroupId, musicGroup.getName());
 | 
	
		
			
				|  |  | +		// ImGroupModel imGroupModel = new ImGroupModel(musicGroupId, musicGroup.getName());
 | 
	
		
			
				|  |  |  		// 教务老师和运营主管加入群组
 | 
	
		
			
				|  |  |  		ImGroupMember[] imGroupMembers = { new ImGroupMember(musicGroup.getTeamTeacherId().toString()),
 | 
	
		
			
				|  |  |  				new ImGroupMember(musicGroup.getEducationalTeacherId().toString()) };
 | 
	
	
		
			
				|  | @@ -158,22 +209,25 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  		} else {
 | 
	
		
			
				|  |  |  			throw new BizException("乐团当前状态是{},不能取消", musicGroup.getStatus().getMsg());
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | -		
 | 
	
		
			
				|  |  | -		//查询是否有中间状态的缴费信息
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		// 查询是否有中间状态的缴费信息
 | 
	
		
			
				|  |  |  		List<StudentPaymentOrder> studentPaymentOrders = studentPaymentOrderDao.queryByDealStatus(musicGroupId, OrderTypeEnum.APPLY, DealStatusEnum.ING);
 | 
	
		
			
				|  |  | -		
 | 
	
		
			
				|  |  | -		if(studentPaymentOrders != null && studentPaymentOrders.size()>0){
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if (studentPaymentOrders != null && studentPaymentOrders.size() > 0) {
 | 
	
		
			
				|  |  |  			throw new BizException("缴费存在交易中的数据,不能取消乐团");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | -		
 | 
	
		
			
				|  |  | -		//查询已缴费信息
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		// 查询已缴费信息
 | 
	
		
			
				|  |  |  		studentPaymentOrders = studentPaymentOrderDao.queryByDealStatus(musicGroupId, OrderTypeEnum.APPLY, DealStatusEnum.SUCCESS);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		// 退费
 | 
	
		
			
				|  |  | -		for(StudentPaymentOrder order : studentPaymentOrders){
 | 
	
		
			
				|  |  | +		for (StudentPaymentOrder order : studentPaymentOrders) {
 | 
	
		
			
				|  |  |  			sysUserCashAccountService.updateBalance(order.getUserId(), order.getActualAmount());
 | 
	
		
			
				|  |  | +			// 增加交易流水
 | 
	
		
			
				|  |  | +			sysUserCashAccountDetailService.addCashAccountDetail(order.getUserId(), order.getActualAmount(), "", "", PlatformCashAccountDetailTypeEnum.REFUNDS,
 | 
	
		
			
				|  |  | +					null, DealStatusEnum.SUCCESS, "取消乐团");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | -		
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  		return true;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -265,59 +319,130 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Override
 | 
	
		
			
				|  |  | -	public boolean quitMusicGroup(String musicGroupId, Integer userId) {
 | 
	
		
			
				|  |  | +	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | +	public boolean applyQuitMusicGroup(String musicGroupId, SysUser sysUser) {
 | 
	
		
			
				|  |  |  		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
 | 
	
		
			
				|  |  |  		if (musicGroup == null) {
 | 
	
		
			
				|  |  |  			throw new BizException("乐团不存在");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | -		
 | 
	
		
			
				|  |  | -		classGroupStudentMapperDao.updateUserStatusByMusicGroupId(musicGroupId, userId, ClassGroupStudentStatusEnum.QUIT);
 | 
	
		
			
				|  |  | -		
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		MusicGroupQuit musicGroupQuit = new MusicGroupQuit();
 | 
	
		
			
				|  |  | +		musicGroupQuit.setCreateTime(new Date());
 | 
	
		
			
				|  |  | +		musicGroupQuit.setJoinDate(sysUser.getCreateTime());
 | 
	
		
			
				|  |  | +		musicGroupQuit.setMusicGroupId(musicGroupId);
 | 
	
		
			
				|  |  | +		musicGroupQuit.setUserId(sysUser.getId());
 | 
	
		
			
				|  |  | +		musicGroupQuit.setStatus(ApprovalStatus.PROCESSING);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		musicGroupQuitDao.insert(musicGroupQuit);
 | 
	
		
			
				|  |  |  		return true;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Override
 | 
	
		
			
				|  |  | -	public boolean renew(String musicGroupId, Integer userId, double amount) {
 | 
	
		
			
				|  |  | +	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | +	public boolean approveQuitMusicGroup(Long id, ApprovalStatus status, String reason) {
 | 
	
		
			
				|  |  | +		MusicGroupQuit musicGroupQuit = musicGroupQuitDao.get(id);
 | 
	
		
			
				|  |  | +		if (musicGroupQuit != null) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			String musicGroupId = musicGroupQuit.getMusicGroupId();
 | 
	
		
			
				|  |  | +			Integer userId = musicGroupQuit.getUserId();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			musicGroupQuit.setStatus(status);
 | 
	
		
			
				|  |  | +			musicGroupQuit.setReason(reason);
 | 
	
		
			
				|  |  | +			musicGroupQuit.setQuitDate(new Date());
 | 
	
		
			
				|  |  | +			musicGroupQuitDao.update(musicGroupQuit);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			if (status == ApprovalStatus.APPROVED) {
 | 
	
		
			
				|  |  | +				classGroupStudentMapperDao.updateUserStatusByMusicGroupId(musicGroupId, userId, ClassGroupStudentStatusEnum.QUIT);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +				// 判断乐器是否是租赁
 | 
	
		
			
				|  |  | +				StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
 | 
	
		
			
				|  |  | +				if (studentRegistration == null) {
 | 
	
		
			
				|  |  | +					throw new BizException("用户注册信息不存在");
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +				Integer subjectId = studentRegistration.getActualSubjectId();
 | 
	
		
			
				|  |  | +				MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
 | 
	
		
			
				|  |  | +				if (musicGroupSubjectPlan == null) {
 | 
	
		
			
				|  |  | +					throw new BizException("乐团声部费用设置不存在");
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +				if (musicGroupSubjectPlan.getDepositFee().doubleValue() > 0) {
 | 
	
		
			
				|  |  | +					// 增加交易流水
 | 
	
		
			
				|  |  | +					sysUserCashAccountDetailService.addCashAccountDetail(userId, musicGroupSubjectPlan.getDepositFee(), "", "",
 | 
	
		
			
				|  |  | +							PlatformCashAccountDetailTypeEnum.REFUNDS, null, DealStatusEnum.SUCCESS, "退出乐团");
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  |  		return true;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Override
 | 
	
		
			
				|  |  | +	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | +	public Map renew(String musicGroupId, Integer userId) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		MusicGroup musicGroup = this.get(musicGroupId);
 | 
	
		
			
				|  |  | +		if (musicGroup == null) {
 | 
	
		
			
				|  |  | +			throw new BizException("乐团不存在");
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if (musicGroupStudentFee == null) {
 | 
	
		
			
				|  |  | +			throw new BizException("个人信息不存在");
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		// 判断当前是否是续费状态
 | 
	
		
			
				|  |  | +		if (musicGroupStudentFee.getPaymentStatus() != PaymentStatus.NON_PAYMENT) {
 | 
	
		
			
				|  |  | +			throw new BizException("已缴费");
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		BigDecimal amount = musicGroupStudentFee.getTemporaryCourseFee();
 | 
	
		
			
				|  |  | +		if (amount == null || amount.doubleValue() == 0) {
 | 
	
		
			
				|  |  | +			amount = musicGroupStudentFee.getCourseFee();
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		try {
 | 
	
		
			
				|  |  | +			return payService.getPayMap(amount, idGeneratorService.generatorId("payment") + "", "https://pay.dayaedu.com/api/yqpay/notify",
 | 
	
		
			
				|  |  | +					"http://dev.dayaedu.com", "测试订单", "测试订单");
 | 
	
		
			
				|  |  | +		} catch (Exception e) {
 | 
	
		
			
				|  |  | +			throw new BizException("调用支付接口出错", e);
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@Override
 | 
	
		
			
				|  |  |  	public PageInfo<MusicGroup> queryMusicGroupPage(MusicGroupQueryInfo queryInfo) {
 | 
	
		
			
				|  |  |  		PageInfo<MusicGroup> musicGroupPageInfo = queryPage(queryInfo);
 | 
	
		
			
				|  |  |  		List<MusicGroup> musicGroupList = musicGroupPageInfo.getRows();
 | 
	
		
			
				|  |  | -		//获取学校编号列表
 | 
	
		
			
				|  |  | +		// 获取学校编号列表
 | 
	
		
			
				|  |  |  		Set<Integer> schoolIds = musicGroupList.stream().map(e -> e.getSchoolId()).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | -		List<Map<Integer,String>> schoolNames =  schoolDao.queryNameByIds(schoolIds);
 | 
	
		
			
				|  |  | -		//获取相关学校名称map
 | 
	
		
			
				|  |  | -		Map<Integer,String> schoolNameMap = MapUtil.convertMybatisMap(schoolNames);
 | 
	
		
			
				|  |  | +		List<Map<Integer, String>> schoolNames = schoolDao.queryNameByIds(schoolIds);
 | 
	
		
			
				|  |  | +		// 获取相关学校名称map
 | 
	
		
			
				|  |  | +		Map<Integer, String> schoolNameMap = MapUtil.convertMybatisMap(schoolNames);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		//获取教务老师编号列表
 | 
	
		
			
				|  |  | +		// 获取教务老师编号列表
 | 
	
		
			
				|  |  |  		Set<Integer> educationalTeacherIds = musicGroupList.stream().map(e -> e.getEducationalTeacherId()).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | -		//获取相关老师的名字
 | 
	
		
			
				|  |  | -		List<Map<Integer,String>> educationalTeacherNames =  teacherDao.queryNameByIds(educationalTeacherIds);
 | 
	
		
			
				|  |  | -		Map<Integer,String> educationalTeacherNameMap = MapUtil.convertMybatisMap(educationalTeacherNames);
 | 
	
		
			
				|  |  | +		// 获取相关老师的名字
 | 
	
		
			
				|  |  | +		List<Map<Integer, String>> educationalTeacherNames = teacherDao.queryNameByIds(educationalTeacherIds);
 | 
	
		
			
				|  |  | +		Map<Integer, String> educationalTeacherNameMap = MapUtil.convertMybatisMap(educationalTeacherNames);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		//获取运营主管编号列表
 | 
	
		
			
				|  |  | +		// 获取运营主管编号列表
 | 
	
		
			
				|  |  |  		Set<Integer> teamTeacherIds = musicGroupList.stream().map(e -> e.getTeamTeacherId()).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | -		List<Map<Integer,String>> teamTeacherNames =  teacherDao.queryNameByIds(teamTeacherIds);
 | 
	
		
			
				|  |  | -		Map<Integer,String> teamTeacherNameMap = MapUtil.convertMybatisMap(teamTeacherNames);
 | 
	
		
			
				|  |  | +		List<Map<Integer, String>> teamTeacherNames = teacherDao.queryNameByIds(teamTeacherIds);
 | 
	
		
			
				|  |  | +		Map<Integer, String> teamTeacherNameMap = MapUtil.convertMybatisMap(teamTeacherNames);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		//获取乐团编号列表
 | 
	
		
			
				|  |  | +		// 获取乐团编号列表
 | 
	
		
			
				|  |  |  		Set<String> musicGroupIds = musicGroupList.stream().map(e -> e.getId()).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | -		//统计乐团在读人数
 | 
	
		
			
				|  |  | -		List<Map<String,Long>> payNums =  musicGroupDao.countPayNum(musicGroupIds);
 | 
	
		
			
				|  |  | -		Map<String,Long> payNumMap = MapUtil.convertMybatisMap(payNums);
 | 
	
		
			
				|  |  | +		// 统计乐团在读人数
 | 
	
		
			
				|  |  | +		List<Map<String, Long>> payNums = musicGroupDao.countPayNum(musicGroupIds);
 | 
	
		
			
				|  |  | +		Map<String, Long> payNumMap = MapUtil.convertMybatisMap(payNums);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		//获取收费类型编号列表
 | 
	
		
			
				|  |  | +		// 获取收费类型编号列表
 | 
	
		
			
				|  |  |  		Set<Integer> chargeTypeIds = musicGroupList.stream().map(e -> e.getChargeTypeId()).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | -		List<Map<Integer,String>> chargeTypeNames =  chargeTypeDao.queryNameByIds(chargeTypeIds);
 | 
	
		
			
				|  |  | -		Map<Integer,String> chargeTypeNameMap = MapUtil.convertMybatisMap(chargeTypeNames);
 | 
	
		
			
				|  |  | +		List<Map<Integer, String>> chargeTypeNames = chargeTypeDao.queryNameByIds(chargeTypeIds);
 | 
	
		
			
				|  |  | +		Map<Integer, String> chargeTypeNameMap = MapUtil.convertMybatisMap(chargeTypeNames);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		musicGroupList.forEach(e->{
 | 
	
		
			
				|  |  | +		musicGroupList.forEach(e -> {
 | 
	
		
			
				|  |  |  			e.setSchoolName(schoolNameMap.get(e.getSchoolId()));
 | 
	
		
			
				|  |  |  			e.setEducationalTeacherName(educationalTeacherNameMap.get(e.getEducationalTeacherId()));
 | 
	
		
			
				|  |  |  			e.setTeamTeacherName(teamTeacherNameMap.get(e.getTeamTeacherId()));
 | 
	
		
			
				|  |  | -			e.setPayNum(payNumMap.get(e.getId())==null?0:payNumMap.get(e.getId()).intValue());
 | 
	
		
			
				|  |  | +			e.setPayNum(payNumMap.get(e.getId()) == null ? 0 : payNumMap.get(e.getId()).intValue());
 | 
	
		
			
				|  |  |  			e.setChargeTypeName(chargeTypeNameMap.get(e.getChargeTypeId()));
 | 
	
		
			
				|  |  |  		});
 | 
	
		
			
				|  |  |  		return musicGroupPageInfo;
 |