|  | @@ -25,6 +25,8 @@ import java.util.Objects;
 | 
	
		
			
				|  |  |  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.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
	
		
			
				|  | @@ -36,31 +38,6 @@ import com.alibaba.fastjson.JSON;
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.ClassGroupDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.ClassGroupRelationDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CourseScheduleEvaluateDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.CoursesGroupDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.GroupDao;
 | 
	
		
			
				|  |  | -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.MusicGroupStudentFeeDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.PracticeGroupDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.SchoolDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.StudentApplyRefundsDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.StudentAttendanceDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.StudentDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.SubjectDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.SysConfigDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.TeacherDao;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.dao.VipGroupDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.ClassGroup4MixDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.ClassGroupImGroupDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.ClassGroupTeacherMapDto;
 | 
	
	
		
			
				|  | @@ -79,27 +56,7 @@ import com.ym.mec.biz.dal.dto.TeacherClassHeadInfo;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.TeacherMusicClassInfoDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.TeacherVipClassInfoDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.UserMusicGroupQueryInfo;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.ClassGroup;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.ClassGroupRelation;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.CourseSchedule;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.CoursesGroup;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.Group;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroup;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.PracticeGroup;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.StudentRegistration;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.Subject;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.SysConfig;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.Teacher;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary;
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.VipGroup;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 | 
	
	
		
			
				|  | @@ -3266,20 +3223,50 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public List<Map<String,Object>> studentClassAuditDetail(String musicGroupId) {
 | 
	
		
			
				|  |  | -        List<Map<String,Object>> result = new ArrayList<>();
 | 
	
		
			
				|  |  | -        //获取班级列表
 | 
	
		
			
				|  |  | -        List<ClassGroup> classGroups = classGroupDao.queryClassGroups(musicGroupId, null);
 | 
	
		
			
				|  |  | -        for (ClassGroup classGroup : classGroups) {
 | 
	
		
			
				|  |  | -            Map<String,Object> resultMap = new HashMap();
 | 
	
		
			
				|  |  | -            resultMap.put("classGroup",classGroup);
 | 
	
		
			
				|  |  | -            //获取班级剩余的课程类型和课程数量
 | 
	
		
			
				|  |  | -            List<Map<String,Integer>> courseTypeNumMap = courseScheduleDao.querySubCourseNumMap(classGroup.getId());
 | 
	
		
			
				|  |  | -            resultMap.put("courseTypeNumMap",courseTypeNumMap);
 | 
	
		
			
				|  |  | -            //获取班级里学员列表
 | 
	
		
			
				|  |  | -            resultMap.put("students",classGroupStudentMapperDao.findCourseStudentNameAndPhoneByClassGroupId(classGroup.getId()));
 | 
	
		
			
				|  |  | -            result.add(resultMap);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        return result;
 | 
	
		
			
				|  |  | +    public Map<String,Integer> classGroupSubCourseNum(Integer classGroupId) {
 | 
	
		
			
				|  |  | +        return MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +//        List<Map<String,Object>> result = new ArrayList<>();
 | 
	
		
			
				|  |  | +//        //获取班级列表
 | 
	
		
			
				|  |  | +//        List<ClassGroup> classGroups = classGroupDao.queryClassGroups(musicGroupId, null);
 | 
	
		
			
				|  |  | +//        for (ClassGroup classGroup : classGroups) {
 | 
	
		
			
				|  |  | +//            Map<String,Object> resultMap = new HashMap();
 | 
	
		
			
				|  |  | +//            resultMap.put("classGroup",classGroup);
 | 
	
		
			
				|  |  | +//            //获取班级剩余的课程类型和课程数量
 | 
	
		
			
				|  |  | +//            List<Map<String,Integer>> courseTypeNumMap = courseScheduleDao.querySubCourseNumMap(classGroup.getId());
 | 
	
		
			
				|  |  | +//            resultMap.put("courseTypeNumMap",courseTypeNumMap);
 | 
	
		
			
				|  |  | +//            //获取班级里学员列表
 | 
	
		
			
				|  |  | +//            resultMap.put("students",classGroupStudentMapperDao.findCourseStudentNameAndPhoneByClassGroupId(classGroup.getId()));
 | 
	
		
			
				|  |  | +//            result.add(resultMap);
 | 
	
		
			
				|  |  | +//        }
 | 
	
		
			
				|  |  | +//        return result;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public List<MusicGroupPaymentCalender> getDefaultPaymentCalender(List<Integer> classGroupIds) {
 | 
	
		
			
				|  |  | +        if(classGroupIds == null || classGroupIds.size() == 0){
 | 
	
		
			
				|  |  | +            throw new BizException("参数校验失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        //获取所选班级最大剩余课时
 | 
	
		
			
				|  |  | +        Map<String,Integer> map = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
 | 
	
		
			
				|  |  | +        //获取每个班级对应课程类型最后一节课
 | 
	
		
			
				|  |  | +        Set<String> courseTypes = map.keySet();
 | 
	
		
			
				|  |  | +        for (Integer classGroupId : classGroupIds) {
 | 
	
		
			
				|  |  | +            //获取当前班级剩余课次
 | 
	
		
			
				|  |  | +            Map<String,Integer> subCourseNumMap = MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
 | 
	
		
			
				|  |  | +            for (String courseType : courseTypes) {
 | 
	
		
			
				|  |  | +                Integer currentNum = subCourseNumMap.get(courseType);
 | 
	
		
			
				|  |  | +                Integer maxNum = map.get(courseType);
 | 
	
		
			
				|  |  | +                //如果当前课程类型不需要新增缴费项目
 | 
	
		
			
				|  |  | +                if(currentNum != null && currentNum >= maxNum){
 | 
	
		
			
				|  |  | +                    continue;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                MusicGroupOrganizationCourseSettingsDetail settingsDetail = musicGroupPaymentCalenderCourseSettingsService.getClassLastSetting(classGroupId,courseType);
 | 
	
		
			
				|  |  | +                settingsDetail.setCourseType(CourseScheduleType.valueOf(courseType));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        //获取最后一节课现价,原价
 | 
	
		
			
				|  |  | +        //生成缴费项目
 | 
	
		
			
				|  |  | +        return null;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  }
 |