|
@@ -3,7 +3,9 @@ package com.ym.mec.biz.service.impl;
|
|
|
import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
|
import com.ym.mec.biz.dal.dto.IndexBaseDto;
|
|
|
import com.ym.mec.biz.dal.entity.Organization;
|
|
|
+import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.IndexDataType;
|
|
|
+import com.ym.mec.biz.dal.enums.JobNatureEnum;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
@@ -82,27 +84,48 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM");
|
|
|
LocalDate nowDate = LocalDate.now();
|
|
|
- LocalDate startDate = nowDate.withMonth(1).withDayOfMonth(1);
|
|
|
- LocalDate endDate = nowDate.withDayOfMonth(1);
|
|
|
- if(StringUtils.isNotBlank(startMonth)){
|
|
|
- startDate = LocalDate.parse(startMonth+"-01", DateUtil.dateFormatter);
|
|
|
- }
|
|
|
-
|
|
|
- if(StringUtils.isNotBlank(endMonth)){
|
|
|
- endDate = LocalDate.parse(endMonth+"-01", DateUtil.dateFormatter);
|
|
|
- }
|
|
|
|
|
|
List<Organization> allOrgans = organizationDao.findAllOrgans();
|
|
|
Set<Integer> organIds = allOrgans.stream().map(Organization::getId).collect(Collectors.toSet());
|
|
|
this.organIds.get().clear();
|
|
|
this.organIds.get().addAll(organIds);
|
|
|
|
|
|
- while (startDate.compareTo(endDate)<=0){
|
|
|
- countUserSignUpData(df.format(startDate));
|
|
|
- countHomeworkData(startMonth);
|
|
|
-
|
|
|
- startDate = startDate.plusMonths(1);
|
|
|
- }
|
|
|
+ startMonth = df.format(nowDate);
|
|
|
+
|
|
|
+ //运营数据
|
|
|
+ saveData(indexBaseMonthDataDao.getSchoolData(startMonth), startMonth, IndexDataType.SCHOOL);
|
|
|
+ saveData(indexBaseMonthDataDao.getMusicData(startMonth), startMonth, IndexDataType.MUSIC_GROUP_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getMusicStudentData(startMonth), startMonth, IndexDataType.MUSIC_GROUP_STUDENT);
|
|
|
+ saveData(null, startMonth, IndexDataType.OTHER_STUDENT);
|
|
|
+
|
|
|
+ //业务数据
|
|
|
+ saveData(indexBaseMonthDataDao.getStudentSignUpData(startMonth), startMonth, IndexDataType.ACTIVATION_RATE);
|
|
|
+ saveData(indexBaseMonthDataDao.getHomeworkData(startMonth, null), startMonth, IndexDataType.HOMEWORK_CREATE_RATE);
|
|
|
+ saveData(indexBaseMonthDataDao.getHomeworkData(startMonth, "submit"), startMonth, IndexDataType.HOMEWORK_SUBMIT_RATE);
|
|
|
+ saveData(indexBaseMonthDataDao.getHomeworkData(startMonth, "comment"), startMonth, IndexDataType.HOMEWORK_COMMENT_RATE);
|
|
|
+
|
|
|
+ //经营数据
|
|
|
+ saveData(null, startMonth, IndexDataType.SHOULD_INCOME_MONEY);
|
|
|
+ saveData(null, startMonth, IndexDataType.ANTICIPATED_INCOME_MONEY);
|
|
|
+ saveData(null, startMonth, IndexDataType.SHOULD_EXPEND_MONEY);
|
|
|
+ saveData(null, startMonth, IndexDataType.ANTICIPATED_EXPEND_MONEY);
|
|
|
+ saveData(null, startMonth, IndexDataType.REVENUE_MONEY);
|
|
|
+
|
|
|
+ //人事数据
|
|
|
+ saveData(indexBaseMonthDataDao.getTeacherData(startMonth, null, null), startMonth, IndexDataType.TEACHER_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getTeacherData(startMonth, JobNatureEnum.FULL_TIME, null), startMonth, IndexDataType.FULL_TIME_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getTeacherData(startMonth, JobNatureEnum.PART_TIME, null), startMonth, IndexDataType.PART_TIME_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getTeacherData(startMonth, null, true), startMonth, IndexDataType.DIMISSION_NUM);
|
|
|
+
|
|
|
+ //学员变动
|
|
|
+ saveData(null, startMonth, IndexDataType.NEWLY_STUDENT_NUM);
|
|
|
+ saveData(null, startMonth, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
|
|
|
+ saveData(null, startMonth, IndexDataType.STUDENT_CONVERSION);
|
|
|
+
|
|
|
+ //课程数据
|
|
|
+ saveData(indexBaseMonthDataDao.getGroupCourseData(startMonth, GroupType.MUSIC), startMonth, IndexDataType.MUSIC_GROUP_COURSE);
|
|
|
+ saveData(indexBaseMonthDataDao.getGroupCourseData(startMonth, GroupType.VIP), startMonth, IndexDataType.VIP_GROUP_COURSE);
|
|
|
+ saveData(indexBaseMonthDataDao.getGroupCourseData(startMonth, GroupType.PRACTICE), startMonth, IndexDataType.PRACTICE_GROUP_COURSE);
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -129,45 +152,4 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
indexBaseMonthDataDao.deleteWithMonthAndType(Arrays.asList(startMonth), indexDataType);
|
|
|
indexBaseMonthDataDao.batchInsertWithDataType(dataList, indexDataType);
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * @describe 激活率
|
|
|
- * @author Joburgess
|
|
|
- * @date 2021/1/11 0011
|
|
|
- * @param startMonth:
|
|
|
- * @return void
|
|
|
- */
|
|
|
- private void countUserSignUpData(String startMonth){
|
|
|
- List<IndexBaseMonthData> dataList = indexBaseMonthDataDao.getStudentSignUpData(startMonth);
|
|
|
- saveData(dataList, startMonth, IndexDataType.ACTIVATION_RATE);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @describe 作业数据
|
|
|
- * @author Joburgess
|
|
|
- * @date 2021/1/11 0011
|
|
|
- * @param startMonth:
|
|
|
- * @return void
|
|
|
- */
|
|
|
- private void countHomeworkData(String startMonth){
|
|
|
- List<IndexBaseMonthData> dataList = indexBaseMonthDataDao.getHomeworkDate(startMonth, null);
|
|
|
- saveData(dataList, startMonth, IndexDataType.HOMEWORK_CREATE_RATE);
|
|
|
-
|
|
|
- List<IndexBaseMonthData> dataList1 = indexBaseMonthDataDao.getHomeworkDate(startMonth, "submit");
|
|
|
- saveData(dataList1, startMonth, IndexDataType.HOMEWORK_SUBMIT_RATE);
|
|
|
-
|
|
|
- List<IndexBaseMonthData> dataList2 = indexBaseMonthDataDao.getHomeworkDate(startMonth, "comment");
|
|
|
- saveData(dataList2, startMonth, IndexDataType.HOMEWORK_COMMENT_RATE);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @describe 统计合作单位数据
|
|
|
- * @author Joburgess
|
|
|
- * @date 2021/1/11 0011
|
|
|
- * @param startMonth:
|
|
|
- * @return void
|
|
|
- */
|
|
|
- private void countSchoolData(String startMonth){
|
|
|
-
|
|
|
- }
|
|
|
}
|