|
|
|
@ -61,6 +61,9 @@ public class StatisticalAnalysisService {
|
|
|
|
|
@Autowired private TeacherOpenCourseQuestionSettingDao teacherOpenCourseQuestionSettingDao;
|
|
|
|
|
@Autowired private HandsOnDao handsOnService;
|
|
|
|
|
@Autowired private ResourcesCompetitionDao resourcesCompetitionService;
|
|
|
|
|
@Autowired private TeacherOpenCourseScoreDashboardDao teacherOpenCourseScoreDashboardDao;
|
|
|
|
|
@Autowired private QuestionLogSummaryDao questionLogSummaryDao;
|
|
|
|
|
@Autowired private TeacherOpenCourseQuestionLogDao teacherOpenCourseQuestionLogDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String PATTERN = "(?<=\"code\":\\[\").*?(?=\"\\],)";
|
|
|
|
@ -87,11 +90,22 @@ public class StatisticalAnalysisService {
|
|
|
|
|
List<TeacherOpenCourseMergeStudent> studentList = teacherOpenCourseMergeStudentService.getValuesByQueryNotWithPermission(teacherOpenCourseMergeStudentQuery);
|
|
|
|
|
data.put("studentNum", studentList.size());
|
|
|
|
|
//学习通过率
|
|
|
|
|
data.put("passRate", 0);
|
|
|
|
|
List<TeacherOpenCourseScoreDashboard> scoreDashboards = teacherOpenCourseScoreDashboardDao.createLambdaQuery().andEq(TeacherOpenCourseScoreDashboard::getTeacherOpenCourseId, teacherOpenCourseId).select();
|
|
|
|
|
long count1 = scoreDashboards.stream().filter(v ->
|
|
|
|
|
"不及格".equals(v.getLastStatus()) || "E".equals(v.getLastStatus())).count();
|
|
|
|
|
long l = scoreDashboards.size() - count1;
|
|
|
|
|
|
|
|
|
|
data.put("passRate", NumberUtil.formatPercent(NumberUtil.div(l,scoreDashboards.size()), 0));
|
|
|
|
|
//授课视频
|
|
|
|
|
data.put("teachingVideoNum", 20);
|
|
|
|
|
TeacherOpenCourseMergeCourseInfoQuery courseInfoQuery = new TeacherOpenCourseMergeCourseInfoQuery();
|
|
|
|
|
courseInfoQuery.setTeacherOpenCourseId(teacherOpenCourseId);
|
|
|
|
|
courseInfoQuery.setCourseInfoStatus(1);
|
|
|
|
|
List<TeacherOpenCourseMergeCourseInfo> courseInfos = teacherOpenCourseMergeCourseInfoService.getValuesByQueryNotWithPermission(courseInfoQuery);
|
|
|
|
|
List<TeacherOpenCourseMergeCourseInfo> videoCount = courseInfos.stream().filter(v -> v.getCourseVideoId() != null).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
data.put("teachingVideoNum", videoCount.size());
|
|
|
|
|
//非视频资源
|
|
|
|
|
data.put("nonVideoResourcesNum", 30);
|
|
|
|
|
data.put("nonVideoResourcesNum", courseInfos.size() - videoCount.size());
|
|
|
|
|
//课程公告
|
|
|
|
|
TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery = new TeacherOpenCourseNoticeQuery();
|
|
|
|
|
teacherOpenCourseNoticeQuery.setTeacherOpenCourseIds(teacherOpenCourseId.toString());
|
|
|
|
@ -242,7 +256,8 @@ public class StatisticalAnalysisService {
|
|
|
|
|
List<TeacherOpenCourseMergeCourseInfo> courseInfos = teacherOpenCourseMergeCourseInfoService.getValuesByQueryNotWithPermission(courseInfoQuery);
|
|
|
|
|
data.put("coursewareNum", courseInfos.size());
|
|
|
|
|
//视频
|
|
|
|
|
data.put("videoNum", courseInfos.size());
|
|
|
|
|
List<TeacherOpenCourseMergeCourseInfo> videoCount = courseInfos.stream().filter(v -> v.getCourseVideoId() != null).collect(Collectors.toList());
|
|
|
|
|
data.put("videoNum", videoCount.size());
|
|
|
|
|
//题目
|
|
|
|
|
//习题总数
|
|
|
|
|
TeacherOpenCourseQuestionSettingQuery teacherOpenCourseQuestionSettingQuery = new TeacherOpenCourseQuestionSettingQuery();
|
|
|
|
@ -267,10 +282,9 @@ public class StatisticalAnalysisService {
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Map<String, Object> adminIndexDetail(Date stime, Date etime, UniversitiesColleges universitiesColleges) {
|
|
|
|
|
|
|
|
|
|
Long universitiesCollegesId = (universitiesColleges == null ? null : universitiesColleges.getUniversitiesCollegesId());
|
|
|
|
|
Long uniOrgId = (universitiesColleges == null ? null : universitiesColleges.getOrgId());
|
|
|
|
|
public Map<String, Object> adminIndexDetail(Date stime, Date etime, UniversitiesColleges universitiesColleges, Long orgId) {
|
|
|
|
|
Long universitiesCollegesId = (universitiesColleges == null ? orgId : universitiesColleges.getUniversitiesCollegesId());
|
|
|
|
|
Long uniOrgId = (universitiesColleges == null ? orgId : universitiesColleges.getOrgId());
|
|
|
|
|
List<Student> studentList = studentService.getStudentByStimeAndEtime(stime, etime, universitiesCollegesId);
|
|
|
|
|
Map<String, Object> data = new HashMap<>();
|
|
|
|
|
//注册学生数
|
|
|
|
@ -278,11 +292,13 @@ public class StatisticalAnalysisService {
|
|
|
|
|
//注册老师数
|
|
|
|
|
List<Teacher> teachers = teacherService.getTeacherByStimeAndEtime(stime, etime, universitiesCollegesId);
|
|
|
|
|
data.put("teacherNumber", teachers.size());
|
|
|
|
|
List<CoreUser> select = coreUserService.createLambdaQuery().andEq(CoreUser::getOrgId, uniOrgId).select();
|
|
|
|
|
List<Long> userIds = select.stream().map(CoreUser::getId).collect(Collectors.toList());
|
|
|
|
|
LambdaQuery<SysLog> logDaoLambdaQuery = sysLogDao.createLambdaQuery();
|
|
|
|
|
if (stime != null && etime != null) {
|
|
|
|
|
logDaoLambdaQuery.andBetween(SysLog::getCreateTime, stime, etime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logDaoLambdaQuery.andIn(SysLog::getUserId, userIds);
|
|
|
|
|
long loginCount = logDaoLambdaQuery.andLike(SysLog::getRequestUrl, "%login%").andLike(SysLog::getResult, "%成功%").count();
|
|
|
|
|
long loginDistinctCount = CollectionUtil.emptyIfNull(logDaoLambdaQuery.distinct()
|
|
|
|
|
.andLike("request_url", "%login%").andLike("result", "%成功%").select("user_id")).size();
|
|
|
|
@ -297,12 +313,28 @@ public class StatisticalAnalysisService {
|
|
|
|
|
//上线应用数
|
|
|
|
|
Long resourcesApplicationCount = resourcesApplicationService.getApplicationByStimeAndEtime(stime, etime, uniOrgId);
|
|
|
|
|
data.put("applicationNumber", resourcesApplicationCount);
|
|
|
|
|
|
|
|
|
|
TeacherOpenCourseQuestionSettingQuery teacherOpenCourseQuestionSettingQuery = new TeacherOpenCourseQuestionSettingQuery();
|
|
|
|
|
teacherOpenCourseQuestionSettingQuery.setOrgId(uniOrgId);
|
|
|
|
|
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseQuestionSettingPushStatus(GlobalPushStatusEnum.PUSH);
|
|
|
|
|
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseQuestionSettingStatus(1);
|
|
|
|
|
List<TeacherOpenCourseQuestionSettingPure> courseQuestionSettings = teacherOpenCourseQuestionSettingDao.getValuesByQueryNotWithPermission(teacherOpenCourseQuestionSettingQuery, null);
|
|
|
|
|
List<Long> collect2 = courseQuestionSettings.stream()
|
|
|
|
|
.map(TeacherOpenCourseQuestionSettingPure::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toList());
|
|
|
|
|
List<QuestionLogSummary> select1 = questionLogSummaryDao.createLambdaQuery()
|
|
|
|
|
.andIsNotNull(QuestionLogSummary::getQuestionLogSummaryStudentTotalScore)
|
|
|
|
|
.andIn(QuestionLogSummary::getQuestionSettingId, collect2)
|
|
|
|
|
.andEq(QuestionLogSummary::getQuestionLogSummaryStatus, 1)
|
|
|
|
|
.select();
|
|
|
|
|
//批改作业数
|
|
|
|
|
data.put("homeWorkNumber", studentList.size());
|
|
|
|
|
data.put("homeWorkNumber", select1.size());
|
|
|
|
|
//课程学习
|
|
|
|
|
data.put("studyNumber", studentList.size());
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> select2 = teacherOpenCourseQuestionLogDao.createLambdaQuery().andEq(TeacherOpenCourseQuestionLog::getOrgId, uniOrgId)
|
|
|
|
|
.andEq(TeacherOpenCourseQuestionLog::getTeacherOpenCourseQuestionLogStatus, 1)
|
|
|
|
|
.select();
|
|
|
|
|
data.put("studyNumber", select2.size());
|
|
|
|
|
//学生做题
|
|
|
|
|
data.put("exerciseNumber", studentList.size());
|
|
|
|
|
data.put("exerciseNumber", select1.size());
|
|
|
|
|
//学校动态码
|
|
|
|
|
data.put("universitiesCollegesAuthCode", universitiesColleges != null ? universitiesColleges.getUniversitiesCollegesAuthCode() : "暂无动态码");
|
|
|
|
|
//注册用户数
|
|
|
|
@ -311,13 +343,17 @@ public class StatisticalAnalysisService {
|
|
|
|
|
.andNotEq(CoreUser::getId, 1).select().size();
|
|
|
|
|
data.put("userNumber", size);
|
|
|
|
|
//案例数量
|
|
|
|
|
int values = handsOnService.createLambdaQuery().andEq(HandsOn::getHandsOnStatus, 1).select().size();
|
|
|
|
|
int values2 = resourcesTrainingService.createLambdaQuery().andEq(ResourcesTraining::getResourcesTrainingStatus, 1).select().size();
|
|
|
|
|
int values3 = resourcesCompetitionService.createLambdaQuery().andEq(ResourcesCompetition::getResourcesCompetitionStatus, 1).select().size();
|
|
|
|
|
int values = handsOnService.createLambdaQuery().andEq(HandsOn::getHandsOnStatus, 1)
|
|
|
|
|
.andEq(HandsOn::getOrgId, uniOrgId).select().size();
|
|
|
|
|
int values2 = resourcesTrainingService.createLambdaQuery().andEq(ResourcesTraining::getResourcesTrainingStatus, 1)
|
|
|
|
|
.andEq(ResourcesTraining::getOrgId, uniOrgId).select().size();
|
|
|
|
|
int values3 = resourcesCompetitionService.createLambdaQuery().andEq(ResourcesCompetition::getResourcesCompetitionStatus, 1)
|
|
|
|
|
.andEq(ResourcesCompetition::getOrgId, uniOrgId).select().size();
|
|
|
|
|
data.put("caseNumber", values + values2 + values3);
|
|
|
|
|
//视频数量
|
|
|
|
|
ResourcesInfoQuery resourcesInfoQuery = new ResourcesInfoQuery();
|
|
|
|
|
resourcesInfoQuery.setResourcesInfoType(1);
|
|
|
|
|
resourcesInfoQuery.setOrgId(uniOrgId);
|
|
|
|
|
List<ResourcesInfo> videoNumber = resourcesInfoService.getValues(resourcesInfoQuery);
|
|
|
|
|
data.put("videoNumber", videoNumber.size());
|
|
|
|
|
//题库数量
|
|
|
|
|