|
|
|
@ -64,6 +64,7 @@ public class StatisticalAnalysisService {
|
|
|
|
|
@Autowired private TeacherOpenCourseScoreDashboardDao teacherOpenCourseScoreDashboardDao;
|
|
|
|
|
@Autowired private QuestionLogSummaryDao questionLogSummaryDao;
|
|
|
|
|
@Autowired private TeacherOpenCourseQuestionLogDao teacherOpenCourseQuestionLogDao;
|
|
|
|
|
@Autowired private ResourcesQuestionSnapshotService resourcesQuestionSnapshotDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String PATTERN = "(?<=\"code\":\\[\").*?(?=\"\\],)";
|
|
|
|
@ -287,17 +288,22 @@ public class StatisticalAnalysisService {
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Map<String, Object> adminIndexDetail(Date stime, Date etime, UniversitiesColleges universitiesColleges, Long orgId) {
|
|
|
|
|
public Map<String, Object> adminIndexDetail(Date stime, Date etime, UniversitiesColleges universitiesColleges, CoreUser coreUser) {
|
|
|
|
|
Long orgId = coreUser.getOrgId();
|
|
|
|
|
Long universitiesCollegesId = (universitiesColleges == null ? orgId : universitiesColleges.getUniversitiesCollegesId());
|
|
|
|
|
Long uniOrgId = (universitiesColleges == null ? orgId : universitiesColleges.getOrgId());
|
|
|
|
|
List<Student> studentList = studentService.getStudentByStimeAndEtime(stime, etime, universitiesCollegesId);
|
|
|
|
|
List<Student> studentList = studentService.getStudentByStimeAndEtime(stime, etime, uniOrgId);
|
|
|
|
|
Map<String, Object> data = new HashMap<>();
|
|
|
|
|
//注册学生数
|
|
|
|
|
data.put("studentNumber", studentList.size());
|
|
|
|
|
//注册老师数
|
|
|
|
|
List<Teacher> teachers = teacherService.getTeacherByStimeAndEtime(stime, etime, universitiesCollegesId);
|
|
|
|
|
List<Teacher> teachers = teacherService.getTeacherByStimeAndEtime(stime, etime, uniOrgId);
|
|
|
|
|
data.put("teacherNumber", teachers.size());
|
|
|
|
|
List<CoreUser> select = coreUserDao.createLambdaQuery().andEq(CoreUser::getOrgId, uniOrgId).select();
|
|
|
|
|
LambdaQuery<CoreUser> lambdaQuery = coreUserDao.createLambdaQuery();
|
|
|
|
|
if (uniOrgId != null && uniOrgId != 1) {
|
|
|
|
|
lambdaQuery.andEq(CoreUser::getOrgId, uniOrgId);
|
|
|
|
|
}
|
|
|
|
|
List<CoreUser> select = lambdaQuery.select();
|
|
|
|
|
List<Long> userIds = select.stream().map(CoreUser::getId).collect(Collectors.toList());
|
|
|
|
|
LambdaQuery<SysLog> logDaoLambdaQuery = sysLogDao.createLambdaQuery();
|
|
|
|
|
if (stime != null && etime != null) {
|
|
|
|
@ -322,7 +328,7 @@ public class StatisticalAnalysisService {
|
|
|
|
|
long loginDistinctCount = loginDistinctCountQuery.count();
|
|
|
|
|
|
|
|
|
|
// 获取登录次数
|
|
|
|
|
Long loginCount = coreUserDao.getSumLoginCount(stime, etime, orgId);
|
|
|
|
|
Long loginCount = coreUserDao.getSumLoginCount(stime, etime, orgId == 1 ? null : orgId);
|
|
|
|
|
|
|
|
|
|
//登录人数
|
|
|
|
|
data.put("loginNumber", loginDistinctCount);
|
|
|
|
@ -336,7 +342,13 @@ public class StatisticalAnalysisService {
|
|
|
|
|
data.put("applicationNumber", resourcesApplicationCount);
|
|
|
|
|
|
|
|
|
|
TeacherOpenCourseQuestionSettingQuery teacherOpenCourseQuestionSettingQuery = new TeacherOpenCourseQuestionSettingQuery();
|
|
|
|
|
teacherOpenCourseQuestionSettingQuery.setOrgId(uniOrgId);
|
|
|
|
|
List<TeacherOpenCourse> select11 = teacherOpenCourseService.createLambdaQuery().andEq(TeacherOpenCourse::getOrgId, uniOrgId)
|
|
|
|
|
.andEq(TeacherOpenCourse::getTeacherOpenCourseStatus, 1).select();
|
|
|
|
|
Set<Long> collect11 = select11.stream().map(TeacherOpenCourse::getTeacherOpenCourseId).collect(Collectors.toSet());
|
|
|
|
|
if (orgId != null && orgId != 1) {
|
|
|
|
|
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseIdPlural(CollectionUtil.join(collect11, ","));
|
|
|
|
|
// teacherOpenCourseQuestionSettingQuery.setOrgId(uniOrgId);
|
|
|
|
|
}
|
|
|
|
|
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseQuestionSettingPushStatus(GlobalPushStatusEnum.PUSH);
|
|
|
|
|
teacherOpenCourseQuestionSettingQuery.setTeacherOpenCourseQuestionSettingStatus(1);
|
|
|
|
|
List<TeacherOpenCourseQuestionSettingPure> courseQuestionSettings = teacherOpenCourseQuestionSettingDao.getValuesByQueryNotWithPermission2(teacherOpenCourseQuestionSettingQuery);
|
|
|
|
@ -352,44 +364,72 @@ public class StatisticalAnalysisService {
|
|
|
|
|
}
|
|
|
|
|
//批改作业数
|
|
|
|
|
data.put("homeWorkNumber", select1.size());
|
|
|
|
|
//课程学习
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> select2 = teacherOpenCourseQuestionLogDao.createLambdaQuery().andEq(TeacherOpenCourseQuestionLog::getOrgId, uniOrgId)
|
|
|
|
|
.andEq(TeacherOpenCourseQuestionLog::getTeacherOpenCourseQuestionLogStatus, 1)
|
|
|
|
|
.select();
|
|
|
|
|
data.put("studyNumber", select2.size());
|
|
|
|
|
//课件学习
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
|
|
|
|
|
tasksQuery.setTeacherOpenCourseIdPlural(CollectionUtil.join(collect11, ","));
|
|
|
|
|
List<TeacherOpenCourseHandsOnSimulationTasks> teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksService.getValuesByQueryNotWithPermission(tasksQuery);
|
|
|
|
|
long count = teacherOpenCourseHandsOnSimulationTasks.stream().filter(v -> "1".equals(v.getTaskType()) || "2".equals(v.getTaskType())).count();
|
|
|
|
|
data.put("studyNumber", count);
|
|
|
|
|
//学生做题
|
|
|
|
|
data.put("exerciseNumber", select1.size());
|
|
|
|
|
ResourcesQuestionSnapshotQuery resourcesQuestionSnapshotQuery = new ResourcesQuestionSnapshotQuery();
|
|
|
|
|
resourcesQuestionSnapshotQuery.setQuestionStatus(1);
|
|
|
|
|
if (uniOrgId != null && uniOrgId != 1) {
|
|
|
|
|
resourcesQuestionSnapshotQuery.setTeacherOpenCourseMergeCourseInfoIdPlural(CollectionUtil.join(collect11,","));
|
|
|
|
|
}
|
|
|
|
|
List<ResourcesQuestionSnapshot> resourcesQuestionSnapshotList = resourcesQuestionSnapshotDao.getValuesByQueryNotWithPermission(resourcesQuestionSnapshotQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.put("exerciseNumber", teacherOpenCourseHandsOnSimulationTasks.size() + resourcesQuestionSnapshotList.size() + courseQuestionSettings.size());
|
|
|
|
|
//学校动态码
|
|
|
|
|
data.put("universitiesCollegesAuthCode", universitiesColleges != null ? universitiesColleges.getUniversitiesCollegesAuthCode() : "暂无动态码");
|
|
|
|
|
//注册用户数
|
|
|
|
|
int size = coreUserDao.createLambdaQuery().andEq(CoreUser::getDelFlag, DelFlagEnum.NORMAL.getValue())
|
|
|
|
|
.andEq(CoreUser::getOrgId, ofNullable(uniOrgId))
|
|
|
|
|
LambdaQuery<CoreUser> lambdaQuery2 = coreUserDao.createLambdaQuery();
|
|
|
|
|
if (uniOrgId!= null && uniOrgId!= 1) {
|
|
|
|
|
lambdaQuery2.andEq(CoreUser::getOrgId, uniOrgId);
|
|
|
|
|
}
|
|
|
|
|
int size = lambdaQuery2.andEq(CoreUser::getDelFlag, DelFlagEnum.NORMAL.getValue())
|
|
|
|
|
.andNotEq(CoreUser::getId, 1).select().size();
|
|
|
|
|
data.put("userNumber", 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();
|
|
|
|
|
LambdaQuery<HandsOn> lambdaQuery3 = handsOnService.createLambdaQuery();
|
|
|
|
|
if (uniOrgId!= null && uniOrgId!= 1) {
|
|
|
|
|
lambdaQuery3.andEq(HandsOn::getOrgId, uniOrgId);
|
|
|
|
|
}
|
|
|
|
|
int values = lambdaQuery3.andEq(HandsOn::getHandsOnStatus, 1).select().size();
|
|
|
|
|
LambdaQuery<ResourcesTraining> lambdaQuery4 = resourcesTrainingService.createLambdaQuery();
|
|
|
|
|
if (uniOrgId!= null && uniOrgId!= 1) {
|
|
|
|
|
lambdaQuery4.andEq(ResourcesTraining::getOrgId, uniOrgId);
|
|
|
|
|
}
|
|
|
|
|
int values2 = lambdaQuery4.andEq(ResourcesTraining::getResourcesTrainingStatus, 1).select().size();
|
|
|
|
|
LambdaQuery<ResourcesCompetition> lambdaQuery5 = resourcesCompetitionService.createLambdaQuery();
|
|
|
|
|
if (uniOrgId!= null && uniOrgId!= 1) {
|
|
|
|
|
lambdaQuery5.andEq(ResourcesCompetition::getOrgId, uniOrgId);
|
|
|
|
|
}
|
|
|
|
|
int values3 = lambdaQuery5.andEq(ResourcesCompetition::getResourcesCompetitionStatus, 1).select().size();
|
|
|
|
|
data.put("caseNumber", values + values2 + values3);
|
|
|
|
|
//视频数量
|
|
|
|
|
ResourcesInfoQuery resourcesInfoQuery = new ResourcesInfoQuery();
|
|
|
|
|
resourcesInfoQuery.setResourcesInfoType(1);
|
|
|
|
|
resourcesInfoQuery.setOrgId(uniOrgId);
|
|
|
|
|
if (uniOrgId!= null && uniOrgId!=1) {
|
|
|
|
|
resourcesInfoQuery.setOrgId(uniOrgId);
|
|
|
|
|
}
|
|
|
|
|
List<ResourcesInfo> videoNumber = resourcesInfoService.getValues(resourcesInfoQuery);
|
|
|
|
|
data.put("videoNumber", videoNumber.size());
|
|
|
|
|
//题库数量
|
|
|
|
|
ResourcesQuestionQuery paras1 = new ResourcesQuestionQuery();
|
|
|
|
|
paras1.setQuestionStatus(1);
|
|
|
|
|
paras1.setOrgId(uniOrgId);
|
|
|
|
|
if (uniOrgId!= null && uniOrgId!=1) {
|
|
|
|
|
paras1.setOrgId(uniOrgId);
|
|
|
|
|
}
|
|
|
|
|
List<ResourcesQuestion> questionList = resourcesQuestionService.getValues(paras1);
|
|
|
|
|
data.put("questionNumber", questionList.size());
|
|
|
|
|
//院校数量
|
|
|
|
|
UniversitiesCollegesQuery paras = new UniversitiesCollegesQuery();
|
|
|
|
|
paras.setUniversitiesCollegesStatus(1);
|
|
|
|
|
paras.setOrgId(uniOrgId);
|
|
|
|
|
if (uniOrgId!= null && uniOrgId!=1) {
|
|
|
|
|
paras.setOrgId(uniOrgId);
|
|
|
|
|
}
|
|
|
|
|
List<UniversitiesColleges> schoolList = universitiesCollegesService.getValues(paras);
|
|
|
|
|
data.put("schoolNumber", schoolList.size());
|
|
|
|
|
return data;
|
|
|
|
|