|  | @@ -3,7 +3,6 @@ package com.ym.mec.biz.service.impl;
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.enums.DealStatusEnum.CLOSE;
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.enums.DealStatusEnum.ING;
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.enums.DealStatusEnum.SUCCESS;
 | 
	
		
			
				|  |  | -import static com.ym.mec.biz.dal.enums.IndexErrorType.WAIT_CREATE_PAYMENT_CALENDER;
 | 
	
		
			
				|  |  |  import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import java.io.IOException;
 | 
	
	
		
			
				|  | @@ -20,6 +19,7 @@ import java.util.Map;
 | 
	
		
			
				|  |  |  import java.util.Set;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  |  import org.slf4j.Logger;
 | 
	
	
		
			
				|  | @@ -34,43 +34,6 @@ import com.alibaba.fastjson.TypeReference;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.entity.SysUserRole;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.ChargeTypeDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.ClassGroupDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CooperationOrganDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.EmployeeDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.MusicGroupDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderStudentDetailDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.MusicGroupPaymentEntitiesDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.MusicGroupPurchaseListDao;
 | 
	
		
			
				|  |  | -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.OrganizationDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.SchoolDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.StudentDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.StudentPreRegistrationDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.StudentVisitDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.SubjectChangeDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.SubjectDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.SysConfigDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.TeacherDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.BasicUserDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.CloseMusicGroupDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.CourseScheduleTeachersDto;
 | 
	
	
		
			
				|  | @@ -285,6 +248,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private GroupEventSource groupEventSource;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private StudentInstrumentDao studentInstrumentDao;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      private SimpleDateFormat sdf_ymd = new SimpleDateFormat("yyyy-MM-dd");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      private SimpleDateFormat sdf_hms = new SimpleDateFormat("HH:mm:ss");
 | 
	
	
		
			
				|  | @@ -466,16 +432,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          studentPreRegistration.setUserId(user.getId());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          Organization organization = organizationDao.get(musicGroup.getOrganId());
 | 
	
		
			
				|  |  | -        if(organization.getGradeType().equals(GradeTypeEnum.SIX_PLUS)){
 | 
	
		
			
				|  |  | +        if (organization.getGradeType().equals(GradeTypeEnum.SIX_PLUS)) {
 | 
	
		
			
				|  |  |              for (SixPlusGradeEnum value : SixPlusGradeEnum.values()) {
 | 
	
		
			
				|  |  | -                if(value.getCode().equals(studentPreRegistration.getCurrentGradeNum())){
 | 
	
		
			
				|  |  | +                if (value.getCode().equals(studentPreRegistration.getCurrentGradeNum())) {
 | 
	
		
			
				|  |  |                      studentPreRegistration.setCurrentGrade(value.getDesc());
 | 
	
		
			
				|  |  |                      break;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -        }else {
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  |              for (FivePlusGradeEnum value : FivePlusGradeEnum.values()) {
 | 
	
		
			
				|  |  | -                if(value.getCode().equals(studentPreRegistration.getCurrentGradeNum())){
 | 
	
		
			
				|  |  | +                if (value.getCode().equals(studentPreRegistration.getCurrentGradeNum())) {
 | 
	
		
			
				|  |  |                      studentPreRegistration.setCurrentGrade(value.getDesc());
 | 
	
		
			
				|  |  |                      break;
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -743,7 +709,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          //乐器保养
 | 
	
		
			
				|  |  | -        if(registerPayDto.getBuyMaintenance()){
 | 
	
		
			
				|  |  | +        if (registerPayDto.getBuyMaintenance()) {
 | 
	
		
			
				|  |  |              BigDecimal maintenancePrice = new BigDecimal(sysConfigDao.findConfigValue("maintenance_price"));
 | 
	
		
			
				|  |  |              orderAmount = orderAmount.add(maintenancePrice);
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -759,7 +725,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          String channelType = "";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, remitFee, courseRemitFee, newCourses,registerPayDto.getBuyMaintenance());
 | 
	
		
			
				|  |  | +        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance());
 | 
	
		
			
				|  |  |          studentPaymentOrder.setVersion(0);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          Date date = new Date();
 | 
	
	
		
			
				|  | @@ -894,7 +860,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if(registerPayDto.getBuyMaintenance()){
 | 
	
		
			
				|  |  | +        if (registerPayDto.getBuyMaintenance()) {
 | 
	
		
			
				|  |  |              BigDecimal maintenancePrice = new BigDecimal(sysConfigDao.findConfigValue("maintenance_price"));
 | 
	
		
			
				|  |  |              orderAmount = orderAmount.add(maintenancePrice);
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -911,7 +877,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          String channelType = "";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.reAddOrder(userId, amount, orderNo, channelType, courseFee, goodsGroups, studentRegistration.getMusicGroupId(), ApplyOrder, remitFee, courseRemitFee, newCourses,registerPayDto.getBuyMaintenance());
 | 
	
		
			
				|  |  | +        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.reAddOrder(userId, amount, orderNo, channelType, courseFee, goodsGroups, studentRegistration.getMusicGroupId(), ApplyOrder, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance());
 | 
	
		
			
				|  |  |          studentPaymentOrder.setVersion(0);
 | 
	
		
			
				|  |  |          Date date = new Date();
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1712,7 +1678,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 | 
	
		
			
				|  |  |      public boolean approveQuitMusicGroup(Long id, ApprovalStatus status, String reason, boolean isRefundCourseFee, boolean isRefundInstrumentFee,
 | 
	
		
			
				|  |  | -                                         boolean isRefundTeachingAssistantsFee) {
 | 
	
		
			
				|  |  | +                                         boolean isRefundTeachingAssistantsFee, BigDecimal maintenanceFee) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          MusicGroupQuit musicGroupQuit = musicGroupQuitDao.get(id);
 | 
	
		
			
				|  |  |          if (musicGroupQuit == null) {
 | 
	
	
		
			
				|  | @@ -1825,7 +1791,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |                  musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            if(MusicGroupStatusEnum.PROGRESS.equals(musicGroup.getStatus())){
 | 
	
		
			
				|  |  | +            if (MusicGroupStatusEnum.PROGRESS.equals(musicGroup.getStatus())) {
 | 
	
		
			
				|  |  |                  //统计变更学员数
 | 
	
		
			
				|  |  |                  groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1878,6 +1844,17 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +            //退乐保费用
 | 
	
		
			
				|  |  | +            if (maintenanceFee != null) {
 | 
	
		
			
				|  |  | +                if (maintenanceFee.compareTo(BigDecimal.ZERO) > 0) {
 | 
	
		
			
				|  |  | +                    int maintenanceNum = studentInstrumentDao.getStudentMaintenanceNum(userId);
 | 
	
		
			
				|  |  | +                    if (maintenanceNum <= 0) {
 | 
	
		
			
				|  |  | +                        throw new BizException("学生没有有效期内的乐保,不能退乐保费用");
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                amount = amount.add(maintenanceFee);
 | 
	
		
			
				|  |  | +                studentInstrumentDao.quitMaintenance(userId);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              if (amount.doubleValue() > 0) {
 | 
	
		
			
				|  |  |                  // 增加交易流水
 | 
	
	
		
			
				|  | @@ -1891,7 +1868,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 | 
	
		
			
				|  |  |      public boolean directQuitMusicGroup(String musicGroupId, Integer userId, String reason, boolean isRefundCourseFee, boolean isRefundInstrumentFee,
 | 
	
		
			
				|  |  | -                                        boolean isRefundTeachingAssistantsFee) {
 | 
	
		
			
				|  |  | +                                        boolean isRefundTeachingAssistantsFee, BigDecimal maintenanceFee) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          SysUser sysUser = sysUserFeignService.queryUserById(userId);
 | 
	
		
			
				|  |  |          if (sysUser == null) {
 | 
	
	
		
			
				|  | @@ -1921,27 +1898,27 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          Date date = new Date();
 | 
	
		
			
				|  |  | -        
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          MusicGroupQuit musicGroupQuit = musicGroupQuitDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
 | 
	
		
			
				|  |  | -		if (musicGroupQuit != null && musicGroupQuit.getStatus() == ApprovalStatus.PROCESSING) {
 | 
	
		
			
				|  |  | -			musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
 | 
	
		
			
				|  |  | -			musicGroupQuit.setReason(reason);
 | 
	
		
			
				|  |  | -			musicGroupQuit.setQuitDate(date);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -			musicGroupQuitDao.update(musicGroupQuit);
 | 
	
		
			
				|  |  | -		} else {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -			musicGroupQuit = new MusicGroupQuit();
 | 
	
		
			
				|  |  | -			musicGroupQuit.setCreateTime(date);
 | 
	
		
			
				|  |  | -			musicGroupQuit.setJoinDate(studentRegistration.getCreateTime());
 | 
	
		
			
				|  |  | -			musicGroupQuit.setMusicGroupId(musicGroupId);
 | 
	
		
			
				|  |  | -			musicGroupQuit.setUserId(sysUser.getId());
 | 
	
		
			
				|  |  | -			musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
 | 
	
		
			
				|  |  | -			musicGroupQuit.setReason(reason);
 | 
	
		
			
				|  |  | -			musicGroupQuit.setQuitDate(date);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -			musicGroupQuitDao.insert(musicGroupQuit);
 | 
	
		
			
				|  |  | -		}
 | 
	
		
			
				|  |  | +        if (musicGroupQuit != null && musicGroupQuit.getStatus() == ApprovalStatus.PROCESSING) {
 | 
	
		
			
				|  |  | +            musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
 | 
	
		
			
				|  |  | +            musicGroupQuit.setReason(reason);
 | 
	
		
			
				|  |  | +            musicGroupQuit.setQuitDate(date);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            musicGroupQuitDao.update(musicGroupQuit);
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            musicGroupQuit = new MusicGroupQuit();
 | 
	
		
			
				|  |  | +            musicGroupQuit.setCreateTime(date);
 | 
	
		
			
				|  |  | +            musicGroupQuit.setJoinDate(studentRegistration.getCreateTime());
 | 
	
		
			
				|  |  | +            musicGroupQuit.setMusicGroupId(musicGroupId);
 | 
	
		
			
				|  |  | +            musicGroupQuit.setUserId(sysUser.getId());
 | 
	
		
			
				|  |  | +            musicGroupQuit.setStatus(ApprovalStatus.APPROVED);
 | 
	
		
			
				|  |  | +            musicGroupQuit.setReason(reason);
 | 
	
		
			
				|  |  | +            musicGroupQuit.setQuitDate(date);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            musicGroupQuitDao.insert(musicGroupQuit);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          List<Integer> classGroupIdList = classGroupStudentMapperDao.queryClassGroupIdList(musicGroupId, userId, GroupType.MUSIC);
 | 
	
		
			
				|  |  |          for (Integer classGroupId : classGroupIdList) {
 | 
	
	
		
			
				|  | @@ -2015,7 +1992,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |              musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if(MusicGroupStatusEnum.PROGRESS.equals(musicGroup.getStatus())){
 | 
	
		
			
				|  |  | +        if (MusicGroupStatusEnum.PROGRESS.equals(musicGroup.getStatus())) {
 | 
	
		
			
				|  |  |              //统计变更学员数
 | 
	
		
			
				|  |  |              groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -2068,6 +2045,17 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        //退乐保费用
 | 
	
		
			
				|  |  | +        if (maintenanceFee != null) {
 | 
	
		
			
				|  |  | +            if (maintenanceFee.compareTo(BigDecimal.ZERO) > 0) {
 | 
	
		
			
				|  |  | +                int maintenanceNum = studentInstrumentDao.getStudentMaintenanceNum(userId);
 | 
	
		
			
				|  |  | +                if (maintenanceNum <= 0) {
 | 
	
		
			
				|  |  | +                    throw new BizException("学生没有有效期内的乐保,不能退乐保费用");
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            amount = amount.add(maintenanceFee);
 | 
	
		
			
				|  |  | +            studentInstrumentDao.quitMaintenance(userId);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          if (amount.doubleValue() > 0) {
 | 
	
		
			
				|  |  |              // 增加交易流水
 | 
	
	
		
			
				|  | @@ -2395,27 +2383,27 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          List<Integer> roles = employeeDao.queryUserRole(sysUser.getId());
 | 
	
		
			
				|  |  |          PageInfo<MusicGroup> musicGroupPageInfo;
 | 
	
		
			
				|  |  |          //待创建缴费项目提醒
 | 
	
		
			
				|  |  | -        if("WAIT_CREATE_PAYMENT_CALENDER".equals(queryInfo.getSearchType())){
 | 
	
		
			
				|  |  | +        if ("WAIT_CREATE_PAYMENT_CALENDER".equals(queryInfo.getSearchType())) {
 | 
	
		
			
				|  |  |              Integer educationUserId = null;
 | 
	
		
			
				|  |  |              if (!sysUser.getIsSuperAdmin() && roles.size() == 1 && roles.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
 | 
	
		
			
				|  |  |                  educationUserId = sysUser.getId();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              //获取关联的乐团列表
 | 
	
		
			
				|  |  | -            List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId,queryInfo.getOrganId());
 | 
	
		
			
				|  |  | +            List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(educationUserId, queryInfo.getOrganId());
 | 
	
		
			
				|  |  |              String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
 | 
	
		
			
				|  |  |              Date date = new Date();
 | 
	
		
			
				|  |  |              String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
 | 
	
		
			
				|  |  | -            if(musicGroupIds.size() > 0){
 | 
	
		
			
				|  |  | -                List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format,musicGroupIds);
 | 
	
		
			
				|  |  | -                if(calenderIds.size() > 0){
 | 
	
		
			
				|  |  | +            if (musicGroupIds.size() > 0) {
 | 
	
		
			
				|  |  | +                List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format, musicGroupIds);
 | 
	
		
			
				|  |  | +                if (calenderIds.size() > 0) {
 | 
	
		
			
				|  |  |                      List<String> queryMusicGroupIds = musicGroupPaymentCalenderDao.queryMusicGroupIds(calenderIds);
 | 
	
		
			
				|  |  | -                    if(queryInfo.getMusicGroupIds() != null){
 | 
	
		
			
				|  |  | +                    if (queryInfo.getMusicGroupIds() != null) {
 | 
	
		
			
				|  |  |                          queryMusicGroupIds.addAll(queryInfo.getMusicGroupIds());
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      queryInfo.setMusicGroupIds(queryMusicGroupIds);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            if(queryInfo.getMusicGroupIds() == null || queryInfo.getMusicGroupIds().size() == 0){
 | 
	
		
			
				|  |  | +            if (queryInfo.getMusicGroupIds() == null || queryInfo.getMusicGroupIds().size() == 0) {
 | 
	
		
			
				|  |  |                  return new PageInfo<MusicGroup>();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -2462,7 +2450,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          Map<Integer, String> cooperationOrganNames = MapUtil.convertMybatisMap(cooperationOrganDao.queryNameByIds(StringUtils.join(musicGroupList.stream().map(MusicGroup::getCooperationOrganId).collect(Collectors.toSet()), ",")));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          Set<Integer> organIds = musicGroupList.stream().map(e -> e.getOrganId()).collect(Collectors.toSet());
 | 
	
		
			
				|  |  | -        Map<Integer,String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(StringUtils.join(organIds,",")));
 | 
	
		
			
				|  |  | +        Map<Integer, String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(StringUtils.join(organIds, ",")));
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          List<MusicGroupPurchaseList> musicGroupPurchaseListCount = musicGroupPurchaseListDao.getCount(musicGroupIds);
 | 
	
		
			
				|  |  |          Map<String, Integer> purchaseListMap = musicGroupPurchaseListCount.stream().collect(Collectors.toMap(MusicGroupPurchaseList::getMusicGroupId, MusicGroupPurchaseList::getPurchaseNum));
 | 
	
	
		
			
				|  | @@ -2478,8 +2466,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |              e.setPayNum(payNumMap.get(e.getId()) == null ? 0 : payNumMap.get(e.getId()));
 | 
	
		
			
				|  |  |              e.setChargeTypeName(chargeTypeNameMap.get(e.getChargeTypeId()));
 | 
	
		
			
				|  |  |              e.setHasVerifyMusicalList(purchaseListMap.get(e.getId()) != null);
 | 
	
		
			
				|  |  | -            if(e.getStatus().equals(MusicGroupStatusEnum.PREPARE) || e.getStatus().equals(MusicGroupStatusEnum.PROGRESS)){
 | 
	
		
			
				|  |  | -                if(viewRegButtonMap.containsKey(e.getId())){
 | 
	
		
			
				|  |  | +            if (e.getStatus().equals(MusicGroupStatusEnum.PREPARE) || e.getStatus().equals(MusicGroupStatusEnum.PROGRESS)) {
 | 
	
		
			
				|  |  | +                if (viewRegButtonMap.containsKey(e.getId())) {
 | 
	
		
			
				|  |  |                      e.setIsRemedy(true);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -2751,7 +2739,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |          Integer cooperationMusicGroupNum = musicGroupDao.getCooperationMusicGroupNum(musicGroup.getCooperationOrganId(), musicGroupId);
 | 
	
		
			
				|  |  |          Integer paymentStudentNum = studentRegistrationDao.getPaymentStudentNum(musicGroupId);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if((cooperationMusicGroupNum <= 0 && paymentStudentNum < 98) || (cooperationMusicGroupNum > 0 && paymentStudentNum < 58)){
 | 
	
		
			
				|  |  | +        if ((cooperationMusicGroupNum <= 0 && paymentStudentNum < 98) || (cooperationMusicGroupNum > 0 && paymentStudentNum < 58)) {
 | 
	
		
			
				|  |  |              checkStudentVisit(musicGroupId);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -2784,9 +2772,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 校验回访
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  |       * @param musicGroupId
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  | -    private void checkStudentVisit(String musicGroupId){
 | 
	
		
			
				|  |  | +    private void checkStudentVisit(String musicGroupId) {
 | 
	
		
			
				|  |  |          boolean hasNoVisit = false;
 | 
	
		
			
				|  |  |          StringBuilder tipsMsg = new StringBuilder();
 | 
	
		
			
				|  |  |          List<StudentRegistration> noPaymentStudents = studentRegistrationDao.getNoPaymentStudent(musicGroupId);
 |