|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
import com.ibeetl.jlw.dao.StatisticalAnalysisDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.SysLogDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.UniversitiesCollegesDao;
|
|
|
|
|
import com.ibeetl.jlw.entity.*;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeSchoolClassQuery;
|
|
|
|
@ -11,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -33,6 +36,10 @@ public class StatisticalAnalysisService {
|
|
|
|
|
@Autowired private CourseInfoService courseInfoService;
|
|
|
|
|
@Autowired private ResourcesApplicationService resourcesApplicationService;
|
|
|
|
|
@Autowired private UniversitiesCollegesDao universitiesCollegesDao;
|
|
|
|
|
@Autowired private SysLogDao sysLogDao;
|
|
|
|
|
|
|
|
|
|
private static final String PATTERN = "(?<=\"code\":\\[\").*?(?=\"\\],)";
|
|
|
|
|
Pattern r = Pattern.compile(PATTERN);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 统计分析
|
|
|
|
@ -133,10 +140,23 @@ public class StatisticalAnalysisService {
|
|
|
|
|
//注册老师数
|
|
|
|
|
List<Teacher> teachers = teacherService.getTeacherByStimeAndEtime(stime, etime);
|
|
|
|
|
data.put("teacherNumber", teachers.size());
|
|
|
|
|
LambdaQuery<SysLog> logDaoLambdaQuery = sysLogDao.createLambdaQuery();
|
|
|
|
|
if (stime != null && etime != null) {
|
|
|
|
|
logDaoLambdaQuery.andBetween(SysLog::getCreateTime, stime, etime);
|
|
|
|
|
}
|
|
|
|
|
List<SysLog> sysLogs = logDaoLambdaQuery.andLike(SysLog::getRequestUrl, "%login%").andLike(SysLog::getResult, "%成功%").select();
|
|
|
|
|
Set<String> set = new HashSet<>();
|
|
|
|
|
for (SysLog sysLog : sysLogs) {
|
|
|
|
|
String result = sysLog.getParams();
|
|
|
|
|
Matcher m = r.matcher(result);
|
|
|
|
|
if (m.find()) {
|
|
|
|
|
set.add(m.group());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//登录人数
|
|
|
|
|
data.put("loginNumber", studentList.size());
|
|
|
|
|
data.put("loginNumber", set.size());
|
|
|
|
|
//登录人次
|
|
|
|
|
data.put("studentPersonTime", studentList.size());
|
|
|
|
|
data.put("studentPersonTime", sysLogs.size());
|
|
|
|
|
//上线课程数
|
|
|
|
|
List<CourseInfo> courseInfoList = courseInfoService.getCourseInfoByStimeAndEtime(stime, etime);
|
|
|
|
|
data.put("courseNumber", courseInfoList.size());
|
|
|
|
|