You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
175 lines
6.9 KiB
Java
175 lines
6.9 KiB
Java
package com.ibeetl.jlw.service;
|
|
|
|
import com.ibeetl.jlw.dao.StatisticalAnalysisDao;
|
|
import com.ibeetl.jlw.dao.UniversitiesCollegesDao;
|
|
import com.ibeetl.jlw.entity.*;
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeSchoolClassQuery;
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeStudentQuery;
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeQuery;
|
|
import org.beetl.sql.core.query.LambdaQuery;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
|
|
/**
|
|
* 统计分析service
|
|
* 暂时是假数据
|
|
* @Version 0.0.1
|
|
* @Author 许良彤
|
|
* @Date 2022/10/7 12:25
|
|
*
|
|
*/
|
|
@Service
|
|
public class StatisticalAnalysisService {
|
|
|
|
@Autowired private StatisticalAnalysisDao statisticalAnalysisDao;
|
|
@Autowired private TeacherOpenCourseMergeSchoolClassService teacherOpenCourseMergeSchoolClassService;
|
|
@Autowired private TeacherOpenCourseMergeStudentService teacherOpenCourseMergeStudentService;
|
|
@Autowired private TeacherOpenCourseNoticeService teacherOpenCourseNoticeService;
|
|
@Autowired private StudentService studentService;
|
|
@Autowired private TeacherService teacherService;
|
|
@Autowired private CourseInfoService courseInfoService;
|
|
@Autowired private ResourcesApplicationService resourcesApplicationService;
|
|
@Autowired private UniversitiesCollegesDao universitiesCollegesDao;
|
|
|
|
/**
|
|
* 统计分析
|
|
* @param
|
|
*/
|
|
public Map<String, Object> detail(Long teacherOpenCourseId, Date stime, Date etime) {
|
|
|
|
|
|
Map<String, Object> data = new HashMap<>(24);
|
|
// 暂不使用连表方式查询
|
|
// statisticalAnalysisDao.detail(teacherOpenCourseId, stime, etime);
|
|
//班级数
|
|
TeacherOpenCourseMergeSchoolClassQuery classQuery = new TeacherOpenCourseMergeSchoolClassQuery();
|
|
classQuery.setTeacherOpenCourseId(teacherOpenCourseId);
|
|
List<TeacherOpenCourseMergeSchoolClass> schoolClasses = teacherOpenCourseMergeSchoolClassService.getValuesByQuery(classQuery);
|
|
data.put("classNum", schoolClasses.size());
|
|
//学生人数
|
|
TeacherOpenCourseMergeStudentQuery teacherOpenCourseMergeStudentQuery = new TeacherOpenCourseMergeStudentQuery();
|
|
teacherOpenCourseMergeStudentQuery.setTeacherOpenCourseId(teacherOpenCourseId);
|
|
List<TeacherOpenCourseMergeStudent> studentList = teacherOpenCourseMergeStudentService.getValuesByQuery(teacherOpenCourseMergeStudentQuery);
|
|
data.put("studentNum", studentList.size());
|
|
//学习通过率
|
|
data.put("passRate", 90);
|
|
//授课视频
|
|
data.put("teachingVideoNum", 20);
|
|
//非视频资源
|
|
data.put("nonVideoResourcesNum", 30);
|
|
//课程公告
|
|
TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery = new TeacherOpenCourseNoticeQuery();
|
|
teacherOpenCourseNoticeQuery.setTeacherOpenCourseIds(teacherOpenCourseId.toString());
|
|
List<TeacherOpenCourseNotice> noticeList = teacherOpenCourseNoticeService.getValuesByQuery(teacherOpenCourseNoticeQuery);
|
|
data.put("noticeNum", noticeList.size());
|
|
//签到
|
|
data.put("signInNum", 30);
|
|
data.put("signInRate", 30);
|
|
//章节练习
|
|
data.put("chapterNum", 40);
|
|
data.put("chapterTotal", 40);
|
|
data.put("chapterPeople", 40);
|
|
//课程实操
|
|
data.put("handsOnNum", 50);
|
|
data.put("handsOnTotal", 50);
|
|
data.put("handsOnPeople", 50);
|
|
//作业
|
|
data.put("homeworkNum", 60);
|
|
data.put("homeworkTotal", 60);
|
|
data.put("homeworkPeople", 60);
|
|
//考试
|
|
data.put("examNum", 72);
|
|
data.put("examTotal", 72);
|
|
data.put("examPeople", 72);
|
|
//线上互动
|
|
data.put("interactNum", 80);
|
|
data.put("interactTotal", 80);
|
|
data.put("interactStudent", 80);
|
|
data.put("interactTeacher", 80);
|
|
return data;
|
|
}
|
|
|
|
/**
|
|
* 首页
|
|
* @param
|
|
* @return
|
|
*/
|
|
public Map<String, Object> indexDetail(String teacherOpenCourseId) {
|
|
Map<String, Object> data = new HashMap<>();
|
|
//课程封面
|
|
data.put("courseInfoThumbnail", "");
|
|
//课程名称
|
|
data.put("courseInfoName", "");
|
|
//课程简介
|
|
data.put("courseInfoContent", "");
|
|
//班级
|
|
data.put("classNum", 2);
|
|
//学生
|
|
data.put("studentNum", 60);
|
|
//课件
|
|
data.put("coursewareNum", 15);
|
|
//视频
|
|
data.put("videoNum", 10);
|
|
//题目
|
|
data.put("subjectNum", 90);
|
|
//案例
|
|
data.put("caseNum", 10);
|
|
//作业
|
|
data.put("homeworkNum", 15);
|
|
//考试
|
|
data.put("examNum", 2);
|
|
|
|
return data;
|
|
}
|
|
|
|
public Map<String, Object> adminIndexDetail(Date stime, Date etime) {
|
|
List<Student> studentList = studentService.getStudentByStimeAndEtime(stime, etime);
|
|
Map<String, Object> data = new HashMap<>();
|
|
//注册学生数
|
|
data.put("studentNumber", studentList.size());
|
|
//注册老师数
|
|
List<Teacher> teachers = teacherService.getTeacherByStimeAndEtime(stime, etime);
|
|
data.put("teacherNumber", teachers.size());
|
|
//登录人数
|
|
data.put("loginNumber", studentList.size());
|
|
//登录人次
|
|
data.put("studentPersonTime", studentList.size());
|
|
//上线课程数
|
|
List<CourseInfo> courseInfoList = courseInfoService.getCourseInfoByStimeAndEtime(stime, etime);
|
|
data.put("courseNumber", courseInfoList.size());
|
|
//上线应用数
|
|
List<ResourcesApplication> resourcesApplicationList = resourcesApplicationService.getApplicationByStimeAndEtime(stime, etime);
|
|
data.put("applicationNumber", resourcesApplicationList.size());
|
|
//批改作业数
|
|
data.put("homeWorkNumber", studentList.size());
|
|
//课程学习
|
|
data.put("studyNumber", studentList.size());
|
|
//学生做题
|
|
data.put("exerciseNumber", studentList.size());
|
|
return data;
|
|
}
|
|
|
|
public Map<String, Object> adminIndexBarchart(Date stime, Date etime) {
|
|
|
|
LambdaQuery<UniversitiesColleges> lambdaQuery = universitiesCollegesDao.createLambdaQuery();
|
|
if (stime != null && etime != null) {
|
|
lambdaQuery.andBetween(UniversitiesColleges::getAddTime, stime, etime);
|
|
}
|
|
List<UniversitiesColleges> universitiesColleges = lambdaQuery.select();
|
|
Map<String, Long> collect = universitiesColleges.stream().collect(Collectors.groupingBy(UniversitiesColleges::getUniversitiesCollegesProvince, Collectors.counting()));
|
|
List<String> xList = new ArrayList<>();
|
|
List<Long> yList = new ArrayList<>();
|
|
|
|
collect.forEach((x,y) -> {
|
|
xList.add(x);
|
|
yList.add(y);
|
|
});
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("xList" , xList);
|
|
map.put("yList" , yList);
|
|
return map;
|
|
}
|
|
} |