|
@@ -6,6 +6,7 @@ import com.yonge.cooleshow.biz.dal.dao.HomeDao;
|
|
import com.yonge.cooleshow.biz.dal.dto.SubjectHomeSearch;
|
|
import com.yonge.cooleshow.biz.dal.dto.SubjectHomeSearch;
|
|
import com.yonge.cooleshow.biz.dal.dto.req.TotalReq;
|
|
import com.yonge.cooleshow.biz.dal.dto.req.TotalReq;
|
|
import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
|
|
import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.GoodTypeEnum;
|
|
import com.yonge.cooleshow.biz.dal.enums.TeacherTagEnum;
|
|
import com.yonge.cooleshow.biz.dal.enums.TeacherTagEnum;
|
|
import com.yonge.cooleshow.biz.dal.service.CourseScheduleService;
|
|
import com.yonge.cooleshow.biz.dal.service.CourseScheduleService;
|
|
import com.yonge.cooleshow.biz.dal.service.HomeService;
|
|
import com.yonge.cooleshow.biz.dal.service.HomeService;
|
|
@@ -16,6 +17,7 @@ import com.yonge.cooleshow.biz.dal.vo.TagTotalTeacher;
|
|
import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent;
|
|
import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalStudent;
|
|
import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher;
|
|
import com.yonge.cooleshow.biz.dal.vo.res.HomeTotalTeacher;
|
|
import com.yonge.cooleshow.biz.dal.vo.res.HomeUserToDoNum;
|
|
import com.yonge.cooleshow.biz.dal.vo.res.HomeUserToDoNum;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.wrapper.teacher.TeacherHomeWrapper;
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
import com.yonge.toolset.base.page.PageInfo;
|
|
import com.yonge.toolset.base.page.PageInfo;
|
|
import com.yonge.toolset.mybatis.support.PageUtil;
|
|
import com.yonge.toolset.mybatis.support.PageUtil;
|
|
@@ -288,4 +290,37 @@ public class HomeServiceImpl implements HomeService {
|
|
return subjectHomeVoPageInfo;
|
|
return subjectHomeVoPageInfo;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 老师端首页统计课程
|
|
|
|
+ *
|
|
|
|
+ * @param query 参数
|
|
|
|
+ * @return TeacherHomeWrapper.TeacherTotalCourse
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<TeacherHomeWrapper.TeacherTotalCourse> teacherTotalCourse(TeacherHomeWrapper.TeacherTotalCourseQuery query) {
|
|
|
|
+
|
|
|
|
+ // VIP定制课 趣纠课 直播课 视频课
|
|
|
|
+
|
|
|
|
+ List<TeacherHomeWrapper.TeacherTotalCourse> result = new ArrayList<>();
|
|
|
|
+ result.add(TeacherHomeWrapper.TeacherTotalCourse.builder().goodType(GoodTypeEnum.LIVE).build());
|
|
|
|
+ result.add(TeacherHomeWrapper.TeacherTotalCourse.builder().goodType(GoodTypeEnum.VIDEO).build());
|
|
|
|
+ result.add(TeacherHomeWrapper.TeacherTotalCourse.builder().goodType(GoodTypeEnum.VIP_COURSE).build());
|
|
|
|
+ result.add(TeacherHomeWrapper.TeacherTotalCourse.builder().goodType(GoodTypeEnum.PRACTICE).build());
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<TeacherHomeWrapper.TeacherTotalCourse> teacherTotalCourses = baserMapper.teacherTotalCourse(query);
|
|
|
|
+ Map<GoodTypeEnum, TeacherHomeWrapper.TeacherTotalCourse> collect = teacherTotalCourses.stream()
|
|
|
|
+ .collect(Collectors.toMap(TeacherHomeWrapper.TeacherTotalCourse::getGoodType, Function.identity(), (key1, key2) -> key2));
|
|
|
|
+ for (TeacherHomeWrapper.TeacherTotalCourse teacherTotalCourse : result) {
|
|
|
|
+ TeacherHomeWrapper.TeacherTotalCourse totalCourse = collect.get(teacherTotalCourse.getGoodType());
|
|
|
|
+ if (totalCourse != null) {
|
|
|
|
+ teacherTotalCourse.setBuyNum(totalCourse.getBuyNum());
|
|
|
|
+ teacherTotalCourse.setClassHourNum(totalCourse.getClassHourNum());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|