|
@@ -6,6 +6,7 @@ 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.constant.CommonConstants;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
@@ -18,6 +19,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
@@ -69,6 +71,13 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
|
|
|
Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = indexBaseDatas.stream().collect(Collectors.groupingBy(IndexBaseMonthData::getDataType));
|
|
|
for (Map.Entry<IndexDataType, List<IndexBaseMonthData>> typeDateMapEntry : typeDateMap.entrySet()) {
|
|
|
+ if(IndexDataType.ACTIVATION_RATE.equals(typeDateMapEntry.getKey())||IndexDataType.HOMEWORK_CREATE_RATE.equals(typeDateMapEntry.getKey())
|
|
|
+ ||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()) {
|
|
|
+ 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));
|
|
|
+ }
|
|
|
+ }
|
|
|
IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
|
|
|
indexBaseData.setIndexMonthData(typeDateMapEntry.getValue());
|
|
|
result.add(indexBaseData);
|
|
@@ -96,7 +105,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
//运营数据
|
|
|
saveData(indexBaseMonthDataDao.getSchoolData(), startMonth, IndexDataType.SCHOOL);
|
|
|
saveData(indexBaseMonthDataDao.getMusicData(), startMonth, IndexDataType.MUSIC_GROUP_NUM);
|
|
|
- saveData(indexBaseMonthDataDao.getMusicStudentData(), startMonth, IndexDataType.MUSIC_GROUP_STUDENT);
|
|
|
+ saveData(indexBaseMonthDataDao.getMusicStudentData(null), startMonth, IndexDataType.MUSIC_GROUP_STUDENT);
|
|
|
saveData(indexBaseMonthDataDao.getOtherStudentData(), startMonth, IndexDataType.OTHER_STUDENT);
|
|
|
|
|
|
//业务数据
|
|
@@ -119,9 +128,9 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
saveData(indexBaseMonthDataDao.getTeacherData(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.getMusicStudentData("ALL"), startMonth, IndexDataType.NEWLY_STUDENT_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getMusicStudentData("QUIT"), startMonth, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
|
|
|
+ saveData(indexBaseMonthDataDao.getStudentConversionData(), startMonth, IndexDataType.STUDENT_CONVERSION);
|
|
|
|
|
|
//课程数据
|
|
|
saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.MUSIC), startMonth, IndexDataType.MUSIC_GROUP_COURSE);
|