|
@@ -501,17 +501,7 @@ public class HomeServiceImpl implements HomeService {
|
|
|
groupBy = "%Y";
|
|
|
dateList = DateUtil.getYearList(startDate,endDate);
|
|
|
}
|
|
|
- List<TeacherIndexWrapper.CourseExposureTotal> courseExposureTotals = exposureRecordService.getDao().courseExposureTotal(search, groupBy);
|
|
|
-// //按分类分组
|
|
|
-// Map<String,List<TeacherIndexWrapper.CourseExposureTotal>> typeMap = courseExposureTotals.stream()
|
|
|
-// .collect(Collectors.groupingBy(TeacherIndexWrapper.CourseExposureTotal::getType));
|
|
|
-// Map<String,List<TeacherIndexWrapper.CourseExposureTotal>> result = new HashMap<>();
|
|
|
-// result.put("EXPOSURE_VIP",exposureFillData(typeMap.get(GoodTypeEnum.VIP_COURSE.getCode()),dateList,new String[]{GoodTypeEnum.VIP_COURSE.getCode()}));
|
|
|
-// result.put("EXPOSURE_PRACTICE",exposureFillData(typeMap.get(GoodTypeEnum.PRACTICE.getCode()),dateList,new String[]{GoodTypeEnum.PRACTICE.getCode()}));
|
|
|
-// result.put("EXPOSURE_LIVE",exposureFillData(typeMap.get(GoodTypeEnum.LIVE.getCode()),dateList,new String[]{GoodTypeEnum.LIVE.getCode()}));
|
|
|
-// result.put("EXPOSURE_VIDEO",exposureFillData(typeMap.get(GoodTypeEnum.VIDEO.getCode()),dateList,new String[]{GoodTypeEnum.VIDEO.getCode()}));
|
|
|
-// result.put("EXPOSURE_MUSIC",exposureFillData(typeMap.get(GoodTypeEnum.MUSIC.getCode()),dateList,new String[]{GoodTypeEnum.MUSIC.getCode()}));
|
|
|
- return exposureFillData(courseExposureTotals,dateList);
|
|
|
+ return exposureFillData(exposureRecordService.getDao().courseExposureTotal(search, groupBy),dateList);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -533,40 +523,16 @@ public class HomeServiceImpl implements HomeService {
|
|
|
dateList = DateUtil.getYearList(startDate,endDate);
|
|
|
}
|
|
|
Map<String,List<TeacherIndexWrapper.CourseExposureTotal>> result = new HashMap<>();
|
|
|
- if(StringUtils.isEmpty(search.getType())){
|
|
|
- //直播课
|
|
|
- List<TeacherIndexWrapper.CourseExposureTotal> liveSummer = userOrderDetailService.getDao().liveBuyTotal(search,groupBy);
|
|
|
- result.put(GoodTypeEnum.LIVE.getCode(),exposureFillData(liveSummer,dateList));
|
|
|
- //视频课
|
|
|
- List<TeacherIndexWrapper.CourseExposureTotal> videoSummer = userOrderDetailService.getDao().videoBuyTotal(search,groupBy);
|
|
|
- result.put(GoodTypeEnum.VIDEO.getCode(),exposureFillData(videoSummer,dateList));
|
|
|
- //获取老师关联的学员
|
|
|
- List<Long> studentIds = teacherService.getDao().getStudentIds(search.getTeacherId(),null);
|
|
|
- if(CollectionUtils.isNotEmpty(studentIds)){
|
|
|
- //曲谱
|
|
|
- search.setStudentIds(studentIds);
|
|
|
- List<TeacherIndexWrapper.CourseExposureTotal> musicSheetSummer = userOrderDetailService.getDao().musicSheetBuyTotal(search,groupBy);
|
|
|
- result.put(GoodTypeEnum.MUSIC.getCode(),exposureFillData(musicSheetSummer,dateList));
|
|
|
- }
|
|
|
- }else {
|
|
|
- if(StringUtils.equals("LIVE",search.getType()) || StringUtils.equals("VIP_COURSE",search.getType()) || StringUtils.equals("PRACTICE",search.getType())){
|
|
|
- //直播课
|
|
|
- List<TeacherIndexWrapper.CourseExposureTotal> liveSummer = userOrderDetailService.getDao().liveBuyTotal(search,groupBy);
|
|
|
- result.put(GoodTypeEnum.LIVE.getCode(),exposureFillData(liveSummer,dateList));
|
|
|
- }else if (StringUtils.equals("VIDEO",search.getType())){
|
|
|
- //视频课
|
|
|
- List<TeacherIndexWrapper.CourseExposureTotal> videoSummer = userOrderDetailService.getDao().videoBuyTotal(search,groupBy);
|
|
|
- result.put(GoodTypeEnum.VIDEO.getCode(),exposureFillData(videoSummer,dateList));
|
|
|
- }else if (StringUtils.equals("MUSIC",search.getType())){
|
|
|
- //获取老师关联的学员
|
|
|
- List<Long> studentIds = teacherService.getDao().getStudentIds(search.getTeacherId(),null);
|
|
|
- if(CollectionUtils.isNotEmpty(studentIds)){
|
|
|
- //曲谱
|
|
|
- search.setStudentIds(studentIds);
|
|
|
- List<TeacherIndexWrapper.CourseExposureTotal> musicSheetSummer = userOrderDetailService.getDao().musicSheetBuyTotal(search,groupBy);
|
|
|
- result.put(GoodTypeEnum.MUSIC.getCode(),exposureFillData(musicSheetSummer,dateList));
|
|
|
- }
|
|
|
- }
|
|
|
+ //课程
|
|
|
+ List<TeacherIndexWrapper.CourseExposureTotal> liveSummer = userOrderDetailService.getDao().liveBuyTotal(search,groupBy);
|
|
|
+ result.put("COURSE",exposureFillData(liveSummer,dateList));
|
|
|
+ //获取老师关联的学员
|
|
|
+ List<Long> studentIds = teacherService.getDao().getStudentIds(search.getTeacherId(),null);
|
|
|
+ if(CollectionUtils.isNotEmpty(studentIds)){
|
|
|
+ //曲谱
|
|
|
+ search.setStudentIds(studentIds);
|
|
|
+ List<TeacherIndexWrapper.CourseExposureTotal> musicSheetSummer = userOrderDetailService.getDao().musicSheetBuyTotal(search,groupBy);
|
|
|
+ result.put(GoodTypeEnum.MUSIC.getCode(),exposureFillData(musicSheetSummer,dateList));
|
|
|
}
|
|
|
//将数据合并,map中所有的数据按时间,将list中的数据相加
|
|
|
List<TeacherIndexWrapper.CourseExposureTotal> finalResult = new ArrayList<>();
|