From c497f77914da6c0c5367f39575b946b1d1306b86 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 10 Dec 2021 18:30:01 +0800 Subject: [PATCH] 测评 --- src/main/java/com/subsidy/controller/AdministerController.java | 35 ++++++++++++++++++++++++++++++++--- src/main/java/com/subsidy/controller/AnsweringQuestionController.java | 5 +++++ src/main/java/com/subsidy/controller/ClassHourDictController.java | 3 ++- src/main/java/com/subsidy/controller/ExerciseDictController.java | 4 ++-- src/main/java/com/subsidy/controller/ExerciseDoneHistoryController.java | 22 +++++++++++++++++++--- src/main/java/com/subsidy/controller/ExerciseDoneResultController.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/controller/MemberController.java | 26 +++++++++++++++++++++++++- src/main/java/com/subsidy/dto/administer/ClassDailyInfoDTO.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/dto/administer/ClassVodInfoDTO.java | 15 +++++++++++++++ src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java | 2 +- src/main/java/com/subsidy/dto/exercise/SubmitDTO.java | 4 ++++ src/main/java/com/subsidy/dto/member/ContentMemberDTO.java | 2 +- src/main/java/com/subsidy/mapper/ClassHourDictMapper.java | 6 ++++++ src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java | 11 +++++++++++ src/main/java/com/subsidy/mapper/ExerciseDictMapper.java | 2 +- src/main/java/com/subsidy/mapper/ExerciseDoneHistoryMapper.java | 11 ++++++++++- src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java | 31 ++++++++++++++++++++++++++++++- src/main/java/com/subsidy/mapper/PaperDictMapper.java | 10 +++++++++- src/main/java/com/subsidy/mapper/VodDictMapper.java | 15 +++++++++++---- src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java | 7 +++++++ src/main/java/com/subsidy/model/ClassHourDictDO.java | 22 +++++++++++++++++++++- src/main/java/com/subsidy/model/ExerciseDictDO.java | 8 ++++---- src/main/java/com/subsidy/model/ExerciseDoneHistoryDO.java | 10 +++++----- src/main/java/com/subsidy/model/ExerciseDoneResultDO.java | 20 ++++++++++++++++---- src/main/java/com/subsidy/model/PaperDictDO.java | 2 +- src/main/java/com/subsidy/service/AdministerService.java | 16 ++++++++++++---- src/main/java/com/subsidy/service/AnsweringQuestionService.java | 2 ++ src/main/java/com/subsidy/service/ExerciseDictService.java | 2 +- src/main/java/com/subsidy/service/ExerciseDoneHistoryService.java | 6 ++++++ src/main/java/com/subsidy/service/ExerciseDoneResultService.java | 3 +++ src/main/java/com/subsidy/service/MemberService.java | 11 ++++++++++- src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java | 224 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------- src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java | 8 ++++++++ src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java | 22 ++++++++++++++-------- src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java | 26 ++++++++++++++++++-------- src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java | 40 +++++++++++++++++++++++++++++++++++++--- src/main/java/com/subsidy/service/impl/ExerciseDoneHistoryServiceImpl.java | 8 ++++++++ src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java | 6 ++++++ src/main/java/com/subsidy/service/impl/MemberServiceImpl.java | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------- src/main/java/com/subsidy/service/impl/PaperDictServiceImpl.java | 2 +- src/main/java/com/subsidy/util/SMSUtils.java | 2 +- src/main/java/com/subsidy/util/excel/ExcelUtil.java | 19 ++++++++----------- src/main/java/com/subsidy/vo/administer/ClassDailyInfoVO.java | 16 ++++++++++++++++ src/main/java/com/subsidy/vo/administer/ClassVodInfoVO.java | 14 ++++++++++++++ src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java | 2 ++ src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java | 21 +++++++++++++++++++++ src/main/java/com/subsidy/vo/administer/GetPaperDetailVO.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java | 6 +++++- src/main/java/com/subsidy/vo/done/GetMaxScoreVO.java | 14 ++++++++++++++ src/main/java/com/subsidy/vo/exercise/GetDoneDetailVO.java | 16 ++++++++++++++++ src/main/java/com/subsidy/vo/exercise/GetDoneHistoryDetailVO.java | 25 +++++++++++++++++++++++++ src/main/java/com/subsidy/vo/exercise/GetPaperExerciseVO.java | 19 +++++++++++++++++++ src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java | 2 ++ src/main/java/com/subsidy/vo/member/GetPaperDetailVO.java | 9 +++++++++ src/main/java/com/subsidy/vo/member/GetPaperDoneDetailVO.java | 9 +++++++++ src/main/java/com/subsidy/vo/paper/QueryPapersVO.java | 10 ++++++++++ src/main/java/com/subsidy/vo/vod/ClassVodCompleteInfoVO.java | 13 +++++++++++++ src/main/java/com/subsidy/vo/vod/DayInfoItemVO.java | 14 ++++++++++++++ src/main/java/com/subsidy/vo/vod/GetMemberStudyInfoVO.java | 16 ++++++++++++++++ src/main/resources/code.properties | 1 + src/main/resources/logback-spring.xml | 2 +- src/main/resources/mapper/ClassHourDictMapper.xml | 30 ++++++++++++++++++++++++------ src/main/resources/mapper/ClassMemberMappingMapper.xml | 26 ++++++++++++++++++++++++++ src/main/resources/mapper/ExerciseDoneHistoryMapper.xml | 23 ++++++++++++++++++++++- src/main/resources/mapper/ExerciseDoneResultMapper.xml | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/PaperDictMapper.xml | 12 ++++++++++++ src/main/resources/mapper/VodDictMapper.xml | 31 +++++++++++++++++++++++++++++++ src/main/resources/mapper/VodPlayHistoryMapper.xml | 46 ++++++++++++++++++++++++++++++++++++---------- 68 files changed, 1106 insertions(+), 210 deletions(-) create mode 100644 src/main/java/com/subsidy/dto/administer/ClassDailyInfoDTO.java create mode 100644 src/main/java/com/subsidy/dto/administer/ClassVodInfoDTO.java create mode 100644 src/main/java/com/subsidy/vo/administer/ClassDailyInfoVO.java create mode 100644 src/main/java/com/subsidy/vo/administer/ClassVodInfoVO.java create mode 100644 src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java create mode 100644 src/main/java/com/subsidy/vo/administer/GetPaperDetailVO.java create mode 100644 src/main/java/com/subsidy/vo/done/GetMaxScoreVO.java create mode 100644 src/main/java/com/subsidy/vo/exercise/GetDoneDetailVO.java create mode 100644 src/main/java/com/subsidy/vo/exercise/GetDoneHistoryDetailVO.java create mode 100644 src/main/java/com/subsidy/vo/member/GetPaperDetailVO.java create mode 100644 src/main/java/com/subsidy/vo/member/GetPaperDoneDetailVO.java create mode 100644 src/main/java/com/subsidy/vo/vod/ClassVodCompleteInfoVO.java create mode 100644 src/main/java/com/subsidy/vo/vod/DayInfoItemVO.java create mode 100644 src/main/java/com/subsidy/vo/vod/GetMemberStudyInfoVO.java diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index 0f9fb5b..5f33bfd 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -4,10 +4,14 @@ package com.subsidy.controller; import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.administer.ClassDailyInfoDTO; import com.subsidy.dto.administer.ClassDetailDTO; +import com.subsidy.dto.administer.ClassVodInfoDTO; import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.model.AdministerDO; import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ExerciseDoneHistoryDO; +import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.service.AdministerService; import com.subsidy.util.ConstantUtils; import com.subsidy.util.excel.ExcelUtil; @@ -106,7 +110,7 @@ public class AdministerController { @PostMapping("exportClassDetail") @ApiOperation("** 班级管理--班级成员--导出 id 班级id userName") - //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ classDetailDTO.setFlag(true); administerService.exportClassDetail(classDetailDTO); @@ -128,20 +132,33 @@ public class AdministerController { } @PostMapping("exerciseTest") - @ApiOperation("** 班级管理--测评成绩 id 班级id userName paperId") + @ApiOperation("班级管理--测评成绩 id 班级id userName paperId") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){ return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO)); } @PostMapping("exportExerciseTest") - @ApiOperation("** 班级管理--测评成绩 id 班级id userName paperId") + @ApiOperation("班级管理--测评成绩 id 班级id userName paperId") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ classDetailDTO.setFlag(true); administerService.exportExerciseTest(classDetailDTO); } + @PostMapping("getMemberPapers") + @ApiOperation("获取某个成员某个卷子的做题历史 memberId paperId") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getMemberPapers(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + return ResponseData.generateCreatedResponse(0,administerService.getMemberPapers(exerciseDoneResultDO)); + } + + @PostMapping("getPaperDetail") + @ApiOperation("获取某个卷子做题详情 doneId getMemberPapers接口返回id memberId成员id") + public ResponseVO getPaperDetail(@RequestBody ExerciseDoneHistoryDO exerciseDoneHistoryDO){ + return ResponseData.generateCreatedResponse(0,administerService.getPaperDetail(exerciseDoneHistoryDO)); + } + @PostMapping("answerRecord") @ApiOperation("** 班级管理--答疑 id 班级id userName") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @@ -157,6 +174,18 @@ public class AdministerController { administerService.exportAnswerRecord(classDetailDTO); } + @PostMapping("classVodInfo") + @ApiOperation("学习记录---课件进度提醒 {courseId 课程id classId 班级id vodName视频名称}") + public ResponseVO classVodInfo(@RequestBody ClassVodInfoDTO classVodInfoDTO){ + return ResponseData.generateCreatedResponse(0,administerService.classVodInfo(classVodInfoDTO)); + } + + @PostMapping("classDailyInfo") + @ApiOperation("学习记录---每日学习时长 {courseId 课程id classId 班级id userName startDate endDate}") + public ResponseVO classDailyInfo(@RequestBody ClassDailyInfoDTO classDailyInfoDTO){ + return ResponseData.generateCreatedResponse(0,administerService.classDailyInfo(classDailyInfoDTO)); + } + @PostMapping("exportZip") @ApiOperation("** 下载压缩包 id 班级id") @CrossOrigin diff --git a/src/main/java/com/subsidy/controller/AnsweringQuestionController.java b/src/main/java/com/subsidy/controller/AnsweringQuestionController.java index 775897b..214a1ba 100644 --- a/src/main/java/com/subsidy/controller/AnsweringQuestionController.java +++ b/src/main/java/com/subsidy/controller/AnsweringQuestionController.java @@ -52,6 +52,11 @@ public class AnsweringQuestionController { return ResponseData.generateCreatedResponse(0, answeringQuestionService.updateQuestion(answeringQuestionDO)); } + @PostMapping("getNoAnswers") + @ApiOperation("获取某个课程没有回答的答疑个数 classId 课程id") + public ResponseVO getNoAnswers(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.getNoAnswers(answeringQuestionDO)); + } } diff --git a/src/main/java/com/subsidy/controller/ClassHourDictController.java b/src/main/java/com/subsidy/controller/ClassHourDictController.java index 34b7744..5e2a0c5 100644 --- a/src/main/java/com/subsidy/controller/ClassHourDictController.java +++ b/src/main/java/com/subsidy/controller/ClassHourDictController.java @@ -38,7 +38,7 @@ public class ClassHourDictController { } @PostMapping("updateSetting") - @ApiOperation("** 修改当天设置时长 id 主键 classHour status") + @ApiOperation("** 修改当天设置时长 id 主键 classHour status interrupt interruptStatus repeatTime repeatStatus") @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) public ResponseVO updateSetting(@RequestBody ClassHourDictDO classHourDictDO){ return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(classHourDictDO)); @@ -51,4 +51,5 @@ public class ClassHourDictController { } + } diff --git a/src/main/java/com/subsidy/controller/ExerciseDictController.java b/src/main/java/com/subsidy/controller/ExerciseDictController.java index 6a7dde3..4609eb6 100644 --- a/src/main/java/com/subsidy/controller/ExerciseDictController.java +++ b/src/main/java/com/subsidy/controller/ExerciseDictController.java @@ -69,13 +69,13 @@ public class ExerciseDictController { } @PostMapping("submit") - @ApiOperation("** 提交答案 {memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ]} ") + @ApiOperation("** 提交答案 {paperId 卷子id memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ] length:做题时长} ") public ResponseVO submit(@RequestBody SubmitDTO submitDTO){ return ResponseData.generateCreatedResponse(0,exerciseDictService.submit(submitDTO)); } @PostMapping("getPaperExercise") - @ApiOperation("获取某个卷子的所有题目 paperId 卷子id exerciseType 类型 difficulty难度 title题目名称") + @ApiOperation("获取某个卷子的所有题目 pageSize pageNum paperId 卷子id exerciseType 类型 difficulty难度 title题目名称") public ResponseVO getPaperExercise(@RequestBody GetPaperExerciseDTO getPaperExerciseDTO){ return ResponseData.generateCreatedResponse(0,exerciseDictService.getPaperExercise(getPaperExerciseDTO)); } diff --git a/src/main/java/com/subsidy/controller/ExerciseDoneHistoryController.java b/src/main/java/com/subsidy/controller/ExerciseDoneHistoryController.java index 6a981ed..206457d 100644 --- a/src/main/java/com/subsidy/controller/ExerciseDoneHistoryController.java +++ b/src/main/java/com/subsidy/controller/ExerciseDoneHistoryController.java @@ -1,9 +1,16 @@ package com.subsidy.controller; -import org.springframework.web.bind.annotation.RequestMapping; +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.model.ExerciseDoneHistoryDO; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.service.ExerciseDoneHistoryService; +import com.subsidy.service.ExerciseDoneResultService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.Api; /** @@ -16,7 +23,16 @@ import io.swagger.annotations.Api; */ @RestController @Api(tags = "做题历史记录表") -@RequestMapping("/exercise-done-history-do") +@RequestMapping("/exerciseDoneHistory") public class ExerciseDoneHistoryController { + @Autowired + private ExerciseDoneHistoryService exerciseDoneHistoryService; + + @PostMapping("getDoneHistoryDetail") + @ApiOperation("获取某一个试卷每个题目的做题详情 id 提交后返回的id memberId 成员id ") + public ResponseVO getDoneHistoryDetail(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + return ResponseData.generateCreatedResponse(0,exerciseDoneHistoryService.getDoneHistoryDetail(exerciseDoneResultDO)); + } + } diff --git a/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java b/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java index 8c7191f..a798d50 100644 --- a/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java +++ b/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java @@ -1,6 +1,14 @@ package com.subsidy.controller; +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.service.ExerciseDoneResultService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -19,4 +27,14 @@ import io.swagger.annotations.Api; @RequestMapping("/exerciseDoneResult") public class ExerciseDoneResultController { + @Autowired + private ExerciseDoneResultService exerciseDoneResultService; + + @PostMapping("getDoneDetail") + @ApiOperation("提交后获取做题结果 id 提交后返回的id") + public ResponseVO getDoneDetail(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + return ResponseData.generateCreatedResponse(0,exerciseDoneResultService.getDoneDetail(exerciseDoneResultDO)); + } + + } diff --git a/src/main/java/com/subsidy/controller/MemberController.java b/src/main/java/com/subsidy/controller/MemberController.java index 5216a10..1441aea 100644 --- a/src/main/java/com/subsidy/controller/MemberController.java +++ b/src/main/java/com/subsidy/controller/MemberController.java @@ -6,6 +6,8 @@ import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.dto.administer.VerifyCodeDTO; import com.subsidy.dto.member.*; +import com.subsidy.model.ExerciseDoneHistoryDO; +import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.model.MemberDO; import com.subsidy.service.MemberService; import com.subsidy.util.ConstantUtils; @@ -106,16 +108,38 @@ public class MemberController { } @PostMapping("getCourseTest") - @ApiOperation("** 获取课程下的测试情况 {memberId 成员id courseId 课程id classId}") + @ApiOperation("获取课程下的测试情况 {memberId 成员id 班级id classId courseId 课程id }") public ResponseVO getCourseTest(@RequestBody ContentMemberDTO contentMemberDTO){ return ResponseData.generateCreatedResponse(0,memberService.getCourseTest(contentMemberDTO)); } + @PostMapping("getTestDoneDetail") + @ApiOperation("获取某个测评学生的完成情况 paperId memberId") + public ResponseVO getPaperDoneDetail(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + return ResponseData.generateCreatedResponse(0,memberService.getPaperDoneDetail(exerciseDoneResultDO)); + } + @PostMapping("getStudyInfo") @ApiOperation("** 获取学生完成课程情况 id 学员id") public ResponseVO getStudyInfo(@RequestBody MemberDO memberDO){ return ResponseData.generateCreatedResponse(0,memberService.getStudyInfo(memberDO)); } + //@PostMapping("getDoneResult") + //@ApiOperation("获取此次完成情况 id 提交接口返回的id") + //public ResponseVO getDoneResult(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + // return ResponseData.generateCreatedResponse(0,memberService.getDoneResult(exerciseDoneResultDO)); + //} + + @PostMapping("checkTimes") + @ApiOperation("检测是否超过次数 memberId paperId classId") + public ResponseVO checkTimes(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ + return ResponseData.generateCreatedResponse(0,memberService.checkTimes(exerciseDoneResultDO)); + } + + @PostMapping("replace") + public void replace(){ + memberService.replace(); + } } diff --git a/src/main/java/com/subsidy/dto/administer/ClassDailyInfoDTO.java b/src/main/java/com/subsidy/dto/administer/ClassDailyInfoDTO.java new file mode 100644 index 0000000..5b5db3c --- /dev/null +++ b/src/main/java/com/subsidy/dto/administer/ClassDailyInfoDTO.java @@ -0,0 +1,22 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class ClassDailyInfoDTO { + + private Long classId; + + private String userName; + + private Long courseId; + + private String startDate; + + private String endDate; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git a/src/main/java/com/subsidy/dto/administer/ClassVodInfoDTO.java b/src/main/java/com/subsidy/dto/administer/ClassVodInfoDTO.java new file mode 100644 index 0000000..a6a2caf --- /dev/null +++ b/src/main/java/com/subsidy/dto/administer/ClassVodInfoDTO.java @@ -0,0 +1,15 @@ +package com.subsidy.dto.administer; + + +import lombok.Data; + +@Data +public class ClassVodInfoDTO { + + private Long classId; + + private String vodName; + + private Long courseId; + +} diff --git a/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java b/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java index 1dffef7..3612d04 100644 --- a/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java +++ b/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java @@ -9,7 +9,7 @@ public class GetPaperExerciseDTO { private Integer pageNum; - private Integer difficulty; + private String difficulty; private String exerciseType; diff --git a/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java b/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java index 2550af2..ac701c0 100644 --- a/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java +++ b/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java @@ -15,4 +15,8 @@ public class SubmitDTO { private Long courseId; private Long classId; + + private Long paperId; + + private Integer length; } diff --git a/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java b/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java index 452b39b..841ae85 100644 --- a/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java +++ b/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java @@ -7,7 +7,7 @@ public class ContentMemberDTO { private Integer memberId; - private Integer courseId; + private Long courseId; private Integer classId; diff --git a/src/main/java/com/subsidy/mapper/ClassHourDictMapper.java b/src/main/java/com/subsidy/mapper/ClassHourDictMapper.java index 0850873..5073596 100644 --- a/src/main/java/com/subsidy/mapper/ClassHourDictMapper.java +++ b/src/main/java/com/subsidy/mapper/ClassHourDictMapper.java @@ -15,4 +15,10 @@ import org.springframework.stereotype.Repository; @Repository public interface ClassHourDictMapper extends BaseMapper { + /** + * 获取课程的次数 + * @return + */ + ClassHourDictDO getClassHourDictInfo(Long classId); + } diff --git a/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java b/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java index c979186..441f533 100644 --- a/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java +++ b/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java @@ -1,10 +1,12 @@ package com.subsidy.mapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassMemberMappingDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.subsidy.model.MemberDO; +import com.subsidy.vo.administer.ClassDailyInfoVO; import org.springframework.stereotype.Repository; import java.util.List; @@ -25,4 +27,13 @@ public interface ClassMemberMappingMapper extends BaseMapper getMemberClass(Long memberId); + /** + * 获取班级成员id + */ + List getClassMembers(Long classId); + + /** + * 获取班级成员id + */ + IPage getClassMembersWithName(IPage iPage, Long classId, String userName); } diff --git a/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java b/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java index ae24fef..296e4bb 100644 --- a/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java +++ b/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java @@ -20,7 +20,7 @@ public interface ExerciseDictMapper extends BaseMapper { /** * 获取某一套卷子的题目 */ - IPage getPaperExercise(IPage page,Long paperId,Integer difficulty,String exerciseType,String title); + IPage getPaperExercise(IPage page,Long paperId,String difficulty,String exerciseType,String title); diff --git a/src/main/java/com/subsidy/mapper/ExerciseDoneHistoryMapper.java b/src/main/java/com/subsidy/mapper/ExerciseDoneHistoryMapper.java index 348cb0b..86b0f4b 100644 --- a/src/main/java/com/subsidy/mapper/ExerciseDoneHistoryMapper.java +++ b/src/main/java/com/subsidy/mapper/ExerciseDoneHistoryMapper.java @@ -2,8 +2,11 @@ package com.subsidy.mapper; import com.subsidy.model.ExerciseDoneHistoryDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.exercise.GetDoneHistoryDetailVO; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 做题历史记录表 Mapper 接口 @@ -12,7 +15,13 @@ import org.springframework.stereotype.Repository; * @author DengMin * @since 2021-12-03 */ - @Repository +@Repository public interface ExerciseDoneHistoryMapper extends BaseMapper { + /** + * 查看某套卷子的做题详情 + */ + List getDoneHistoryDetail(Long doneId, Long memberId); + + } diff --git a/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java b/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java index 788d86d..da31a9a 100644 --- a/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java +++ b/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java @@ -2,8 +2,14 @@ package com.subsidy.mapper; import com.subsidy.model.ExerciseDoneResultDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.administer.GetMemberPapersVO; +import com.subsidy.vo.administer.GetPaperDetailVO; +import com.subsidy.vo.done.GetMaxScoreVO; +import com.subsidy.vo.exercise.GetDoneDetailVO; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 学生课程习题完成情况 Mapper 接口 @@ -12,7 +18,30 @@ import org.springframework.stereotype.Repository; * @author DengMin * @since 2021-10-15 */ - @Repository +@Repository public interface ExerciseDoneResultMapper extends BaseMapper { + + /** + * 学生某个课程某套卷子的完成情况 + */ + List queryExerciseDoneResult(Long memberId, Long classId, Long paperId); + + /** + * 查看某个卷子完成详情 id exercise_done_result的主键 + */ + List getPaperDetail(Long memberId,Long doneId); + + /** + * 根据主键id查看完成情况 + */ + GetDoneDetailVO getDoneDetail(Long id); + + /** + * 查看某个课程下学生完成卷子的最高分 + */ + List getMaxScore(Long classId, Long memberId); + + + } diff --git a/src/main/java/com/subsidy/mapper/PaperDictMapper.java b/src/main/java/com/subsidy/mapper/PaperDictMapper.java index 52cb06c..8be15e6 100644 --- a/src/main/java/com/subsidy/mapper/PaperDictMapper.java +++ b/src/main/java/com/subsidy/mapper/PaperDictMapper.java @@ -18,6 +18,14 @@ import java.util.List; @Repository public interface PaperDictMapper extends BaseMapper { - List queryPapers(PaperDictDO paperDictDO); + /** + * 查看某个课程下的卷子 + * @return + */ + List queryPapers(Long courseId,String paperName,Integer paperStatus); + /** + * 查看某个卷子有多少人完成 卷子id + */ + Integer completeCount(Long paperId); } diff --git a/src/main/java/com/subsidy/mapper/VodDictMapper.java b/src/main/java/com/subsidy/mapper/VodDictMapper.java index 71dd0e3..08ca4b5 100644 --- a/src/main/java/com/subsidy/mapper/VodDictMapper.java +++ b/src/main/java/com/subsidy/mapper/VodDictMapper.java @@ -3,6 +3,7 @@ package com.subsidy.mapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.VodDictDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.vod.ClassVodCompleteInfoVO; import com.subsidy.vo.vod.GetContendVodsVO; import org.springframework.stereotype.Repository; @@ -21,10 +22,16 @@ public interface VodDictMapper extends BaseMapper { /** * 查看某个目录下的视频 - * @param page - * @param vodName - * @param contentId - * @return */ IPage getContendVods(IPage page,String vodName,Long contentId); + + /** + * 查看某个课程下的视频 + */ + List getCourseVods(Long courseId,String vodName); + + /** + * 获取某课程下,学习人数和平均学习时长 + */ + ClassVodCompleteInfoVO classVodCompleteInfo(Long classId, List memberIds,String vodName); } diff --git a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java index acae106..fb63813 100644 --- a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java +++ b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java @@ -3,9 +3,12 @@ package com.subsidy.mapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.VodPlayHistoryDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.vod.GetMemberStudyInfoVO; import com.subsidy.vo.vod.StudyHistoryVO; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* 视频播放历史记录表 Mapper 接口 @@ -22,5 +25,9 @@ public interface VodPlayHistoryMapper extends BaseMapper { */ IPage studyHistory(IPage iPage,Long memberId); + /** + * 从成员,日期的维度查看学生学习时长 + */ + List getMemberStudyInfo(Long classId,List memberIds,String startDate,String endDate); } diff --git a/src/main/java/com/subsidy/model/ClassHourDictDO.java b/src/main/java/com/subsidy/model/ClassHourDictDO.java index b346cd3..f81135f 100644 --- a/src/main/java/com/subsidy/model/ClassHourDictDO.java +++ b/src/main/java/com/subsidy/model/ClassHourDictDO.java @@ -33,7 +33,27 @@ public class ClassHourDictDO extends BaseModel { private Integer classHour; /** - * 有效/无效 + * 断联时间,单位分钟 + */ + private Integer interrupt; + + /** + * 重复测试次数 + */ + private Integer repeatTime; + + /** + * 断联是否开启 + */ + private Integer interruptStatus; + + /** + * 重复测试是否开启 + */ + private Integer repeatStatus; + + /** + * 课时有效/无效 */ private Integer status; diff --git a/src/main/java/com/subsidy/model/ExerciseDictDO.java b/src/main/java/com/subsidy/model/ExerciseDictDO.java index 73d6341..3a59c9f 100644 --- a/src/main/java/com/subsidy/model/ExerciseDictDO.java +++ b/src/main/java/com/subsidy/model/ExerciseDictDO.java @@ -25,10 +25,10 @@ public class ExerciseDictDO extends BaseModel { @TableId(value = "id", type = IdType.AUTO) private Long id; - ///** - // * 试卷id - // */ - //private Long paperId; + /** + * 试卷id + */ + private Long paperId; /** * 题目类型:单选/多选/是非 diff --git a/src/main/java/com/subsidy/model/ExerciseDoneHistoryDO.java b/src/main/java/com/subsidy/model/ExerciseDoneHistoryDO.java index 1bde02b..49e223b 100644 --- a/src/main/java/com/subsidy/model/ExerciseDoneHistoryDO.java +++ b/src/main/java/com/subsidy/model/ExerciseDoneHistoryDO.java @@ -26,6 +26,11 @@ public class ExerciseDoneHistoryDO extends BaseModel { private Long id; /** + * exercise_done_result的主键 + */ + private Long doneId; + + /** * 卷子id */ private Long paperId; @@ -55,10 +60,5 @@ public class ExerciseDoneHistoryDO extends BaseModel { */ private Integer result; - /** - * 看视频/做题时长 - */ - private Integer length; - } diff --git a/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java b/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java index 44a37e8..74cd33a 100644 --- a/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java +++ b/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java @@ -25,10 +25,11 @@ public class ExerciseDoneResultDO extends BaseModel { @TableId(value = "id", type = IdType.AUTO) private Long id; - ///** - // * 卷子id - // */ - //private Long paperId; + + /** + * 卷子id + */ + private Long paperId; /** * 成员id @@ -55,5 +56,16 @@ public class ExerciseDoneResultDO extends BaseModel { */ private Integer totalCounts; + /** + * 测试分数 + */ + private Integer score; + + /** + * 是否合格 0:不合格 1:合格 + */ + private String result; + + private Integer length; } diff --git a/src/main/java/com/subsidy/model/PaperDictDO.java b/src/main/java/com/subsidy/model/PaperDictDO.java index 193c6d0..ea61b8f 100644 --- a/src/main/java/com/subsidy/model/PaperDictDO.java +++ b/src/main/java/com/subsidy/model/PaperDictDO.java @@ -28,7 +28,7 @@ public class PaperDictDO extends BaseModel { /** * 课程id */ - private String courseId; + private Long courseId; /** * 卷子名称 diff --git a/src/main/java/com/subsidy/service/AdministerService.java b/src/main/java/com/subsidy/service/AdministerService.java index ead20d2..d05dcc1 100644 --- a/src/main/java/com/subsidy/service/AdministerService.java +++ b/src/main/java/com/subsidy/service/AdministerService.java @@ -1,12 +1,12 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.administer.ClassDailyInfoDTO; import com.subsidy.dto.administer.ClassDetailDTO; +import com.subsidy.dto.administer.ClassVodInfoDTO; import com.subsidy.dto.administer.OperatorsDTO; -import com.subsidy.model.AdministerDO; +import com.subsidy.model.*; import com.baomidou.mybatisplus.extension.service.IService; -import com.subsidy.model.ClassDictDO; -import com.subsidy.model.MemberDO; import com.subsidy.vo.administer.*; import com.subsidy.vo.classdict.ClassDetailVO; import com.subsidy.vo.member.ClassSignVO; @@ -48,14 +48,22 @@ public interface AdministerService extends IService { List exportSignDetail(ClassDetailDTO classDetailDTO)throws Exception; - IPage exerciseTest(ClassDetailDTO classDetailDTO); + IPage exerciseTest(ClassDetailDTO classDetailDTO); List exportExerciseTest(ClassDetailDTO classDetailDTO)throws Exception; + List getMemberPapers(ExerciseDoneResultDO exerciseDoneResultDO); + + List getPaperDetail(ExerciseDoneHistoryDO exerciseDoneHistoryDO); + IPage answerRecord(ClassDetailDTO classDetailDTO); List exportAnswerRecord(ClassDetailDTO classDetailDTO)throws Exception; + List classVodInfo(ClassVodInfoDTO classVodInfoDTO); + + IPage classDailyInfo(ClassDailyInfoDTO classDailyInfoDTO); + void export(ClassDetailDTO classDetailDTO)throws Exception; String importMember(Long companyId, MultipartFile multipartFile); diff --git a/src/main/java/com/subsidy/service/AnsweringQuestionService.java b/src/main/java/com/subsidy/service/AnsweringQuestionService.java index 7af3159..d4c3eb2 100644 --- a/src/main/java/com/subsidy/service/AnsweringQuestionService.java +++ b/src/main/java/com/subsidy/service/AnsweringQuestionService.java @@ -22,4 +22,6 @@ public interface AnsweringQuestionService extends IService String deleteQuestion(AnsweringQuestionDO answeringQuestionDO); String updateQuestion(AnsweringQuestionDO answeringQuestionDO); + + Integer getNoAnswers(AnsweringQuestionDO answeringQuestionDO); } diff --git a/src/main/java/com/subsidy/service/ExerciseDictService.java b/src/main/java/com/subsidy/service/ExerciseDictService.java index 96f5fa6..a730c54 100644 --- a/src/main/java/com/subsidy/service/ExerciseDictService.java +++ b/src/main/java/com/subsidy/service/ExerciseDictService.java @@ -31,7 +31,7 @@ public interface ExerciseDictService extends IService { List getCourseExercises(CourseDictDO courseDictDO); - String submit(SubmitDTO submitDTO); + Long submit(SubmitDTO submitDTO); IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO); } diff --git a/src/main/java/com/subsidy/service/ExerciseDoneHistoryService.java b/src/main/java/com/subsidy/service/ExerciseDoneHistoryService.java index 9112b5d..41ded22 100644 --- a/src/main/java/com/subsidy/service/ExerciseDoneHistoryService.java +++ b/src/main/java/com/subsidy/service/ExerciseDoneHistoryService.java @@ -2,6 +2,10 @@ package com.subsidy.service; import com.subsidy.model.ExerciseDoneHistoryDO; import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.vo.exercise.GetDoneHistoryDetailVO; + +import java.util.List; /** *

@@ -13,4 +17,6 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface ExerciseDoneHistoryService extends IService { + List getDoneHistoryDetail(ExerciseDoneResultDO exerciseDoneResultDO); + } diff --git a/src/main/java/com/subsidy/service/ExerciseDoneResultService.java b/src/main/java/com/subsidy/service/ExerciseDoneResultService.java index 5628acb..b29624d 100644 --- a/src/main/java/com/subsidy/service/ExerciseDoneResultService.java +++ b/src/main/java/com/subsidy/service/ExerciseDoneResultService.java @@ -2,6 +2,7 @@ package com.subsidy.service; import com.subsidy.model.ExerciseDoneResultDO; import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.exercise.GetDoneDetailVO; /** *

@@ -13,4 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface ExerciseDoneResultService extends IService { + GetDoneDetailVO getDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO); + } diff --git a/src/main/java/com/subsidy/service/MemberService.java b/src/main/java/com/subsidy/service/MemberService.java index 5541de8..1ddfb6b 100644 --- a/src/main/java/com/subsidy/service/MemberService.java +++ b/src/main/java/com/subsidy/service/MemberService.java @@ -3,10 +3,13 @@ package com.subsidy.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.dto.administer.VerifyCodeDTO; import com.subsidy.dto.member.*; +import com.subsidy.model.ExerciseDoneHistoryDO; +import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.model.MemberDO; import com.baomidou.mybatisplus.extension.service.IService; import com.subsidy.vo.administer.UserRoleVO; import com.subsidy.vo.member.*; +import com.subsidy.vo.paper.QueryPapersVO; import java.util.List; @@ -42,9 +45,15 @@ public interface MemberService extends IService { IPage studyHistory(StudyHistoryDTO studyHistoryDTO); - GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO); + List getCourseTest(ContentMemberDTO contentMemberDTO); + + List getPaperDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO); GetStudyInfoVO getStudyInfo(MemberDO memberDO); + ExerciseDoneResultDO getDoneResult(ExerciseDoneResultDO exerciseDoneResultDO); + + String checkTimes(ExerciseDoneResultDO exerciseDoneResultDO); + void replace(); } diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index 28613c5..790411d 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.administer.ClassDailyInfoDTO; import com.subsidy.dto.administer.ClassDetailDTO; +import com.subsidy.dto.administer.ClassVodInfoDTO; import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.member.ImportMemberDTO; import com.subsidy.mapper.*; @@ -16,8 +18,12 @@ import com.subsidy.util.excel.ExcelColumn; import com.subsidy.util.excel.ExcelUtil; import com.subsidy.vo.administer.*; import com.subsidy.vo.classdict.ClassDetailVO; +import com.subsidy.vo.done.GetMaxScoreVO; import com.subsidy.vo.member.ClassSignVO; import com.subsidy.vo.sign.AnswerRecordVO; +import com.subsidy.vo.vod.ClassVodCompleteInfoVO; +import com.subsidy.vo.vod.DayInfoItemVO; +import com.subsidy.vo.vod.GetMemberStudyInfoVO; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; @@ -46,6 +52,8 @@ import java.io.*; import java.lang.reflect.Member; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; @@ -98,6 +106,9 @@ public class AdministerServiceImpl extends ServiceImpl() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) - .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId())); - - if (null != exerciseDoneResultDO) { - classDetailVO.setRightCounts(exerciseDoneResultDO.getRightCounts()); - classDetailVO.setTotalExeCounts(exerciseDoneResultDO.getTotalCounts()); - classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); + //学生测试完成情况 多套卷子各返回最高成绩 + List getMaxScoreVOS = exerciseDoneResultMapper.getMaxScore(classDictDO.getId(),classDetailVO.getId()); + classDetailVO.setGetMaxScoreVOS(getMaxScoreVOS); - if (classDetailVO.getScore() >= 60) { - classDetailVO.setResult("合格"); - } else { - classDetailVO.setResult("不合格"); + Boolean flag = true; + for (GetMaxScoreVO getMaxScoreVO : getMaxScoreVOS){ + if (getMaxScoreVO.getScore()<60){ + flag = false; } + } + if (flag){ + classDetailVO.setResult("合格"); + }else { + classDetailVO.setResult("不合格"); } classDetailVO.setClassProcess(i + "/" + vodDictDOS.size()); @@ -417,16 +426,26 @@ public class AdministerServiceImpl extends ServiceImpl() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) - .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId())); - if (null != exerciseDoneResultDO) { - classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); - } else { - classDetailVO.setScore(0); + //学生测试完成情况 多套卷子各返回最高成绩 + List getMaxScoreVOS = exerciseDoneResultMapper.getMaxScore(classDictDO.getId(),classDetailVO.getId()); + classDetailVO.setGetMaxScoreVOS(getMaxScoreVOS); + + Boolean flag = true; + + StringBuilder stringBuilder = new StringBuilder(); + for (GetMaxScoreVO getMaxScoreVO : getMaxScoreVOS){ + stringBuilder.append(getMaxScoreVO.getPaperName()+":"+getMaxScoreVO.getScore()); + if (getMaxScoreVO.getScore()<60){ + flag = false; + } + stringBuilder.append(" "); + } + + if (flag){ + classDetailVO.setResult("合格"); + }else { + classDetailVO.setResult("不合格"); } //答疑 @@ -598,36 +617,24 @@ public class AdministerServiceImpl extends ServiceImpl exerciseTest(ClassDetailDTO classDetailDTO) { Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); IPage exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); List classSignVOS = exerciseTestVOIPage.getRecords(); - //课程详情 - ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); - for (ExerciseTestVO exerciseTestVO : classSignVOS) { //学生测试完成情况 - ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) - .eq(ExerciseDoneResultDO::getMemberId, exerciseTestVO.getId())); - - if (null != exerciseDoneResultDO) { - int rights = exerciseDoneResultDO.getRightCounts(); - int total = exerciseDoneResultDO.getTotalCounts(); - int score = MathUtil.intDivFloorPercent(rights, total); - exerciseTestVO.setScore(score); - if (score >= 60) { - exerciseTestVO.setResult("合格"); - } else { - exerciseTestVO.setResult("不合格"); - } - exerciseTestVO.setCount(1); - + List exerciseDoneResultDOs = exerciseDoneResultMapper.queryExerciseDoneResult(exerciseTestVO.getId(), classDetailDTO.getId(), classDetailDTO.getPaperId()); + + exerciseTestVO.setPaperId(exerciseTestVO.getPaperId()); + if (exerciseDoneResultDOs.size() > 0) { + exerciseTestVO.setScore(exerciseDoneResultDOs.get(0).getScore()); + exerciseTestVO.setResult(exerciseDoneResultDOs.get(0).getResult()); + //测评次数 + exerciseTestVO.setCount(exerciseDoneResultDOs.size()); } else { exerciseTestVO.setScore(0); exerciseTestVO.setResult("不合格"); @@ -650,37 +657,36 @@ public class AdministerServiceImpl extends ServiceImpl() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) - .eq(ExerciseDoneResultDO::getMemberId, exerciseTestVO.getId())); - - if (null != exerciseDoneResultDO) { - int rights = exerciseDoneResultDO.getRightCounts(); - int total = exerciseDoneResultDO.getTotalCounts(); - int score = MathUtil.intDivFloorPercent(rights, total); - exerciseTestVO.setScore(score); - if (score >= 60) { - exerciseTestVO.setResult("合格"); - } else { - exerciseTestVO.setResult("不合格"); - } + List exerciseDoneResultDOs = exerciseDoneResultMapper.queryExerciseDoneResult(exerciseTestVO.getId(), classDetailDTO.getId(), classDetailDTO.getPaperId()); + + if (exerciseDoneResultDOs.size() > 0) { + exerciseTestVO.setScore(exerciseDoneResultDOs.get(0).getScore()); + exerciseTestVO.setResult(exerciseDoneResultDOs.get(0).getResult()); + //测评次数 + exerciseTestVO.setCount(exerciseDoneResultDOs.size()); } else { exerciseTestVO.setScore(0); exerciseTestVO.setResult("不合格"); + exerciseTestVO.setCount(0); } } - if (classDetailDTO.getFlag()) { CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); ExcelUtil.writeTestExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", exerciseTestVOS, ExcelFormatUtils.scoreList); } - return exerciseTestVOS; } + public List getMemberPapers(ExerciseDoneResultDO exerciseDoneResultDO) { + return exerciseDoneResultMapper.queryExerciseDoneResult(exerciseDoneResultDO.getMemberId(), null, exerciseDoneResultDO.getPaperId()); + } + + public List getPaperDetail(ExerciseDoneHistoryDO exerciseDoneHistoryDO) { + return exerciseDoneResultMapper.getPaperDetail(exerciseDoneHistoryDO.getMemberId(), exerciseDoneHistoryDO.getDoneId()); + } + public IPage answerRecord(ClassDetailDTO classDetailDTO) { Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); return this.baseMapper.answerRecord(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); @@ -701,6 +707,83 @@ public class AdministerServiceImpl extends ServiceImpl classVodInfo(ClassVodInfoDTO classVodInfoDTO) { + + List result = new ArrayList<>(); + //获取班级成员 + List memberIds = classMemberMappingMapper.getClassMembers(classVodInfoDTO.getClassId()); + + List vodDictDOS = vodDictMapper.getCourseVods(classVodInfoDTO.getCourseId(),classVodInfoDTO.getVodName()); + for (VodDictDO vodDictDO : vodDictDOS) { + + //获取这个视频的学习人数和平均学习时长 + ClassVodCompleteInfoVO classVodCompleteInfoVO = vodDictMapper.classVodCompleteInfo(classVodInfoDTO.getClassId(), memberIds,classVodInfoDTO.getVodName()); + ClassVodInfoVO classVodInfoVO = new ClassVodInfoVO(); + classVodInfoVO.setVodName(vodDictDO.getVodName()); + classVodInfoVO.setStudyCnt(classVodCompleteInfoVO.getCnt()); + classVodInfoVO.setStudyLength(classVodCompleteInfoVO.getStudyLength()); + result.add(classVodInfoVO); + } + return result; + } + + public IPage classDailyInfo(ClassDailyInfoDTO classDailyInfoDTO) { + + Page pager = new Page(classDailyInfoDTO.getPageNum(), classDailyInfoDTO.getPageSize()); + + //获取班级成员 + IPage classDailyInfoVOIPage = classMemberMappingMapper.getClassMembersWithName(pager, classDailyInfoDTO.getClassId(), classDailyInfoDTO.getUserName()); + //整理出这些学员id + List classDailyInfoVOS = classDailyInfoVOIPage.getRecords(); + List memberIds = new ArrayList<>(); + for (ClassDailyInfoVO classDailyInfoVO : classDailyInfoVOS) { + memberIds.add(classDailyInfoVO.getId()); + } + + //这些成员完成情况 + List getMemberStudyInfoVOS = vodPlayHistoryMapper.getMemberStudyInfo(classDailyInfoDTO.getClassId(), memberIds, classDailyInfoDTO.getStartDate(), classDailyInfoDTO.getEndDate()); + + for (ClassDailyInfoVO classDailyInfoVO : classDailyInfoVOS) { + List dayInfoItemVOS = new ArrayList<>(); + for (GetMemberStudyInfoVO getMemberStudyInfoVO : getMemberStudyInfoVOS) { + if (classDailyInfoVO.getId().equals(getMemberStudyInfoVO.getMemberId())) { + DayInfoItemVO dayInfoItemVO = new DayInfoItemVO(); + dayInfoItemVO.setStudyDate(getMemberStudyInfoVO.getStudyDate()); + dayInfoItemVO.setTotalLength(getMemberStudyInfoVO.getPlayLength()); + dayInfoItemVOS.add(dayInfoItemVO); + } + } + classDailyInfoVO.setDayInfoItemVOS(dayInfoItemVOS); + } + return classDailyInfoVOIPage; + } + + + //JAVA 获取时间段内的每一天 + public static List findDaysStr(String begintTime, String endTime) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Date dBegin = null; + Date dEnd = null; + try { + dBegin = sdf.parse(begintTime); + dEnd = sdf.parse(endTime); + } catch (ParseException e) { + e.printStackTrace(); + } + List daysStrList = new ArrayList(); + daysStrList.add(sdf.format(dBegin)); + Calendar calBegin = Calendar.getInstance(); + calBegin.setTime(dBegin); + Calendar calEnd = Calendar.getInstance(); + calEnd.setTime(dEnd); + while (dEnd.after(calBegin.getTime())) { + calBegin.add(Calendar.DAY_OF_MONTH, 1); + String dayStr = sdf.format(calBegin.getTime()); + daysStrList.add(dayStr); + } + return daysStrList; + } + public void export(ClassDetailDTO classDetailDTO) throws Exception { ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); @@ -737,9 +820,9 @@ public class AdministerServiceImpl extends ServiceImpl exerciseTestVOS = exportExerciseTest(classDetailDTO); @@ -759,9 +842,6 @@ public class AdministerServiceImpl extends ServiceImpl 0) { String usernames = userName(accountName, 0, companyId); - memberDO1.setAccountName(usernames); + memberDO1.setAccountName(usernames.replace("u:","v")); } else { - memberDO1.setAccountName(accountName); + memberDO1.setAccountName(accountName.replace("u:","v")); } } catch (BadHanyuPinyinOutputFormatCombination ex) { @@ -1051,11 +1131,7 @@ public class AdministerServiceImpl extends ServiceImpl= 60) { - newCell.setCellValue("合格"); - } else { - newCell.setCellValue("不合格"); - } + rowIndex++; seq++; } diff --git a/src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java b/src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java index fe91fc8..cd3cf55 100644 --- a/src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java @@ -1,5 +1,6 @@ package com.subsidy.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.subsidy.dto.GetCourseQuestionDTO; @@ -42,5 +43,12 @@ public class AnsweringQuestionServiceImpl extends ServiceImpl() + .lambda() + .eq(AnsweringQuestionDO::getClassId, answeringQuestionDO.getClassId()) + .isNull(AnsweringQuestionDO::getAnswer)); + } + } diff --git a/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java index f617547..df43ee0 100644 --- a/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ClassHourDictServiceImpl.java @@ -36,14 +36,20 @@ public class ClassHourDictServiceImpl extends ServiceImpl() .lambda() .eq(ClassHourDictDO::getCompanyId,classHourDictDO.getCompanyId())); - if (null==classHourDictDO){ - ClassHourDictDO classHourDictDO2 = new ClassHourDictDO(); - classHourDictDO2.setCompanyId(classHourDictDO.getCompanyId()); - classHourDictDO2.setStatus(0); - classHourDictDO2.setClassHour(6); - this.baseMapper.insert(classHourDictDO2); - return classHourDictDO2; - } + //if (null==classHourDictDO){ + // ClassHourDictDO classHourDictDO2 = new ClassHourDictDO(); + // classHourDictDO2.setCompanyId(classHourDictDO.getCompanyId()); + // classHourDictDO2.setStatus(0); + // classHourDictDO2.setClassHour(6); + // + // classHourDictDO2.setInterruptStatus(0); + // classHourDictDO2.setInterrupt(15); + // + // classHourDictDO2.setRepeatStatus(0); + // classHourDictDO2.setRepeatTime(3); + // this.baseMapper.insert(classHourDictDO2); + // return classHourDictDO2; + //} return classHourDictDO1; } diff --git a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java index 5d4dfb9..437c402 100644 --- a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java @@ -7,14 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.subsidy.common.exception.HttpException; import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.company.AddCompanyDTO; -import com.subsidy.mapper.AdministerMapper; -import com.subsidy.mapper.DepartmentDictMapper; -import com.subsidy.mapper.RoleAdministerMappingMapper; -import com.subsidy.model.AdministerDO; -import com.subsidy.model.CompanyDictDO; -import com.subsidy.mapper.CompanyDictMapper; -import com.subsidy.model.DepartmentDictDO; -import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.mapper.*; +import com.subsidy.model.*; import com.subsidy.service.CompanyDictService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; @@ -47,6 +41,9 @@ public class CompanyDictServiceImpl extends ServiceImpl operators(OperatorsDTO operatorsDTO) { Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); //判断该用户的角色 @@ -100,6 +97,19 @@ public class CompanyDictServiceImpl extends ServiceImpl getAllExercises(GetAllExercisesDTO getAllExercisesDTO) { Page pager = new Page(getAllExercisesDTO.getPageNum(), getAllExercisesDTO.getPageSize()); @@ -93,7 +101,8 @@ public class ExerciseDictServiceImpl extends ServiceImpl= 60) { + exerciseDoneResultDO.setResult("合格"); + } else { + exerciseDoneResultDO.setResult("不合格"); + } exerciseDoneResultMapper.delete(new QueryWrapper() .lambda() @@ -121,10 +142,23 @@ public class ExerciseDictServiceImpl extends ServiceImpl getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO) { Page pager = new Page(getPaperExerciseDTO.getPageNum(), getPaperExerciseDTO.getPageSize()); return this.baseMapper.getPaperExercise(pager,getPaperExerciseDTO.getPaperId(),getPaperExerciseDTO.getDifficulty(),getPaperExerciseDTO.getExerciseType(),getPaperExerciseDTO.getTitle()); } diff --git a/src/main/java/com/subsidy/service/impl/ExerciseDoneHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/ExerciseDoneHistoryServiceImpl.java index e6149f6..4abd1aa 100644 --- a/src/main/java/com/subsidy/service/impl/ExerciseDoneHistoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ExerciseDoneHistoryServiceImpl.java @@ -2,10 +2,14 @@ package com.subsidy.service.impl; import com.subsidy.model.ExerciseDoneHistoryDO; import com.subsidy.mapper.ExerciseDoneHistoryMapper; +import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.service.ExerciseDoneHistoryService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.vo.exercise.GetDoneHistoryDetailVO; import org.springframework.stereotype.Service; +import java.util.List; + /** *

* 做题历史记录表 服务实现类 @@ -17,4 +21,8 @@ import org.springframework.stereotype.Service; @Service public class ExerciseDoneHistoryServiceImpl extends ServiceImpl implements ExerciseDoneHistoryService { + public List getDoneHistoryDetail(ExerciseDoneResultDO exerciseDoneResultDO){ + return this.baseMapper.getDoneHistoryDetail(exerciseDoneResultDO.getId(),exerciseDoneResultDO.getMemberId()); + } + } diff --git a/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java b/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java index 3575d56..dd2c015 100644 --- a/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java @@ -4,6 +4,7 @@ import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.mapper.ExerciseDoneResultMapper; import com.subsidy.service.ExerciseDoneResultService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.vo.exercise.GetDoneDetailVO; import org.springframework.stereotype.Service; /** @@ -17,4 +18,9 @@ import org.springframework.stereotype.Service; @Service public class ExerciseDoneResultServiceImpl extends ServiceImpl implements ExerciseDoneResultService { + + public GetDoneDetailVO getDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO){ + return this.baseMapper.getDoneDetail(exerciseDoneResultDO.getId()); + } + } diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java index 1b4587f..0cd2edd 100644 --- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -14,8 +14,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.util.ConstantUtils; import com.subsidy.util.MathUtil; import com.subsidy.vo.administer.UserRoleVO; +import com.subsidy.vo.course.QueryCoursesVO; import com.subsidy.vo.member.*; +import com.subsidy.vo.paper.QueryPapersVO; import com.subsidy.vo.vod.StudyHistoryVO; +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -48,9 +54,6 @@ public class MemberServiceImpl extends ServiceImpl imple private VodPlayHistoryMapper vodPlayHistoryMapper; @Autowired - private CourseDictMapper courseDictMapper; - - @Autowired private VodDictMapper vodDictMapper; @Autowired @@ -60,13 +63,10 @@ public class MemberServiceImpl extends ServiceImpl imple private ExerciseDoneResultMapper exerciseDoneResultMapper; @Autowired - private ExerciseDictMapper exerciseDictMapper; - - @Autowired - private DepartmentDictMapper departmentDictMapper; + private ClassMemberMappingMapper classMemberMappingMapper; @Autowired - private ClassMemberMappingMapper classMemberMappingMapper; + private PaperDictMapper paperDictMapper; @Autowired private ClassDictMapper classDictMapper; @@ -77,6 +77,9 @@ public class MemberServiceImpl extends ServiceImpl imple @Autowired private MemberDepartmentMappingMapper memberDepartmentMappingMapper; + @Autowired + private ClassHourDictMapper classHourDictMapper; + public IPage getAll(GetAllDTO getAllDTO) { Page pager = new Page(getAllDTO.getPageNum(), getAllDTO.getPageSize()); IPage iPage = this.baseMapper.getMembers(pager, getAllDTO.getDepartmentId(), getAllDTO.getUserName(), getAllDTO.getStatus()); @@ -160,7 +163,7 @@ public class MemberServiceImpl extends ServiceImpl imple Integer count1 = this.baseMapper.selectCount(new QueryWrapper() .lambda() .eq(MemberDO::getAccountName, addMemberDTO.getAccountName()) - .eq(MemberDO::getCompanyId,addMemberDTO.getCompanyId()) + .eq(MemberDO::getCompanyId, addMemberDTO.getCompanyId()) .ne(MemberDO::getId, addMemberDTO.getId())); if (count1 > 0) { @@ -215,7 +218,8 @@ public class MemberServiceImpl extends ServiceImpl imple SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper() .lambda() .eq(SmsVerifyCodeDO::getTelephone, verifyCodeDTO.getTelephone()) - .eq(SmsVerifyCodeDO::getVerifyCode, verifyCodeDTO.getVerifyCode())); + .eq(SmsVerifyCodeDO::getVerifyCode, verifyCodeDTO.getVerifyCode()) + .gt(SmsVerifyCodeDO::getCreateDate, LocalDateTime.now().minusMinutes(30L))); if (smsCodeDO == null) { throw new HttpException(70010); } @@ -441,45 +445,41 @@ public class MemberServiceImpl extends ServiceImpl imple return iPage; } - public GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO) { - - GetCourseTestVO getCourseTestVO = new GetCourseTestVO(); + public List getCourseTest(ContentMemberDTO contentMemberDTO) { + //查看该班级下的测试卷子(有效卷子) ClassDictDO classDictDO = classDictMapper.selectById(contentMemberDTO.getClassId()); - - CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); - getCourseTestVO.setCourseId(courseDictDO.getId()); - getCourseTestVO.setCourseName(courseDictDO.getCourseName()); - getCourseTestVO.setDeadline(classDictDO.getEndDate()); - - ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() - .lambda() - .eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) - .eq(ExerciseDoneResultDO::getMemberId, contentMemberDTO.getMemberId())); - - if (null != exerciseDoneResultDO) { - getCourseTestVO.setRightCount(String.valueOf(exerciseDoneResultDO.getRightCounts())); - getCourseTestVO.setTotalCount(String.valueOf(exerciseDoneResultDO.getTotalCounts())); - - //正确率 - Integer percent = MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts()); - if (percent >= 60) { - getCourseTestVO.setResult("合格"); + List queryPapersVOS = paperDictMapper.queryPapers(contentMemberDTO.getCourseId(), null, 1); + for (QueryPapersVO queryPapersVO : queryPapersVOS) { + //多少人已完成 + Integer cnt = paperDictMapper.completeCount(queryPapersVO.getId()); + queryPapersVO.setCompleteCnt(cnt); + //自己成绩 + List exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getMemberId, contentMemberDTO.getMemberId()) + .eq(ExerciseDoneResultDO::getPaperId, queryPapersVO.getId()) + .orderByDesc(ExerciseDoneResultDO::getScore)); + + if (exerciseDoneResultDOS.size() > 0) { + queryPapersVO.setRightCounts(exerciseDoneResultDOS.get(0).getRightCounts()); + queryPapersVO.setTotalCount(exerciseDoneResultDOS.get(0).getTotalCounts()); + queryPapersVO.setResult(exerciseDoneResultDOS.get(0).getResult()); } else { - getCourseTestVO.setResult("不合格"); + queryPapersVO.setResult("待完成"); } - getCourseTestVO.setPercent(String.valueOf(percent)); - } else { - getCourseTestVO.setRightCount("-"); - //该课程下有多少习题 - Integer count = exerciseDictMapper.selectCount(new QueryWrapper() - .lambda() - .eq(ExerciseDictDO::getCourseId, courseDictDO.getId())); - getCourseTestVO.setTotalCount(String.valueOf(count)); - getCourseTestVO.setPercent("-"); - getCourseTestVO.setResult("不合格"); + + //截止时间 + queryPapersVO.setEndDate(classDictDO.getEndDate()); } - return getCourseTestVO; + return queryPapersVOS; + } + + public List getPaperDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO) { + return exerciseDoneResultMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getMemberId, exerciseDoneResultDO.getMemberId()) + .eq(ExerciseDoneResultDO::getPaperId, exerciseDoneResultDO.getPaperId())); } public GetStudyInfoVO getStudyInfo(MemberDO memberDO) { @@ -532,4 +532,55 @@ public class MemberServiceImpl extends ServiceImpl imple return getStudyInfoVO; } + public ExerciseDoneResultDO getDoneResult(ExerciseDoneResultDO exerciseDoneResultDO) { + return exerciseDoneResultMapper.selectById(exerciseDoneResultDO.getId()); + } + + public String checkTimes(ExerciseDoneResultDO exerciseDoneResultDO) { + + + ClassHourDictDO classHourDictDO = classHourDictMapper.getClassHourDictInfo(exerciseDoneResultDO.getClassId()); + + if (null != classHourDictDO) { + Integer status = classHourDictDO.getRepeatStatus(); + if (1 == status) { + int cnt = classHourDictDO.getRepeatTime(); + + //查看这个人这个卷子做了几次 + Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getMemberId, exerciseDoneResultDO.getMemberId()) + .eq(ExerciseDoneResultDO::getPaperId, exerciseDoneResultDO.getPaperId())); + + if (cnt <= count) { + throw new HttpException(60001); + } + } + } + return ConstantUtils.CHECK_STATUS; + } + + public void replace(){ + + List memberDOS = this.baseMapper.selectList(null); + + HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); + //拼音小写 + format.setCaseType(HanyuPinyinCaseType.LOWERCASE); + //不带声调 + format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + + try { + for (MemberDO memberDO : memberDOS) { + + String accountName = PinyinHelper.toHanYuPinyinString(memberDO.getUserName(), format, "", true); + memberDO.setAccountName(accountName); + this.baseMapper.updateById(memberDO); + } + }catch (Exception e){ + + } + } + + } diff --git a/src/main/java/com/subsidy/service/impl/PaperDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/PaperDictServiceImpl.java index b651b9f..a7655fd 100644 --- a/src/main/java/com/subsidy/service/impl/PaperDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/PaperDictServiceImpl.java @@ -24,7 +24,7 @@ import java.util.List; public class PaperDictServiceImpl extends ServiceImpl implements PaperDictService { public List queryPapers(PaperDictDO paperDictDO){ - return this.baseMapper.queryPapers(paperDictDO); + return this.baseMapper.queryPapers(paperDictDO.getCourseId(),paperDictDO.getPaperName(),null); } public String deletePaper(PaperDictDO paperDictDO){ diff --git a/src/main/java/com/subsidy/util/SMSUtils.java b/src/main/java/com/subsidy/util/SMSUtils.java index e038dd6..73b3f15 100644 --- a/src/main/java/com/subsidy/util/SMSUtils.java +++ b/src/main/java/com/subsidy/util/SMSUtils.java @@ -48,7 +48,7 @@ public class SMSUtils { //必填:短信签名-可在短信控制台中找到 request.setSignName("有课互联"); //必填:短信模板-可在短信控制台中找到 - request.setTemplateCode("SMS_190945394"); + request.setTemplateCode("SMS_229640297"); //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 request.setTemplateParam("{\"code\":\""+ code +"\"}"); diff --git a/src/main/java/com/subsidy/util/excel/ExcelUtil.java b/src/main/java/com/subsidy/util/excel/ExcelUtil.java index fe908b4..fc6d242 100644 --- a/src/main/java/com/subsidy/util/excel/ExcelUtil.java +++ b/src/main/java/com/subsidy/util/excel/ExcelUtil.java @@ -446,11 +446,8 @@ public class ExcelUtil { newCell = dataRow.createCell(10); newCell.setCellStyle(cellStyle); - if (classDetailVO.getScore() >= 60) { - newCell.setCellValue("合格"); - } else { - newCell.setCellValue("不合格"); - } + + newCell.setCellValue(classDetailVO.getResult()); rowIndex++; seq++; @@ -466,7 +463,7 @@ public class ExcelUtil { } } - public static void writeSignExcel(String companyName, String studyDate, String courseName, String title, Listlist, List headerList) throws Exception { + public static void writeSignExcel(String companyName, String studyDate, String courseName, String title, List list, List headerList) throws Exception { ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletResponse response = requestAttributes.getResponse(); @@ -872,17 +869,17 @@ public class ExcelUtil { //次数 newCell = dataRow.createCell(5); newCell.setCellStyle(cellStyle); - if (exerciseTestVO.getScore()!=0){ + if (exerciseTestVO.getScore() != 0) { newCell.setCellValue(1); - }else { + } else { newCell.setCellValue(0); } newCell = dataRow.createCell(6); newCell.setCellStyle(cellStyle); - if (exerciseTestVO.getScore()>=60){ + if (exerciseTestVO.getScore() >= 60) { newCell.setCellValue("合格"); - }else { + } else { newCell.setCellValue("不合格"); } @@ -1033,7 +1030,7 @@ public class ExcelUtil { sheet.addMergedRegion(cellRangeAddress31); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 3,5); + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 3, 5); sheet.addMergedRegion(cellRangeAddress32); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 thirdRow.createCell(0).setCellValue(thirdHead[0]); diff --git a/src/main/java/com/subsidy/vo/administer/ClassDailyInfoVO.java b/src/main/java/com/subsidy/vo/administer/ClassDailyInfoVO.java new file mode 100644 index 0000000..6859989 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ClassDailyInfoVO.java @@ -0,0 +1,16 @@ +package com.subsidy.vo.administer; + +import com.subsidy.vo.vod.DayInfoItemVO; +import lombok.Data; + +import java.util.List; + +@Data +public class ClassDailyInfoVO { + + private Long id; + + private String userName; + + private List dayInfoItemVOS; +} diff --git a/src/main/java/com/subsidy/vo/administer/ClassVodInfoVO.java b/src/main/java/com/subsidy/vo/administer/ClassVodInfoVO.java new file mode 100644 index 0000000..53e4352 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/ClassVodInfoVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class ClassVodInfoVO { + + private String vodName; + + private Integer studyCnt; + + private Long studyLength; + +} diff --git a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java index 24114d9..0a0e649 100644 --- a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java +++ b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java @@ -25,4 +25,6 @@ public class ExerciseTestVO { private String telephone; private Integer count; + + private Long paperId; } diff --git a/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java b/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java new file mode 100644 index 0000000..836bac9 --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java @@ -0,0 +1,21 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class GetMemberPapersVO { + + private Long id; + + private String paperName; + + private Integer rightCounts; + + private Integer totalCounts; + + private String result; + + private String createDate; + + private Integer score; +} diff --git a/src/main/java/com/subsidy/vo/administer/GetPaperDetailVO.java b/src/main/java/com/subsidy/vo/administer/GetPaperDetailVO.java new file mode 100644 index 0000000..f4f0c1a --- /dev/null +++ b/src/main/java/com/subsidy/vo/administer/GetPaperDetailVO.java @@ -0,0 +1,20 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class GetPaperDetailVO { + + private String title; + + private String result; + + private String answer; + + private String rightAnswer; + + private String items; + + private String detail; + +} diff --git a/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java b/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java index 8132f30..9ab86e9 100644 --- a/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java +++ b/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java @@ -1,8 +1,11 @@ package com.subsidy.vo.classdict; import com.subsidy.util.excel.ExcelColumn; +import com.subsidy.vo.done.GetMaxScoreVO; import lombok.Data; +import java.util.List; + @Data public class ClassDetailVO{ @@ -60,7 +63,7 @@ public class ClassDetailVO{ * 评价测试 */ @ExcelColumn(col = 8,value = "评价测试") - private Integer score; + private String score; /** * 答疑个数 @@ -72,5 +75,6 @@ public class ClassDetailVO{ private String result; + private List getMaxScoreVOS; } diff --git a/src/main/java/com/subsidy/vo/done/GetMaxScoreVO.java b/src/main/java/com/subsidy/vo/done/GetMaxScoreVO.java new file mode 100644 index 0000000..36178a3 --- /dev/null +++ b/src/main/java/com/subsidy/vo/done/GetMaxScoreVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.done; + +import lombok.Data; + +@Data +public class GetMaxScoreVO { + + private Long paperId; + + private String paperName; + + private Long score; + +} diff --git a/src/main/java/com/subsidy/vo/exercise/GetDoneDetailVO.java b/src/main/java/com/subsidy/vo/exercise/GetDoneDetailVO.java new file mode 100644 index 0000000..ebad311 --- /dev/null +++ b/src/main/java/com/subsidy/vo/exercise/GetDoneDetailVO.java @@ -0,0 +1,16 @@ +package com.subsidy.vo.exercise; + +import lombok.Data; + +@Data +public class GetDoneDetailVO { + + private Integer rightCounts; + + private Integer totalCounts; + + private String result; + + private String createDate; + +} diff --git a/src/main/java/com/subsidy/vo/exercise/GetDoneHistoryDetailVO.java b/src/main/java/com/subsidy/vo/exercise/GetDoneHistoryDetailVO.java new file mode 100644 index 0000000..738106f --- /dev/null +++ b/src/main/java/com/subsidy/vo/exercise/GetDoneHistoryDetailVO.java @@ -0,0 +1,25 @@ +package com.subsidy.vo.exercise; + +import lombok.Data; + +@Data +public class GetDoneHistoryDetailVO { + + private Long id; + + private String title; + + private String items; + + private String rightAnswer; + + private String difficulty; + + private String answer; + + private Integer result; + + private String exerciseType; + + +} diff --git a/src/main/java/com/subsidy/vo/exercise/GetPaperExerciseVO.java b/src/main/java/com/subsidy/vo/exercise/GetPaperExerciseVO.java index be97305..0768c79 100644 --- a/src/main/java/com/subsidy/vo/exercise/GetPaperExerciseVO.java +++ b/src/main/java/com/subsidy/vo/exercise/GetPaperExerciseVO.java @@ -2,7 +2,26 @@ package com.subsidy.vo.exercise; import lombok.Data; + @Data public class GetPaperExerciseVO { + private Long id; + + private String exerciseType; + + private Long courseId; + + private String difficulty; + + private String title; + + private String items; + + private String rightAnswer; + + private String detail; + + private Integer orderNo; + } diff --git a/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java b/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java index 9417ae1..72b1479 100644 --- a/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java +++ b/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java @@ -9,4 +9,6 @@ public class MemberExerciseVO { private String selectAnswer; + private Integer result; + } diff --git a/src/main/java/com/subsidy/vo/member/GetPaperDetailVO.java b/src/main/java/com/subsidy/vo/member/GetPaperDetailVO.java new file mode 100644 index 0000000..99ad45a --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/GetPaperDetailVO.java @@ -0,0 +1,9 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class GetPaperDetailVO { + + +} diff --git a/src/main/java/com/subsidy/vo/member/GetPaperDoneDetailVO.java b/src/main/java/com/subsidy/vo/member/GetPaperDoneDetailVO.java new file mode 100644 index 0000000..1d8746f --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/GetPaperDoneDetailVO.java @@ -0,0 +1,9 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class GetPaperDoneDetailVO { + + +} diff --git a/src/main/java/com/subsidy/vo/paper/QueryPapersVO.java b/src/main/java/com/subsidy/vo/paper/QueryPapersVO.java index 7be6aa1..00a303f 100644 --- a/src/main/java/com/subsidy/vo/paper/QueryPapersVO.java +++ b/src/main/java/com/subsidy/vo/paper/QueryPapersVO.java @@ -11,4 +11,14 @@ public class QueryPapersVO { private String paperStatus; + private Integer completeCnt; + + private Integer rightCounts; + + private Integer totalCount; + + private String result; + + private String endDate; + } diff --git a/src/main/java/com/subsidy/vo/vod/ClassVodCompleteInfoVO.java b/src/main/java/com/subsidy/vo/vod/ClassVodCompleteInfoVO.java new file mode 100644 index 0000000..b769a97 --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/ClassVodCompleteInfoVO.java @@ -0,0 +1,13 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class ClassVodCompleteInfoVO { + + private Integer cnt; + + private Long studyLength; + + +} diff --git a/src/main/java/com/subsidy/vo/vod/DayInfoItemVO.java b/src/main/java/com/subsidy/vo/vod/DayInfoItemVO.java new file mode 100644 index 0000000..bb4e088 --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/DayInfoItemVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class DayInfoItemVO { + + private String studyDate; + + private Long totalLength; + + private Integer distinctLength; + +} diff --git a/src/main/java/com/subsidy/vo/vod/GetMemberStudyInfoVO.java b/src/main/java/com/subsidy/vo/vod/GetMemberStudyInfoVO.java new file mode 100644 index 0000000..1cfc897 --- /dev/null +++ b/src/main/java/com/subsidy/vo/vod/GetMemberStudyInfoVO.java @@ -0,0 +1,16 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class GetMemberStudyInfoVO { + + private Long memberId; + + private String studyDate; + + private Long playLength; + + private Integer distinctLength; + +} diff --git a/src/main/resources/code.properties b/src/main/resources/code.properties index 9bcb12f..16a5cfe 100644 --- a/src/main/resources/code.properties +++ b/src/main/resources/code.properties @@ -20,6 +20,7 @@ meishu.code-message[40001]=该目录已存在 meishu.code-message[50001]=该试卷已存在 +meishu.code-message[60001]=已超过最大测试次数 meishu.code-message[70010]=验证码错误 diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index dfd4cbb..0fa1a04 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -42,7 +42,7 @@ ${LOG_PATH}${APP_NAME}/error/%d{yyyy-MM-dd}-%i.log.gz - 30 + 180 diff --git a/src/main/resources/mapper/ClassHourDictMapper.xml b/src/main/resources/mapper/ClassHourDictMapper.xml index f96ac25..138848c 100644 --- a/src/main/resources/mapper/ClassHourDictMapper.xml +++ b/src/main/resources/mapper/ClassHourDictMapper.xml @@ -4,12 +4,12 @@ - - - - - - + + + + + + @@ -20,4 +20,22 @@ id, class_hour, status + + diff --git a/src/main/resources/mapper/ClassMemberMappingMapper.xml b/src/main/resources/mapper/ClassMemberMappingMapper.xml index 018b963..55f02db 100644 --- a/src/main/resources/mapper/ClassMemberMappingMapper.xml +++ b/src/main/resources/mapper/ClassMemberMappingMapper.xml @@ -33,4 +33,30 @@ and t.member_id = #{memberId} + + + + diff --git a/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml b/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml index 8dff1bc..2547a0d 100644 --- a/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml +++ b/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml @@ -14,7 +14,6 @@ - @@ -25,4 +24,26 @@ id, paper_id, member_id, class_id, exercise_id, answer, result, length + + + + diff --git a/src/main/resources/mapper/ExerciseDoneResultMapper.xml b/src/main/resources/mapper/ExerciseDoneResultMapper.xml index 4b35529..7150293 100644 --- a/src/main/resources/mapper/ExerciseDoneResultMapper.xml +++ b/src/main/resources/mapper/ExerciseDoneResultMapper.xml @@ -22,4 +22,74 @@ id, member_id, course_id, right_counts, total_counts + + + + + + + + diff --git a/src/main/resources/mapper/PaperDictMapper.xml b/src/main/resources/mapper/PaperDictMapper.xml index 913d89a..1452d50 100644 --- a/src/main/resources/mapper/PaperDictMapper.xml +++ b/src/main/resources/mapper/PaperDictMapper.xml @@ -34,7 +34,19 @@ AND t.paper_name LIKE concat('%',#{paperName} ,'%') + + AND t.paper_status = #{paperStatus} + + diff --git a/src/main/resources/mapper/VodDictMapper.xml b/src/main/resources/mapper/VodDictMapper.xml index a7efd42..1220b42 100644 --- a/src/main/resources/mapper/VodDictMapper.xml +++ b/src/main/resources/mapper/VodDictMapper.xml @@ -41,4 +41,35 @@ + + + + diff --git a/src/main/resources/mapper/VodPlayHistoryMapper.xml b/src/main/resources/mapper/VodPlayHistoryMapper.xml index 5b71efc..6ad4a30 100644 --- a/src/main/resources/mapper/VodPlayHistoryMapper.xml +++ b/src/main/resources/mapper/VodPlayHistoryMapper.xml @@ -4,15 +4,15 @@ - - - - - - - - - + + + + + + + + + @@ -23,7 +23,7 @@ id, class_id, vod_id, member_id, play_length, play_record - SELECT t2.id, t2.vod_length, @@ -57,4 +57,30 @@ order by t.playDate desc + + -- libgit2 0.25.0