Commit c497f779 by 涂亚平

测评

1 parent 7697e95a
Showing with 956 additions and 136 deletions
...@@ -4,10 +4,14 @@ package com.subsidy.controller; ...@@ -4,10 +4,14 @@ package com.subsidy.controller;
import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO; import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.administer.ClassDailyInfoDTO;
import com.subsidy.dto.administer.ClassDetailDTO; import com.subsidy.dto.administer.ClassDetailDTO;
import com.subsidy.dto.administer.ClassVodInfoDTO;
import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.model.AdministerDO; import com.subsidy.model.AdministerDO;
import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ExerciseDoneHistoryDO;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.service.AdministerService; import com.subsidy.service.AdministerService;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.excel.ExcelUtil; import com.subsidy.util.excel.ExcelUtil;
...@@ -106,7 +110,7 @@ public class AdministerController { ...@@ -106,7 +110,7 @@ public class AdministerController {
@PostMapping("exportClassDetail") @PostMapping("exportClassDetail")
@ApiOperation("** 班级管理--班级成员--导出 id 班级id userName") @ApiOperation("** 班级管理--班级成员--导出 id 班级id userName")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true); classDetailDTO.setFlag(true);
administerService.exportClassDetail(classDetailDTO); administerService.exportClassDetail(classDetailDTO);
...@@ -128,20 +132,33 @@ public class AdministerController { ...@@ -128,20 +132,33 @@ public class AdministerController {
} }
@PostMapping("exerciseTest") @PostMapping("exerciseTest")
@ApiOperation("** 班级管理--测评成绩 id 班级id userName paperId") @ApiOperation("班级管理--测评成绩 id 班级id userName paperId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){ public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO)); return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO));
} }
@PostMapping("exportExerciseTest") @PostMapping("exportExerciseTest")
@ApiOperation("** 班级管理--测评成绩 id 班级id userName paperId") @ApiOperation("班级管理--测评成绩 id 班级id userName paperId")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true); classDetailDTO.setFlag(true);
administerService.exportExerciseTest(classDetailDTO); 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") @PostMapping("answerRecord")
@ApiOperation("** 班级管理--答疑 id 班级id userName") @ApiOperation("** 班级管理--答疑 id 班级id userName")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
...@@ -157,6 +174,18 @@ public class AdministerController { ...@@ -157,6 +174,18 @@ public class AdministerController {
administerService.exportAnswerRecord(classDetailDTO); 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") @PostMapping("exportZip")
@ApiOperation("** 下载压缩包 id 班级id") @ApiOperation("** 下载压缩包 id 班级id")
@CrossOrigin @CrossOrigin
......
...@@ -52,6 +52,11 @@ public class AnsweringQuestionController { ...@@ -52,6 +52,11 @@ public class AnsweringQuestionController {
return ResponseData.generateCreatedResponse(0, answeringQuestionService.updateQuestion(answeringQuestionDO)); 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));
}
} }
...@@ -38,7 +38,7 @@ public class ClassHourDictController { ...@@ -38,7 +38,7 @@ public class ClassHourDictController {
} }
@PostMapping("updateSetting") @PostMapping("updateSetting")
@ApiOperation("** 修改当天设置时长 id 主键 classHour status") @ApiOperation("** 修改当天设置时长 id 主键 classHour status interrupt interruptStatus repeatTime repeatStatus")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateSetting(@RequestBody ClassHourDictDO classHourDictDO){ public ResponseVO updateSetting(@RequestBody ClassHourDictDO classHourDictDO){
return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(classHourDictDO)); return ResponseData.generateCreatedResponse(0,classHourDictService.updateSetting(classHourDictDO));
...@@ -51,4 +51,5 @@ public class ClassHourDictController { ...@@ -51,4 +51,5 @@ public class ClassHourDictController {
} }
} }
...@@ -69,13 +69,13 @@ public class ExerciseDictController { ...@@ -69,13 +69,13 @@ public class ExerciseDictController {
} }
@PostMapping("submit") @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){ public ResponseVO submit(@RequestBody SubmitDTO submitDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.submit(submitDTO)); return ResponseData.generateCreatedResponse(0,exerciseDictService.submit(submitDTO));
} }
@PostMapping("getPaperExercise") @PostMapping("getPaperExercise")
@ApiOperation("获取某个卷子的所有题目 paperId 卷子id exerciseType 类型 difficulty难度 title题目名称") @ApiOperation("获取某个卷子的所有题目 pageSize pageNum paperId 卷子id exerciseType 类型 difficulty难度 title题目名称")
public ResponseVO getPaperExercise(@RequestBody GetPaperExerciseDTO getPaperExerciseDTO){ public ResponseVO getPaperExercise(@RequestBody GetPaperExerciseDTO getPaperExerciseDTO){
return ResponseData.generateCreatedResponse(0,exerciseDictService.getPaperExercise(getPaperExerciseDTO)); return ResponseData.generateCreatedResponse(0,exerciseDictService.getPaperExercise(getPaperExerciseDTO));
} }
......
package com.subsidy.controller; 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; import io.swagger.annotations.Api;
/** /**
...@@ -16,7 +23,16 @@ import io.swagger.annotations.Api; ...@@ -16,7 +23,16 @@ import io.swagger.annotations.Api;
*/ */
@RestController @RestController
@Api(tags = "做题历史记录表") @Api(tags = "做题历史记录表")
@RequestMapping("/exercise-done-history-do") @RequestMapping("/exerciseDoneHistory")
public class ExerciseDoneHistoryController { 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));
}
} }
package com.subsidy.controller; 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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -19,4 +27,14 @@ import io.swagger.annotations.Api; ...@@ -19,4 +27,14 @@ import io.swagger.annotations.Api;
@RequestMapping("/exerciseDoneResult") @RequestMapping("/exerciseDoneResult")
public class ExerciseDoneResultController { 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));
}
} }
...@@ -6,6 +6,8 @@ import com.subsidy.common.ResponseVO; ...@@ -6,6 +6,8 @@ import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired; import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.administer.VerifyCodeDTO; import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.member.*; import com.subsidy.dto.member.*;
import com.subsidy.model.ExerciseDoneHistoryDO;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.service.MemberService; import com.subsidy.service.MemberService;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
...@@ -106,16 +108,38 @@ public class MemberController { ...@@ -106,16 +108,38 @@ public class MemberController {
} }
@PostMapping("getCourseTest") @PostMapping("getCourseTest")
@ApiOperation("** 获取课程下的测试情况 {memberId 成员id courseId 课程id classId}") @ApiOperation("获取课程下的测试情况 {memberId 成员id 班级id classId courseId 课程id }")
public ResponseVO getCourseTest(@RequestBody ContentMemberDTO contentMemberDTO){ public ResponseVO getCourseTest(@RequestBody ContentMemberDTO contentMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.getCourseTest(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") @PostMapping("getStudyInfo")
@ApiOperation("** 获取学生完成课程情况 id 学员id") @ApiOperation("** 获取学生完成课程情况 id 学员id")
public ResponseVO getStudyInfo(@RequestBody MemberDO memberDO){ public ResponseVO getStudyInfo(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.getStudyInfo(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();
}
} }
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;
}
package com.subsidy.dto.administer;
import lombok.Data;
@Data
public class ClassVodInfoDTO {
private Long classId;
private String vodName;
private Long courseId;
}
...@@ -9,7 +9,7 @@ public class GetPaperExerciseDTO { ...@@ -9,7 +9,7 @@ public class GetPaperExerciseDTO {
private Integer pageNum; private Integer pageNum;
private Integer difficulty; private String difficulty;
private String exerciseType; private String exerciseType;
......
...@@ -15,4 +15,8 @@ public class SubmitDTO { ...@@ -15,4 +15,8 @@ public class SubmitDTO {
private Long courseId; private Long courseId;
private Long classId; private Long classId;
private Long paperId;
private Integer length;
} }
...@@ -7,7 +7,7 @@ public class ContentMemberDTO { ...@@ -7,7 +7,7 @@ public class ContentMemberDTO {
private Integer memberId; private Integer memberId;
private Integer courseId; private Long courseId;
private Integer classId; private Integer classId;
......
...@@ -15,4 +15,10 @@ import org.springframework.stereotype.Repository; ...@@ -15,4 +15,10 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface ClassHourDictMapper extends BaseMapper<ClassHourDictDO> { public interface ClassHourDictMapper extends BaseMapper<ClassHourDictDO> {
/**
* 获取课程的次数
* @return
*/
ClassHourDictDO getClassHourDictInfo(Long classId);
} }
package com.subsidy.mapper; package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.classDict.GetSpareMembersDTO; import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.ClassMemberMappingDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.subsidy.vo.administer.ClassDailyInfoVO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
...@@ -25,4 +27,13 @@ public interface ClassMemberMappingMapper extends BaseMapper<ClassMemberMappingD ...@@ -25,4 +27,13 @@ public interface ClassMemberMappingMapper extends BaseMapper<ClassMemberMappingD
*/ */
List<ClassDictDO> getMemberClass(Long memberId); List<ClassDictDO> getMemberClass(Long memberId);
/**
* 获取班级成员id
*/
List<Long> getClassMembers(Long classId);
/**
* 获取班级成员id
*/
IPage<ClassDailyInfoVO> getClassMembersWithName(IPage iPage, Long classId, String userName);
} }
...@@ -20,7 +20,7 @@ public interface ExerciseDictMapper extends BaseMapper<ExerciseDictDO> { ...@@ -20,7 +20,7 @@ public interface ExerciseDictMapper extends BaseMapper<ExerciseDictDO> {
/** /**
* 获取某一套卷子的题目 * 获取某一套卷子的题目
*/ */
IPage<GetPaperExerciseVO> getPaperExercise(IPage page,Long paperId,Integer difficulty,String exerciseType,String title); IPage<GetPaperExerciseVO> getPaperExercise(IPage page,Long paperId,String difficulty,String exerciseType,String title);
......
...@@ -2,8 +2,11 @@ package com.subsidy.mapper; ...@@ -2,8 +2,11 @@ package com.subsidy.mapper;
import com.subsidy.model.ExerciseDoneHistoryDO; import com.subsidy.model.ExerciseDoneHistoryDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.exercise.GetDoneHistoryDetailVO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* <p> * <p>
* 做题历史记录表 Mapper 接口 * 做题历史记录表 Mapper 接口
...@@ -12,7 +15,13 @@ import org.springframework.stereotype.Repository; ...@@ -12,7 +15,13 @@ import org.springframework.stereotype.Repository;
* @author DengMin * @author DengMin
* @since 2021-12-03 * @since 2021-12-03
*/ */
@Repository @Repository
public interface ExerciseDoneHistoryMapper extends BaseMapper<ExerciseDoneHistoryDO> { public interface ExerciseDoneHistoryMapper extends BaseMapper<ExerciseDoneHistoryDO> {
/**
* 查看某套卷子的做题详情
*/
List<GetDoneHistoryDetailVO> getDoneHistoryDetail(Long doneId, Long memberId);
} }
...@@ -2,8 +2,14 @@ package com.subsidy.mapper; ...@@ -2,8 +2,14 @@ package com.subsidy.mapper;
import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.model.ExerciseDoneResultDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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 org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* <p> * <p>
* 学生课程习题完成情况 Mapper 接口 * 学生课程习题完成情况 Mapper 接口
...@@ -12,7 +18,30 @@ import org.springframework.stereotype.Repository; ...@@ -12,7 +18,30 @@ import org.springframework.stereotype.Repository;
* @author DengMin * @author DengMin
* @since 2021-10-15 * @since 2021-10-15
*/ */
@Repository @Repository
public interface ExerciseDoneResultMapper extends BaseMapper<ExerciseDoneResultDO> { public interface ExerciseDoneResultMapper extends BaseMapper<ExerciseDoneResultDO> {
/**
* 学生某个课程某套卷子的完成情况
*/
List<GetMemberPapersVO> queryExerciseDoneResult(Long memberId, Long classId, Long paperId);
/**
* 查看某个卷子完成详情 id exercise_done_result的主键
*/
List<GetPaperDetailVO> getPaperDetail(Long memberId,Long doneId);
/**
* 根据主键id查看完成情况
*/
GetDoneDetailVO getDoneDetail(Long id);
/**
* 查看某个课程下学生完成卷子的最高分
*/
List<GetMaxScoreVO> getMaxScore(Long classId, Long memberId);
} }
...@@ -18,6 +18,14 @@ import java.util.List; ...@@ -18,6 +18,14 @@ import java.util.List;
@Repository @Repository
public interface PaperDictMapper extends BaseMapper<PaperDictDO> { public interface PaperDictMapper extends BaseMapper<PaperDictDO> {
List<QueryPapersVO> queryPapers(PaperDictDO paperDictDO); /**
* 查看某个课程下的卷子
* @return
*/
List<QueryPapersVO> queryPapers(Long courseId,String paperName,Integer paperStatus);
/**
* 查看某个卷子有多少人完成 卷子id
*/
Integer completeCount(Long paperId);
} }
...@@ -3,6 +3,7 @@ package com.subsidy.mapper; ...@@ -3,6 +3,7 @@ package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.VodDictDO; import com.subsidy.model.VodDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.vod.ClassVodCompleteInfoVO;
import com.subsidy.vo.vod.GetContendVodsVO; import com.subsidy.vo.vod.GetContendVodsVO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -21,10 +22,16 @@ public interface VodDictMapper extends BaseMapper<VodDictDO> { ...@@ -21,10 +22,16 @@ public interface VodDictMapper extends BaseMapper<VodDictDO> {
/** /**
* 查看某个目录下的视频 * 查看某个目录下的视频
* @param page
* @param vodName
* @param contentId
* @return
*/ */
IPage<GetContendVodsVO> getContendVods(IPage page,String vodName,Long contentId); IPage<GetContendVodsVO> getContendVods(IPage page,String vodName,Long contentId);
/**
* 查看某个课程下的视频
*/
List<VodDictDO> getCourseVods(Long courseId,String vodName);
/**
* 获取某课程下,学习人数和平均学习时长
*/
ClassVodCompleteInfoVO classVodCompleteInfo(Long classId, List<Long> memberIds,String vodName);
} }
...@@ -3,9 +3,12 @@ package com.subsidy.mapper; ...@@ -3,9 +3,12 @@ package com.subsidy.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.model.VodPlayHistoryDO; import com.subsidy.model.VodPlayHistoryDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.vod.GetMemberStudyInfoVO;
import com.subsidy.vo.vod.StudyHistoryVO; import com.subsidy.vo.vod.StudyHistoryVO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* <p> * <p>
* 视频播放历史记录表 Mapper 接口 * 视频播放历史记录表 Mapper 接口
...@@ -22,5 +25,9 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> { ...@@ -22,5 +25,9 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
*/ */
IPage<StudyHistoryVO> studyHistory(IPage iPage,Long memberId); IPage<StudyHistoryVO> studyHistory(IPage iPage,Long memberId);
/**
* 从成员,日期的维度查看学生学习时长
*/
List<GetMemberStudyInfoVO> getMemberStudyInfo(Long classId,List<Long> memberIds,String startDate,String endDate);
} }
...@@ -33,7 +33,27 @@ public class ClassHourDictDO extends BaseModel { ...@@ -33,7 +33,27 @@ public class ClassHourDictDO extends BaseModel {
private Integer classHour; private Integer classHour;
/** /**
* 有效/无效 * 断联时间,单位分钟
*/
private Integer interrupt;
/**
* 重复测试次数
*/
private Integer repeatTime;
/**
* 断联是否开启
*/
private Integer interruptStatus;
/**
* 重复测试是否开启
*/
private Integer repeatStatus;
/**
* 课时有效/无效
*/ */
private Integer status; private Integer status;
......
...@@ -25,10 +25,10 @@ public class ExerciseDictDO extends BaseModel { ...@@ -25,10 +25,10 @@ public class ExerciseDictDO extends BaseModel {
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
///** /**
// * 试卷id * 试卷id
// */ */
//private Long paperId; private Long paperId;
/** /**
* 题目类型:单选/多选/是非 * 题目类型:单选/多选/是非
......
...@@ -26,6 +26,11 @@ public class ExerciseDoneHistoryDO extends BaseModel { ...@@ -26,6 +26,11 @@ public class ExerciseDoneHistoryDO extends BaseModel {
private Long id; private Long id;
/** /**
* exercise_done_result的主键
*/
private Long doneId;
/**
* 卷子id * 卷子id
*/ */
private Long paperId; private Long paperId;
...@@ -55,10 +60,5 @@ public class ExerciseDoneHistoryDO extends BaseModel { ...@@ -55,10 +60,5 @@ public class ExerciseDoneHistoryDO extends BaseModel {
*/ */
private Integer result; private Integer result;
/**
* 看视频/做题时长
*/
private Integer length;
} }
...@@ -25,10 +25,11 @@ public class ExerciseDoneResultDO extends BaseModel { ...@@ -25,10 +25,11 @@ public class ExerciseDoneResultDO extends BaseModel {
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
///**
// * 卷子id /**
// */ * 卷子id
//private Long paperId; */
private Long paperId;
/** /**
* 成员id * 成员id
...@@ -55,5 +56,16 @@ public class ExerciseDoneResultDO extends BaseModel { ...@@ -55,5 +56,16 @@ public class ExerciseDoneResultDO extends BaseModel {
*/ */
private Integer totalCounts; private Integer totalCounts;
/**
* 测试分数
*/
private Integer score;
/**
* 是否合格 0:不合格 1:合格
*/
private String result;
private Integer length;
} }
...@@ -28,7 +28,7 @@ public class PaperDictDO extends BaseModel { ...@@ -28,7 +28,7 @@ public class PaperDictDO extends BaseModel {
/** /**
* 课程id * 课程id
*/ */
private String courseId; private Long courseId;
/** /**
* 卷子名称 * 卷子名称
......
package com.subsidy.service; package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.administer.ClassDailyInfoDTO;
import com.subsidy.dto.administer.ClassDetailDTO; import com.subsidy.dto.administer.ClassDetailDTO;
import com.subsidy.dto.administer.ClassVodInfoDTO;
import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.model.AdministerDO; import com.subsidy.model.*;
import com.baomidou.mybatisplus.extension.service.IService; 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.administer.*;
import com.subsidy.vo.classdict.ClassDetailVO; import com.subsidy.vo.classdict.ClassDetailVO;
import com.subsidy.vo.member.ClassSignVO; import com.subsidy.vo.member.ClassSignVO;
...@@ -48,14 +48,22 @@ public interface AdministerService extends IService<AdministerDO> { ...@@ -48,14 +48,22 @@ public interface AdministerService extends IService<AdministerDO> {
List<ClassSignVO> exportSignDetail(ClassDetailDTO classDetailDTO)throws Exception; List<ClassSignVO> exportSignDetail(ClassDetailDTO classDetailDTO)throws Exception;
IPage exerciseTest(ClassDetailDTO classDetailDTO); IPage<ExerciseTestVO> exerciseTest(ClassDetailDTO classDetailDTO);
List<ExerciseTestVO> exportExerciseTest(ClassDetailDTO classDetailDTO)throws Exception; List<ExerciseTestVO> exportExerciseTest(ClassDetailDTO classDetailDTO)throws Exception;
List<GetMemberPapersVO> getMemberPapers(ExerciseDoneResultDO exerciseDoneResultDO);
List<GetPaperDetailVO> getPaperDetail(ExerciseDoneHistoryDO exerciseDoneHistoryDO);
IPage answerRecord(ClassDetailDTO classDetailDTO); IPage answerRecord(ClassDetailDTO classDetailDTO);
List<AnswerRecordVO> exportAnswerRecord(ClassDetailDTO classDetailDTO)throws Exception; List<AnswerRecordVO> exportAnswerRecord(ClassDetailDTO classDetailDTO)throws Exception;
List<ClassVodInfoVO> classVodInfo(ClassVodInfoDTO classVodInfoDTO);
IPage<ClassDailyInfoVO> classDailyInfo(ClassDailyInfoDTO classDailyInfoDTO);
void export(ClassDetailDTO classDetailDTO)throws Exception; void export(ClassDetailDTO classDetailDTO)throws Exception;
String importMember(Long companyId, MultipartFile multipartFile); String importMember(Long companyId, MultipartFile multipartFile);
......
...@@ -22,4 +22,6 @@ public interface AnsweringQuestionService extends IService<AnsweringQuestionDO> ...@@ -22,4 +22,6 @@ public interface AnsweringQuestionService extends IService<AnsweringQuestionDO>
String deleteQuestion(AnsweringQuestionDO answeringQuestionDO); String deleteQuestion(AnsweringQuestionDO answeringQuestionDO);
String updateQuestion(AnsweringQuestionDO answeringQuestionDO); String updateQuestion(AnsweringQuestionDO answeringQuestionDO);
Integer getNoAnswers(AnsweringQuestionDO answeringQuestionDO);
} }
...@@ -31,7 +31,7 @@ public interface ExerciseDictService extends IService<ExerciseDictDO> { ...@@ -31,7 +31,7 @@ public interface ExerciseDictService extends IService<ExerciseDictDO> {
List<ExerciseVO> getCourseExercises(CourseDictDO courseDictDO); List<ExerciseVO> getCourseExercises(CourseDictDO courseDictDO);
String submit(SubmitDTO submitDTO); Long submit(SubmitDTO submitDTO);
IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO); IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO);
} }
...@@ -2,6 +2,10 @@ package com.subsidy.service; ...@@ -2,6 +2,10 @@ package com.subsidy.service;
import com.subsidy.model.ExerciseDoneHistoryDO; import com.subsidy.model.ExerciseDoneHistoryDO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.vo.exercise.GetDoneHistoryDetailVO;
import java.util.List;
/** /**
* <p> * <p>
...@@ -13,4 +17,6 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -13,4 +17,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ExerciseDoneHistoryService extends IService<ExerciseDoneHistoryDO> { public interface ExerciseDoneHistoryService extends IService<ExerciseDoneHistoryDO> {
List<GetDoneHistoryDetailVO> getDoneHistoryDetail(ExerciseDoneResultDO exerciseDoneResultDO);
} }
...@@ -2,6 +2,7 @@ package com.subsidy.service; ...@@ -2,6 +2,7 @@ package com.subsidy.service;
import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.model.ExerciseDoneResultDO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.exercise.GetDoneDetailVO;
/** /**
* <p> * <p>
...@@ -13,4 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -13,4 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ExerciseDoneResultService extends IService<ExerciseDoneResultDO> { public interface ExerciseDoneResultService extends IService<ExerciseDoneResultDO> {
GetDoneDetailVO getDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO);
} }
...@@ -3,10 +3,13 @@ package com.subsidy.service; ...@@ -3,10 +3,13 @@ package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.administer.VerifyCodeDTO; import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.member.*; import com.subsidy.dto.member.*;
import com.subsidy.model.ExerciseDoneHistoryDO;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.MemberDO; import com.subsidy.model.MemberDO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.administer.UserRoleVO; import com.subsidy.vo.administer.UserRoleVO;
import com.subsidy.vo.member.*; import com.subsidy.vo.member.*;
import com.subsidy.vo.paper.QueryPapersVO;
import java.util.List; import java.util.List;
...@@ -42,9 +45,15 @@ public interface MemberService extends IService<MemberDO> { ...@@ -42,9 +45,15 @@ public interface MemberService extends IService<MemberDO> {
IPage studyHistory(StudyHistoryDTO studyHistoryDTO); IPage studyHistory(StudyHistoryDTO studyHistoryDTO);
GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO); List<QueryPapersVO> getCourseTest(ContentMemberDTO contentMemberDTO);
List<ExerciseDoneResultDO> getPaperDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO);
GetStudyInfoVO getStudyInfo(MemberDO memberDO); GetStudyInfoVO getStudyInfo(MemberDO memberDO);
ExerciseDoneResultDO getDoneResult(ExerciseDoneResultDO exerciseDoneResultDO);
String checkTimes(ExerciseDoneResultDO exerciseDoneResultDO);
void replace();
} }
package com.subsidy.service.impl; package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.dto.GetCourseQuestionDTO; import com.subsidy.dto.GetCourseQuestionDTO;
...@@ -42,5 +43,12 @@ public class AnsweringQuestionServiceImpl extends ServiceImpl<AnsweringQuestionM ...@@ -42,5 +43,12 @@ public class AnsweringQuestionServiceImpl extends ServiceImpl<AnsweringQuestionM
return ConstantUtils.SET_SUCCESS; return ConstantUtils.SET_SUCCESS;
} }
public Integer getNoAnswers(AnsweringQuestionDO answeringQuestionDO) {
return this.baseMapper.selectCount(new QueryWrapper<AnsweringQuestionDO>()
.lambda()
.eq(AnsweringQuestionDO::getClassId, answeringQuestionDO.getClassId())
.isNull(AnsweringQuestionDO::getAnswer));
}
} }
...@@ -36,14 +36,20 @@ public class ClassHourDictServiceImpl extends ServiceImpl<ClassHourDictMapper, C ...@@ -36,14 +36,20 @@ public class ClassHourDictServiceImpl extends ServiceImpl<ClassHourDictMapper, C
ClassHourDictDO classHourDictDO1 = this.baseMapper.selectOne(new QueryWrapper<ClassHourDictDO>() ClassHourDictDO classHourDictDO1 = this.baseMapper.selectOne(new QueryWrapper<ClassHourDictDO>()
.lambda() .lambda()
.eq(ClassHourDictDO::getCompanyId,classHourDictDO.getCompanyId())); .eq(ClassHourDictDO::getCompanyId,classHourDictDO.getCompanyId()));
if (null==classHourDictDO){ //if (null==classHourDictDO){
ClassHourDictDO classHourDictDO2 = new ClassHourDictDO(); // ClassHourDictDO classHourDictDO2 = new ClassHourDictDO();
classHourDictDO2.setCompanyId(classHourDictDO.getCompanyId()); // classHourDictDO2.setCompanyId(classHourDictDO.getCompanyId());
classHourDictDO2.setStatus(0); // classHourDictDO2.setStatus(0);
classHourDictDO2.setClassHour(6); // classHourDictDO2.setClassHour(6);
this.baseMapper.insert(classHourDictDO2); //
return classHourDictDO2; // classHourDictDO2.setInterruptStatus(0);
} // classHourDictDO2.setInterrupt(15);
//
// classHourDictDO2.setRepeatStatus(0);
// classHourDictDO2.setRepeatTime(3);
// this.baseMapper.insert(classHourDictDO2);
// return classHourDictDO2;
//}
return classHourDictDO1; return classHourDictDO1;
} }
......
...@@ -7,14 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -7,14 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.common.exception.HttpException; import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.administer.OperatorsDTO; import com.subsidy.dto.administer.OperatorsDTO;
import com.subsidy.dto.company.AddCompanyDTO; import com.subsidy.dto.company.AddCompanyDTO;
import com.subsidy.mapper.AdministerMapper; import com.subsidy.mapper.*;
import com.subsidy.mapper.DepartmentDictMapper; import com.subsidy.model.*;
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.service.CompanyDictService; import com.subsidy.service.CompanyDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
...@@ -47,6 +41,9 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -47,6 +41,9 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
@Autowired @Autowired
private DepartmentDictMapper departmentDictMapper; private DepartmentDictMapper departmentDictMapper;
@Autowired
private ClassHourDictMapper classHourDictMapper;
public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) { public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) {
Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize());
//判断该用户的角色 //判断该用户的角色
...@@ -100,6 +97,19 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa ...@@ -100,6 +97,19 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
//departmentDictDO.setParentId(1L); //departmentDictDO.setParentId(1L);
departmentDictMapper.insert(departmentDictDO); departmentDictMapper.insert(departmentDictDO);
//class_hour_dict
ClassHourDictDO classHourDictDO2 = new ClassHourDictDO();
classHourDictDO2.setCompanyId(companyDictDO.getId());
classHourDictDO2.setStatus(0);
classHourDictDO2.setClassHour(6);
classHourDictDO2.setInterruptStatus(0);
classHourDictDO2.setInterrupt(15);
classHourDictDO2.setRepeatStatus(0);
classHourDictDO2.setRepeatTime(3);
classHourDictMapper.insert(classHourDictDO2);
return ConstantUtils.ADD_SUCCESS; return ConstantUtils.ADD_SUCCESS;
} }
......
...@@ -8,17 +8,22 @@ import com.subsidy.dto.exercise.GetAllExercisesDTO; ...@@ -8,17 +8,22 @@ import com.subsidy.dto.exercise.GetAllExercisesDTO;
import com.subsidy.dto.exercise.GetPaperExerciseDTO; import com.subsidy.dto.exercise.GetPaperExerciseDTO;
import com.subsidy.dto.exercise.SubmitDTO; import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.mapper.ExerciseDictMapper; import com.subsidy.mapper.ExerciseDictMapper;
import com.subsidy.mapper.ExerciseDoneHistoryMapper;
import com.subsidy.mapper.ExerciseDoneResultMapper; import com.subsidy.mapper.ExerciseDoneResultMapper;
import com.subsidy.model.CourseDictDO; import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO; import com.subsidy.model.ExerciseDictDO;
import com.subsidy.model.ExerciseDoneHistoryDO;
import com.subsidy.model.ExerciseDoneResultDO; import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.service.ExerciseDictService; import com.subsidy.service.ExerciseDictService;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.MathUtil;
import com.subsidy.vo.course.ExerciseVO; import com.subsidy.vo.course.ExerciseVO;
import com.subsidy.vo.exercise.GetPaperExerciseVO;
import com.subsidy.vo.exercise.MemberExerciseVO; import com.subsidy.vo.exercise.MemberExerciseVO;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -37,6 +42,9 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe ...@@ -37,6 +42,9 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
@Autowired @Autowired
private ExerciseDoneResultMapper exerciseDoneResultMapper; private ExerciseDoneResultMapper exerciseDoneResultMapper;
@Autowired
private ExerciseDoneHistoryMapper exerciseDoneHistoryMapper;
public IPage<ExerciseDictDO> getAllExercises(GetAllExercisesDTO getAllExercisesDTO) { public IPage<ExerciseDictDO> getAllExercises(GetAllExercisesDTO getAllExercisesDTO) {
Page pager = new Page(getAllExercisesDTO.getPageNum(), getAllExercisesDTO.getPageSize()); Page pager = new Page(getAllExercisesDTO.getPageNum(), getAllExercisesDTO.getPageSize());
...@@ -93,7 +101,8 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe ...@@ -93,7 +101,8 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
return exerciseVOS; return exerciseVOS;
} }
public String submit(SubmitDTO submitDTO) { @Transactional(rollbackFor = Exception.class)
public Long submit(SubmitDTO submitDTO) {
ExerciseDoneResultDO exerciseDoneResultDO = new ExerciseDoneResultDO(); ExerciseDoneResultDO exerciseDoneResultDO = new ExerciseDoneResultDO();
...@@ -104,7 +113,10 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe ...@@ -104,7 +113,10 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
for (MemberExerciseVO exerciseVO : memberExerciseVOS) { for (MemberExerciseVO exerciseVO : memberExerciseVOS) {
ExerciseDictDO exerciseDictDO = this.baseMapper.selectById(exerciseVO.getId()); ExerciseDictDO exerciseDictDO = this.baseMapper.selectById(exerciseVO.getId());
if (exerciseDictDO.getRightAnswer().equals(exerciseVO.getSelectAnswer())) { if (exerciseDictDO.getRightAnswer().equals(exerciseVO.getSelectAnswer())) {
exerciseVO.setResult(1);
rightCounts++; rightCounts++;
}else {
exerciseVO.setResult(0);
} }
} }
...@@ -113,6 +125,15 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe ...@@ -113,6 +125,15 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
exerciseDoneResultDO.setTotalCounts(memberExerciseVOS.size()); exerciseDoneResultDO.setTotalCounts(memberExerciseVOS.size());
exerciseDoneResultDO.setCourseId(submitDTO.getCourseId()); exerciseDoneResultDO.setCourseId(submitDTO.getCourseId());
exerciseDoneResultDO.setMemberId(submitDTO.getMemberId()); exerciseDoneResultDO.setMemberId(submitDTO.getMemberId());
exerciseDoneResultDO.setPaperId(submitDTO.getPaperId());
exerciseDoneResultDO.setLength(submitDTO.getLength());
int score = MathUtil.intDivFloorPercent(rightCounts, memberExerciseVOS.size());
exerciseDoneResultDO.setScore(score);
if (score >= 60) {
exerciseDoneResultDO.setResult("合格");
} else {
exerciseDoneResultDO.setResult("不合格");
}
exerciseDoneResultMapper.delete(new QueryWrapper<ExerciseDoneResultDO>() exerciseDoneResultMapper.delete(new QueryWrapper<ExerciseDoneResultDO>()
.lambda() .lambda()
...@@ -121,10 +142,23 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe ...@@ -121,10 +142,23 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
exerciseDoneResultMapper.insert(exerciseDoneResultDO); exerciseDoneResultMapper.insert(exerciseDoneResultDO);
return ConstantUtils.COMMIT_SUCCESS; for (MemberExerciseVO memberExerciseVO : memberExerciseVOS){
ExerciseDoneHistoryDO exerciseDoneHistoryDO = new ExerciseDoneHistoryDO();
exerciseDoneHistoryDO.setPaperId(submitDTO.getPaperId());
exerciseDoneHistoryDO.setDoneId(exerciseDoneResultDO.getId());
exerciseDoneHistoryDO.setMemberId(submitDTO.getMemberId());
exerciseDoneHistoryDO.setClassId(submitDTO.getClassId());
exerciseDoneHistoryDO.setExerciseId(memberExerciseVO.getId());
exerciseDoneHistoryDO.setAnswer(memberExerciseVO.getSelectAnswer());
exerciseDoneHistoryDO.setResult(memberExerciseVO.getResult());
exerciseDoneHistoryMapper.insert(exerciseDoneHistoryDO);
}
return exerciseDoneResultDO.getId();
} }
public IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO) { public IPage<GetPaperExerciseVO> getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO) {
Page pager = new Page(getPaperExerciseDTO.getPageNum(), getPaperExerciseDTO.getPageSize()); Page pager = new Page(getPaperExerciseDTO.getPageNum(), getPaperExerciseDTO.getPageSize());
return this.baseMapper.getPaperExercise(pager,getPaperExerciseDTO.getPaperId(),getPaperExerciseDTO.getDifficulty(),getPaperExerciseDTO.getExerciseType(),getPaperExerciseDTO.getTitle()); return this.baseMapper.getPaperExercise(pager,getPaperExerciseDTO.getPaperId(),getPaperExerciseDTO.getDifficulty(),getPaperExerciseDTO.getExerciseType(),getPaperExerciseDTO.getTitle());
} }
......
...@@ -2,10 +2,14 @@ package com.subsidy.service.impl; ...@@ -2,10 +2,14 @@ package com.subsidy.service.impl;
import com.subsidy.model.ExerciseDoneHistoryDO; import com.subsidy.model.ExerciseDoneHistoryDO;
import com.subsidy.mapper.ExerciseDoneHistoryMapper; import com.subsidy.mapper.ExerciseDoneHistoryMapper;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.service.ExerciseDoneHistoryService; import com.subsidy.service.ExerciseDoneHistoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.vo.exercise.GetDoneHistoryDetailVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* <p> * <p>
* 做题历史记录表 服务实现类 * 做题历史记录表 服务实现类
...@@ -17,4 +21,8 @@ import org.springframework.stereotype.Service; ...@@ -17,4 +21,8 @@ import org.springframework.stereotype.Service;
@Service @Service
public class ExerciseDoneHistoryServiceImpl extends ServiceImpl<ExerciseDoneHistoryMapper, ExerciseDoneHistoryDO> implements ExerciseDoneHistoryService { public class ExerciseDoneHistoryServiceImpl extends ServiceImpl<ExerciseDoneHistoryMapper, ExerciseDoneHistoryDO> implements ExerciseDoneHistoryService {
public List<GetDoneHistoryDetailVO> getDoneHistoryDetail(ExerciseDoneResultDO exerciseDoneResultDO){
return this.baseMapper.getDoneHistoryDetail(exerciseDoneResultDO.getId(),exerciseDoneResultDO.getMemberId());
}
} }
...@@ -4,6 +4,7 @@ import com.subsidy.model.ExerciseDoneResultDO; ...@@ -4,6 +4,7 @@ import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.mapper.ExerciseDoneResultMapper; import com.subsidy.mapper.ExerciseDoneResultMapper;
import com.subsidy.service.ExerciseDoneResultService; import com.subsidy.service.ExerciseDoneResultService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.vo.exercise.GetDoneDetailVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -17,4 +18,9 @@ import org.springframework.stereotype.Service; ...@@ -17,4 +18,9 @@ import org.springframework.stereotype.Service;
@Service @Service
public class ExerciseDoneResultServiceImpl extends ServiceImpl<ExerciseDoneResultMapper, ExerciseDoneResultDO> implements ExerciseDoneResultService { public class ExerciseDoneResultServiceImpl extends ServiceImpl<ExerciseDoneResultMapper, ExerciseDoneResultDO> implements ExerciseDoneResultService {
public GetDoneDetailVO getDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO){
return this.baseMapper.getDoneDetail(exerciseDoneResultDO.getId());
}
} }
...@@ -14,8 +14,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -14,8 +14,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.MathUtil; import com.subsidy.util.MathUtil;
import com.subsidy.vo.administer.UserRoleVO; import com.subsidy.vo.administer.UserRoleVO;
import com.subsidy.vo.course.QueryCoursesVO;
import com.subsidy.vo.member.*; import com.subsidy.vo.member.*;
import com.subsidy.vo.paper.QueryPapersVO;
import com.subsidy.vo.vod.StudyHistoryVO; 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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -48,9 +54,6 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -48,9 +54,6 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
private VodPlayHistoryMapper vodPlayHistoryMapper; private VodPlayHistoryMapper vodPlayHistoryMapper;
@Autowired @Autowired
private CourseDictMapper courseDictMapper;
@Autowired
private VodDictMapper vodDictMapper; private VodDictMapper vodDictMapper;
@Autowired @Autowired
...@@ -60,13 +63,10 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -60,13 +63,10 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
private ExerciseDoneResultMapper exerciseDoneResultMapper; private ExerciseDoneResultMapper exerciseDoneResultMapper;
@Autowired @Autowired
private ExerciseDictMapper exerciseDictMapper; private ClassMemberMappingMapper classMemberMappingMapper;
@Autowired
private DepartmentDictMapper departmentDictMapper;
@Autowired @Autowired
private ClassMemberMappingMapper classMemberMappingMapper; private PaperDictMapper paperDictMapper;
@Autowired @Autowired
private ClassDictMapper classDictMapper; private ClassDictMapper classDictMapper;
...@@ -77,6 +77,9 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -77,6 +77,9 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
@Autowired @Autowired
private MemberDepartmentMappingMapper memberDepartmentMappingMapper; private MemberDepartmentMappingMapper memberDepartmentMappingMapper;
@Autowired
private ClassHourDictMapper classHourDictMapper;
public IPage<GetAllVO> getAll(GetAllDTO getAllDTO) { public IPage<GetAllVO> getAll(GetAllDTO getAllDTO) {
Page pager = new Page(getAllDTO.getPageNum(), getAllDTO.getPageSize()); Page pager = new Page(getAllDTO.getPageNum(), getAllDTO.getPageSize());
IPage iPage = this.baseMapper.getMembers(pager, getAllDTO.getDepartmentId(), getAllDTO.getUserName(), getAllDTO.getStatus()); IPage iPage = this.baseMapper.getMembers(pager, getAllDTO.getDepartmentId(), getAllDTO.getUserName(), getAllDTO.getStatus());
...@@ -160,7 +163,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -160,7 +163,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
Integer count1 = this.baseMapper.selectCount(new QueryWrapper<MemberDO>() Integer count1 = this.baseMapper.selectCount(new QueryWrapper<MemberDO>()
.lambda() .lambda()
.eq(MemberDO::getAccountName, addMemberDTO.getAccountName()) .eq(MemberDO::getAccountName, addMemberDTO.getAccountName())
.eq(MemberDO::getCompanyId,addMemberDTO.getCompanyId()) .eq(MemberDO::getCompanyId, addMemberDTO.getCompanyId())
.ne(MemberDO::getId, addMemberDTO.getId())); .ne(MemberDO::getId, addMemberDTO.getId()));
if (count1 > 0) { if (count1 > 0) {
...@@ -215,7 +218,8 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -215,7 +218,8 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper<SmsVerifyCodeDO>() SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper<SmsVerifyCodeDO>()
.lambda() .lambda()
.eq(SmsVerifyCodeDO::getTelephone, verifyCodeDTO.getTelephone()) .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) { if (smsCodeDO == null) {
throw new HttpException(70010); throw new HttpException(70010);
} }
...@@ -441,45 +445,41 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -441,45 +445,41 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
return iPage; return iPage;
} }
public GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO) { public List<QueryPapersVO> getCourseTest(ContentMemberDTO contentMemberDTO) {
GetCourseTestVO getCourseTestVO = new GetCourseTestVO();
//查看该班级下的测试卷子(有效卷子)
ClassDictDO classDictDO = classDictMapper.selectById(contentMemberDTO.getClassId()); ClassDictDO classDictDO = classDictMapper.selectById(contentMemberDTO.getClassId());
List<QueryPapersVO> queryPapersVOS = paperDictMapper.queryPapers(contentMemberDTO.getCourseId(), null, 1);
CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); for (QueryPapersVO queryPapersVO : queryPapersVOS) {
getCourseTestVO.setCourseId(courseDictDO.getId()); //多少人已完成
getCourseTestVO.setCourseName(courseDictDO.getCourseName()); Integer cnt = paperDictMapper.completeCount(queryPapersVO.getId());
getCourseTestVO.setDeadline(classDictDO.getEndDate()); queryPapersVO.setCompleteCnt(cnt);
//自己成绩
ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper<ExerciseDoneResultDO>() List<ExerciseDoneResultDO> exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper<ExerciseDoneResultDO>()
.lambda() .lambda()
.eq(ExerciseDoneResultDO::getClassId, classDictDO.getId()) .eq(ExerciseDoneResultDO::getMemberId, contentMemberDTO.getMemberId())
.eq(ExerciseDoneResultDO::getMemberId, contentMemberDTO.getMemberId())); .eq(ExerciseDoneResultDO::getPaperId, queryPapersVO.getId())
.orderByDesc(ExerciseDoneResultDO::getScore));
if (null != exerciseDoneResultDO) {
getCourseTestVO.setRightCount(String.valueOf(exerciseDoneResultDO.getRightCounts())); if (exerciseDoneResultDOS.size() > 0) {
getCourseTestVO.setTotalCount(String.valueOf(exerciseDoneResultDO.getTotalCounts())); queryPapersVO.setRightCounts(exerciseDoneResultDOS.get(0).getRightCounts());
queryPapersVO.setTotalCount(exerciseDoneResultDOS.get(0).getTotalCounts());
//正确率 queryPapersVO.setResult(exerciseDoneResultDOS.get(0).getResult());
Integer percent = MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts());
if (percent >= 60) {
getCourseTestVO.setResult("合格");
} else { } else {
getCourseTestVO.setResult("不合格"); queryPapersVO.setResult("待完成");
} }
getCourseTestVO.setPercent(String.valueOf(percent));
} else { //截止时间
getCourseTestVO.setRightCount("-"); queryPapersVO.setEndDate(classDictDO.getEndDate());
//该课程下有多少习题
Integer count = exerciseDictMapper.selectCount(new QueryWrapper<ExerciseDictDO>()
.lambda()
.eq(ExerciseDictDO::getCourseId, courseDictDO.getId()));
getCourseTestVO.setTotalCount(String.valueOf(count));
getCourseTestVO.setPercent("-");
getCourseTestVO.setResult("不合格");
} }
return getCourseTestVO; return queryPapersVOS;
}
public List<ExerciseDoneResultDO> getPaperDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO) {
return exerciseDoneResultMapper.selectList(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
.eq(ExerciseDoneResultDO::getMemberId, exerciseDoneResultDO.getMemberId())
.eq(ExerciseDoneResultDO::getPaperId, exerciseDoneResultDO.getPaperId()));
} }
public GetStudyInfoVO getStudyInfo(MemberDO memberDO) { public GetStudyInfoVO getStudyInfo(MemberDO memberDO) {
...@@ -532,4 +532,55 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -532,4 +532,55 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
return getStudyInfoVO; 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<ExerciseDoneResultDO>()
.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<MemberDO> 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){
}
}
} }
...@@ -24,7 +24,7 @@ import java.util.List; ...@@ -24,7 +24,7 @@ import java.util.List;
public class PaperDictServiceImpl extends ServiceImpl<PaperDictMapper, PaperDictDO> implements PaperDictService { public class PaperDictServiceImpl extends ServiceImpl<PaperDictMapper, PaperDictDO> implements PaperDictService {
public List<QueryPapersVO> queryPapers(PaperDictDO paperDictDO){ public List<QueryPapersVO> queryPapers(PaperDictDO paperDictDO){
return this.baseMapper.queryPapers(paperDictDO); return this.baseMapper.queryPapers(paperDictDO.getCourseId(),paperDictDO.getPaperName(),null);
} }
public String deletePaper(PaperDictDO paperDictDO){ public String deletePaper(PaperDictDO paperDictDO){
......
...@@ -48,7 +48,7 @@ public class SMSUtils { ...@@ -48,7 +48,7 @@ public class SMSUtils {
//必填:短信签名-可在短信控制台中找到 //必填:短信签名-可在短信控制台中找到
request.setSignName("有课互联"); request.setSignName("有课互联");
//必填:短信模板-可在短信控制台中找到 //必填:短信模板-可在短信控制台中找到
request.setTemplateCode("SMS_190945394"); request.setTemplateCode("SMS_229640297");
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
request.setTemplateParam("{\"code\":\""+ code +"\"}"); request.setTemplateParam("{\"code\":\""+ code +"\"}");
......
...@@ -446,11 +446,8 @@ public class ExcelUtil { ...@@ -446,11 +446,8 @@ public class ExcelUtil {
newCell = dataRow.createCell(10); newCell = dataRow.createCell(10);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
if (classDetailVO.getScore() >= 60) {
newCell.setCellValue("合格"); newCell.setCellValue(classDetailVO.getResult());
} else {
newCell.setCellValue("不合格");
}
rowIndex++; rowIndex++;
seq++; seq++;
...@@ -466,7 +463,7 @@ public class ExcelUtil { ...@@ -466,7 +463,7 @@ public class ExcelUtil {
} }
} }
public static <T> void writeSignExcel(String companyName, String studyDate, String courseName, String title, List<ClassSignVO>list, List<String> headerList) throws Exception { public static <T> void writeSignExcel(String companyName, String studyDate, String courseName, String title, List<ClassSignVO> list, List<String> headerList) throws Exception {
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletResponse response = requestAttributes.getResponse(); HttpServletResponse response = requestAttributes.getResponse();
...@@ -872,17 +869,17 @@ public class ExcelUtil { ...@@ -872,17 +869,17 @@ public class ExcelUtil {
//次数 //次数
newCell = dataRow.createCell(5); newCell = dataRow.createCell(5);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
if (exerciseTestVO.getScore()!=0){ if (exerciseTestVO.getScore() != 0) {
newCell.setCellValue(1); newCell.setCellValue(1);
}else { } else {
newCell.setCellValue(0); newCell.setCellValue(0);
} }
newCell = dataRow.createCell(6); newCell = dataRow.createCell(6);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
if (exerciseTestVO.getScore()>=60){ if (exerciseTestVO.getScore() >= 60) {
newCell.setCellValue("合格"); newCell.setCellValue("合格");
}else { } else {
newCell.setCellValue("不合格"); newCell.setCellValue("不合格");
} }
...@@ -1033,7 +1030,7 @@ public class ExcelUtil { ...@@ -1033,7 +1030,7 @@ public class ExcelUtil {
sheet.addMergedRegion(cellRangeAddress31); sheet.addMergedRegion(cellRangeAddress31);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 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); sheet.addMergedRegion(cellRangeAddress32);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框
thirdRow.createCell(0).setCellValue(thirdHead[0]); thirdRow.createCell(0).setCellValue(thirdHead[0]);
......
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<DayInfoItemVO> dayInfoItemVOS;
}
package com.subsidy.vo.administer;
import lombok.Data;
@Data
public class ClassVodInfoVO {
private String vodName;
private Integer studyCnt;
private Long studyLength;
}
...@@ -25,4 +25,6 @@ public class ExerciseTestVO { ...@@ -25,4 +25,6 @@ public class ExerciseTestVO {
private String telephone; private String telephone;
private Integer count; private Integer count;
private Long paperId;
} }
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;
}
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;
}
package com.subsidy.vo.classdict; package com.subsidy.vo.classdict;
import com.subsidy.util.excel.ExcelColumn; import com.subsidy.util.excel.ExcelColumn;
import com.subsidy.vo.done.GetMaxScoreVO;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class ClassDetailVO{ public class ClassDetailVO{
...@@ -60,7 +63,7 @@ public class ClassDetailVO{ ...@@ -60,7 +63,7 @@ public class ClassDetailVO{
* 评价测试 * 评价测试
*/ */
@ExcelColumn(col = 8,value = "评价测试") @ExcelColumn(col = 8,value = "评价测试")
private Integer score; private String score;
/** /**
* 答疑个数 * 答疑个数
...@@ -72,5 +75,6 @@ public class ClassDetailVO{ ...@@ -72,5 +75,6 @@ public class ClassDetailVO{
private String result; private String result;
private List<GetMaxScoreVO> getMaxScoreVOS;
} }
package com.subsidy.vo.done;
import lombok.Data;
@Data
public class GetMaxScoreVO {
private Long paperId;
private String paperName;
private Long score;
}
package com.subsidy.vo.exercise;
import lombok.Data;
@Data
public class GetDoneDetailVO {
private Integer rightCounts;
private Integer totalCounts;
private String result;
private String createDate;
}
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;
}
...@@ -2,7 +2,26 @@ package com.subsidy.vo.exercise; ...@@ -2,7 +2,26 @@ package com.subsidy.vo.exercise;
import lombok.Data; import lombok.Data;
@Data @Data
public class GetPaperExerciseVO { 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;
} }
...@@ -9,4 +9,6 @@ public class MemberExerciseVO { ...@@ -9,4 +9,6 @@ public class MemberExerciseVO {
private String selectAnswer; private String selectAnswer;
private Integer result;
} }
package com.subsidy.vo.member;
import lombok.Data;
@Data
public class GetPaperDetailVO {
}
package com.subsidy.vo.member;
import lombok.Data;
@Data
public class GetPaperDoneDetailVO {
}
...@@ -11,4 +11,14 @@ public class QueryPapersVO { ...@@ -11,4 +11,14 @@ public class QueryPapersVO {
private String paperStatus; private String paperStatus;
private Integer completeCnt;
private Integer rightCounts;
private Integer totalCount;
private String result;
private String endDate;
} }
package com.subsidy.vo.vod;
import lombok.Data;
@Data
public class ClassVodCompleteInfoVO {
private Integer cnt;
private Long studyLength;
}
package com.subsidy.vo.vod;
import lombok.Data;
@Data
public class DayInfoItemVO {
private String studyDate;
private Long totalLength;
private Integer distinctLength;
}
package com.subsidy.vo.vod;
import lombok.Data;
@Data
public class GetMemberStudyInfoVO {
private Long memberId;
private String studyDate;
private Long playLength;
private Integer distinctLength;
}
...@@ -20,6 +20,7 @@ meishu.code-message[40001]=该目录已存在 ...@@ -20,6 +20,7 @@ meishu.code-message[40001]=该目录已存在
meishu.code-message[50001]=该试卷已存在 meishu.code-message[50001]=该试卷已存在
meishu.code-message[60001]=已超过最大测试次数
meishu.code-message[70010]=验证码错误 meishu.code-message[70010]=验证码错误
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</timeBasedFileNamingAndTriggeringPolicy> </timeBasedFileNamingAndTriggeringPolicy>
<FileNamePattern>${LOG_PATH}${APP_NAME}/error/%d{yyyy-MM-dd}-%i.log.gz <FileNamePattern>${LOG_PATH}${APP_NAME}/error/%d{yyyy-MM-dd}-%i.log.gz
</FileNamePattern> </FileNamePattern>
<MaxHistory>30</MaxHistory> <MaxHistory>180</MaxHistory>
</rollingPolicy> </rollingPolicy>
</appender> </appender>
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.ClassHourDictDO"> <resultMap id="BaseResultMap" type="com.subsidy.model.ClassHourDictDO">
<id column="id" property="id" /> <id column="id" property="id"/>
<result column="create_date" property="createDate" /> <result column="create_date" property="createDate"/>
<result column="update_date" property="updateDate" /> <result column="update_date" property="updateDate"/>
<result column="delete_date" property="deleteDate" /> <result column="delete_date" property="deleteDate"/>
<result column="class_hour" property="classHour" /> <result column="class_hour" property="classHour"/>
<result column="status" property="status" /> <result column="status" property="status"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
...@@ -20,4 +20,22 @@ ...@@ -20,4 +20,22 @@
id, class_hour, status id, class_hour, status
</sql> </sql>
<select id="getClassHourDictInfo" parameterType="long" resultType="com.subsidy.model.ClassHourDictDO">
SELECT
class_hour,
interrupt,
repeat_time,
STATUS,
interrupt_status,
repeat_status
FROM
class_dict t
LEFT JOIN class_hour_dict t2 ON t.company_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.id = #{classId}
AND t2.repeat_status = 1
</select>
</mapper> </mapper>
...@@ -33,4 +33,30 @@ ...@@ -33,4 +33,30 @@
and t.member_id = #{memberId} and t.member_id = #{memberId}
</select> </select>
<select id="getClassMembers" resultType="long">
SELECT
t.member_id
FROM
class_member_mapping t
WHERE
t.delete_date IS NULL
AND t.class_id = #{classId}
</select>
<select id="getClassMembersWithName" resultType="com.subsidy.vo.administer.ClassDailyInfoVO">
SELECT
t2.id,
t2.user_name
FROM
class_member_mapping t
left join member t2 on t.member_id = t2.id
WHERE
t.delete_date IS NULL
AND t.class_id = #{classId}
<if test="userName !=null and userName !=''">
and t2.user_name like concat('%',#{userName} ,'%')
</if>
</select>
</mapper> </mapper>
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
<result column="exercise_id" property="exerciseId" /> <result column="exercise_id" property="exerciseId" />
<result column="answer" property="answer" /> <result column="answer" property="answer" />
<result column="result" property="result" /> <result column="result" property="result" />
<result column="length" property="length" />
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
...@@ -25,4 +24,26 @@ ...@@ -25,4 +24,26 @@
id, paper_id, member_id, class_id, exercise_id, answer, result, length id, paper_id, member_id, class_id, exercise_id, answer, result, length
</sql> </sql>
<select id="getDoneHistoryDetail" resultType="com.subsidy.vo.exercise.GetDoneHistoryDetailVO">
SELECT
t2.id,
t2.title,
t2.items,
t2.right_answer,
t2.difficulty,
t.answer,
t.result,
t2.exercise_type
FROM
exercise_done_history t
LEFT JOIN exercise_dict t2 on t.exercise_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.done_id = #{doneId}
AND t.member_id = #{memberId}
</select>
</mapper> </mapper>
...@@ -22,4 +22,74 @@ ...@@ -22,4 +22,74 @@
id, member_id, course_id, right_counts, total_counts id, member_id, course_id, right_counts, total_counts
</sql> </sql>
<select id="queryExerciseDoneResult" resultType="com.subsidy.vo.administer.GetMemberPapersVO">
SELECT
t.id,
t.paper_id,
right_counts,
total_counts,
score,
result,
create_date
FROM
exercise_done_result t
WHERE
t.delete_date is null
and t.member_id = #{memberId}
<if test="classId != null and classId !=''">
AND t.class_id = #{classId}
</if>
<if test="paperId != null and paperId !=''">
AND t.paper_id = #{paperId}
</if>
order by t.create_date
</select>
<select id="getPaperDetail" resultType="com.subsidy.vo.administer.GetPaperDetailVO">
SELECT
t2.title,
t.result,
t.answer,
t2.right_answer,
t2.items,
t2.detail
FROM
exercise_done_history t
LEFT JOIN exercise_dict t2 ON t.exercise_id = t2.id
WHERE
t.delete_date is null
and t2.delete_date is null
and t.done_id = #{doneId}
AND t.member_id = #{memberId}
</select>
<select id="getDoneDetail" parameterType="long" resultType="com.subsidy.vo.exercise.GetDoneDetailVO">
SELECT
right_counts,
total_counts,
result,
create_date
FROM
exercise_done_result t
where t.delete_date is null
and t.id = #{id}
</select>
<select id="getMaxScore" resultType="com.subsidy.vo.done.GetMaxScoreVO">
SELECT
t.paper_id,
t2.paper_name,
max( t.score ) AS score
FROM
exercise_done_result t
left join paper_dict t2 on t.paper_id = t2.id
WHERE
t.member_id = #{memberId}
AND t.class_id = #{classId}
GROUP BY
t.class_id,
t.paper_id,
t.member_id
</select>
</mapper> </mapper>
...@@ -34,7 +34,19 @@ ...@@ -34,7 +34,19 @@
<if test="paperName != null and paperName !=''"> <if test="paperName != null and paperName !=''">
AND t.paper_name LIKE concat('%',#{paperName} ,'%') AND t.paper_name LIKE concat('%',#{paperName} ,'%')
</if> </if>
<if test="paperStatus != null and paperStatus !=''">
AND t.paper_status = #{paperStatus}
</if>
</select> </select>
<select id="completeCount" parameterType="long" resultType="integer">
SELECT
count( DISTINCT t.member_id ) AS cnt
FROM
exercise_done_result t
WHERE
t.delete_date IS NULL
AND t.paper_id = #{paperId}
</select>
</mapper> </mapper>
...@@ -41,4 +41,35 @@ ...@@ -41,4 +41,35 @@
</if> </if>
</select> </select>
<select id="getCourseVods" parameterType="long" resultType="com.subsidy.model.VodDictDO">
SELECT
t2.id,
t2.vod_name
FROM
course_content t
LEFT JOIN vod_dict t2 ON t.id = t2.content_id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
and t.course_id = #{courseId}
<if test="vodName != null and vodName !=''">
and t2.vod_name like concat('%',#{vodName} ,'%')
</if>
</select>
<select id="classVodCompleteInfo" resultType="com.subsidy.vo.vod.ClassVodCompleteInfoVO">
SELECT
count(DISTINCT ( t.member_id )) AS cnt,
round( sum( t.play_length ) / count( DISTINCT ( t.member_id )), 0 ) studyLength
FROM
vod_play_history t
WHERE
t.class_id = #{classId}
AND t.member_id IN
<foreach collection="memberIds" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
</mapper> </mapper>
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.VodPlayHistoryDO"> <resultMap id="BaseResultMap" type="com.subsidy.model.VodPlayHistoryDO">
<id column="id" property="id" /> <id column="id" property="id"/>
<result column="create_date" property="createDate" /> <result column="create_date" property="createDate"/>
<result column="update_date" property="updateDate" /> <result column="update_date" property="updateDate"/>
<result column="delete_date" property="deleteDate" /> <result column="delete_date" property="deleteDate"/>
<result column="class_id" property="classId" /> <result column="class_id" property="classId"/>
<result column="vod_id" property="vodId" /> <result column="vod_id" property="vodId"/>
<result column="member_id" property="memberId" /> <result column="member_id" property="memberId"/>
<result column="play_length" property="playLength" /> <result column="play_length" property="playLength"/>
<result column="play_record" property="playRecord" /> <result column="play_record" property="playRecord"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
id, class_id, vod_id, member_id, play_length, play_record id, class_id, vod_id, member_id, play_length, play_record
</sql> </sql>
<select id="studyHistory" parameterType="long" resultType="com.subsidy.vo.vod.StudyHistoryVO"> <select id="studyHistory" parameterType="long" resultType="com.subsidy.vo.vod.StudyHistoryVO">
SELECT SELECT
t2.id, t2.id,
t2.vod_length, t2.vod_length,
...@@ -57,4 +57,30 @@ ...@@ -57,4 +57,30 @@
order by t.playDate desc order by t.playDate desc
</select> </select>
<select id="getMemberStudyInfo" resultType="com.subsidy.vo.vod.GetMemberStudyInfoVO">
SELECT
t.member_id,
DATE_FORMAT( t.create_date, '%Y-%m-%d' ) as studyDate,
sum( t.play_length ) as playLength,
sum(
IF
( t.play_length > t2.vod_length, t2.vod_length, t.play_length )) AS distinctLength
FROM
vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.class_id = #{classId}
AND t.member_id IN
<foreach collection="memberIds" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
AND DATE_FORMAT( t.create_date, '%Y-%m-%d' ) BETWEEN DATE_FORMAT( #{startDate}, '%Y-%m-%d' )
AND DATE_FORMAT( #{endDate}, '%Y-%m-%d' )
GROUP BY
t.member_id,
DATE_FORMAT( t.create_date, '%Y-%m-%d' )
</select>
</mapper> </mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!