|
@@ -20,9 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.text.DateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
-import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -96,6 +94,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
||IndexDataType.HOMEWORK_SUBMIT_RATE.equals(typeDateMapEntry.getKey())||IndexDataType.HOMEWORK_SUBMIT_RATE.equals(typeDateMapEntry.getKey())
|
|
|
||IndexDataType.STUDENT_CONVERSION.equals(typeDateMapEntry.getKey())){
|
|
|
for (IndexBaseMonthData indexBaseMonthData : typeDateMapEntry.getValue()) {
|
|
|
+ if(indexBaseMonthData.getTotalNum().compareTo(BigDecimal.ZERO)==0){
|
|
|
+ indexBaseMonthData.setPercent(BigDecimal.ZERO);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
indexBaseMonthData.setPercent(indexBaseMonthData.getActivateNum().divide(indexBaseMonthData.getTotalNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
|
|
|
}
|
|
|
}
|
|
@@ -121,19 +123,21 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
this.organIds.get().addAll(allOrgans.stream().map(Organization::getId).collect(Collectors.toSet()));
|
|
|
}
|
|
|
|
|
|
- month = df.format(nowDate);
|
|
|
+ if(StringUtils.isBlank(month)){
|
|
|
+ month = df.format(nowDate);
|
|
|
+ }
|
|
|
|
|
|
//运营数据
|
|
|
saveData(indexBaseMonthDataDao.getSchoolData(month), month, IndexDataType.SCHOOL);
|
|
|
- saveData(indexBaseMonthDataDao.getMusicData(), month, IndexDataType.MUSIC_GROUP_NUM);
|
|
|
- saveData(indexBaseMonthDataDao.getMusicStudentData(null), month, IndexDataType.MUSIC_GROUP_STUDENT);
|
|
|
- saveData(indexBaseMonthDataDao.getOtherStudentData(), month, IndexDataType.OTHER_STUDENT);
|
|
|
+ saveData(indexBaseMonthDataDao.getMusicData(month), month, IndexDataType.MUSIC_GROUP_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getMusicStudentData(month, null), month, IndexDataType.MUSIC_GROUP_STUDENT);
|
|
|
+ saveData(indexBaseMonthDataDao.getOtherStudentData(month), month, IndexDataType.OTHER_STUDENT);
|
|
|
|
|
|
//业务数据
|
|
|
- saveData(indexBaseMonthDataDao.getStudentSignUpData(), month, IndexDataType.ACTIVATION_RATE);
|
|
|
- saveData(indexBaseMonthDataDao.getHomeworkData(null), month, IndexDataType.HOMEWORK_CREATE_RATE);
|
|
|
- saveData(indexBaseMonthDataDao.getHomeworkData("submit"), month, IndexDataType.HOMEWORK_SUBMIT_RATE);
|
|
|
- saveData(indexBaseMonthDataDao.getHomeworkData("comment"), month, IndexDataType.HOMEWORK_COMMENT_RATE);
|
|
|
+ saveData(indexBaseMonthDataDao.getStudentSignUpData(month), month, IndexDataType.ACTIVATION_RATE);
|
|
|
+ saveData(indexBaseMonthDataDao.getHomeworkData(month, null), month, IndexDataType.HOMEWORK_CREATE_RATE);
|
|
|
+ saveData(indexBaseMonthDataDao.getHomeworkData(month, "submit"), month, IndexDataType.HOMEWORK_SUBMIT_RATE);
|
|
|
+ saveData(indexBaseMonthDataDao.getHomeworkData(month, "comment"), month, IndexDataType.HOMEWORK_COMMENT_RATE);
|
|
|
|
|
|
//经营数据
|
|
|
saveData(null, month, IndexDataType.SHOULD_INCOME_MONEY);
|
|
@@ -143,20 +147,20 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
saveData(null, month, IndexDataType.REVENUE_MONEY);
|
|
|
|
|
|
//人事数据
|
|
|
- saveData(indexBaseMonthDataDao.getTeacherData(null, null), month, IndexDataType.TEACHER_NUM);
|
|
|
- saveData(indexBaseMonthDataDao.getTeacherData(JobNatureEnum.FULL_TIME, null), month, IndexDataType.FULL_TIME_NUM);
|
|
|
- saveData(indexBaseMonthDataDao.getTeacherData(JobNatureEnum.PART_TIME, null), month, IndexDataType.PART_TIME_NUM);
|
|
|
- saveData(indexBaseMonthDataDao.getTeacherData(null, true), month, IndexDataType.DIMISSION_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getTeacherData(month, null, null), month, IndexDataType.TEACHER_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getTeacherData(month, JobNatureEnum.FULL_TIME, null), month, IndexDataType.FULL_TIME_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getTeacherData(month, JobNatureEnum.PART_TIME, null), month, IndexDataType.PART_TIME_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getTeacherData(month, null, true), month, IndexDataType.DIMISSION_NUM);
|
|
|
|
|
|
//学员变动
|
|
|
- saveData(indexBaseMonthDataDao.getMusicStudentData("ALL"), month, IndexDataType.NEWLY_STUDENT_NUM);
|
|
|
- saveData(indexBaseMonthDataDao.getMusicStudentData("QUIT"), month, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
|
|
|
- saveData(indexBaseMonthDataDao.getStudentConversionData(), month, IndexDataType.STUDENT_CONVERSION);
|
|
|
+ saveData(indexBaseMonthDataDao.getMusicStudentData(month, "ALL"), month, IndexDataType.NEWLY_STUDENT_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getMusicStudentData(month, "QUIT"), month, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getStudentConversionData(month), month, IndexDataType.STUDENT_CONVERSION);
|
|
|
|
|
|
//课程数据
|
|
|
- saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.MUSIC), month, IndexDataType.MUSIC_GROUP_COURSE);
|
|
|
- saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.VIP), month, IndexDataType.VIP_GROUP_COURSE);
|
|
|
- saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.PRACTICE), month, IndexDataType.PRACTICE_GROUP_COURSE);
|
|
|
+ saveData(indexBaseMonthDataDao.getGroupCourseData(month, GroupType.MUSIC), month, IndexDataType.MUSIC_GROUP_COURSE);
|
|
|
+ saveData(indexBaseMonthDataDao.getGroupCourseData(month, GroupType.VIP), month, IndexDataType.VIP_GROUP_COURSE);
|
|
|
+ saveData(indexBaseMonthDataDao.getGroupCourseData(month, GroupType.PRACTICE), month, IndexDataType.PRACTICE_GROUP_COURSE);
|
|
|
|
|
|
return result;
|
|
|
}
|