|  | @@ -202,6 +202,18 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getGroupCourseData(dayStr, GroupType.MUSIC, CourseStatusEnum.NOT_START), dayStr, IndexDataType.SURPLUS_MUSIC_COURSE_NUM);
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getGroupCourseData(dayStr, GroupType.VIP, CourseStatusEnum.NOT_START), dayStr, IndexDataType.SURPLUS_VIP_COURSE_NUM);
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getGroupCourseData(dayStr, GroupType.PRACTICE, CourseStatusEnum.NOT_START), dayStr, IndexDataType.SURPLUS_PRACTICE_COURSE_NUM);
 | 
	
		
			
				|  |  | +		//学员变动
 | 
	
		
			
				|  |  | +		saveData(indexBaseMonthDataDao.getMusicStudentData(dayStr, "ADD"), dayStr, IndexDataType.NEWLY_STUDENT_NUM);
 | 
	
		
			
				|  |  | +		saveData(indexBaseMonthDataDao.getMusicStudentData(dayStr, "QUIT"), dayStr, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
 | 
	
		
			
				|  |  | +		saveData(indexBaseMonthDataDao.getMusicGroupPreRegistrationStudentData(dayStr), dayStr, IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM);
 | 
	
		
			
				|  |  | +		saveData(indexBaseMonthDataDao.getMusicGroupStudentFromPreData(dayStr, null), dayStr, IndexDataType.STUDENT_CONVERSION_STUDENT_NUM);
 | 
	
		
			
				|  |  | +		saveData(indexBaseMonthDataDao.getMusicGroupStudentFromPreData(dayStr, PaymentStatusEnum.YES), dayStr, IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM);
 | 
	
		
			
				|  |  | +		List<Integer> studentIds = indexBaseMonthDataDao.getMusicGroupStudentIdFromPre(dayStr, PaymentStatusEnum.YES);
 | 
	
		
			
				|  |  | +		List<IndexBaseMonthData> convertStudentNum = new ArrayList<>();
 | 
	
		
			
				|  |  | +		if(!CollectionUtils.isEmpty(studentIds)){
 | 
	
		
			
				|  |  | +			convertStudentNum = indexBaseMonthDataDao.getStudentConversionData(dayStr, studentIds);
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		saveData(convertStudentNum, dayStr, IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		//已消耗课时
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getGroupSurplusCourseData(dayStr, null, CourseStatusEnum.OVER), dayStr, IndexDataType.OVER_COURSE_NUM);
 | 
	
	
		
			
				|  | @@ -219,11 +231,102 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getHomeworkData(dayStr, "submit"), monday.toString(), IndexDataType.HOMEWORK_SUBMIT_RATE);
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getHomeworkData(dayStr, "comment"), monday.toString(), IndexDataType.HOMEWORK_COMMENT_RATE);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +	private void countStudentConvertData(List<IndexBaseDto> result, Date currentMonth){
 | 
	
		
			
				|  |  | +		List<IndexBaseMonthData> convertData = new ArrayList<>();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		Map<IndexDataType, IndexBaseDto> typeDataMap = result.stream().collect(Collectors.toMap(IndexBaseDto::getDataType, i -> i, (i1, i2) -> i1));
 | 
	
		
			
				|  |  | +		List<IndexBaseMonthData> preStudentNum = new ArrayList<>();
 | 
	
		
			
				|  |  | +		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM)){
 | 
	
		
			
				|  |  | +			preStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM).getIndexMonthData();
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  |  		//课程数据
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getGroupCourseDataWithGroup(dayStr, GroupType.MUSIC, null), dayStr, IndexDataType.MUSIC_GROUP_COURSE);
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getGroupCourseDataWithGroup(dayStr, GroupType.VIP, null), dayStr, IndexDataType.VIP_GROUP_COURSE);
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getGroupCourseDataWithGroup(dayStr, GroupType.PRACTICE, null), dayStr, IndexDataType.PRACTICE_GROUP_COURSE);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +		IndexBaseMonthData preStudentNumData = new IndexBaseMonthData();
 | 
	
		
			
				|  |  | +		preStudentNumData = preStudentNum.stream().max(Comparator.comparing(IndexBaseMonthData::getMonth)).get();
 | 
	
		
			
				|  |  | +//		preStudentNumData.setMonth(currentMonth);
 | 
	
		
			
				|  |  | +		preStudentNumData.setDataType(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM);
 | 
	
		
			
				|  |  | +		preStudentNumData.setTitle(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM.getMsg());
 | 
	
		
			
				|  |  | +//		preStudentNumData.setTotalNum(preStudentNum.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 | 
	
		
			
				|  |  | +//		preStudentNumData.setActivateNum(preStudentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 | 
	
		
			
				|  |  | +//		preStudentNumData.setPercent(preStudentNumData.getActivateNum());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		List<IndexBaseMonthData> studentNum = new ArrayList<>();
 | 
	
		
			
				|  |  | +		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM)){
 | 
	
		
			
				|  |  | +			studentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM).getIndexMonthData();
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		IndexBaseMonthData studentNumData = new IndexBaseMonthData();
 | 
	
		
			
				|  |  | +		studentNumData = studentNum.stream().max(Comparator.comparing(IndexBaseMonthData::getMonth)).get();
 | 
	
		
			
				|  |  | +//		studentNumData.setMonth(currentMonth);
 | 
	
		
			
				|  |  | +		studentNumData.setDataType(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM);
 | 
	
		
			
				|  |  | +		studentNumData.setTitle(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM.getMsg());
 | 
	
		
			
				|  |  | +//		studentNumData.setTotalNum(studentNum.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 | 
	
		
			
				|  |  | +//		studentNumData.setActivateNum(studentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		List<IndexBaseMonthData> paymentStudentNum = new ArrayList<>();
 | 
	
		
			
				|  |  | +		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM)){
 | 
	
		
			
				|  |  | +			paymentStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM).getIndexMonthData();
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		IndexBaseMonthData paymentStudentNumData = new IndexBaseMonthData();
 | 
	
		
			
				|  |  | +		paymentStudentNumData = paymentStudentNum.stream().max(Comparator.comparing(IndexBaseMonthData::getMonth)).get();
 | 
	
		
			
				|  |  | +//		paymentStudentNumData.setMonth(currentMonth);
 | 
	
		
			
				|  |  | +		paymentStudentNumData.setDataType(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM);
 | 
	
		
			
				|  |  | +		paymentStudentNumData.setTitle(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM.getMsg());
 | 
	
		
			
				|  |  | +//		paymentStudentNumData.setTotalNum(paymentStudentNum.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 | 
	
		
			
				|  |  | +//		paymentStudentNumData.setActivateNum(paymentStudentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		List<IndexBaseMonthData> convertStudentNum = new ArrayList<>();
 | 
	
		
			
				|  |  | +		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM)){
 | 
	
		
			
				|  |  | +			convertStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM).getIndexMonthData();
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		IndexBaseMonthData convertStudentNumData = new IndexBaseMonthData();
 | 
	
		
			
				|  |  | +		convertStudentNumData = convertStudentNum.stream().max(Comparator.comparing(IndexBaseMonthData::getMonth)).get();
 | 
	
		
			
				|  |  | +//		convertStudentNumData.setMonth(currentMonth);
 | 
	
		
			
				|  |  | +		convertStudentNumData.setDataType(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM);
 | 
	
		
			
				|  |  | +		convertStudentNumData.setTitle(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM.getMsg());
 | 
	
		
			
				|  |  | +//		convertStudentNumData.setTotalNum(convertStudentNum.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 | 
	
		
			
				|  |  | +//		convertStudentNumData.setActivateNum(convertStudentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if(true){
 | 
	
		
			
				|  |  | +			studentNumData.setPercent(studentNumData.getActivateNum());
 | 
	
		
			
				|  |  | +			paymentStudentNumData.setPercent(paymentStudentNumData.getActivateNum());
 | 
	
		
			
				|  |  | +			convertStudentNumData.setPercent(convertStudentNumData.getActivateNum());
 | 
	
		
			
				|  |  | +		}else if(preStudentNumData.getActivateNum().compareTo(BigDecimal.ZERO)==0){
 | 
	
		
			
				|  |  | +			studentNumData.setPercent(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | +			paymentStudentNumData.setPercent(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | +			convertStudentNumData.setPercent(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | +		}else{
 | 
	
		
			
				|  |  | +			studentNumData.setPercent(studentNumData.getActivateNum().divide(preStudentNumData.getActivateNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
 | 
	
		
			
				|  |  | +			if(studentNumData.getActivateNum().compareTo(BigDecimal.ZERO)==0){
 | 
	
		
			
				|  |  | +				paymentStudentNumData.setPercent(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | +				convertStudentNumData.setPercent(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | +			}else{
 | 
	
		
			
				|  |  | +				paymentStudentNumData.setPercent(paymentStudentNumData.getActivateNum().divide(studentNumData.getActivateNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
 | 
	
		
			
				|  |  | +				if(paymentStudentNumData.getActivateNum().compareTo(BigDecimal.ZERO)==0){
 | 
	
		
			
				|  |  | +					convertStudentNumData.setPercent(BigDecimal.ZERO);
 | 
	
		
			
				|  |  | +				}else{
 | 
	
		
			
				|  |  | +					convertStudentNumData.setPercent(convertStudentNumData.getActivateNum().divide(paymentStudentNumData.getActivateNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		convertData.add(preStudentNumData);
 | 
	
		
			
				|  |  | +		convertData.add(studentNumData);
 | 
	
		
			
				|  |  | +		convertData.add(paymentStudentNumData);
 | 
	
		
			
				|  |  | +		convertData.add(convertStudentNumData);
 | 
	
		
			
				|  |  | +		IndexBaseDto indexBaseData = new IndexBaseDto(IndexDataType.STUDENT_CONVERSION, IndexDataType.STUDENT_CONVERSION.getMsg());
 | 
	
		
			
				|  |  | +		indexBaseData.setIndexMonthData(convertData, currentMonth);
 | 
	
		
			
				|  |  | +		if(paymentStudentNumData.getActivateNum().compareTo(BigDecimal.ZERO)==0){
 | 
	
		
			
				|  |  | +			indexBaseData.setPercent(convertStudentNumData.getPercent());
 | 
	
		
			
				|  |  | +		}else{
 | 
	
		
			
				|  |  | +			indexBaseData.setPercent(convertStudentNumData.getActivateNum().divide(paymentStudentNumData.getActivateNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		result.add(indexBaseData);
 | 
	
		
			
				|  |  |  		//学员变动
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getAddStudentRegistrationData(dayStr), dayStr, IndexDataType.ADD_STUDENT_REGISTRATION_NUM);
 | 
	
		
			
				|  |  |  		saveData(indexBaseMonthDataDao.getMusicStudentData(dayStr, null), dayStr, IndexDataType.MUSIC_GROUP_STUDENT);
 | 
	
	
		
			
				|  | @@ -445,9 +548,33 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 | 
	
		
			
				|  |  |  				flag2 = true;
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | +		/*if(!flag2){
 | 
	
		
			
				|  |  | +			int attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),startTime);
 | 
	
		
			
				|  |  | +			if(attendanceInfo > 0){
 | 
	
		
			
				|  |  | +				flag2 = true;
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		if(!flag2){
 | 
	
		
			
				|  |  | +			int attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode(),startTime);
 | 
	
		
			
				|  |  | +			if(attendanceInfo1 > 0){
 | 
	
		
			
				|  |  | +				flag2 = true;
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}*/
 | 
	
		
			
				|  |  |  		resultMap.put("studentInfo",flag2);
 | 
	
		
			
				|  |  |  		boolean flag3 = false;
 | 
	
		
			
				|  |  |  		if(!flag3){
 | 
	
		
			
				|  |  | +			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIdsStr,startTime);
 | 
	
		
			
				|  |  | +			if(attendanceError > 0){
 | 
	
		
			
				|  |  | +				flag3 = true;
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		if(!flag3){
 | 
	
		
			
				|  |  | +			int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIdsStr,startTime);
 | 
	
		
			
				|  |  | +			if(noAttendance > 0){
 | 
	
		
			
				|  |  | +				flag3 = true;
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		if(!flag3){
 | 
	
		
			
				|  |  |  			int teacherLeave = indexBaseMonthDataDao.queryTeacherLeave(organIdsStr,startTime);
 | 
	
		
			
				|  |  |  			if(teacherLeave > 0){
 | 
	
		
			
				|  |  |  				flag3 = true;
 |