diff --git a/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java b/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java index 9110710c..7a438ff3 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java @@ -5,7 +5,9 @@ import com.ibeetl.jlw.entity.CourseInfo; import com.ibeetl.jlw.entity.Student; import com.ibeetl.jlw.entity.StudentExtendSchoolInfo; import com.ibeetl.jlw.entity.api.student.StudentActiveInfo; +import com.ibeetl.jlw.entity.dto.ApplicationUseLogsAnalysisDTO; import com.ibeetl.jlw.entity.dto.StudentEditPasswordDTO; +import com.ibeetl.jlw.entity.vo.ApplicationUseLogsAnalysisVO; import com.ibeetl.jlw.entity.vo.StudentLogAnalysisVO; import com.ibeetl.jlw.entity.vo.StudentLoginLogVO; import com.ibeetl.jlw.entity.vo.StudentUseLogVO; @@ -84,4 +86,10 @@ public interface StudentDao extends BaseMapper{ StudentActiveInfo studentActiveInfo(Long studentId, Long userId); + /** + * 分页查询使用记录,院校级别的统计。不关心哪个用户 + * @param dto + * @return + */ + PageQuery applicationUseLogsAnalysis(PageQuery dto); } \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/entity/dto/ApplicationUseLogsAnalysisDTO.java b/web/src/main/java/com/ibeetl/jlw/entity/dto/ApplicationUseLogsAnalysisDTO.java new file mode 100644 index 00000000..5aa2df3c --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/dto/ApplicationUseLogsAnalysisDTO.java @@ -0,0 +1,40 @@ +package com.ibeetl.jlw.entity.dto; + +import com.ibeetl.admin.core.web.query.PageParam; +import lombok.Data; + +import java.util.Date; + +/** + * 功能描述:
+ * 子系统应用,使用时间的统计分析实体 + * @author: mlx + * @description: + * @date: 2023/3/15 23:02 + * @version: 1.0 + */ +@Data +public class ApplicationUseLogsAnalysisDTO extends PageParam { + + /** + * 使用时间-开始时间 + */ + private Date startTime; + /** + * 使用时间-结束时间 + */ + private Date endTime; + /** + * 院校ID + */ + private String universitiesCollegesId; + /** + * 子系统ID + */ + private String applicationId; + /** + * 归属模块 + */ + private String courseLabelType; + +} diff --git a/web/src/main/java/com/ibeetl/jlw/entity/vo/ApplicationUseLogsAnalysisVO.java b/web/src/main/java/com/ibeetl/jlw/entity/vo/ApplicationUseLogsAnalysisVO.java new file mode 100644 index 00000000..1cb3e35d --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/vo/ApplicationUseLogsAnalysisVO.java @@ -0,0 +1,54 @@ +package com.ibeetl.jlw.entity.vo; + +import com.ibeetl.admin.core.entity.BaseEntity; +import lombok.Data; + +/** + * 功能描述:
+ * 子系统应用,使用时间的统计分析实体 + * @author: mlx + * @description: + * @date: 2023/3/15 23:02 + * @version: 1.0 + */ +@Data +public class ApplicationUseLogsAnalysisVO extends BaseEntity { + + /** + * 子系统名称 + */ + private String applicationName; + /** + * 子系统ID + */ + private String applicationId; + /** + * 归属模块 + */ + private String courseLabelType; + /** + * 院校名称 + */ + private String universitiesCollegesName; + /** + * 院校ID + */ + private String universitiesCollegesId; + /** + * 所属省份 + */ + private String province; + /** + * 使用人数 + */ + private Long usePeopleCount; + /** + * 使用时长 + */ + private String useDuration; + /** + * 使用总时间 + */ + private String useTotalDuration; + +} diff --git a/web/src/main/java/com/ibeetl/jlw/service/StudentService.java b/web/src/main/java/com/ibeetl/jlw/service/StudentService.java index 11e00232..3fb448d1 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/StudentService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/StudentService.java @@ -23,6 +23,8 @@ import com.ibeetl.admin.core.web.JsonReturnCode; import com.ibeetl.jlw.dao.SchoolClassDao; import com.ibeetl.jlw.dao.StudentDao; import com.ibeetl.jlw.entity.*; +import com.ibeetl.jlw.entity.dto.ApplicationUseLogsAnalysisDTO; +import com.ibeetl.jlw.entity.vo.ApplicationUseLogsAnalysisVO; import com.ibeetl.jlw.entity.vo.StudentLogAnalysisVO; import com.ibeetl.jlw.entity.vo.StudentLoginLogVO; import com.ibeetl.jlw.entity.vo.StudentUseLogVO; @@ -1001,6 +1003,15 @@ public class StudentService extends CoreBaseService{ } } + /** + * 分页查询使用记录,院校级别的统计。不关心哪个用户 + * @param page + * @return + */ + public PageQuery applicationUseLogsAnalysis(PageQuery page) { + return studentDao.applicationUseLogsAnalysis(page); + } + //大赛任务二答卷 线程处理 private class TaskCallableForCT2Q implements Callable { CompetitionTaskSecondQuestionStepQuery condition; diff --git a/web/src/main/java/com/ibeetl/jlw/web/StudentController.java b/web/src/main/java/com/ibeetl/jlw/web/StudentController.java index 5579075b..1d849935 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/StudentController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/StudentController.java @@ -24,8 +24,10 @@ import com.ibeetl.admin.core.util.TimeTool; import com.ibeetl.admin.core.web.JsonResult; import com.ibeetl.jlw.dao.SchoolClassDao; import com.ibeetl.jlw.entity.*; +import com.ibeetl.jlw.entity.dto.ApplicationUseLogsAnalysisDTO; import com.ibeetl.jlw.entity.dto.StudentBatchImportAdminDTO; import com.ibeetl.jlw.entity.dto.StudentBatchImportUniAdminDTO; +import com.ibeetl.jlw.entity.vo.ApplicationUseLogsAnalysisVO; import com.ibeetl.jlw.entity.vo.StudentLogAnalysisVO; import com.ibeetl.jlw.entity.vo.StudentLoginLogVO; import com.ibeetl.jlw.entity.vo.StudentUseLogVO; @@ -3009,4 +3011,39 @@ public class StudentController extends BaseController{ listener.putFailMessage(e.getMessage()); } } + + /** + * 分页查询使用记录,院校级别的统计。不关心哪个用户 + * TODO 理想 这里还没写完。 + * @param dto + * @return + */ + @PostMapping(MODEL + "/applicationUseLogsAnalysis.json") + @ResponseBody + public JsonResult applicationUseLogsAnalysis(ApplicationUseLogsAnalysisDTO dto, @SCoreUser CoreUser coreUser) { + return JsonResult.success(studentService.applicationUseLogsAnalysis(dto.getPageQuery())); + } + + /** + * 功能描述:
+ * 学生登录日志 导出 + * + * @param condition + * @param coreUser + * @Author: lx + * @Date: 2022/12/17 3:34 + */ + @GetMapping(MODEL + "/applicationUseLogsAnalysisExport.json") + @ResponseBody + public String applicationUseLogsAnalysisExport(ApplicationUseLogsAnalysisDTO condition, @SCoreUser CoreUser coreUser) throws IOException { + Assert.isFalse(coreUser.isStudent(), "暂无权限访问!"); + + condition.setPage(1); condition.setLimit(Integer.MAX_VALUE + 0L); + PageQuery page = studentService.applicationUseLogsAnalysis(condition.getPageQuery()); + + String filename = StrUtil.format("院校使用日志导出{}.xlsx", System.currentTimeMillis()); + write(response, filename, "Sheet1", ApplicationUseLogsAnalysisVO.class, page.getList()); + return null; + } + }