Commit c497f779 by 涂亚平

测评

1 parent 7697e95a
Showing with 1106 additions and 210 deletions
......@@ -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
......
......@@ -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));
}
}
......@@ -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 {
}
}
......@@ -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));
}
......
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));
}
}
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));
}
}
......@@ -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();
}
}
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 {
private Integer pageNum;
private Integer difficulty;
private String difficulty;
private String exerciseType;
......
......@@ -15,4 +15,8 @@ public class SubmitDTO {
private Long courseId;
private Long classId;
private Long paperId;
private Integer length;
}
......@@ -7,7 +7,7 @@ public class ContentMemberDTO {
private Integer memberId;
private Integer courseId;
private Long courseId;
private Integer classId;
......
......@@ -15,4 +15,10 @@ import org.springframework.stereotype.Repository;
@Repository
public interface ClassHourDictMapper extends BaseMapper<ClassHourDictDO> {
/**
* 获取课程的次数
* @return
*/
ClassHourDictDO getClassHourDictInfo(Long classId);
}
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<ClassMemberMappingD
*/
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> {
/**
* 获取某一套卷子的题目
*/
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;
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;
/**
* <p>
* 做题历史记录表 Mapper 接口
......@@ -12,7 +15,13 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2021-12-03
*/
@Repository
@Repository
public interface ExerciseDoneHistoryMapper extends BaseMapper<ExerciseDoneHistoryDO> {
/**
* 查看某套卷子的做题详情
*/
List<GetDoneHistoryDetailVO> getDoneHistoryDetail(Long doneId, Long memberId);
}
......@@ -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;
/**
* <p>
* 学生课程习题完成情况 Mapper 接口
......@@ -12,7 +18,30 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2021-10-15
*/
@Repository
@Repository
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;
@Repository
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;
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<VodDictDO> {
/**
* 查看某个目录下的视频
* @param page
* @param vodName
* @param contentId
* @return
*/
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;
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;
/**
* <p>
* 视频播放历史记录表 Mapper 接口
......@@ -22,5 +25,9 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
*/
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 {
private Integer classHour;
/**
* 有效/无效
* 断联时间,单位分钟
*/
private Integer interrupt;
/**
* 重复测试次数
*/
private Integer repeatTime;
/**
* 断联是否开启
*/
private Integer interruptStatus;
/**
* 重复测试是否开启
*/
private Integer repeatStatus;
/**
* 课时有效/无效
*/
private Integer status;
......
......@@ -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;
/**
* 题目类型:单选/多选/是非
......
......@@ -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;
}
......@@ -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;
}
......@@ -28,7 +28,7 @@ public class PaperDictDO extends BaseModel {
/**
* 课程id
*/
private String courseId;
private Long courseId;
/**
* 卷子名称
......
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<AdministerDO> {
List<ClassSignVO> exportSignDetail(ClassDetailDTO classDetailDTO)throws Exception;
IPage exerciseTest(ClassDetailDTO classDetailDTO);
IPage<ExerciseTestVO> exerciseTest(ClassDetailDTO classDetailDTO);
List<ExerciseTestVO> exportExerciseTest(ClassDetailDTO classDetailDTO)throws Exception;
List<GetMemberPapersVO> getMemberPapers(ExerciseDoneResultDO exerciseDoneResultDO);
List<GetPaperDetailVO> getPaperDetail(ExerciseDoneHistoryDO exerciseDoneHistoryDO);
IPage answerRecord(ClassDetailDTO classDetailDTO);
List<AnswerRecordVO> exportAnswerRecord(ClassDetailDTO classDetailDTO)throws Exception;
List<ClassVodInfoVO> classVodInfo(ClassVodInfoDTO classVodInfoDTO);
IPage<ClassDailyInfoVO> classDailyInfo(ClassDailyInfoDTO classDailyInfoDTO);
void export(ClassDetailDTO classDetailDTO)throws Exception;
String importMember(Long companyId, MultipartFile multipartFile);
......
......@@ -22,4 +22,6 @@ public interface AnsweringQuestionService extends IService<AnsweringQuestionDO>
String deleteQuestion(AnsweringQuestionDO answeringQuestionDO);
String updateQuestion(AnsweringQuestionDO answeringQuestionDO);
Integer getNoAnswers(AnsweringQuestionDO answeringQuestionDO);
}
......@@ -31,7 +31,7 @@ public interface ExerciseDictService extends IService<ExerciseDictDO> {
List<ExerciseVO> getCourseExercises(CourseDictDO courseDictDO);
String submit(SubmitDTO submitDTO);
Long submit(SubmitDTO submitDTO);
IPage getPaperExercise(GetPaperExerciseDTO getPaperExerciseDTO);
}
......@@ -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;
/**
* <p>
......@@ -13,4 +17,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ExerciseDoneHistoryService extends IService<ExerciseDoneHistoryDO> {
List<GetDoneHistoryDetailVO> getDoneHistoryDetail(ExerciseDoneResultDO exerciseDoneResultDO);
}
......@@ -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;
/**
* <p>
......@@ -13,4 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ExerciseDoneResultService extends IService<ExerciseDoneResultDO> {
GetDoneDetailVO getDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO);
}
......@@ -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<MemberDO> {
IPage studyHistory(StudyHistoryDTO studyHistoryDTO);
GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO);
List<QueryPapersVO> getCourseTest(ContentMemberDTO contentMemberDTO);
List<ExerciseDoneResultDO> getPaperDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO);
GetStudyInfoVO getStudyInfo(MemberDO memberDO);
ExerciseDoneResultDO getDoneResult(ExerciseDoneResultDO exerciseDoneResultDO);
String checkTimes(ExerciseDoneResultDO exerciseDoneResultDO);
void replace();
}
......@@ -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<AdministerMapper, Adminis
@Autowired
private MemberDepartmentMappingMapper memberDepartmentMappingMapper;
@Autowired
private VodDictMapper vodDictMapper;
public LoginVO login(AdministerDO administerDO) {
LoginVO loginVO = new LoginVO();
......@@ -335,23 +346,21 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
}
classDetailVO.setStudyVodCounts(i);
//学生测试完成情况
ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper<ExerciseDoneResultDO>()
.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<GetMaxScoreVO> 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<AdministerMapper, Adminis
}
//classDetailVO.setStudyVodCounts(i);
classDetailVO.setClassProcess(i + "/" + vodDictDOS.size());
//学生测试完成情况
ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper<ExerciseDoneResultDO>()
.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<GetMaxScoreVO> 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<AdministerMapper, Adminis
}
public IPage exerciseTest(ClassDetailDTO classDetailDTO) {
public IPage<ExerciseTestVO> exerciseTest(ClassDetailDTO classDetailDTO) {
Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize());
IPage<ExerciseTestVO> exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
List<ExerciseTestVO> classSignVOS = exerciseTestVOIPage.getRecords();
//课程详情
ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
for (ExerciseTestVO exerciseTestVO : classSignVOS) {
//学生测试完成情况
ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper<ExerciseDoneResultDO>()
.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<GetMemberPapersVO> 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<AdministerMapper, Adminis
for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) {
//学生测试完成情况
ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper<ExerciseDoneResultDO>()
.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<GetMemberPapersVO> 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<GetMemberPapersVO> getMemberPapers(ExerciseDoneResultDO exerciseDoneResultDO) {
return exerciseDoneResultMapper.queryExerciseDoneResult(exerciseDoneResultDO.getMemberId(), null, exerciseDoneResultDO.getPaperId());
}
public List<GetPaperDetailVO> 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<AdministerMapper, Adminis
return answerRecordVOS;
}
public List<ClassVodInfoVO> classVodInfo(ClassVodInfoDTO classVodInfoDTO) {
List<ClassVodInfoVO> result = new ArrayList<>();
//获取班级成员
List<Long> memberIds = classMemberMappingMapper.getClassMembers(classVodInfoDTO.getClassId());
List<VodDictDO> 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<ClassDailyInfoVO> classDailyInfo(ClassDailyInfoDTO classDailyInfoDTO) {
Page pager = new Page(classDailyInfoDTO.getPageNum(), classDailyInfoDTO.getPageSize());
//获取班级成员
IPage<ClassDailyInfoVO> classDailyInfoVOIPage = classMemberMappingMapper.getClassMembersWithName(pager, classDailyInfoDTO.getClassId(), classDailyInfoDTO.getUserName());
//整理出这些学员id
List<ClassDailyInfoVO> classDailyInfoVOS = classDailyInfoVOIPage.getRecords();
List<Long> memberIds = new ArrayList<>();
for (ClassDailyInfoVO classDailyInfoVO : classDailyInfoVOS) {
memberIds.add(classDailyInfoVO.getId());
}
//这些成员完成情况
List<GetMemberStudyInfoVO> getMemberStudyInfoVOS = vodPlayHistoryMapper.getMemberStudyInfo(classDailyInfoDTO.getClassId(), memberIds, classDailyInfoDTO.getStartDate(), classDailyInfoDTO.getEndDate());
for (ClassDailyInfoVO classDailyInfoVO : classDailyInfoVOS) {
List<DayInfoItemVO> 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<String> 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<String> daysStrList = new ArrayList<String>();
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<AdministerMapper, Adminis
compressFileToZipStream(zipOutputStream, baos1, "sign.xlsx");
///**
// * 测试成绩
// */
/**
* 测试成绩
*/
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
classDetailDTO.setFlag(false);
List<ExerciseTestVO> exerciseTestVOS = exportExerciseTest(classDetailDTO);
......@@ -759,9 +842,6 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
zipOutputStream.closeEntry();
baos.close();
//baos1.close();
//baos2.close();
//baos3.close();
zipOutputStream.flush();
zipOutputStream.close();
......@@ -802,9 +882,9 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
.eq(MemberDO::getCompanyId, companyId));
if (memberDOS.size() > 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<AdministerMapper, Adminis
newCell = dataRow.createCell(10);
newCell.setCellStyle(cellStyle);
if (classDetailVO.getScore() >= 60) {
newCell.setCellValue("合格");
} else {
newCell.setCellValue("不合格");
}
rowIndex++;
seq++;
}
......
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<AnsweringQuestionM
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
ClassHourDictDO classHourDictDO1 = this.baseMapper.selectOne(new QueryWrapper<ClassHourDictDO>()
.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;
}
......
......@@ -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<CompanyDictMapper, Compa
@Autowired
private DepartmentDictMapper departmentDictMapper;
@Autowired
private ClassHourDictMapper classHourDictMapper;
public IPage<OperatorsVO> operators(OperatorsDTO operatorsDTO) {
Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize());
//判断该用户的角色
......@@ -100,6 +97,19 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
//departmentDictDO.setParentId(1L);
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;
}
......
......@@ -8,17 +8,22 @@ import com.subsidy.dto.exercise.GetAllExercisesDTO;
import com.subsidy.dto.exercise.GetPaperExerciseDTO;
import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.mapper.ExerciseDictMapper;
import com.subsidy.mapper.ExerciseDoneHistoryMapper;
import com.subsidy.mapper.ExerciseDoneResultMapper;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO;
import com.subsidy.model.ExerciseDoneHistoryDO;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.service.ExerciseDictService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.MathUtil;
import com.subsidy.vo.course.ExerciseVO;
import com.subsidy.vo.exercise.GetPaperExerciseVO;
import com.subsidy.vo.exercise.MemberExerciseVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
......@@ -37,6 +42,9 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
@Autowired
private ExerciseDoneResultMapper exerciseDoneResultMapper;
@Autowired
private ExerciseDoneHistoryMapper exerciseDoneHistoryMapper;
public IPage<ExerciseDictDO> getAllExercises(GetAllExercisesDTO getAllExercisesDTO) {
Page pager = new Page(getAllExercisesDTO.getPageNum(), getAllExercisesDTO.getPageSize());
......@@ -93,7 +101,8 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
return exerciseVOS;
}
public String submit(SubmitDTO submitDTO) {
@Transactional(rollbackFor = Exception.class)
public Long submit(SubmitDTO submitDTO) {
ExerciseDoneResultDO exerciseDoneResultDO = new ExerciseDoneResultDO();
......@@ -104,7 +113,10 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
for (MemberExerciseVO exerciseVO : memberExerciseVOS) {
ExerciseDictDO exerciseDictDO = this.baseMapper.selectById(exerciseVO.getId());
if (exerciseDictDO.getRightAnswer().equals(exerciseVO.getSelectAnswer())) {
exerciseVO.setResult(1);
rightCounts++;
}else {
exerciseVO.setResult(0);
}
}
......@@ -113,6 +125,15 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
exerciseDoneResultDO.setTotalCounts(memberExerciseVOS.size());
exerciseDoneResultDO.setCourseId(submitDTO.getCourseId());
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>()
.lambda()
......@@ -121,10 +142,23 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
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());
return this.baseMapper.getPaperExercise(pager,getPaperExerciseDTO.getPaperId(),getPaperExerciseDTO.getDifficulty(),getPaperExerciseDTO.getExerciseType(),getPaperExerciseDTO.getTitle());
}
......
......@@ -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;
/**
* <p>
* 做题历史记录表 服务实现类
......@@ -17,4 +21,8 @@ import org.springframework.stereotype.Service;
@Service
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;
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<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;
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<MemberMapper, MemberDO> imple
private VodPlayHistoryMapper vodPlayHistoryMapper;
@Autowired
private CourseDictMapper courseDictMapper;
@Autowired
private VodDictMapper vodDictMapper;
@Autowired
......@@ -60,13 +63,10 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> 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<MemberMapper, MemberDO> imple
@Autowired
private MemberDepartmentMappingMapper memberDepartmentMappingMapper;
@Autowired
private ClassHourDictMapper classHourDictMapper;
public IPage<GetAllVO> 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<MemberMapper, MemberDO> imple
Integer count1 = this.baseMapper.selectCount(new QueryWrapper<MemberDO>()
.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<MemberMapper, MemberDO> imple
SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper<SmsVerifyCodeDO>()
.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<MemberMapper, MemberDO> imple
return iPage;
}
public GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO) {
GetCourseTestVO getCourseTestVO = new GetCourseTestVO();
public List<QueryPapersVO> 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<ExerciseDoneResultDO>()
.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<QueryPapersVO> queryPapersVOS = paperDictMapper.queryPapers(contentMemberDTO.getCourseId(), null, 1);
for (QueryPapersVO queryPapersVO : queryPapersVOS) {
//多少人已完成
Integer cnt = paperDictMapper.completeCount(queryPapersVO.getId());
queryPapersVO.setCompleteCnt(cnt);
//自己成绩
List<ExerciseDoneResultDO> exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper<ExerciseDoneResultDO>()
.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<ExerciseDictDO>()
.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<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) {
......@@ -532,4 +532,55 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> 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<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;
public class PaperDictServiceImpl extends ServiceImpl<PaperDictMapper, PaperDictDO> implements PaperDictService {
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){
......
......@@ -48,7 +48,7 @@ public class SMSUtils {
//必填:短信签名-可在短信控制台中找到
request.setSignName("有课互联");
//必填:短信模板-可在短信控制台中找到
request.setTemplateCode("SMS_190945394");
request.setTemplateCode("SMS_229640297");
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
request.setTemplateParam("{\"code\":\""+ code +"\"}");
......
......@@ -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 <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();
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]);
......
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 {
private String telephone;
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;
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<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;
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;
}
......@@ -9,4 +9,6 @@ public class MemberExerciseVO {
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 {
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]=该目录已存在
meishu.code-message[50001]=该试卷已存在
meishu.code-message[60001]=已超过最大测试次数
meishu.code-message[70010]=验证码错误
......
......@@ -42,7 +42,7 @@
</timeBasedFileNamingAndTriggeringPolicy>
<FileNamePattern>${LOG_PATH}${APP_NAME}/error/%d{yyyy-MM-dd}-%i.log.gz
</FileNamePattern>
<MaxHistory>30</MaxHistory>
<MaxHistory>180</MaxHistory>
</rollingPolicy>
</appender>
......
......@@ -4,12 +4,12 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.ClassHourDictDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="class_hour" property="classHour" />
<result column="status" property="status" />
<id column="id" property="id"/>
<result column="create_date" property="createDate"/>
<result column="update_date" property="updateDate"/>
<result column="delete_date" property="deleteDate"/>
<result column="class_hour" property="classHour"/>
<result column="status" property="status"/>
</resultMap>
<!-- 通用查询结果列 -->
......@@ -20,4 +20,22 @@
id, class_hour, status
</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>
......@@ -33,4 +33,30 @@
and t.member_id = #{memberId}
</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>
......@@ -14,7 +14,6 @@
<result column="exercise_id" property="exerciseId" />
<result column="answer" property="answer" />
<result column="result" property="result" />
<result column="length" property="length" />
</resultMap>
<!-- 通用查询结果列 -->
......@@ -25,4 +24,26 @@
id, paper_id, member_id, class_id, exercise_id, answer, result, length
</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>
......@@ -22,4 +22,74 @@
id, member_id, course_id, right_counts, total_counts
</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>
......@@ -34,7 +34,19 @@
<if test="paperName != null and paperName !=''">
AND t.paper_name LIKE concat('%',#{paperName} ,'%')
</if>
<if test="paperStatus != null and paperStatus !=''">
AND t.paper_status = #{paperStatus}
</if>
</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>
......@@ -41,4 +41,35 @@
</if>
</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>
......@@ -4,15 +4,15 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.VodPlayHistoryDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="class_id" property="classId" />
<result column="vod_id" property="vodId" />
<result column="member_id" property="memberId" />
<result column="play_length" property="playLength" />
<result column="play_record" property="playRecord" />
<id column="id" property="id"/>
<result column="create_date" property="createDate"/>
<result column="update_date" property="updateDate"/>
<result column="delete_date" property="deleteDate"/>
<result column="class_id" property="classId"/>
<result column="vod_id" property="vodId"/>
<result column="member_id" property="memberId"/>
<result column="play_length" property="playLength"/>
<result column="play_record" property="playRecord"/>
</resultMap>
<!-- 通用查询结果列 -->
......@@ -23,7 +23,7 @@
id, class_id, vod_id, member_id, play_length, play_record
</sql>
<select id="studyHistory" parameterType="long" resultType="com.subsidy.vo.vod.StudyHistoryVO">
<select id="studyHistory" parameterType="long" resultType="com.subsidy.vo.vod.StudyHistoryVO">
SELECT
t2.id,
t2.vod_length,
......@@ -57,4 +57,30 @@
order by t.playDate desc
</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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!