Commit c88a9ad1 by 涂亚平

普陀督导组结构校对

1 parent 6e9f568f
Showing with 3170 additions and 344 deletions
......@@ -6,9 +6,9 @@ import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.administer.*;
import com.subsidy.dto.member.QingxuetangLoginDTO;
import com.subsidy.model.*;
import com.subsidy.service.AdministerService;
import com.subsidy.dto.classDict.SocialTestDetailDTO;
import com.subsidy.vo.member.DownloadFailMembersDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* <p>
......@@ -122,20 +121,49 @@ public class AdministerController {
}
@PostMapping("exerciseTest")
@ApiOperation("班级管理--测评成绩 id 班级id userName paperId pageSize pageNum")
@ApiOperation("##2024.3##班级管理(企业线上化培训)--测评成绩 id 班级id userName paperId pageSize pageNum")
@LoginRequired
public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO) {
return ResponseData.generateCreatedResponse(0, administerService.exerciseTest(classDetailDTO));
}
@PostMapping("exportExerciseTest")
@ApiOperation("班级管理--测评成绩 id 班级id userName paperId")
@ApiOperation("##2024.3##班级管理--测评成绩 id 班级id userName paperId")
@LoginRequired
public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO) throws Exception {
classDetailDTO.setFlag(true);
administerService.exportExerciseTest(classDetailDTO);
}
@PostMapping("socialExerciseTest")
@ApiOperation("##2024.3##社会化、学徒制--班级管理--测评成绩 id 班级id userName paperId pageSize pageNum")
@LoginRequired
public ResponseVO socialExerciseTest(@RequestBody ClassDetailDTO classDetailDTO) {
return ResponseData.generateCreatedResponse(0, administerService.socialExerciseTest(classDetailDTO));
}
@PostMapping("socialTestDetail")
@ApiOperation("##2024.3##社会化、学徒制--班级管理--测评概览 id 班级id memberId 学员id")
@LoginRequired
public ResponseVO socialTestDetail(@RequestBody SocialTestDetailDTO socialTestDetailDTO) {
return ResponseData.generateCreatedResponse(0, administerService.socialTestDetail(socialTestDetailDTO));
}
@PostMapping("socialTestRecord")
@ApiOperation("##2024.3##社会化、学徒制--班级管理--测评记录 id 班级id memberId 学员id ")
@LoginRequired
public ResponseVO socialTestRecord(@RequestBody SocialTestDetailDTO socialTestDetailDTO) {
return ResponseData.generateCreatedResponse(0, administerService.socialTestRecord(socialTestDetailDTO));
}
@PostMapping("exportSocialExerciseTest")
@ApiOperation("##2024.3##班级管理--测评成绩 id 班级id userName ")
@LoginRequired
public void exportSocialExerciseTest(@RequestBody ClassDetailDTO classDetailDTO) throws Exception {
classDetailDTO.setFlag(true);
administerService.exportSocialExerciseTest(classDetailDTO);
}
@PostMapping("getMemberPapers")
@ApiOperation("获取某个成员某个卷子的做题历史 memberId paperId")
@LoginRequired
......
......@@ -38,7 +38,7 @@ public class ClassDictController {
private ClassDictService classDictService;
@PostMapping("getAllClasses")
@ApiOperation("获取某公司下的所有班级 companyId 所选企业id className 班级名称 openStatus 开放状态 startDate 开始时间 endDate 结束时间")
@ApiOperation("##2024.3##获取某公司下的所有班级 companyId 所选企业id className 班级名称 openStatus 开放状态 0:开课中 1:待开始 2:已结课 startDate 开始时间 endDate 结束时间 classType:班级类型:0:企业线上培训 2:学徒制 ")
@LoginRequired
public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO)throws Exception{
return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO));
......@@ -52,20 +52,22 @@ public class ClassDictController {
}
@PostMapping("addClass")
@ApiOperation("添加班级 userId:登录人id companyId courseId classType classTypeId(证书课程的话传0) className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进 memberIds [] 班级学员 classNoticeDOS[noticeType noticeTime]")
@ApiOperation("##2024.3##添加班级 userId:登录人id companyId courseId classType:班级类型:0:企业线上培训 1:企业内训 2:学徒制 classTypeId(证书课程的话传0)" +
" className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进" +
" memberIds [] 班级学员 classNoticeDOS[noticeType noticeTime paperTime测试时间开关 paperTimeLimit测试时间限制 faceCheck 人脸识别开关 vodIds[] ")
@LoginRequired
public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){
return ResponseData.generateCreatedResponse(0,classDictService.addClass(addClassDTO));
}
@PostMapping("updateClass")
@ApiOperation("修改班级 id className classTypeId startDate endDate isOrder 是否按顺序播放 isFastPlay 是否允许快进 " +
@ApiOperation("##2024.3##修改班级 id className classTypeId startDate endDate isOrder 是否按顺序播放 isFastPlay 是否允许快进 " +
"testRule:测试规则 classType limitHour 学习上限时长 imageClassCheck:首次进入班级时人脸验证 imageTestCheck:测试前人脸识别验证" +
"activityDetection:活跃度检测开启/关闭 activityDetectionMethod:活跃度检测方式 firstDragAllowed:首次播放允许拖曳" +
"firstSpeedAllowed:首次播放允许倍速 playSnap 课程抓拍 classCode")
"firstSpeedAllowed:首次播放允许倍速 playSnap 课程抓拍 classCode paperTime测试时间开关 paperTimeLimit测试时间限制 faceCheck 人脸识别开关 vodIds[]")
@LoginRequired
public ResponseVO updateClass(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.updateClass(classDictDO));
public ResponseVO updateClass(@RequestBody AddClassDTO addClassDTO){
return ResponseData.generateCreatedResponse(0,classDictService.updateClass(addClassDTO));
}
@PostMapping("classDetail")
......@@ -136,5 +138,10 @@ public class ClassDictController {
classDictService.downloadFailClassMembers(downloadFailClassMembers);
}
@PostMapping("classVods")
@ApiOperation("##2024.3##通过班级id查询视频 id 班级id")
public ResponseVO classVods(@RequestBody ClassDictDO classDictDO){
return ResponseData.generateCreatedResponse(0,classDictService.classVods(classDictDO));
}
}
......@@ -60,4 +60,16 @@ public class ClassTypeDictController {
return ResponseData.generateCreatedResponse(0,classTypeDictService.queryClassTypes(classTypeDTO));
}
@PostMapping("queryOnlineClassTypes")
@ApiOperation("查看内训和企业线上化 companyId")
public ResponseVO queryOnlineClassTypes(@RequestBody ClassTypeDictDO classTypeDictDO){
return ResponseData.generateCreatedResponse(0,classTypeDictService.queryOnlineClassTypes(classTypeDictDO));
}
@PostMapping("querySocialClassTypes")
@ApiOperation("查看社会化学徒制 companyId")
public ResponseVO querySocialClassTypes(@RequestBody ClassTypeDictDO classTypeDictDO){
return ResponseData.generateCreatedResponse(0,classTypeDictService.querySocialClassTypes(classTypeDictDO));
}
}
package com.subsidy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 百分比认证视频表 前端控制器
* </p>
*
* @author Tuyp
* @since 2024-03-18
*/
@RestController
@Api(tags = "百分比认证视频表")
@RequestMapping("/class-vod-face-check-do")
public class ClassVodFaceCheckController {
}
......@@ -47,7 +47,7 @@ public class ContentVodMappingController {
}
@PostMapping("addContentVod")
@ApiOperation("添加课程内容视频:contentId/内容ID、vodIds [vodId, vodAliasName]")
@ApiOperation("##2024.3##添加课程内容视频:contentId/内容ID、vodIds [vodId, vodAliasName]")
@LoginRequired
public ResponseVO addContentVod(@RequestBody AddContentVodDTO addContentVod) {
contentVodMappingService.addContentVod(addContentVod);
......
......@@ -22,9 +22,6 @@ import org.springframework.web.bind.annotation.RestController;
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-11
*/
@RestController
@Api(tags = "课程表")
......@@ -35,7 +32,7 @@ public class CourseDictController {
private CourseDictService courseDictService;
@PostMapping("addCourse")
@ApiOperation("添加课程 companyId courseName courseType coverPage openStatus remark fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[] businessIds[]")
@ApiOperation("##2024.3##添加课程 companyId courseName courseType coverPage openStatus remark fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[] businessIds[] courseDataType 0:企业线上培训 1:学徒制 ")
@LoginRequired
public ResponseVO addCourse(@RequestBody AddCourseDTO addCourseDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(addCourseDTO));
......@@ -49,7 +46,7 @@ public class CourseDictController {
}
@PostMapping("queryCourses")
@ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId businessId rankId courseType openStatus")
@ApiOperation("##2024.3##平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId businessId rankId courseType openStatus courseDataType 0:企业线上培训 1:学徒制")
@LoginRequired
public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO));
......@@ -63,7 +60,7 @@ public class CourseDictController {
}
@PostMapping("queryCompanyCourse")
@ApiOperation("企业内容管理-- { companyId 所选企业id pageSize pageNum courseName categoryId jobId rankId openStatus}")
@ApiOperation("##2024.3##企业内容管理-- { companyId 所选企业id pageSize pageNum courseName categoryId jobId rankId openStatus courseDataType 0:企业线上培训 1:学徒制}")
@LoginRequired
public ResponseVO queryCompanyCourse(@RequestBody QueryCoursesDTO queryCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.queryCompanyCourse(queryCoursesDTO));
......
package com.subsidy.controller;
import com.subsidy.service.DudaoService;
import com.subsidy.vo.renshe.RensheResponseVO;
import com.subsidy.vo.dudao.RensheResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -84,5 +84,4 @@ public class ExerciseDictController {
return ResponseData.generateCreatedResponse(0,exerciseDictService.select(file,paperId,courseId));
}
}
......@@ -43,14 +43,14 @@ public class ImageCheckRecordController {
}
@PostMapping("imageCheck")
@ApiOperation("课程/测评人身核验(权威库:身份证) PC端 id 用户id classId 班级id classPlace 1:视频的时候检测 2:测评的时候检测 paperId")
@ApiOperation("课程/测评人身核验(权威库:身份证) PC端 vodId id 用户id classId 班级id classPlace 1:视频的时候检测 2:测评的时候检测 paperId")
@TimeRequired
public ResponseVO imageCheck(@RequestBody ImageCheckDTO imageCheckDTO) throws Exception {
return ResponseData.generateCreatedResponse(0, imageCheckRecordService.imageCheck(imageCheckDTO));
}
@PostMapping("h5ImageCheck")
@ApiOperation("课程/测评人脸核验(权威库:身份证) 微信浮层H5 id 用户id classId 班级id classPlace 1:视频的时候检测 2:测评的时候检测 paperId")
@ApiOperation("课程/测评人脸核验(权威库:身份证) 微信浮层H5 vodId id 用户id classId 班级id classPlace 1:视频的时候检测 2:测评的时候检测 paperId")
@TimeRequired
public ResponseVO h5CheckResult(@RequestBody ImageCheckDTO imageCheckDTO)throws Exception{
return ResponseData.generateCreatedResponse(0,imageCheckRecordService.h5CheckResult(imageCheckDTO));
......
package com.subsidy.controller;
import com.alibaba.fastjson.JSON;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.live.PolyvInfoDTO;
import com.subsidy.dto.member.*;
import com.subsidy.dto.vod.InsertHistoryNewDTO;
import com.subsidy.mapper.MemberMapper;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.MemberDO;
import com.subsidy.service.MemberService;
import com.subsidy.vo.live.PolyvInfoVO;
import com.subsidy.dto.member.CheckItemDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -50,8 +47,6 @@ public class MemberController {
memberService.exportAllMembers(getAllDTO);
}
@PostMapping("deleteMember")
@ApiOperation("删除成员 id ")
@LoginRequired
......@@ -106,7 +101,6 @@ public class MemberController {
return ResponseData.generateCreatedResponse(0,memberService.kexinkuLogin(kexinkuLoginDTO));
}
@PostMapping("checkStatus")
@ApiOperation("实名制验证状态 id")
@TimeRequired
......@@ -130,7 +124,7 @@ public class MemberController {
@PostMapping("myCourses")
@ApiOperation("手机端:我的学习--补贴培训课程 memberId 学员id status 状态 0:全部 1:进行中 2:待开始 3:已完成 ")
// @LoginRequired
@LoginRequired
@TimeRequired
public ResponseVO myCourses(@RequestBody MyCoursesDTO myCoursesDTO){
return ResponseData.generateCreatedResponse(0,memberService.myCourses(myCoursesDTO));
......@@ -145,13 +139,32 @@ public class MemberController {
}
@PostMapping("contentVod")
@ApiOperation("手机端:目录+视频 classId 班级id courseId 课程 memberId 学员id")
@ApiOperation("##2024.3##企业线上培训----手机端:目录+视频 classId 班级id courseId 课程 memberId 学员id")
@LoginRequired
@TimeRequired
public ResponseVO contentVod(@RequestBody ContentMemberDTO contentVodDTO){
return ResponseData.generateCreatedResponse(0,memberService.contentVod(contentVodDTO));
}
@PostMapping("socialContentVod")
@ApiOperation("##2024.3##社会化学徒制----手机端:目录+视频 classId 班级id courseId 课程 memberId 学员id")
@LoginRequired
@TimeRequired
public ResponseVO socialContentVod(@RequestBody ContentMemberDTO contentVodDTO){
return ResponseData.generateCreatedResponse(0,memberService.socialContentVod(contentVodDTO));
}
@PostMapping("checkItem")
@ApiOperation("##2024.3##每次点开题目或者视频的时候看下前置事项 memberId classId vodId:当前视频的id paperId:上一个视频的题目id type 0:视频 1:习题")
public ResponseVO checkItem(@RequestBody CheckItemDTO checkItemVO){
return ResponseData.generateCreatedResponse(0,memberService.checkItem(checkItemVO));
}
@PostMapping("contentFiles")
@ApiOperation("手机端:目录+课件 courseId 课程 memberId 学员id")
@LoginRequired
......@@ -176,6 +189,14 @@ public class MemberController {
return ResponseData.generateCreatedResponse(0,memberService.getCourseTest(contentMemberDTO));
}
@PostMapping("socialCourseTest")
@ApiOperation("##2024.3##获取课程下的测试情况 {memberId 成员id 班级id classId courseId 课程id }")
@LoginRequired
@TimeRequired
public ResponseVO socialCourseTest(@RequestBody ContentMemberDTO contentMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.socialCourseTest(contentMemberDTO));
}
@PostMapping("getTestDoneDetail")
@ApiOperation("获取某个测评学生的完成情况 paperId memberId")
@LoginRequired
......
......@@ -165,7 +165,7 @@ public class OssController {
// 完成分片上传。
CompleteMultipartUploadResult completeMultipartUploadResult = ossClient.completeMultipartUpload(completeMultipartUploadRequest);
uploadFileVO.setUrl(completeMultipartUploadResult.getLocation());
uploadFileVO.setUrl(completeMultipartUploadResult.getLocation().replace("http","https"));
System.out.println(completeMultipartUploadResult.getLocation());
} catch (OSSException oe) {
System.out.println("Caught an OSSException, which means your request made it to OSS, "
......
......@@ -69,4 +69,9 @@ public class RenSheJuController {
return renSheJuService.clear();
}
@PostMapping("post6plus")
public RensheResponseVO post6plus() throws Exception {
return renSheJuService.post6plus();
}
}
......@@ -70,7 +70,7 @@ public class VodLabelDictController {
@PostMapping(value = "queryVodLabelTree")
@ApiOperation("获取目录和视频")
@LoginRequired
// @LoginRequired
public ResponseVO getContentVodTree() {
return ResponseData.generateCreatedResponse(0, vodLableDictService.queryVodLabelTree());
}
......
......@@ -13,5 +13,7 @@ public class AddClassDTO extends ClassDictDO {
private List<Long> memberIds;
private List<Long> vodIds;
private List<ClassNoticeDO> classNoticeDOS;
}
package com.subsidy.dto.classDict;
import lombok.Data;
@Data
public class SocialTestDetailDTO {
private Integer pageSize;
private Integer pageNum;
private Long memberId;
private Long id;
}
......@@ -10,4 +10,5 @@ public class ContentVodDTO {
private Long vodId;
private String vodAliasName;
}
......@@ -67,4 +67,7 @@ public class AddCourseDTO {
*/
private List<Long> businessIds;
private Integer courseDataType;
}
......@@ -27,4 +27,6 @@ public class QueryCoursesDTO {
private String openStatus;
private Integer courseDataType;
}
package com.subsidy.dto.dudao;
import lombok.Data;
@Data
public class ActivityList {
/**
* 是否通过,0.通过 1.未通过
*/
private Integer access;
/**
* 检验类型,1.人脸识别 2.弹出框点击事件 3.课堂答题 4.其他
*/
private Integer activityDetection;
/**
* 活跃度检测时间,【13位时间戳】【精确到毫秒】
*/
private Long activityTime;
/**
* 错误类型,1.人脸识别未通过2.弹出框未点击3.没有做课堂答题4.课堂答题合格率不达标
*/
private Integer errorInfo;
}
package com.subsidy.dto.dudao;
import lombok.Data;
@Data
public class AnswerAndQuestionList {
/**
* 回答时间
*/
private long answer;
/**
* 提问时间
*/
private long question;
}
package com.subsidy.dto.dudao;
import lombok.Data;
import java.util.List;
@Data
public class AnswerBasic {
/**
* 答疑辅导,提问和回答都存在值时才进行传递
*/
private List<AnswerAndQuestionList> answerAndQuestionList;
private String downCode;
private String identity;
}
package com.subsidy.dto.dudao;
import lombok.Data;
import java.util.List;
@Data
public class ChapterExamBasic {
/**
* 是否通过,0通过1未通过
*/
private Long access;
/**
* 活跃度列表(数组),【数组】
*/
private List<ActivityList> activityList;
/**
* 章节(课程)编码
*/
private String chapterCode;
/**
* 临时班级(项目)编号
*/
private String downCode;
/**
* 章节(课程)考试时间列表,【数组】
*/
private List<ExamList> examList;
/**
* 章节(课程)考试总时长,该字段数据应为当日产生examList列表内多条结束时间-开始时间累加和【秒】
*/
private Long examTime;
/**
* 学员身份证号,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* 学员电话号,会对学生手机号长度、格式进行校验
*/
private String phone;
/**
* 学员姓名
*/
private String studentName;
}
package com.subsidy.dto.dudao;
import lombok.Data;
@Data
public class ChapterList2 {
private String chapterCode;
private String chapterName;
private Integer isExam;
private String chapterTime;
private String examTime;
}
package com.subsidy.dto.dudao;
import lombok.Data;
@Data
public class ChapterList3 {
/**
* 章节(课程)编码,与基本信息内的章节(课程)编码相对应
*/
private String chapterCode;
/**
* 章节(课程)学习时长,该学习时间段内本章节学习累计时长【秒】
*/
private long chapterTime;
/**
* 学习结束时间(视频播放结束时间),【13位时间戳】【精确到毫秒】
*/
private Long endTime;
/**
* 章节(课程)暂停时长,该学习时间段内本章节播放暂停累计时长【秒】(2023年2月1日开始实行)
*/
private Long pauseTime;
/**
* 学习开始时间(视频播放开始时间),【13位时间戳】【精确到毫秒】
*/
private Long startTime;
}
package com.subsidy.dto.dudao;
import com.subsidy.vo.dudao.EpidemicSituationClassBasic;
import lombok.Data;
import java.util.List;
@Data
public class ClassBaseInfoDTO {
private List<EpidemicSituationClassBasic> epidemicSituationClassBasic;
private String privateKey;
}
package com.subsidy.dto.dudao;
import lombok.Data;
@Data
public class ClassCodeBasic {
/**
* 班级(项目)编号
*/
private String classCode;
/**
* 临时班级(项目)编号
*/
private String downCode;
}
package com.subsidy.dto.dudao;
import lombok.Data;
import java.util.List;
@Data
public class ClassHourBasic {
/**
* 临时班级(临时项目)编号
*/
private String downCode;
/**
* 学员姓名
*/
private String studentName;
/**
* 学员电话号,会对学生手机号长度、格式进行校验
*/
private String phone;
/**
* 学员身份证号,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* 当日累计学习时长,视频暂停时间不计入【秒】
*/
private long learnTime;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】
*/
private long loginTime;
/**
* 当日累计播放时长,视频暂停时间计入【秒】
*/
private Long playTime;
/**
* 上线时间列表,【数组】
*/
private List<LoginList> loginList;
/**
* 活跃度列表,【数组】
*/
private List<ActivityList> activityList;
}
package com.subsidy.dto.dudao;
import lombok.Data;
import java.util.List;
@Data
public class ClassHourBehaviorDTO {
/**
* 班级(项目)学时列表,【数组】班级(项目)学时列表
*/
private List<ClassHourBasic> classHourBasic;
/**
* 私钥
*/
private String privateKey;
}
package com.subsidy.dto.dudao;
import lombok.Data;
@Data
public class ExamList {
/**
* 章节(课程)考试时间列表,【13位时间戳】【精确到毫秒】
*/
private long endTime;
/**
* 登录ip,会对IP进行校验
*/
private String ip;
/**
* 章节(课程)考试开始时间,【13位时间戳】【精确到毫秒】
*/
private long startTime;
}
package com.subsidy.dto.dudao;
import lombok.Data;
import java.util.List;
@Data
public class LoginList {
/**
* 章节(课程)学时列表
*/
private List<ChapterList3> chapterList;
/**
* 下线时间,【13位时间戳】【精确到毫秒】
*/
private long endTime;
/**
* 登录ip,会对IP进行校验
*/
private String ip;
/**
* 上线时间,【13位时间戳】【精确到毫秒】
*/
private long startTime;
}
package com.subsidy.dto.dudao;
import lombok.Data;
import java.util.List;
@Data
public class UploadChapterBehaviorDTO {
/**
* 章节(课程)考试列表,【数组】
*/
private List<ChapterExamBasic> chapterExamBasic;
/**
* 私钥
*/
private String privateKey;
}
package com.subsidy.dto.dudao;
import lombok.Data;
import java.util.List;
@Data
public class UploadClassAnswerQuestionBehaviorDTO {
private List<AnswerBasic> answerBasic;
private String privateKey;
}
package com.subsidy.dto.dudao;
import lombok.Data;
import java.util.List;
@Data
public class UploadClassCodeDTO {
private List<ClassCodeBasic> classCodeBasic;
/**
* 私钥
*/
private String privateKey;
}
......@@ -25,4 +25,9 @@ public class ImageCheckDTO {
*/
private Integer classPlace;
/**
* 视频id
*/
private Long vodId;
}
package com.subsidy.dto.member;
import lombok.Data;
@Data
public class CheckItemDTO {
private Long memberId;
private Long classId;
private Long vodId;
private Long paperId;
private Integer type;
}
package com.subsidy.vo.member;
package com.subsidy.dto.member;
import com.subsidy.util.excel.ExcelColumnUtil;
import lombok.Data;
......
package com.subsidy.dto.renshe;
import com.subsidy.dto.renshe.ClassHourBasic;
import lombok.Data;
import java.util.List;
......
......@@ -8,6 +8,9 @@ import com.subsidy.model.ClassDictDO;
import com.subsidy.model.CompanyDictDO;
import com.subsidy.vo.administer.*;
import com.subsidy.vo.classdict.ClassDetailVO;
import com.subsidy.vo.classdict.SocialTestDetailVO;
import com.subsidy.vo.classdict.SocialTestRecordVO;
import com.subsidy.vo.classdict.VodPassRateVO;
import com.subsidy.vo.company.GetAllCompanyVO;
import com.subsidy.vo.member.ClassSignVO;
import com.subsidy.vo.sign.AnswerRecordVO;
......@@ -44,6 +47,21 @@ public interface AdministerMapper extends BaseMapper<AdministerDO> {
IPage<ExerciseTestVO> exerciseTest(IPage iPage, Long classId, String userName);
/**
* 计算某个人的章通过率
*/
VodPassRateVO vodPassRate(Long classId, Long memberId);
/**
* 测评概览
*/
List<SocialTestDetailVO> socialTestDetail(Long classId, Long memberId);
/**
* 班级考试详情 倒序
*/
List<SocialTestRecordVO> socialTestRecord(Long classId,Long memberId);
/**
* 获取班级成员---答疑记录
*/
IPage<AnswerRecordVO> answerRecord(IPage iPage, Long classId, String userName);
......
......@@ -6,6 +6,7 @@ import com.subsidy.model.ClassDictDO;
import com.subsidy.model.MemberDO;
import com.subsidy.model.VodDictDO;
import com.subsidy.vo.classdict.*;
import com.subsidy.vo.vod.VodInfoVO;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
......@@ -25,7 +26,7 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> {
/**
* 获取某企业的全部班级
*/
List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO);
List<GetAllClassesVO> getAllClasses(Long companyId,String className,String startDate,String endDate,String openStatus,Integer classType);
/**
* 获取某班级下的全部视频
......@@ -72,4 +73,9 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> {
*/
List<Long> dailyClassInfo();
/**
* 查看班级里有多少视频
*/
List<VodInfoVO> classVods(Long classId);
}
package com.subsidy.mapper;
import com.subsidy.model.ClassVodFaceCheckDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 百分比认证视频表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2024-03-18
*/
@Repository
public interface ClassVodFaceCheckMapper extends BaseMapper<ClassVodFaceCheckDO> {
List<Long> faceVodIds(Long classId);
}
......@@ -2,8 +2,11 @@ package com.subsidy.mapper;
import com.subsidy.model.ContentVodMappingDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.model.CourseDictDO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 目录视频关系表 Mapper 接口
......@@ -12,7 +15,17 @@ import org.springframework.stereotype.Repository;
* @author DengMin
* @since 2022-07-19
*/
@Repository
@Repository
public interface ContentVodMappingMapper extends BaseMapper<ContentVodMappingDO> {
/**
* 查看章节属于哪个课程,返回课程的详细信息
*/
CourseDictDO getCourseByContentId(Long contentId);
/**
* 查看某个课程之前视频的ids
*/
List<Long> oldVodIds(Long contentId);
}
......@@ -36,5 +36,8 @@ public interface CourseContentMapper extends BaseMapper<CourseContentDO> {
*/
List<FileDictDO> contentFiles(Long courseId);
/**
* 课程最大的orderNo
*/
Integer selectMaxOrderNo(Long courseId);
}
......@@ -27,7 +27,7 @@ public interface CourseDictMapper extends BaseMapper<CourseDictDO> {
* courseName fieldId categoryId jobId courseRank courseType
* @return
*/
IPage<QueryCoursesVO > queryCourses(IPage page, String courseName, Long fieldId,Long categoryId,Long jobId,Long rankId, String courseType,Long companyId,String openStatus,Long businessId);
IPage<QueryCoursesVO > queryCourses(IPage page, String courseName, Long fieldId,Long categoryId,Long jobId,Long rankId, String courseType,Long companyId,String openStatus,Long businessId,Integer courseDataType);
/**
* 通过课程id查询课程下的学生-----弃用
......
package com.subsidy.mapper;
import com.subsidy.dto.renshe.ChapterList2;
import com.subsidy.dto.renshe.ChapterList3;
import com.subsidy.dto.dudao.ChapterList2;
import com.subsidy.dto.dudao.ChapterList3;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.MemberDO;
import com.subsidy.model.OprMemDictDO;
import com.subsidy.vo.renshe.*;
import com.subsidy.vo.dudao.*;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -111,7 +111,7 @@ public interface DudaoMapper {
/**
* 考试活跃度检测--人脸
*/
List<ExamActivitiesVO> examActivities(Long classId,Long memberId);
List<ExamActivitiesVO> examActivities(Long classId, Long memberId);
/**
* 找到某人某个时间段内的测评记录
......
......@@ -93,6 +93,15 @@ public interface MemberMapper extends BaseMapper<MemberDO> {
*/
List<MemberLivesVO> memberLives(Long memberId);
/**
* 查看某个人某个课程的视频是否已经学完
*/
Integer checkClassVodPlayStatus(Long memberId,Long classId,Long vodId);
/**
* 查看某个人某个课程的视频是否已经学完
*/
Integer checkClassPaperPassStatus(Long memberId,Long classId,Long paperId);
}
package com.subsidy.mapper;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.PaperDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.subsidy.vo.paper.MemberMaxScoreVO;
import com.subsidy.vo.paper.QueryPapersVO;
import org.springframework.stereotype.Repository;
......@@ -34,4 +36,15 @@ public interface PaperDictMapper extends BaseMapper<PaperDictDO> {
*/
Integer queryCoursePapersCnt(Long courseId);
/**
* 某学员某个班级某个视频获得的最高分数
*/
MemberMaxScoreVO memberMaxScore(Long memberId, Long classId, Long vodId);
/**
* 通过 courseId paperId 查看卷子
* 倒序查询课程对应的卷子
*/
List<Long> lastPaper(Long courseId);
}
......@@ -116,7 +116,7 @@ public interface RenSheJuMapper {
List<ClassImageChecksVO> passExamCheck(Long classId);
/**
* 进入到课程第二次做人脸识别 弃用
* 进入到课程第二次做人脸识别
*/
List<ClassImageChecksVO> studyCheck(Long classId);
......@@ -145,5 +145,9 @@ public interface RenSheJuMapper {
*/
List<Long> imageClassIds(String classType);
/**
* 补推人脸识别数据
*/
List<ClassImageChecksVO> post6plus(Long classId);
}
......@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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 com.subsidy.vo.vod.QueryVodPageVO;
import com.subsidy.vo.vod.VodPlayStateVO;
import com.subsidy.vo.vod.*;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -51,4 +48,6 @@ public interface VodDictMapper extends BaseMapper<VodDictDO> {
List<VodDictDO> getCompanyVod(Long contentId);
IPage<QueryVodPageVO> queryVodPage(Page page, Long labelId, String vodName);
List<VodInfoVO> vodInfo(Long labelId);
}
......@@ -48,7 +48,10 @@ public class ClassDictDO extends BaseModel {
*/
private String classTypeId;
private String classType;
/**
* 班级类型:0:企业线上培训 1:企业内训 2:学徒制
*/
private Integer classType;
/**
* 课程id
......@@ -145,4 +148,19 @@ public class ClassDictDO extends BaseModel {
*/
private Integer checkFlag;
/**
* 考试时间限制 为空的时候不限制
*/
private Integer paperTimeLimit;
/**
* 人脸识别开关
*/
private Integer faceCheck;
/**
* 考试时长开关
*/
private Integer paperTime;
}
......@@ -50,4 +50,9 @@ public class ClassMemberMappingDO extends BaseModel {
*/
private String photo;
/**
*
*/
private Integer submitFlag;
}
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 百分比认证视频表
* </p>
*
* @author Tuyp
* @since 2024-03-18
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("class_vod_face_check")
public class ClassVodFaceCheckDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 班级id
*/
private Long classId;
/**
* 视频id
*/
private Long vodId;
}
......@@ -43,6 +43,12 @@ public class CourseDictDO extends BaseModel {
*/
private String courseType;
/**
* 0:企业线上培训 1:学徒制
*/
private Integer courseDataType;
/**
* 课程封面
*/
......
......@@ -104,5 +104,39 @@ public class MemberDO extends BaseModel {
*/
private String status;
/**
* QQ号
*/
private String qqNo;
/**
* 微信账号
*/
private String wechat;
/**
* 实习状态
*/
private String practiceStatus;
/**
* 学院id
*/
private Long collegeId;
/**
* 专业id
*/
private String major;
/**
* 入学年份
*/
private String enrollmentYear;
/**
* 人员类型 0:学院 2 :职工
*/
private Integer memberType;
}
......@@ -40,5 +40,10 @@ public class PaperDictDO extends BaseModel {
*/
private Integer paperStatus;
/**
* 视频id
*/
private Long vodId;
}
......@@ -6,11 +6,13 @@ import com.subsidy.dto.administer.*;
import com.subsidy.model.*;
import com.subsidy.vo.administer.*;
import com.subsidy.vo.classdict.ClassDetailVO;
import com.subsidy.dto.classDict.SocialTestDetailDTO;
import com.subsidy.vo.classdict.SocialTestDetailVO;
import com.subsidy.vo.classdict.SocialTestRecordVO;
import com.subsidy.vo.image.GetMemberCheckDetailVO;
import com.subsidy.vo.member.ClassSignVO;
import com.subsidy.vo.member.DownloadFailMembersDTO;
import com.subsidy.vo.member.ImportMemberResultVO;
import com.subsidy.vo.member.ImportMemberVO;
import com.subsidy.vo.sign.AnswerRecordVO;
import org.springframework.web.multipart.MultipartFile;
......@@ -55,6 +57,14 @@ public interface AdministerService extends IService<AdministerDO> {
List<ExerciseTestVO> exportExerciseTest(ClassDetailDTO classDetailDTO)throws Exception;
IPage<ExerciseTestVO> socialExerciseTest(ClassDetailDTO classDetailDTO);
List<SocialTestDetailVO> socialTestDetail(SocialTestDetailDTO socialTestDetailDTO);
List<SocialTestRecordVO> socialTestRecord(SocialTestDetailDTO socialTestDetailDTO);
List<ExportSocialExerciseTestVO> exportSocialExerciseTest(ClassDetailDTO classDetailDTO)throws Exception;
List<GetMemberPapersVO> getMemberPapers(ExerciseDoneResultDO exerciseDoneResultDO);
List<GetPaperDetailVO> getPaperDetail(ExerciseDoneHistoryDO exerciseDoneHistoryDO);
......
......@@ -8,10 +8,12 @@ import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.MemberDO;
import com.subsidy.vo.classdict.ClassDetail;
import com.subsidy.vo.classdict.GetAllClassesVO;
import com.subsidy.vo.classdict.GetClassBaseInfoVO;
import com.subsidy.vo.member.DownloadFailClassMembers;
import com.subsidy.vo.member.ImportClassMembersVO;
import com.subsidy.vo.vod.VodInfoVO;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
......@@ -33,9 +35,9 @@ public interface ClassDictService extends IService<ClassDictDO> {
Long addClass(AddClassDTO addClassDTO);
String updateClass(ClassDictDO classDictDO);
String updateClass(AddClassDTO addClassDTO);
ClassDictDO classDetail(ClassDictDO classDictDO);
ClassDetail classDetail(ClassDictDO classDictDO);
String removeMember(ClassMemberMappingDO classMemberMappingDO);
......@@ -55,4 +57,6 @@ public interface ClassDictService extends IService<ClassDictDO> {
void downloadFailClassMembers(DownloadFailClassMembers downloadFailClassMembers);
List<VodInfoVO> classVods(ClassDictDO classDictDO);
}
package com.subsidy.service;
import com.subsidy.dto.classDict.ClassTypeDTO;
import com.subsidy.mapper.ClassTypeDictMapper;
import com.subsidy.model.ClassTypeDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
......@@ -24,4 +25,7 @@ public interface ClassTypeDictService extends IService<ClassTypeDictDO> {
List<ClassTypeDictDO> queryClassTypes(ClassTypeDTO classTypeDTO);
List<ClassTypeDictDO> queryOnlineClassTypes(ClassTypeDictDO classTypeDictDO);
ClassTypeDictDO querySocialClassTypes(ClassTypeDictDO classTypeDictDO);
}
package com.subsidy.service;
import com.subsidy.model.ClassVodFaceCheckDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 百分比认证视频表 服务类
* </p>
*
* @author Tuyp
* @since 2024-03-18
*/
public interface ClassVodFaceCheckService extends IService<ClassVodFaceCheckDO> {
}
package com.subsidy.service;
import com.subsidy.dto.renshe.*;
import com.subsidy.vo.renshe.RensheResponseVO;
import com.subsidy.vo.dudao.RensheResponseVO;
import java.io.IOException;
......
......@@ -3,10 +3,8 @@ package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.live.PolyvInfoDTO;
import com.subsidy.dto.member.*;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.FileDictDO;
import com.subsidy.model.MemberDO;
import com.subsidy.vo.administer.UserRoleVO;
import com.subsidy.vo.live.MemberLivesVO;
......@@ -59,12 +57,18 @@ public interface MemberService extends IService<MemberDO> {
ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO);
SocialContentVodNewVO socialContentVod(ContentMemberDTO contentMemberDTO);
CheckItemVO checkItem(CheckItemDTO checkItemDTO);
List<ContentFilesVO> contentFiles(ContentMemberDTO contentMemberDTO);
IPage studyHistory(StudyHistoryDTO studyHistoryDTO);
List<QueryPapersVO> getCourseTest(ContentMemberDTO contentMemberDTO);
List<SocialCourseTestVO> socialCourseTest(ContentMemberDTO contentMemberDTO);
List<ExerciseDoneResultDO> getPaperDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO);
GetStudyInfoVO getStudyInfo(MemberDO memberDO);
......
......@@ -26,4 +26,6 @@ public interface RenSheJuService {
void test();
RensheResponseVO post6plus() throws Exception ;
}
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.administer.*;
import com.subsidy.dto.classDict.SocialTestDetailDTO;
import com.subsidy.dto.member.ImportMemberDTO;
import com.subsidy.mapper.*;
import com.subsidy.model.*;
......@@ -14,6 +15,9 @@ import com.subsidy.util.*;
import com.subsidy.util.excel.ExcelUtil;
import com.subsidy.vo.administer.*;
import com.subsidy.vo.classdict.ClassDetailVO;
import com.subsidy.vo.classdict.SocialTestDetailVO;
import com.subsidy.vo.classdict.SocialTestRecordVO;
import com.subsidy.vo.classdict.VodPassRateVO;
import com.subsidy.vo.company.GetAllCompanyVO;
import com.subsidy.vo.done.GetMaxScoreVO;
import com.subsidy.vo.done.TestScoreInfoVO;
......@@ -93,9 +97,6 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
private CompanyDictMapper companyDictMapper;
@Autowired
private RoleAdministerMappingMapper roleAdministerMappingMapper;
@Autowired
private MemberMapper memberMapper;
@Autowired
......@@ -128,19 +129,40 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
@Autowired
private ServiceAdministerMappingMapper serviceAdministerMappingMapper;
public LoginVO login(AdministerDO administerDO) {
LoginVO loginVO = new LoginVO();
//查看service_administer_mapping表有没有映射关系 roleType为0的时候才做判断
List<Long> longs = new ArrayList<Long>();
longs.add(0L);
longs.add(1L);
longs.add(3L);
AdministerDO administerDO1 = this.baseMapper.selectOne(new QueryWrapper<AdministerDO>()
.lambda()
.eq(AdministerDO::getAccountName, administerDO.getAccountName())
.ne(AdministerDO::getRole, 2));
.in(AdministerDO::getRole, longs));
if (null == administerDO1) {
throw new HttpException(10012);
}
if (0 == administerDO1.getRole()) {
int count = serviceAdministerMappingMapper.selectCount(new QueryWrapper<ServiceAdministerMappingDO>()
.lambda()
.eq(ServiceAdministerMappingDO::getAdministerId, administerDO1.getId())
.eq(ServiceAdministerMappingDO::getServiceId, 1));
if (count == 0) {
throw new HttpException(10029);
}
}
if ("0".equals(administerDO1.getStatus())) {
throw new HttpException(10013);
}
......@@ -241,7 +263,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//鉴权逻辑 对不对
String preAuthen = "appId=qxywz5nnWMI7ABCS"
+"&id="+administerDO.getId()
+ "&id=" + administerDO.getId()
+ "&accountName=" + administerDO.getAccountName()
+ "&appSecret=626737T1-65K0-5xC2-0Y0V-2Aq9QUAJ";
......@@ -283,15 +305,6 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
});
}
administerPermissionVO.setPermissions(treeList);
// //查询角色
// RoleAdministerMappingDO roleAdministerMappingDO = roleAdministerMappingMapper.selectOne(new QueryWrapper<RoleAdministerMappingDO>()
// .lambda()
// .eq(RoleAdministerMappingDO::getAdministerId, administerDO.getId()));
// administerPermissionVO.setRole(roleAdministerMappingDO.getRoleId());
// CompanyDictDO companyDictDO = companyDictMapper.selectById(administerDO.getCompanyId());
// administerPermissionVO.setCompanyName(companyDictDO.getCompanyName());
// administerPermissionVO.setShortName(companyDictDO.getShortName());
administerPermissionVO.setRole(administerDO.getRole());
/**
......@@ -881,6 +894,84 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
return exerciseTestVOS;
}
public IPage<ExerciseTestVO> socialExerciseTest(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();
for (ExerciseTestVO exerciseTestVO : classSignVOS) {
//章通过率
VodPassRateVO vodPassRateVO = this.baseMapper.vodPassRate(classDetailDTO.getId(), exerciseTestVO.getId());
exerciseTestVO.setTtl(vodPassRateVO.getTtl());
exerciseTestVO.setPs(vodPassRateVO.getPs());
//总评价
if (vodPassRateVO.getTtl() == vodPassRateVO.getPs()) {
exerciseTestVO.setResult("合格");
} else {
exerciseTestVO.setResult("不合格");
}
}
exerciseTestVOIPage.setRecords(classSignVOS);
return exerciseTestVOIPage;
}
public List<SocialTestDetailVO> socialTestDetail(SocialTestDetailDTO socialTestDetailDTO) {
return this.baseMapper.socialTestDetail(socialTestDetailDTO.getId(), socialTestDetailDTO.getMemberId());
}
public List<SocialTestRecordVO> socialTestRecord(SocialTestDetailDTO socialTestDetailDTO) {
return this.baseMapper.socialTestRecord(socialTestDetailDTO.getId(), socialTestDetailDTO.getMemberId());
}
public List<ExportSocialExerciseTestVO> exportSocialExerciseTest(ClassDetailDTO classDetailDTO) throws Exception {
Page pager = new Page(0, -1L);
IPage<ExerciseTestVO> exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName());
List<ExerciseTestVO> exerciseTestVOS = exerciseTestVOIPage.getRecords();
//课程详情
ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId());
List<ExportSocialExerciseTestVO> result = new ArrayList<>();
for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) {
//遍历学生,查看每个人最好的一次成绩
List<SocialTestDetailVO> socialTestDetailVOIPage = this.baseMapper.socialTestDetail(classDetailDTO.getId(), exerciseTestVO.getId());
MemberDO memberDO = memberMapper.selectById(exerciseTestVO.getId());
for (SocialTestDetailVO socialTestDetailVO : socialTestDetailVOIPage) {
ExportSocialExerciseTestVO exportSocialExerciseTestVO = new ExportSocialExerciseTestVO();
exportSocialExerciseTestVO.setUserName(memberDO.getUserName());
exportSocialExerciseTestVO.setIdCard(memberDO.getIdCard());
exportSocialExerciseTestVO.setTelephone(memberDO.getTelephone());
exportSocialExerciseTestVO.setVodName(socialTestDetailVO.getVodName());
exportSocialExerciseTestVO.setStartDate(socialTestDetailVO.getStartDate());
exportSocialExerciseTestVO.setEndDate(socialTestDetailVO.getCreateDate());
exportSocialExerciseTestVO.setScore(socialTestDetailVO.getScore());
exportSocialExerciseTestVO.setResult(socialTestDetailVO.getResult());
result.add(exportSocialExerciseTestVO);
}
}
if (classDetailDTO.getFlag()) {
CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId());
String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate();
if (null == companyDictDO.getCompanyName()) {
ExcelUtil.writeSocialTestExcel(null, studyDate, classDictDO.getClassName(), "测试成绩表", result, ExcelFormatUtils.socialScoreList);
} else {
ExcelUtil.writeSocialTestExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "测试成绩表", result, ExcelFormatUtils.socialScoreList);
}
}
return result;
}
public List<GetMemberPapersVO> getMemberPapers(ExerciseDoneResultDO exerciseDoneResultDO) {
return exerciseDoneResultMapper.queryExerciseDoneResult(exerciseDoneResultDO.getMemberId(), null, exerciseDoneResultDO.getPaperId());
}
......@@ -1359,32 +1450,48 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
compressFileToZipStream(zipOutputStream, baos1, "sign.xlsx");
/**
* 测试成绩
*/
//查看这个班级的课程下有几个试卷
//通过班级找课程
ClassDictDO classDictDO1 = classDictMapper.selectById(classDetailDTO.getId());
//通过课程id去找这个课程有几套卷子
List<PaperDictDO> paperDictDOS = paperDictMapper.selectList(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId, classDictDO1.getCourseId()));
if (0 == classDictDO.getClassType()) {
/**
* 测试成绩 企业线上化导出
*/
//查看这个班级的课程下有几个试卷
for (int i = 0; i < paperDictDOS.size(); i++) {
//通过班级找课程
ClassDictDO classDictDO1 = classDictMapper.selectById(classDetailDTO.getId());
//通过课程id去找这个课程有几套卷子
List<PaperDictDO> paperDictDOS = paperDictMapper.selectList(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId, classDictDO1.getCourseId()));
for (int i = 0; i < paperDictDOS.size(); i++) {
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
classDetailDTO.setFlag(false);
classDetailDTO.setPaperId(paperDictDOS.get(i).getId());
List<ExerciseTestVO> exerciseTestVOS = exportExerciseTest(classDetailDTO);
if (null == companyDictDO) {
testListExcel(null, studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
} else {
testListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
}
compressFileToZipStream(zipOutputStream, baos2, "test" + i + ".xlsx");
}
} else if (2 == classDictDO.getClassType()) {
/**
* 学徒制导出
*/
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
classDetailDTO.setFlag(false);
classDetailDTO.setPaperId(paperDictDOS.get(i).getId());
List<ExerciseTestVO> exerciseTestVOS = exportExerciseTest(classDetailDTO);
List<ExportSocialExerciseTestVO> exportSocialExerciseTestVOS = exportSocialExerciseTest(classDetailDTO);
if (null == companyDictDO) {
testListExcel(null, studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
socialTestListExcel(null, studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.socialScoreList, exportSocialExerciseTestVOS, null, 0, baos2);
} else {
testListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
socialTestListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.socialScoreList, exportSocialExerciseTestVOS, null, 0, baos2);
}
compressFileToZipStream(zipOutputStream, baos2, "test" + i + ".xlsx");
compressFileToZipStream(zipOutputStream, baos2, "test.xlsx");
}
/**
* 答疑记录
*/
......@@ -2212,7 +2319,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
sheet.addMergedRegion(cellRangeAddress21);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 6);
CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 9);
sheet.addMergedRegion(cellRangeAddress22);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框
......@@ -2224,11 +2331,11 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//第三行 2
SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1
CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 4);
CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3);
sheet.addMergedRegion(cellRangeAddress31);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 8);
CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 9);
sheet.addMergedRegion(cellRangeAddress32);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框
thirdRow.createCell(0).setCellValue(thirdHead[0]);
......@@ -2325,6 +2432,228 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
}
}
public static void socialTestListExcel(String companyName, String studyDate, String courseName, String title, List<String> headerList, List<ExportSocialExerciseTestVO> exerciseTestVOS, String datePattern, int colWidth, OutputStream out) {
// 声明一个工作薄
SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存
workbook.setCompressTempFiles(true);
//表头样式
CellStyle titleStyle = workbook.createCellStyle();
setStyle(titleStyle);
Font titleFont = workbook.createFont();
titleFont.setFontHeightInPoints((short) 20);
titleFont.setBoldweight((short) 700);
titleStyle.setFont(titleFont);
//第二行
CellStyle secondStyle = workbook.createCellStyle();
secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
Font secondFont = workbook.createFont();
secondStyle.setFont(secondFont);
//第三行
CellStyle thirdStyle = workbook.createCellStyle();
thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
Font thirdFont = workbook.createFont();
thirdStyle.setFont(thirdFont);
// 列头样式
CellStyle headerStyle = workbook.createCellStyle();
setStyle(headerStyle);
Font headerFont = workbook.createFont();
headerFont.setFontHeightInPoints((short) 12);
headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
headerStyle.setFont(headerFont);
// 数据单元格样式
CellStyle cellStyle = workbook.createCellStyle();
setStyle(cellStyle);
Font cellFont = workbook.createFont();
cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
cellStyle.setFont(cellFont);
// 生成一个(带标题)表格
SXSSFSheet sheet = workbook.createSheet();
//设置列宽
int minBytes = 17;//至少字节数
int[] arrColWidth = new int[headerList.size()];
// 产生表格标题行,以及设置列宽
String[] headers = new String[headerList.size()];
int ii = 0;
for (int i = 0; i < headerList.size(); i++) {
headers[ii] = headerList.get(i);
int bytes = headerList.get(i).getBytes().length;
arrColWidth[ii] = bytes < minBytes ? minBytes : bytes;
sheet.setColumnWidth(ii, arrColWidth[ii] * 256);
ii++;
}
//第二行
int[] secondWidth = new int[2];
// 产生表格标题行,以及设置列宽
String[] secondHead = new String[2];
List<String> secondList = Arrays.asList("培训实施单位:" + companyName, "培训时间:" + studyDate);
//第三行
int[] thirdWidth = new int[2];
// 产生表格标题行,以及设置列宽
String[] thirdHead = new String[2];
List<String> thirdList = Arrays.asList("培训项目:" + courseName, "培训平台:有课互联系统");
ii = 0;
for (int i = 0; i < 2; i++) {
secondHead[ii] = secondList.get(i);
int bytes = secondList.get(i).getBytes().length;
secondWidth[ii] = bytes < minBytes ? minBytes : bytes;
sheet.setColumnWidth(ii, secondWidth[ii] * 256);
ii++;
}
ii = 0;
for (int i = 0; i < 2; i++) {
thirdHead[ii] = thirdList.get(i);
int bytes = thirdList.get(i).getBytes().length;
thirdWidth[ii] = bytes < minBytes ? minBytes : bytes;
sheet.setColumnWidth(ii, thirdWidth[ii] * 256);
ii++;
}
// 遍历集合数据,产生数据行
//标题 0
SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0
titleRow.createCell(0).setCellValue(title);
setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框
titleRow.getCell(0).setCellStyle(titleStyle);
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1));
//第二行 1
SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1
CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 3);
sheet.addMergedRegion(cellRangeAddress21);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 8);
sheet.addMergedRegion(cellRangeAddress22);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框
secondRow.createCell(0).setCellValue(secondHead[0]);
secondRow.getCell(0).setCellStyle(secondStyle);
secondRow.createCell(4).setCellValue(secondHead[1]);
secondRow.getCell(4).setCellStyle(secondStyle);
//第三行 2
SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1
CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3);
sheet.addMergedRegion(cellRangeAddress31);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 8);
sheet.addMergedRegion(cellRangeAddress32);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框
thirdRow.createCell(0).setCellValue(thirdHead[0]);
thirdRow.getCell(0).setCellStyle(thirdStyle);
thirdRow.createCell(4).setCellValue(thirdHead[1]);
thirdRow.getCell(4).setCellStyle(thirdStyle);
//标题 3
SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1
for (int i = 0; i < headers.length; i++) {
headerRow.createCell(i).setCellValue(headers[i]);
headerRow.getCell(i).setCellStyle(headerStyle);
}
int seq = 1;
//内容
int rowIndex = 0;
for (ExportSocialExerciseTestVO exerciseTestVO : exerciseTestVOS) {
if (rowIndex == 65535 || rowIndex == 0) {
if (rowIndex != 0) {
sheet = workbook.createSheet();//如果数据超过了,则在第二页显示
}
rowIndex = 4;//数据内容从 rowIndex=2开始
}
SXSSFRow dataRow = sheet.createRow(rowIndex);
SXSSFCell newCell = dataRow.createCell(0);
cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(seq);
newCell = dataRow.createCell(1);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(exerciseTestVO.getUserName());
newCell = dataRow.createCell(2);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(exerciseTestVO.getIdCard());
newCell = dataRow.createCell(3);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(exerciseTestVO.getTelephone());
newCell = dataRow.createCell(4);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(exerciseTestVO.getVodName());
newCell = dataRow.createCell(5);
newCell.setCellStyle(cellStyle);
if (null != exerciseTestVO.getScore()){
newCell.setCellValue(exerciseTestVO.getScore());
}
//开始时间
newCell = dataRow.createCell(6);
newCell.setCellStyle(cellStyle);
if (null != exerciseTestVO.getScore()){
newCell.setCellValue(exerciseTestVO.getStartDate());
}
//结束时间
newCell = dataRow.createCell(7);
newCell.setCellStyle(cellStyle);
if (null != exerciseTestVO.getScore()){
newCell.setCellValue(exerciseTestVO.getEndDate());
}
newCell = dataRow.createCell(8);
newCell.setCellStyle(cellStyle);
if (null != exerciseTestVO.getScore() && exerciseTestVO.getScore()>=60){
newCell.setCellValue("合格");
}else {
newCell.setCellValue("不合格");
}
rowIndex++;
seq++;
}
try {
workbook.write(out);
workbook.close();
workbook.dispose();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void askListExcel(String companyName, String studyDate, String courseName, String title, List<String> headerList, List<AnswerRecordVO> answerRecordVOS, String datePattern, int colWidth, OutputStream out) {
// 声明一个工作薄
SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存
......
......@@ -11,17 +11,9 @@ import com.subsidy.dto.classDict.AddClassDTO;
import com.subsidy.dto.classDict.AddMemberToClassDTO;
import com.subsidy.dto.classDict.GetClassBaseInfoDTO;
import com.subsidy.dto.classDict.GetSpareMembersDTO;
import com.subsidy.dto.member.ImportMemberDTO;
import com.subsidy.jobs.CourseNotificationJob;
import com.subsidy.mapper.*;
import com.subsidy.model.AnsweringQuestionDO;
import com.subsidy.model.ClassDictDO;
import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.ClassNoticeDO;
import com.subsidy.model.CompanyDictDO;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.MemberDO;
import com.subsidy.model.VodDictDO;
import com.subsidy.model.*;
import com.subsidy.service.ClassDictService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.DateFormatUtil;
......@@ -29,14 +21,12 @@ import com.subsidy.util.QuartzUtil;
import com.subsidy.util.SMSUtils;
import com.subsidy.util.excel.ExcelUtil;
import com.subsidy.util.websocket.WebSocketUtil;
import com.subsidy.vo.classdict.ClassSettingsVO;
import com.subsidy.vo.classdict.GetAllClassesVO;
import com.subsidy.vo.classdict.GetClassBaseInfoVO;
import com.subsidy.vo.classdict.SystemSettings;
import com.subsidy.vo.classdict.*;
import com.subsidy.vo.member.DownloadFailClassMembers;
import com.subsidy.vo.member.DownloadFailClassMembersDTO;
import com.subsidy.vo.member.ImportClassMemberDTO;
import com.subsidy.dto.member.ImportClassMemberDTO;
import com.subsidy.vo.member.ImportClassMembersVO;
import com.subsidy.vo.vod.VodInfoVO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -49,6 +39,7 @@ import org.springframework.web.socket.WebSocketSession;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
* <p>
......@@ -88,10 +79,13 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
@Autowired
private CompanyMemberMappingMapper companyMemberMappingMapper;
@Autowired
private ClassVodFaceCheckMapper classVodFaceCheckMapper;
public List<GetAllClassesVO> getAllClasses(ClassDictDO classDictDO) throws Exception {
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
List<GetAllClassesVO> getAllClassesVOS = this.baseMapper.getAllClasses(classDictDO);
List<GetAllClassesVO> getAllClassesVOS = this.baseMapper.getAllClasses(classDictDO.getCompanyId(),classDictDO.getClassName(),classDictDO.getStartDate(),classDictDO.getEndDate(),classDictDO.getOpenStatus(),classDictDO.getClassType());
for (GetAllClassesVO getAllClassesVO : getAllClassesVOS) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(fmt.parse(getAllClassesVO.getEndDate()));
......@@ -99,9 +93,9 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
if (new Date().before(fmt.parse(getAllClassesVO.getStartDate()))) {
getAllClassesVO.setOpenStatus("1"); //待开始
} else if (new Date().after(calendar.getTime())) {
getAllClassesVO.setOpenStatus("2");
getAllClassesVO.setOpenStatus("2"); //已结束
} else {
getAllClassesVO.setOpenStatus("0");
getAllClassesVO.setOpenStatus("0"); //开课中
}
}
return getAllClassesVOS;
......@@ -137,6 +131,17 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
classMemberMappingMapper.insert(classMemberMappingDO);
}
//添加视频人脸认证
List<Long> vodIds = addClassDTO.getVodIds();
if (null != vodIds && vodIds.size() > 0) {
for (Long vodId : vodIds) {
ClassVodFaceCheckDO classVodFaceCheckDO = new ClassVodFaceCheckDO();
classVodFaceCheckDO.setClassId(classDictDO.getId());
classVodFaceCheckDO.setVodId(vodId);
classVodFaceCheckMapper.insert(classVodFaceCheckDO);
}
}
//添加通知
if (null != addClassDTO.getClassNoticeDOS()) {
List<ClassNoticeDO> classNoticeDOS = addClassDTO.getClassNoticeDOS();
......@@ -158,9 +163,45 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
return classDictDO.getId();
}
public String updateClass(ClassDictDO classDictDO) {
public String updateClass(AddClassDTO addClassDTO) {
ClassDictDO classDictDO = new ClassDictDO();
BeanUtils.copyProperties(addClassDTO, classDictDO);
this.baseMapper.updateById(classDictDO);
List<Long> vodIds = addClassDTO.getVodIds();
if (null != vodIds && vodIds.size() > 0) {
//
List<Long> oldIds = classVodFaceCheckMapper.faceVodIds(addClassDTO.getId());
List<Long> newIds = addClassDTO.getVodIds();
List<Long> newVodIds = new ArrayList<>();
for (Long lg : newIds) {
newVodIds.add(lg);
}
newIds.removeAll(oldIds); //
if (newIds.size() > 0) {
for (Long lg : newIds) {
ClassVodFaceCheckDO classVodFaceCheckDO = new ClassVodFaceCheckDO();
classVodFaceCheckDO.setVodId(lg);
classVodFaceCheckDO.setClassId(addClassDTO.getId());
classVodFaceCheckMapper.insert(classVodFaceCheckDO);
}
}
oldIds.removeAll(newVodIds);
if (oldIds.size() > 0) {
for (Long lg : oldIds) {
classVodFaceCheckMapper.delete(new QueryWrapper<ClassVodFaceCheckDO>()
.lambda()
.eq(ClassVodFaceCheckDO::getClassId, addClassDTO.getId())
.eq(ClassVodFaceCheckDO::getVodId, lg));
}
}
}
//班级所在公司
SystemSettings systemSettings = this.baseMapper.getCompanySettings(classDictDO.getId());
......@@ -177,6 +218,11 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
systemSettings.setClassSettingsVOS(classSettings);
String data = JSONObject.toJSONString(ResponseData.generateCreatedResponse(0, systemSettings), SerializerFeature.WriteMapNullValue);
webSocketSession.sendMessage(new TextMessage(data));
// ConcurrentHashMap<Long, WebSocketSession> webSocketMap = WebSocketUtil.webSocketMap;
// for (Map.Entry<Long, WebSocketSession> entry : webSocketMap.entrySet()) {
// webSocketMap.get(entry.getKey()).sendMessage(new TextMessage(data));
// }
} catch (Exception e) {
e.printStackTrace();
}
......@@ -186,8 +232,18 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
return ConstantUtils.SET_SUCCESS;
}
public ClassDictDO classDetail(ClassDictDO classDictDO) {
return this.baseMapper.selectById(classDictDO.getId());
public ClassDetail classDetail(ClassDictDO classDictDO) {
ClassDetail classDetail = new ClassDetail();
ClassDictDO classDictDO1 = this.baseMapper.selectById(classDictDO.getId());
BeanUtils.copyProperties(classDictDO1,classDetail);
//视频id
List<Long> longs = classVodFaceCheckMapper.faceVodIds(classDictDO.getId());
classDetail.setVodIds(longs);
return classDetail;
}
public String removeMember(ClassMemberMappingDO classMemberMappingDO) {
......@@ -302,7 +358,6 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
return getAllClassesVOS;
}
public ImportClassMembersVO importClassMembers(MultipartFile multipartFile, Long companyId) {
ImportClassMembersVO importClassMembersVO = new ImportClassMembersVO();
......@@ -340,5 +395,8 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
ExcelUtil.writeExcel(downloadFailClassMembersDTOS, DownloadFailClassMembersDTO.class);
}
public List<VodInfoVO> classVods(ClassDictDO classDictDO) {
return this.baseMapper.classVods(classDictDO.getId());
}
}
package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.classDict.ClassTypeDTO;
import com.subsidy.mapper.RoleAdministerMappingMapper;
import com.subsidy.model.ClassDictDO;
......@@ -32,11 +33,33 @@ public class ClassTypeDictServiceImpl extends ServiceImpl<ClassTypeDictMapper, C
private RoleAdministerMappingMapper roleAdministerMappingMapper;
public String addClassType(ClassTypeDictDO classTypeDictDO) {
int count = this.baseMapper.selectCount(new QueryWrapper<ClassTypeDictDO>()
.lambda()
.eq(ClassTypeDictDO::getCompanyId, classTypeDictDO.getCompanyId())
.eq(ClassTypeDictDO::getClassType, classTypeDictDO.getClassType()));
if (count > 0) {
throw new HttpException(40002);
}
this.baseMapper.insert(classTypeDictDO);
return ConstantUtils.ADD_SUCCESS;
}
public String updateClassType(ClassTypeDictDO classTypeDictDO) {
int count = this.baseMapper.selectCount(new QueryWrapper<ClassTypeDictDO>()
.lambda()
.eq(ClassTypeDictDO::getCompanyId, classTypeDictDO.getCompanyId())
.eq(ClassTypeDictDO::getClassType, classTypeDictDO.getClassType())
.ne(ClassTypeDictDO::getId, classTypeDictDO.getId()));
if (count > 0) {
throw new HttpException(40002);
}
this.baseMapper.updateById(classTypeDictDO);
return ConstantUtils.SET_SUCCESS;
}
......@@ -53,10 +76,10 @@ public class ClassTypeDictServiceImpl extends ServiceImpl<ClassTypeDictMapper, C
//查看当前登录人的角色 角色映射表
int count = roleAdministerMappingMapper.selectCount(new QueryWrapper<RoleAdministerMappingDO>()
.lambda()
.eq(RoleAdministerMappingDO::getAdministerId,classTypeDTO.getUserId())
.eq(RoleAdministerMappingDO::getRoleId,1));
.eq(RoleAdministerMappingDO::getAdministerId, classTypeDTO.getUserId())
.eq(RoleAdministerMappingDO::getRoleId, 1));
if (count>0){
if (count > 0) {
//平台支持
ClassTypeDictDO classTypeDictDO = this.baseMapper.selectById(1);
classTypeDictDOS.add(classTypeDictDO);
......@@ -65,10 +88,24 @@ public class ClassTypeDictServiceImpl extends ServiceImpl<ClassTypeDictMapper, C
//企业自己的班级类型
List<ClassTypeDictDO> classTypeDictDOList = this.baseMapper.selectList(new QueryWrapper<ClassTypeDictDO>()
.lambda()
.eq(ClassTypeDictDO::getCompanyId,classTypeDTO.getCompanyId()));
.eq(ClassTypeDictDO::getCompanyId, classTypeDTO.getCompanyId()));
classTypeDictDOS.addAll(classTypeDictDOList);
classTypeDictDOS.addAll(classTypeDictDOList);
return classTypeDictDOS;
}
public List<ClassTypeDictDO> queryOnlineClassTypes(ClassTypeDictDO classTypeDictDO) {
return this.baseMapper.selectList(new QueryWrapper<ClassTypeDictDO>()
.lambda()
.eq(ClassTypeDictDO::getCompanyId, classTypeDictDO.getCompanyId())
.ne(ClassTypeDictDO::getClassType, "社会化、学徒制"));
}
public ClassTypeDictDO querySocialClassTypes(ClassTypeDictDO classTypeDictDO) {
return this.baseMapper.selectOne(new QueryWrapper<ClassTypeDictDO>()
.lambda()
.eq(ClassTypeDictDO::getCompanyId, classTypeDictDO.getCompanyId())
.eq(ClassTypeDictDO::getClassType, "社会化、学徒制"));
}
}
package com.subsidy.service.impl;
import com.subsidy.model.ClassVodFaceCheckDO;
import com.subsidy.mapper.ClassVodFaceCheckMapper;
import com.subsidy.service.ClassVodFaceCheckService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 百分比认证视频表 服务实现类
* </p>
*
* @author Tuyp
* @since 2024-03-18
*/
@Service
public class ClassVodFaceCheckServiceImpl extends ServiceImpl<ClassVodFaceCheckMapper, ClassVodFaceCheckDO> implements ClassVodFaceCheckService {
}
......@@ -6,9 +6,8 @@ import com.subsidy.dto.content.GetContendVodsDTO;
import com.subsidy.dto.contentVod.AddContentVodDTO;
import com.subsidy.dto.contentVod.ContentVodDTO;
import com.subsidy.dto.vod.ChangeOrdersDTO;
import com.subsidy.mapper.VodDictMapper;
import com.subsidy.model.ContentVodMappingDO;
import com.subsidy.mapper.ContentVodMappingMapper;
import com.subsidy.mapper.*;
import com.subsidy.model.*;
import com.subsidy.service.ContentVodMappingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.vo.vod.GetContendVodsVO;
......@@ -16,6 +15,8 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
......@@ -33,6 +34,12 @@ public class ContentVodMappingServiceImpl extends ServiceImpl<ContentVodMappingM
@Autowired
private VodDictMapper vodDictMapper;
@Autowired
private PaperDictMapper paperDictMapper;
@Autowired
private CourseContentMapper courseContentMapper;
@Override
public List<GetContendVodsVO> getContendVods(GetContendVodsDTO getContendVodsDTO) {
List<GetContendVodsVO> contendVods = vodDictMapper.getContendVods(getContendVodsDTO.getVodName(), getContendVodsDTO.getContentId());
......@@ -40,15 +47,15 @@ public class ContentVodMappingServiceImpl extends ServiceImpl<ContentVodMappingM
}
@Override
public void changeContentVodOrders(ChangeOrdersDTO changeOrdersDTO){
if(CollectionUtils.isNotEmpty(changeOrdersDTO.getVodIds())) {
public void changeContentVodOrders(ChangeOrdersDTO changeOrdersDTO) {
if (CollectionUtils.isNotEmpty(changeOrdersDTO.getVodIds())) {
for (int i = 0; i < changeOrdersDTO.getVodIds().size(); i++) {
ContentVodMappingDO contentVodMappingDO = this.baseMapper.selectOne(new QueryWrapper<ContentVodMappingDO>().lambda()
.eq(ContentVodMappingDO::getContentId, changeOrdersDTO.getContentId())
.eq(ContentVodMappingDO::getVodId, changeOrdersDTO.getVodIds().get(i)));
ContentVodMappingDO contentVodMapping = new ContentVodMappingDO();
contentVodMapping.setId(contentVodMappingDO.getId());
contentVodMapping.setOrderNo(i+1);
contentVodMapping.setOrderNo(i + 1);
this.baseMapper.updateById(contentVodMapping);
}
}
......@@ -60,20 +67,24 @@ public class ContentVodMappingServiceImpl extends ServiceImpl<ContentVodMappingM
.lambda()
.eq(ContentVodMappingDO::getContentId, contentVodDTO.getContentId())
.eq(ContentVodMappingDO::getVodId, contentVodDTO.getVodId()));
if(contentVodMappingDO == null) {
if (contentVodMappingDO == null) {
throw new HttpException(18001);
}
paperDictMapper.delete(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getVodId, contentVodDTO.getVodId()));
this.baseMapper.deleteById(contentVodMappingDO.getId());
}
@Override
public void addContentVod(AddContentVodDTO addContentVod) {
if(CollectionUtils.isNotEmpty(addContentVod.getVodIds())) {
if (CollectionUtils.isNotEmpty(addContentVod.getVodIds())) {
List<ContentVodMappingDO> list = this.baseMapper.selectList(new QueryWrapper<ContentVodMappingDO>()
.lambda()
.eq(ContentVodMappingDO::getContentId, addContentVod.getContentId()));
if(CollectionUtils.isNotEmpty(list)) {
if (CollectionUtils.isNotEmpty(list)) {
this.baseMapper.deleteBatchIds(list.stream().map(ContentVodMappingDO::getId).collect(Collectors.toList()));
}
......@@ -82,24 +93,68 @@ public class ContentVodMappingServiceImpl extends ServiceImpl<ContentVodMappingM
.eq(ContentVodMappingDO::getContentId, addContentVod.getContentId())
.orderByDesc(ContentVodMappingDO::getOrderNo));
int orderNo = 0;
if(CollectionUtils.isNotEmpty(contentVodMappingList)) {
if (CollectionUtils.isNotEmpty(contentVodMappingList)) {
orderNo = contentVodMappingList.get(0).getOrderNo();
}
for (ContentVodDTO contentVodDTO : addContentVod.getVodIds()) {
ContentVodMappingDO cvm = this.baseMapper.selectOne(new QueryWrapper<ContentVodMappingDO>().lambda()
ContentVodMappingDO cvm = this.baseMapper.selectOne(new QueryWrapper<ContentVodMappingDO>().lambda()
.eq(ContentVodMappingDO::getVodId, contentVodDTO.getVodId())
.eq(ContentVodMappingDO::getContentId, addContentVod.getContentId()));
if(cvm == null) {
if (cvm == null) {
ContentVodMappingDO contentVodMappingDO = new ContentVodMappingDO();
contentVodMappingDO.setContentId(addContentVod.getContentId());
contentVodMappingDO.setVodId(contentVodDTO.getVodId());
contentVodMappingDO.setVodAliasName(contentVodDTO.getVodAliasName());
contentVodMappingDO.setOrderNo(++ orderNo);
contentVodMappingDO.setOrderNo(++orderNo);
this.baseMapper.insert(contentVodMappingDO);
}
}
}
//查看该章节的课程是社会化还是学徒制
CourseDictDO courseDictDO = this.baseMapper.getCourseByContentId(addContentVod.getContentId());
if (1 == courseDictDO.getCourseDataType()) {
//找到之前存在的卷子的视频ids
List<Long> oldVodIds = this.baseMapper.oldVodIds(addContentVod.getContentId());
//新视频的ids
List<ContentVodDTO> contentVodDTOS = addContentVod.getVodIds();
List<Long> newIds = new ArrayList<>();
HashMap<Long, String> hashMap = new HashMap<>();
for (ContentVodDTO contentVodDTO : contentVodDTOS) {
newIds.add(contentVodDTO.getVodId());
hashMap.put(contentVodDTO.getVodId(),contentVodDTO.getVodAliasName());
}
List<Long> newIds2 = new ArrayList<>();
for (Long lg : newIds) {
newIds2.add(lg);
}
newIds.removeAll(oldVodIds); //
if (newIds.size() > 0) {
for (Long lg : newIds) {
PaperDictDO paperDictDO = new PaperDictDO();
paperDictDO.setCourseId(courseDictDO.getId());
paperDictDO.setPaperName(hashMap.get(lg));
paperDictDO.setPaperStatus(1);
paperDictDO.setVodId(lg);
paperDictMapper.insert(paperDictDO);
}
}
oldVodIds.removeAll(newIds2); //
if (oldVodIds.size() > 0) {
paperDictMapper.delete(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId, courseDictDO.getId())
.in(PaperDictDO::getVodId, oldVodIds));
}
}
}
@Override
......@@ -108,7 +163,7 @@ public class ContentVodMappingServiceImpl extends ServiceImpl<ContentVodMappingM
.lambda()
.eq(ContentVodMappingDO::getVodId, contentVodDTO.getVodId())
.eq(ContentVodMappingDO::getContentId, contentVodDTO.getContentId()));
if(contentVodMappingDO != null) {
if (contentVodMappingDO != null) {
ContentVodMappingDO cvm = new ContentVodMappingDO();
cvm.setId(contentVodMappingDO.getId());
cvm.setVodAliasName(contentVodDTO.getVodAliasName());
......
......@@ -123,7 +123,6 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
}
}
if (null != addCourseDTO.getFieldDictDOS()) {
List<Long> fieldDictDOS = addCourseDTO.getFieldDictDOS();
for (Long lg : fieldDictDOS) {
......@@ -144,7 +143,6 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
}
}
//经营范围
if (null != addCourseDTO.getBusinessIds()) {
List<Long> businessId = addCourseDTO.getBusinessIds();
......@@ -187,7 +185,7 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
public IPage<QueryCoursesVO> queryCourses(QueryCoursesDTO queryCoursesDTO) {
Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize());
IPage<QueryCoursesVO> iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getFieldId(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), queryCoursesDTO.getCourseType(), null, queryCoursesDTO.getOpenStatus(), queryCoursesDTO.getBusinessId());
IPage<QueryCoursesVO> iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getFieldId(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), queryCoursesDTO.getCourseType(), null, queryCoursesDTO.getOpenStatus(), queryCoursesDTO.getBusinessId(),queryCoursesDTO.getCourseDataType());
List<QueryCoursesVO> queryCoursesVOS = iPage.getRecords();
for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) {
......@@ -243,8 +241,14 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
queryCoursesVO.setVodLength(vodPlayLength);
//测试数
Integer paperCnt = paperDictMapper.queryCoursePapersCnt(queryCoursesVO.getId());
queryCoursesVO.setPaperCount(paperCnt);
if (0 == queryCoursesDTO.getCourseDataType()){
//企业线上培训
Integer paperCnt = paperDictMapper.queryCoursePapersCnt(queryCoursesVO.getId());
queryCoursesVO.setPaperCount(paperCnt);
}else {
//学徒制 视频数量即是考试数量
queryCoursesVO.setPaperCount(vodCnt);
}
}
return iPage;
......@@ -355,7 +359,7 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
public IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO) {
Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize());
IPage<QueryCoursesVO> iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), null, queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), null, queryCoursesDTO.getCompanyId(), queryCoursesDTO.getOpenStatus(),
queryCoursesDTO.getBusinessId());
queryCoursesDTO.getBusinessId(),queryCoursesDTO.getCourseDataType());
List<QueryCoursesVO> queryCoursesVOS = iPage.getRecords();
for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) {
......@@ -388,7 +392,6 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
queryCoursesVO.setRankDictDOS(rankDictDOS);
//经营范围
//经营范围
List<BusinessScopeDictDO> businessScopeDictDOS = businessScopeDictMapper.getBusinessScope(queryCoursesVO.getId());
List<BusinessVO> businessVOS = new ArrayList<>();
......@@ -410,9 +413,14 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
Integer vodPlayLength = courseDictMapper.queryCoursePlayLength(queryCoursesVO.getId());
queryCoursesVO.setVodLength(vodPlayLength);
//测试数
Integer paperCnt = paperDictMapper.queryCoursePapersCnt(queryCoursesVO.getId());
queryCoursesVO.setPaperCount(paperCnt);
if (0 == queryCoursesDTO.getCourseDataType()){
//企业线上培训 测试数量
Integer paperCnt = paperDictMapper.queryCoursePapersCnt(queryCoursesVO.getId());
queryCoursesVO.setPaperCount(paperCnt);
}else {
//学徒制 视频数量即是考试数量
queryCoursesVO.setPaperCount(vodCnt);
}
}
return iPage;
}
......
......@@ -2,15 +2,14 @@ package com.subsidy.service.impl;
import com.alibaba.fastjson.JSON;
import com.subsidy.common.configure.RenSheConfig;
import com.subsidy.dto.renshe.*;
import com.subsidy.dto.dudao.*;
import com.subsidy.mapper.ClassDictMapper;
import com.subsidy.mapper.DudaoMapper;
import com.subsidy.mapper.RenSheJuMapper;
import com.subsidy.mapper.RenshejuHistoryMapper;
import com.subsidy.model.*;
import com.subsidy.service.DudaoService;
import com.subsidy.util.DudaoConstant;
import com.subsidy.vo.renshe.*;
import com.subsidy.vo.dudao.*;
import net.sf.json.JSONObject;
import okhttp3.*;
import org.springframework.beans.BeanUtils;
......@@ -46,9 +45,6 @@ public class DudaoServiceImpl implements DudaoService {
@Autowired
private DudaoMapper dudaoMapper;
// @Autowired
// private RenSheJuMapper renSheJuMapper;
public RensheResponseVO all()throws IOException{
classBaseInfo();
......@@ -87,6 +83,7 @@ public class DudaoServiceImpl implements DudaoService {
List<Long> imageClassIds = dudaoMapper.imageClassIds("0");
Set<Long> classIds = new HashSet<>();
// classIds.add(424L);
vodClassIds.stream().forEach(x->classIds.add(x));
examClassIds.stream().forEach(x->classIds.add(x));
......@@ -100,11 +97,11 @@ public class DudaoServiceImpl implements DudaoService {
//班级基本信息
ClassBaseInfoVO classBaseInfoVO = dudaoMapper.classBaseInfo(classId);
BeanUtils.copyProperties(classBaseInfoVO, epidemicSituationClassBasic);
epidemicSituationClassBasic.setClassCode(classBaseInfoVO.getDownCode());
epidemicSituationClassBasic.setDownCode(classBaseInfoVO.getDownCode());
//章节
List<ChapterList2> chapterLists = dudaoMapper.classChapters(classId);
ChapterList2 chapterList2 = chapterLists.get(chapterLists.size() - 1);
com.subsidy.dto.dudao.ChapterList2 chapterList2 = chapterLists.get(chapterLists.size() - 1);
chapterList2.setIsExam(1);
epidemicSituationClassBasic.setChapterList(chapterLists);
......@@ -178,6 +175,9 @@ public class DudaoServiceImpl implements DudaoService {
//产生视频学习数据的班级
List<Long> vodClassIds = dudaoMapper.vodClassIds("0");
// List<Long> vodClassIds = new ArrayList<>();
// vodClassIds.add(424L);
List<DailyStudyInfoVO> result = new ArrayList<>();
for (Long classId : vodClassIds){
......@@ -189,7 +189,7 @@ public class DudaoServiceImpl implements DudaoService {
for (DailyStudyInfoVO dailyStudyInfoVO : result) {
ClassHourBasic classHourBasic = new ClassHourBasic();
BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic);
classHourBasic.setClassCode(dailyStudyInfoVO.getClassCode());
classHourBasic.setDownCode(String.valueOf(dailyStudyInfoVO.getClassId()));
//上线时间列表
//找到当天每次上线下线时间
......@@ -306,6 +306,9 @@ public class DudaoServiceImpl implements DudaoService {
//找出前一天产生考试数据的班级
List<Long> classIds = dudaoMapper.dailyExamBasic("0");
// List<Long>classIds = new ArrayList<>();
// classIds.add(424L);
try {
if (classIds.size() > 0) {
for (Long classId : classIds) {
......@@ -319,7 +322,7 @@ public class DudaoServiceImpl implements DudaoService {
//章节课程考试时间列表
ChapterExamBasic chapterExamBasic = new ChapterExamBasic();
chapterExamBasic.setClassCode(classDictDO.getClassCode());
chapterExamBasic.setDownCode(String.valueOf(classDictDO.getId()));
//最后一节课作为chapterCode
String vodId = dudaoMapper.classVodName(classId);
......@@ -358,7 +361,7 @@ public class DudaoServiceImpl implements DudaoService {
//下线时间
List<OprMemDictDO> loginOutRecords = dudaoMapper.loginOutRecords(memberDO.getId());
// boolean flag = false;
boolean flag = false;
for (int i = 0; i < loginRecords.size(); i++) {
//找到该时间段内的测评
......@@ -368,17 +371,17 @@ public class DudaoServiceImpl implements DudaoService {
examList.setStartTime(Timestamp.valueOf(exerciseDoneResultDO.getStartDate()).getTime());
examList.setEndTime(Timestamp.valueOf(exerciseDoneResultDO.getCreateDate()).getTime());
examList.setIp(loginRecords.get(i).getIpAddress());
// if ("合格".equals(exerciseDoneResultDO.getResult())) {
// flag = true;
// }
if ("合格".equals(exerciseDoneResultDO.getResult())) {
flag = true;
}
examLists.add(examList);
}
}
// if (flag == true) {
// chapterExamBasic.setAccess(0L);
// } else {
// chapterExamBasic.setAccess(1L);
// }
if (flag == true) {
chapterExamBasic.setAccess(0L);
} else {
chapterExamBasic.setAccess(1L);
}
chapterExamBasic.setExamList(examLists);
chapterExamBasics.add(chapterExamBasic);
}
......@@ -423,6 +426,7 @@ public class DudaoServiceImpl implements DudaoService {
return null;
}
} catch (Exception e) {
e.printStackTrace();
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(DudaoConstant.POST_3);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString());
......@@ -473,7 +477,7 @@ public class DudaoServiceImpl implements DudaoService {
AnswerBasic answerBasic = new AnswerBasic();
String downCode = key.split(":")[0];
String identity = key.split(":")[1];
answerBasic.setClassCode(downCode);
answerBasic.setDownCode(downCode);
answerBasic.setIdentity(identity);
answerBasic.setAnswerAndQuestionList(hashMap.get(key));
answerBasics.add(answerBasic);
......
......@@ -10,9 +10,7 @@ import com.subsidy.dto.exercise.JudgeDTO;
import com.subsidy.dto.exercise.SelectDTO;
import com.subsidy.dto.exercise.SubmitDTO;
import com.subsidy.dto.member.ImportMemberDTO;
import com.subsidy.mapper.ExerciseDictMapper;
import com.subsidy.mapper.ExerciseDoneHistoryMapper;
import com.subsidy.mapper.ExerciseDoneResultMapper;
import com.subsidy.mapper.*;
import com.subsidy.model.*;
import com.subsidy.service.ExerciseDictService;
import com.subsidy.util.ConstantUtils;
......@@ -55,6 +53,16 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
@Autowired
private ExerciseDoneHistoryMapper exerciseDoneHistoryMapper;
@Autowired
private ClassDictMapper classDictMapper;
@Autowired
private ClassMemberMappingMapper classMemberMappingMapper;
@Autowired
private PaperDictMapper paperDictMapper;
public String addExercise(ExerciseDictDO exerciseDictDO) {
Integer orderNoTmp = this.baseMapper.getMaximumNo(exerciseDictDO.getPaperId());
......@@ -88,23 +96,34 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
SimpleDateFormat startDateFormat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ClassDictDO classDictDO = classDictMapper.selectById(submitDTO.getClassId());
//判断数据库里是否有一样开始时间的记录,有的话就不插入
Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
.eq(ExerciseDoneResultDO::getMemberId,submitDTO.getMemberId())
.eq(ExerciseDoneResultDO::getClassId,submitDTO.getClassId())
.eq(ExerciseDoneResultDO::getPaperId,submitDTO.getPaperId())
.eq(ExerciseDoneResultDO::getStartDate,submitDTO.getStartDate()));
.lambda()
.eq(ExerciseDoneResultDO::getMemberId, submitDTO.getMemberId())
.eq(ExerciseDoneResultDO::getClassId, submitDTO.getClassId())
.eq(ExerciseDoneResultDO::getPaperId, submitDTO.getPaperId())
.eq(ExerciseDoneResultDO::getStartDate, submitDTO.getStartDate()));
if (count == 0){
if (count == 0) {
try {
Date startDate = startDateFormat1.parse(submitDTO.getStartDate());
if (new Date().getTime() - startDate.getTime() < 180 * 1000L) {
if (2== classDictDO.getClassType() && null != classDictDO.getPaperTime() && null != classDictDO.getPaperTimeLimit() && 1 == classDictDO.getPaperTime() && new Date().getTime() - startDate.getTime() < classDictDO.getPaperTimeLimit() * 60 * 1000L) {
throw new HttpException(20003);
}
} catch (ParseException e) {
if (1 == classDictDO.getClassType() && null != classDictDO.getPaperTime() && null != classDictDO.getPaperTimeLimit() && 1 == classDictDO.getPaperTime() && new Date().getTime() - startDate.getTime() < classDictDO.getPaperTimeLimit() * 60 * 1000L) {
throw new HttpException(20003);
}
if (0 == classDictDO.getClassType() && new Date().getTime() - startDate.getTime() < 3 * 60 * 1000L) {
throw new HttpException(20003);
}
} catch (ParseException e) {
e.printStackTrace();
}
int rightCounts = 0;
......@@ -146,6 +165,27 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
}
}
//提交状态
if (0 == classDictDO.getClassType()) {
//企业线上化 只要提交过,就将状态置为1,之后视频数据不在写入
ClassMemberMappingDO classMemberMappingDO = classMemberMappingMapper.selectOne(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getMemberId, submitDTO.getMemberId())
.eq(ClassMemberMappingDO::getClassId, submitDTO.getClassId()));
classMemberMappingDO.setSubmitFlag(1);
classMemberMappingMapper.updateById(classMemberMappingDO);
} else if (2 == classDictDO.getClassType() || 1 == classDictDO.getClassType()) {
List<Long> paperIds = paperDictMapper.lastPaper(classDictDO.getCourseId());
if (submitDTO.getPaperId() .equals( paperIds.get(0))){
//企业线上化 只要提交过,就将状态置为1,之后视频数据不在写入
ClassMemberMappingDO classMemberMappingDO = classMemberMappingMapper.selectOne(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getMemberId, submitDTO.getMemberId())
.eq(ClassMemberMappingDO::getClassId, submitDTO.getClassId()));
classMemberMappingDO.setSubmitFlag(1);
classMemberMappingMapper.updateById(classMemberMappingDO);
}
}
return exerciseDoneResultDO.getId();
}
......@@ -154,12 +194,12 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
return this.baseMapper.getPaperExercise(pager, getPaperExerciseDTO.getPaperId(), getPaperExerciseDTO.getDifficulty(), getPaperExerciseDTO.getExerciseType(), getPaperExerciseDTO.getTitle());
}
public String judge(MultipartFile multipartFile,Long paperId,Long courseId){
public String judge(MultipartFile multipartFile, Long paperId, Long courseId) {
try {
ExcelUtil.readExcel(null, JudgeDTO.class, multipartFile).forEach(s -> {
ExerciseDictDO exerciseDictDO = new ExerciseDictDO();
exerciseDictDO.setTitle("<p>"+s.getTitle()+"</p>");
exerciseDictDO.setTitle("<p>" + s.getTitle() + "</p>");
exerciseDictDO.setRightAnswer(s.getAnswer());
exerciseDictDO.setExerciseType(s.getExerciseType());
exerciseDictDO.setDifficulty("适中");
......@@ -175,12 +215,12 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
return ConstantUtils.ADD_SUCCESS;
}
public String select(MultipartFile multipartFile,Long paperId,Long courseId){
public String select(MultipartFile multipartFile, Long paperId, Long courseId) {
try {
ExcelUtil.readExcel(null, SelectDTO.class, multipartFile).forEach(s -> {
ExerciseDictDO exerciseDictDO = new ExerciseDictDO();
exerciseDictDO.setTitle("<p>"+s.getTitle()+"<p>");
exerciseDictDO.setTitle("<p>" + s.getTitle() + "<p>");
exerciseDictDO.setOrderNo(s.getId());
exerciseDictDO.setExerciseType(s.getExerciseType());
//选项
......@@ -192,16 +232,16 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
items.append("{\"label\":\"<p>").append(s.getAnswerD()).append("</p>\",\"value\":\"D\"}]");
exerciseDictDO.setItems(items.toString());
if ("单选题".equals(s.getExerciseType())){
if ("单选题".equals(s.getExerciseType())) {
exerciseDictDO.setRightAnswer(s.getRightAnswer());
}else {
} else {
String[] answers = s.getRightAnswer().split(",");
StringBuffer answer = new StringBuffer();
answer.append("[");
int i = 0;
for (String split : answers){
for (String split : answers) {
answer.append("\"").append(split).append("\"");
if(i!=answers.length-1){
if (i != answers.length - 1) {
answer.append(",");
}
i++;
......
......@@ -71,19 +71,19 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
}
public SendIdCardInfoVO imageCheck(ImageCheckDTO imageCheckDTO) throws Exception {
return PCCheckIdCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 0, imageCheckDTO.getClassPlace(), imageCheckDTO.getPaperId());
return PCCheckIdCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 0, imageCheckDTO.getClassPlace(), imageCheckDTO.getPaperId(),imageCheckDTO.getVodId());
}
public SendIdCardInfoVO h5CheckResult(ImageCheckDTO imageCheckDTO) throws Exception {
return H5IdCheckCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 0, imageCheckDTO.getClassPlace(), imageCheckDTO.getPaperId());
return H5IdCheckCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 0, imageCheckDTO.getClassPlace(), imageCheckDTO.getPaperId(),imageCheckDTO.getVodId());
}
public SendIdCardInfoVO loginCheck(ImageCheckDTO imageCheckDTO) throws Exception {
return PCCheckIdCard(imageCheckDTO.getId(), null, 1, null, null);
return PCCheckIdCard(imageCheckDTO.getId(), null, 1, null, null,imageCheckDTO.getVodId());
}
public SendIdCardInfoVO h5LoginCheck(ImageCheckDTO imageCheckDTO) throws Exception {
return H5IdCheckCard(imageCheckDTO.getId(), null, 1, null, null);
return H5IdCheckCard(imageCheckDTO.getId(), null, 1, null, null,imageCheckDTO.getVodId());
}
/**
......@@ -103,7 +103,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
* H5端调取权威库(身份证)验证 权威库
* 1,签到页 0 班级内
*/
public SendIdCardInfoVO H5IdCheckCard(Long id, Long classId, Integer checkPlace, Integer classPlace, Long paperId) {
public SendIdCardInfoVO H5IdCheckCard(Long id, Long classId, Integer checkPlace, Integer classPlace, Long paperId,Long vodId) {
getDailyCheckCnt(id);
//获取这个学生的基本信息
MemberDO memberDO = memberMapper.selectById(id);
......@@ -132,6 +132,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
}
activityDetectionDO.setMemberId(memberDO.getId());
activityDetectionDO.setFaceCheckId(imageCheckRecordDO.getId());
activityDetectionDO.setVodId(vodId);
activityDetectionMapper.insert(activityDetectionDO);
//获取signTicket
......@@ -187,7 +188,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
* PC端调取权威库(身份证)验证 权威库
* 1,签到页 0 班级内
*/
public SendIdCardInfoVO PCCheckIdCard(Long id, Long classId, Integer checkPlace, Integer classPlace, Long paperId) {
public SendIdCardInfoVO PCCheckIdCard(Long id, Long classId, Integer checkPlace, Integer classPlace, Long paperId,Long vodId) {
getDailyCheckCnt(id);
//获取这个学生的基本信息
......@@ -216,6 +217,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
}
activityDetectionDO.setMemberId(memberDO.getId());
activityDetectionDO.setFaceCheckId(imageCheckRecordDO.getId());
activityDetectionDO.setVodId(vodId);
activityDetectionMapper.insert(activityDetectionDO);
//获取signTicket
......@@ -293,11 +295,6 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
.eq(ImageCheckRecordDO::getBizSeqNo, checkResultDTO.getId()));
if (!StringUtils.isEmpty(resultVO.getSimilarity())) {
BeanUtils.copyProperties(resultVO, imageCheckRecordDO);
// ActivityDetectionDO activityDetectionDO = new ActivityDetectionDO();
// activityDetectionDO.setClassId(imageCheckRecordDO.getClassId());
// activityDetectionDO.setMemberId(imageCheckRecordDO.getMemberId());
// activityDetectionDO.setCheckType(1);
// activityDetectionDO.setFaceCheckId(imageCheckRecordDO.getId());
ActivityDetectionDO activityDetectionDO = activityDetectionMapper.selectOne(new QueryWrapper<ActivityDetectionDO>()
.lambda()
.eq(ActivityDetectionDO::getFaceCheckId,imageCheckRecordDO.getId()));
......@@ -328,12 +325,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
e.printStackTrace();
}
// if (null != imageCheckRecordDO.getPaperId()) {
// activityDetectionDO.setCheckType(2);
// }
imageCheckRecordMapper.updateById(imageCheckRecordDO);
activityDetectionMapper.updateImageCheckCreateDate(activityDetectionDO.getId(),activityDetectionDO.getStatus(),imageCheckRecordDO.getCreateDate(),imageCheckRecordDO.getUpdateDate());
// activityDetectionMapper.updateById(activityDetectionDO);
}
return imageCheckRecordDO;
}
......
......@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.common.configure.QXueYouConfig;
import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.administer.VerifyCodeDTO;
import com.subsidy.dto.live.PolyvInfoDTO;
import com.subsidy.dto.member.*;
import com.subsidy.mapper.*;
import com.subsidy.model.*;
......@@ -19,6 +18,7 @@ import com.subsidy.vo.administer.UserRoleVO;
import com.subsidy.vo.live.MemberLivesVO;
import com.subsidy.vo.live.PolyvInfoVO;
import com.subsidy.vo.member.*;
import com.subsidy.vo.paper.MemberMaxScoreVO;
import com.subsidy.vo.paper.QueryPapersVO;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
......@@ -39,15 +39,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Member;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
//import com.subsidy.util.RedisUtil;
......@@ -128,6 +124,9 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
@Autowired
private CompanyMemberMappingMapper companyMemberMappingMapper;
@Autowired
private ExerciseDictMapper exerciseDictMapper;
public IPage<GetAllVO> getAll(GetAllDTO getAllDTO) {
Page pager = new Page(getAllDTO.getPageNum(), getAllDTO.getPageSize());
......@@ -807,7 +806,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
if (i == 0 && contentStatus) {
//第一个视频默认打开
memberVodVO.setStatus(true);
} else if (memberVodVO.getPercent().equals("100")) {
} else if (100 == memberVodVO.getPercent()) {
//这个视频看完了,已解锁
memberVodVO.setStatus(true);
} else {
......@@ -853,6 +852,240 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
return contentVodNewVO;
}
public SocialContentVodNewVO socialContentVod(ContentMemberDTO contentMemberDTO) {
SocialContentVodNewVO socialContentVodNewVO = new SocialContentVodNewVO();
//课程详细信息
ClassDictDO classDictDO = classDictMapper.selectById(contentMemberDTO.getClassId());
socialContentVodNewVO.setIsFastPlay(classDictDO.getIsFastPlay());
socialContentVodNewVO.setIsOrder(classDictDO.getIsOrder());
socialContentVodNewVO.setTestRule(classDictDO.getTestRule());
List<SocialContentVodVO> socialContentVodVOS = new ArrayList<>();
//查看所有的content 目录
List<CourseContentDO> courseContentDOS = courseContentMapper.selectList(new QueryWrapper<CourseContentDO>()
.lambda()
.eq(CourseContentDO::getCourseId, contentMemberDTO.getCourseId())
.orderByAsc(CourseContentDO::getOrderNo));
ClassDictDO classDictDO1 = classDictMapper.selectById(contentMemberDTO.getClassId());
//查看这个课程所有考试
List<PaperDictDO> paperDictDOS = paperDictMapper.selectList(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId, contentMemberDTO.getCourseId()));
/**
* 视频id paperId
*/
HashMap<Long, Long> hashMap = new HashMap<>();
for (PaperDictDO paperDictDO : paperDictDOS) {
hashMap.put(paperDictDO.getVodId(), paperDictDO.getId());
}
int i = 0;
//遍历目录
for (CourseContentDO courseContentDO : courseContentDOS) {
SocialContentVodVO socialContentVodVO = new SocialContentVodVO();
socialContentVodVO.setContent(courseContentDO.getContent());
List<MemberVodVO> memberVodVOS = courseContentMapper.contentVodProcess(courseContentDO.getId(), contentMemberDTO.getMemberId(), contentMemberDTO.getClassId());
//视频状态
Boolean vodFlag = true;
int playCount = 0;
//题目状态
Boolean testFlag = true;
List<SocialVodTestVO> socialVodTestVOS = new ArrayList<>();
if (1 == classDictDO1.getIsOrder()) {
for (MemberVodVO memberVodVO : memberVodVOS) {
//视频+1
SocialVodTestVO vodVo = new SocialVodTestVO();
vodVo.setId(memberVodVO.getId());
vodVo.setItemName(memberVodVO.getVodName());
vodVo.setPercent(memberVodVO.getPercent());
vodVo.setVodUrl(memberVodVO.getVodUrl());
vodVo.setLeftLength(memberVodVO.getLeftLength());
vodVo.setPlayRecord(memberVodVO.getPlayRecord());
vodVo.setId(memberVodVO.getId());
vodVo.setVodLength(memberVodVO.getVodLength());
//这个视频的人脸有没有做
int vodFaceCheck = activityDetectionMapper.selectCount(new QueryWrapper<ActivityDetectionDO>()
.lambda()
.eq(ActivityDetectionDO::getVodId,memberVodVO.getId())
.eq(ActivityDetectionDO::getMemberId,contentMemberDTO.getMemberId())
.eq(ActivityDetectionDO::getClassId,contentMemberDTO.getClassId())
.eq(ActivityDetectionDO::getStatus,1));
if (vodFaceCheck > 0){
vodVo.setVodFaceCheckFlag(true);
}else {
vodVo.setVodFaceCheckFlag(false);
}
//当前视频有没有做过活跃度检测
Integer count = activityDetectionMapper.selectCount(new QueryWrapper<ActivityDetectionDO>()
.lambda()
.eq(ActivityDetectionDO::getVodId, memberVodVO.getId())
.eq(ActivityDetectionDO::getMemberId, contentMemberDTO.getMemberId())
.eq(ActivityDetectionDO::getClassId, contentMemberDTO.getClassId())
.eq(ActivityDetectionDO::getStatus, 1));
if (count > 0) {
vodVo.setActivityStatus(true);
} else {
vodVo.setActivityStatus(false);
}
if (i == 0 && vodFlag) {
vodVo.setStatus(true);
} else if(memberVodVO.getPercent().equals("100")|| testFlag) {
//这个视频看完了,已解锁
vodVo.setStatus(true);
} else {
vodVo.setStatus(false);
vodFlag = false;
}
//视频+1
vodVo.setItemType(0);
socialVodTestVOS.add(vodVo);
SocialVodTestVO testVO = new SocialVodTestVO();
//查看该视频对应的试卷名 并赋值
PaperDictDO paperDictDO = paperDictMapper.selectOne(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId, contentMemberDTO.getCourseId())
.eq(PaperDictDO::getVodId, memberVodVO.getId()));
testVO.setId(paperDictDO.getId());
testVO.setItemName(paperDictDO.getPaperName());
testVO.setItemType(1);
testVO.setId(paperDictDO.getId());
if (vodFlag && 100 == memberVodVO.getPercent()) {
//视频全部看完
playCount++;
//计算最好成绩 memberId,classId,vodId
MemberMaxScoreVO memberMaxScoreVO = paperDictMapper.memberMaxScore(contentMemberDTO.getMemberId(), contentMemberDTO.getClassId(), memberVodVO.getId());
if (null == memberMaxScoreVO) {
testVO.setTestStatus("待完成");
testVO.setStatus(false);
testFlag = false;
} else {
testVO.setRightCount(memberMaxScoreVO.getRightCounts());
testVO.setTotalCount(memberMaxScoreVO.getTotalCounts());
if ("合格".equals(memberMaxScoreVO.getResult())) {
testVO.setTestStatus("通过");
testVO.setStatus(true);
testFlag = true;
} else {
testVO.setTestStatus("未通过");
testVO.setStatus(false);
testFlag = false;
}
}
} else {
//视频看完后才可以做题
testVO.setTestStatus("待解锁");
testVO.setStatus(false);
testFlag = false;
}
socialVodTestVOS.add(testVO);
i++;
}
} else {
//课程不需要按照顺序播放 ,全部是解锁标识
for (MemberVodVO memberVodVO : memberVodVOS) {
SocialVodTestVO vodVO = new SocialVodTestVO();
vodVO.setId(memberVodVO.getId());
vodVO.setItemName(memberVodVO.getVodName());
vodVO.setVodLength(memberVodVO.getVodLength());
vodVO.setPercent(memberVodVO.getPercent());
vodVO.setLeftLength(memberVodVO.getLeftLength());
vodVO.setItemType(0);
vodVO.setStatus(true);
vodVO.setVodUrl(memberVodVO.getVodUrl());
//这个视频的人脸有没有做
int vodFaceCheck = activityDetectionMapper.selectCount(new QueryWrapper<ActivityDetectionDO>()
.lambda()
.eq(ActivityDetectionDO::getVodId,memberVodVO.getId())
.eq(ActivityDetectionDO::getMemberId,contentMemberDTO.getMemberId())
.eq(ActivityDetectionDO::getClassId,contentMemberDTO.getClassId())
.eq(ActivityDetectionDO::getStatus,1));
if (vodFaceCheck > 0){
vodVO.setVodFaceCheckFlag(true);
}else {
vodVO.setVodFaceCheckFlag(false);
}
socialVodTestVOS.add(vodVO);
SocialVodTestVO testVO = new SocialVodTestVO();
//查看该视频对应的试卷名 并赋值
PaperDictDO paperDictDO = paperDictMapper.selectOne(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId, contentMemberDTO.getCourseId())
.eq(PaperDictDO::getVodId, memberVodVO.getId()));
testVO.setItemName(paperDictDO.getPaperName());
testVO.setItemType(1);
testVO.setId(paperDictDO.getId());
memberVodVO.setStatus(true);
if (100==memberVodVO.getPercent()) {
//视频全部看完
playCount++;
//计算最好成绩 memberId,classId,vodId
MemberMaxScoreVO memberMaxScoreVO = paperDictMapper.memberMaxScore(contentMemberDTO.getMemberId(), contentMemberDTO.getClassId(), memberVodVO.getId());
if (null == memberMaxScoreVO) {
testVO.setTestStatus("待完成");
} else {
testVO.setRightCount(memberMaxScoreVO.getRightCounts());
testVO.setTotalCount(memberMaxScoreVO.getTotalCounts());
if ("合格".equals(memberMaxScoreVO.getResult())) {
testVO.setTestStatus("通过");
} else {
testVO.setTestStatus("未通过");
}
}
} else {
//视频看完后才可以做题
testVO.setTestStatus("待解锁");
}
socialVodTestVOS.add(testVO);
}
}
socialContentVodVO.setSocialVodTestVOS(socialVodTestVOS);
socialContentVodVO.setPlayVods(playCount);
socialContentVodVO.setTotalVods(memberVodVOS.size());
socialContentVodVOS.add(socialContentVodVO);
}
socialContentVodNewVO.setSocialContentVodVOS(socialContentVodVOS);
//最新的视频记录
List<ContentVodNewVO> contentVodNewVOS = vodPlayHistoryMapper.memberRecentPlay(contentMemberDTO.getClassId(), contentMemberDTO.getMemberId());
if (contentVodNewVOS.size() > 0) {
socialContentVodNewVO.setId(contentVodNewVOS.get(0).getId());
socialContentVodNewVO.setPlayRecord(contentVodNewVOS.get(0).getPlayRecord());
}
return socialContentVodNewVO;
}
public CheckItemVO checkItem(CheckItemDTO checkItemDTO){
CheckItemVO checkItemVO = new CheckItemVO();
if (0 == checkItemDTO.getType()){
//视频 查看上一个视频对应的题目是否已经通过
Integer integer = this.baseMapper.checkClassPaperPassStatus(checkItemDTO.getMemberId(), checkItemDTO.getClassId(), checkItemDTO.getPaperId());
checkItemVO.setNextFlag(integer);
}else {
//题目 vodId 当前题目对应的视频id
Integer integer = this.baseMapper.checkClassVodPlayStatus(checkItemDTO.getMemberId(), checkItemDTO.getClassId(), checkItemDTO.getVodId());
checkItemVO.setNextFlag(integer);
}
return checkItemVO;
}
public List<ContentFilesVO> contentFiles(ContentMemberDTO contentMemberDTO) {
List<ContentFilesVO> contentFilesVOS = new ArrayList<>();
......@@ -925,6 +1158,118 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
return queryPapersVOS;
}
public List<SocialCourseTestVO> socialCourseTest(ContentMemberDTO contentMemberDTO) {
//课程详细信息
List<SocialCourseTestVO> socialContentVodVOS = new ArrayList<>();
//查看所有的content 目录
List<CourseContentDO> courseContentDOS = courseContentMapper.selectList(new QueryWrapper<CourseContentDO>()
.lambda()
.eq(CourseContentDO::getCourseId, contentMemberDTO.getCourseId())
.orderByAsc(CourseContentDO::getOrderNo));
ClassDictDO classDictDO1 = classDictMapper.selectById(contentMemberDTO.getClassId());
//查看这个课程所有考试
List<PaperDictDO> paperDictDOS = paperDictMapper.selectList(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId, contentMemberDTO.getCourseId()));
/**
* 视频id paperId
*/
HashMap<Long, Long> hashMap = new HashMap<>();
for (PaperDictDO paperDictDO : paperDictDOS) {
hashMap.put(paperDictDO.getVodId(), paperDictDO.getId());
}
//遍历目录
for (CourseContentDO courseContentDO : courseContentDOS) {
List<MemberVodVO> memberVodVOS = courseContentMapper.contentVodProcess(courseContentDO.getId(), contentMemberDTO.getMemberId(), contentMemberDTO.getClassId());
//视频状态
Boolean vodFlag = true;
if (1 == classDictDO1.getIsOrder()) {
for (MemberVodVO memberVodVO : memberVodVOS) {
SocialCourseTestVO socialCourseTestVO = new SocialCourseTestVO();
//查看该视频对应的试卷名 并赋值
PaperDictDO paperDictDO = paperDictMapper.selectOne(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId, contentMemberDTO.getCourseId())
.eq(PaperDictDO::getVodId, memberVodVO.getId()));
socialCourseTestVO.setItemName(paperDictDO.getPaperName());
socialCourseTestVO.setId(paperDictDO.getId());
if (vodFlag && 100 == memberVodVO.getPercent()) {
//视频全部看完
//计算最好成绩 memberId,classId,vodId
MemberMaxScoreVO memberMaxScoreVO = paperDictMapper.memberMaxScore(contentMemberDTO.getMemberId(), contentMemberDTO.getClassId(), memberVodVO.getId());
if (null == memberMaxScoreVO) {
socialCourseTestVO.setTestStatus("待完成");
} else {
socialCourseTestVO.setRightCount(memberMaxScoreVO.getRightCounts());
socialCourseTestVO.setTotalCount(memberMaxScoreVO.getTotalCounts());
if ("合格".equals(memberMaxScoreVO.getResult())) {
socialCourseTestVO.setTestStatus("通过");
} else {
socialCourseTestVO.setTestStatus("未通过");
}
}
} else {
//视频看完后才可以做题
socialCourseTestVO.setTestStatus("待解锁");
}
socialContentVodVOS.add(socialCourseTestVO);
}
} else {
//课程不需要按照顺序播放 ,全部是解锁标识
for (MemberVodVO memberVodVO : memberVodVOS) {
SocialCourseTestVO testVO = new SocialCourseTestVO();
memberVodVO.setStatus(true);
//查一下该视频对应的考卷
//查看该视频对应的试卷名 并赋值
PaperDictDO paperDictDO = paperDictMapper.selectOne(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId, contentMemberDTO.getCourseId())
.eq(PaperDictDO::getVodId, memberVodVO.getId()));
testVO.setId(paperDictDO.getId());
testVO.setItemName(paperDictDO.getPaperName());
int totalCnt = exerciseDictMapper.selectCount(new QueryWrapper<ExerciseDictDO>()
.lambda()
.eq(ExerciseDictDO::getPaperId,paperDictDO.getId()));
testVO.setTotalCount(totalCnt);
if (100 ==memberVodVO.getPercent()) {
//视频全部看完
//计算最好成绩 memberId,classId,vodId
MemberMaxScoreVO memberMaxScoreVO = paperDictMapper.memberMaxScore(contentMemberDTO.getMemberId(), contentMemberDTO.getClassId(), memberVodVO.getId());
if (null == memberMaxScoreVO) {
testVO.setTestStatus("待完成");
testVO.setRightCount(memberMaxScoreVO.getRightCounts());
} else {
testVO.setRightCount(memberMaxScoreVO.getRightCounts());
if ("合格".equals(memberMaxScoreVO.getResult())) {
testVO.setTestStatus("通过");
} else {
testVO.setTestStatus("未通过");
}
}
} else {
//视频看完后才可以做题
testVO.setTestStatus("待解锁");
testVO.setRightCount(0);
}
socialContentVodVOS.add(testVO);
}
}
}
return socialContentVodVOS;
}
public List<ExerciseDoneResultDO> getPaperDoneDetail(ExerciseDoneResultDO exerciseDoneResultDO) {
return exerciseDoneResultMapper.selectList(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
......
......@@ -2,12 +2,17 @@ package com.subsidy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.common.exception.HttpException;
import com.subsidy.mapper.CourseDictMapper;
import com.subsidy.mapper.ExerciseDictMapper;
import com.subsidy.model.CourseDictDO;
import com.subsidy.model.ExerciseDictDO;
import com.subsidy.model.PaperDictDO;
import com.subsidy.mapper.PaperDictMapper;
import com.subsidy.service.PaperDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.paper.QueryPapersVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
......@@ -24,28 +29,47 @@ import java.util.List;
@Service
public class PaperDictServiceImpl extends ServiceImpl<PaperDictMapper, PaperDictDO> implements PaperDictService {
public List<QueryPapersVO> queryPapers(PaperDictDO paperDictDO){
return this.baseMapper.queryPapers(paperDictDO.getCourseId(),paperDictDO.getPaperName(),null);
@Autowired
private CourseDictMapper courseDictMapper;
@Autowired
private ExerciseDictMapper exerciseDictMapper;
public List<QueryPapersVO> queryPapers(PaperDictDO paperDictDO) {
CourseDictDO courseDictDO = courseDictMapper.selectById(paperDictDO.getCourseId());
List<QueryPapersVO> queryPapersVOS = this.baseMapper.queryPapers(paperDictDO.getCourseId(), paperDictDO.getPaperName(), null);
//学徒制要查看题目数量
if (1 == courseDictDO.getCourseDataType()) {
for (QueryPapersVO queryPapers : queryPapersVOS) {
//题目个数
int count = exerciseDictMapper.selectCount(new QueryWrapper<ExerciseDictDO>()
.lambda()
.eq(ExerciseDictDO::getPaperId,queryPapers.getId()));
queryPapers.setExerciseCnt(count);
}
}
return queryPapersVOS;
}
public String deletePaper(PaperDictDO paperDictDO){
public String deletePaper(PaperDictDO paperDictDO) {
this.baseMapper.deleteById(paperDictDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
public String updateStatus(PaperDictDO paperDictDO){
public String updateStatus(PaperDictDO paperDictDO) {
this.baseMapper.updateById(paperDictDO);
return ConstantUtils.SET_SUCCESS;
}
public String addPaper(PaperDictDO paperDictDO){
public String addPaper(PaperDictDO paperDictDO) {
Integer count = this.baseMapper.selectCount(new QueryWrapper<PaperDictDO>()
.lambda()
.eq(PaperDictDO::getCourseId,paperDictDO.getCourseId())
.eq(PaperDictDO::getPaperName,paperDictDO.getPaperName()));
.lambda()
.eq(PaperDictDO::getCourseId, paperDictDO.getCourseId())
.eq(PaperDictDO::getPaperName, paperDictDO.getPaperName()));
if (count>0){
if (count > 0) {
throw new HttpException(50001);
}
paperDictDO.setPaperStatus(0);
......
......@@ -12,7 +12,6 @@ import com.subsidy.model.*;
import com.subsidy.service.RenSheJuService;
import com.subsidy.util.OSSUtils;
import com.subsidy.util.RenSheJuConstant;
import com.subsidy.util.SMSUtils;
import com.subsidy.vo.renshe.*;
import net.sf.json.JSONObject;
import okhttp3.*;
......@@ -70,6 +69,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
List<Long> imageClassIds = renSheJuMapper.imageClassIds("0");
Set<Long> classIds = new HashSet<>();
// classIds.add(490L);
vodClassIds.stream().forEach(x -> classIds.add(x));
examClassIds.stream().forEach(x -> classIds.add(x));
......@@ -161,6 +161,9 @@ public class RenSheJuServiceImpl implements RenSheJuService {
// 产生视频学习数据的班级
List<Long> vodClassIds = renSheJuMapper.vodClassIds("0");
// List<Long> vodClassIds = new ArrayList<>();
// vodClassIds.add(490L);
List<DailyStudyInfoVO> result = new ArrayList<>();
try {
......@@ -279,6 +282,9 @@ public class RenSheJuServiceImpl implements RenSheJuService {
//找出前一天产生考试数据的班级
List<Long> classIds = renSheJuMapper.dailyExamBasic("0");
// List<Long> classIds = new ArrayList<>();
// classIds.add(490L);
try {
if (classIds.size() > 0) {
for (Long classId : classIds) {
......@@ -670,6 +676,86 @@ public class RenSheJuServiceImpl implements RenSheJuService {
return null;
}
public RensheResponseVO post6plus() throws Exception {
List<RensheResponseVO> rensheResponseVOS = new ArrayList<>();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
List<Long> classIds = new ArrayList<>();
classIds.add(477L);
for (Long classId : classIds) {
//计算开始时间和截止时间
ClassDictDO classDictDO = classDictMapper.selectById(classId);
UploadImageDTO uploadImage = new UploadImageDTO();
uploadImage.setPrivateKey(getSecret());
uploadImage.setClassCode(classDictDO.getClassCode());
List<ImageDetailList> imageDetailLists = new ArrayList<>();
try {
List<ClassImageChecksVO> classImageChecksVOS2 = renSheJuMapper.post6plus(classId);
for (ClassImageChecksVO cicon : classImageChecksVOS2) {
ImageDetailList imageDetailList = new ImageDetailList();
BeanUtils.copyProperties(cicon, imageDetailList);
imageDetailList.setImageBase64("data:image/jpeg;base64," + OSSUtils.image2Base64(cicon.getImage()));
imageDetailLists.add(imageDetailList);
}
uploadImage.setImageDetailList(imageDetailLists);
if (imageDetailLists.size() > 0) {
System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadImage));
RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadImage).toString());
Request request = new Request.Builder()
.url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadImage")
.method("POST", body)
.addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_7);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString());
if (null != rensheResponseVO.getCtt()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
} else {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getMsg());
}
renshejuHistoryMapper.insert(renshejuHistoryDO);
rensheResponseVOS.add(rensheResponseVO);
} else {
RenshejuHistoryDO renshejuHistoryDO1 = new RenshejuHistoryDO();
renshejuHistoryDO1.setInterfaceName(RenSheJuConstant.POST_7);
renshejuHistoryDO1.setInputParam(JSONObject.fromObject(uploadImage).toString());
renshejuHistoryDO1.setOutputParam(RenSheJuConstant.NO_DATA);
renshejuHistoryMapper.insert(renshejuHistoryDO1);
}
} catch (Exception e) {
e.printStackTrace();
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_7);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
}
}
return null;
}
public RensheStringVO clear() throws IOException {
OkHttpClient client = new OkHttpClient().newBuilder()
......
......@@ -10,6 +10,7 @@ import com.subsidy.model.VodLabelDictDO;
import com.subsidy.mapper.VodLabelDictMapper;
import com.subsidy.service.VodLabelDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.vo.vod.VodInfoVO;
import com.subsidy.vo.vodLabel.VodLabelTreeVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -43,10 +44,7 @@ public class VodLabelDictServiceImpl extends ServiceImpl<VodLabelDictMapper, Vod
public List<VodLabelTreeVO> queryVodLabelTree() {
List<VodLabelTreeVO> list = this.baseMapper.queryVodLabel();
for (VodLabelTreeVO vodLabelTreeVO : list) {
List<VodDictDO> vodDictDOList = vodDictMapper.selectList(new QueryWrapper<VodDictDO>()
.lambda()
.eq(VodDictDO::getLabelId, vodLabelTreeVO.getId())
.orderByDesc(VodDictDO::getOrderNo));
List<VodInfoVO> vodDictDOList = vodDictMapper.vodInfo(vodLabelTreeVO.getId());
vodLabelTreeVO.setVods(vodDictDOList);
}
return list;
......
......@@ -61,16 +61,14 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
@Autowired
private SMSUtils smsUtils;
@Autowired
private ExerciseDoneResultMapper exerciseDoneResultMapper;
@Transactional(rollbackFor = Exception.class)
public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO, HttpServletRequest request) throws Exception {
Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
Integer count = classMemberMappingMapper.selectCount(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ExerciseDoneResultDO::getClassId, vodPlayHistoryDO.getClassId())
.eq(ExerciseDoneResultDO::getMemberId, vodPlayHistoryDO.getMemberId()));
.eq(ClassMemberMappingDO::getClassId, vodPlayHistoryDO.getClassId())
.eq(ClassMemberMappingDO::getMemberId, vodPlayHistoryDO.getMemberId())
.eq(ClassMemberMappingDO::getSubmitFlag, 1));
//只有开始学习时间晚于签到时间的数据才会插进去
Date date = new Date();
......@@ -138,10 +136,11 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
@Transactional(rollbackFor = Exception.class)
public String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO, HttpServletRequest request) throws Exception {
Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
Integer count = classMemberMappingMapper.selectCount(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ExerciseDoneResultDO::getClassId, insertHistoryNewDTO.getClassId())
.eq(ExerciseDoneResultDO::getMemberId, insertHistoryNewDTO.getMemberId()));
.eq(ClassMemberMappingDO::getClassId, insertHistoryNewDTO.getClassId())
.eq(ClassMemberMappingDO::getMemberId, insertHistoryNewDTO.getMemberId())
.eq(ClassMemberMappingDO::getSubmitFlag, 1));
//只有开始学习时间晚于签到时间的数据才会插进去
Date date = new Date();
......
......@@ -12,6 +12,8 @@ public class ExcelFormatUtils {
public static final List<String> scoreList = Arrays.asList("序号", "成员名称", "身份证号码", "联系方式", "测试成绩", "测试次数","开始时间","结束时间","测评时间", "总评价");
public static final List<String> socialScoreList = Arrays.asList("序号", "成员名称", "身份证号码", "联系方式", "课节名称", "测试成绩","开始时间","结束时间", "总评价");
public static final List<String> answersList = Arrays.asList("序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间");
public static final List<String> studyLogList = Arrays.asList("开始时间","结束时间","课程","类型","学习时长","累计有效时长");
......
......@@ -2,8 +2,10 @@ package com.subsidy.util.excel;
import com.subsidy.model.MemberDO;
import com.subsidy.vo.administer.ExerciseTestVO;
import com.subsidy.vo.administer.ExportSocialExerciseTestVO;
import com.subsidy.vo.administer.MemberStudyLogVO;
import com.subsidy.vo.classdict.ClassDetailVO;
import com.subsidy.vo.classdict.SocialTestDetailVO;
import com.subsidy.vo.member.ClassSignVO;
import com.subsidy.vo.sign.AnswerRecordVO;
import lombok.extern.slf4j.Slf4j;
......@@ -315,6 +317,7 @@ public class ExcelUtil {
/**
* 导出excel文件
*
* @param list
* @param cls
* @param <T>
......@@ -325,7 +328,7 @@ public class ExcelUtil {
Field[] fields = cls.getDeclaredFields();
List<Field> fieldList = Arrays.stream(fields).filter(field -> {
ExcelColumn annotation = field.getAnnotation(ExcelColumn.class);
if(annotation != null) {
if (annotation != null) {
field.setAccessible(true);
return true;
}
......@@ -333,7 +336,7 @@ public class ExcelUtil {
}).sorted(Comparator.comparing(field -> {
int col = 0;
ExcelColumn annotation = field.getAnnotation(ExcelColumn.class);
if(annotation != null) {
if (annotation != null) {
col = annotation.col();
}
return col;
......@@ -1060,6 +1063,240 @@ public class ExcelUtil {
}
}
public static <T> void writeSocialTestExcel(String companyName, String studyDate, String courseName, String title, List<ExportSocialExerciseTestVO> list, List<String> headerList) throws Exception {
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletResponse response = requestAttributes.getResponse();
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.addHeader("content-disposition", "attachment;filename="
+ java.net.URLEncoder.encode("test.xlsx", "utf-8"));
// 声明一个工作薄
SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存
workbook.setCompressTempFiles(true);
//表头样式
CellStyle titleStyle = workbook.createCellStyle();
setStyle(titleStyle);
Font titleFont = workbook.createFont();
titleFont.setFontHeightInPoints((short) 20);
titleFont.setBoldweight((short) 700);
titleStyle.setFont(titleFont);
//第二行
CellStyle secondStyle = workbook.createCellStyle();
secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
Font secondFont = workbook.createFont();
secondStyle.setFont(secondFont);
//第三行
CellStyle thirdStyle = workbook.createCellStyle();
thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT);
Font thirdFont = workbook.createFont();
thirdStyle.setFont(thirdFont);
// 列头样式
CellStyle headerStyle = workbook.createCellStyle();
setStyle(headerStyle);
Font headerFont = workbook.createFont();
headerFont.setFontHeightInPoints((short) 12);
headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
headerStyle.setFont(headerFont);
// 数据单元格样式
CellStyle cellStyle = workbook.createCellStyle();
setStyle(cellStyle);
Font cellFont = workbook.createFont();
cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);
cellStyle.setFont(cellFont);
// 生成一个(带标题)表格
SXSSFSheet sheet = workbook.createSheet();
//设置列宽
int minBytes = 17;//至少字节数
int[] arrColWidth = new int[headerList.size()];
// 产生表格标题行,以及设置列宽
String[] headers = new String[headerList.size()];
int ii = 0;
for (int i = 0; i < headerList.size(); i++) {
headers[ii] = headerList.get(i);
int bytes = headerList.get(i).getBytes().length;
arrColWidth[ii] = bytes < minBytes ? minBytes : bytes;
sheet.setColumnWidth(ii, arrColWidth[ii] * 256);
ii++;
}
//第二行
int[] secondWidth = new int[2];
// 产生表格标题行,以及设置列宽
String[] secondHead = new String[2];
List<String> secondList = Arrays.asList("培训实施单位:" + companyName, "培训时间:" + studyDate);
//第三行
int[] thirdWidth = new int[2];
// 产生表格标题行,以及设置列宽
String[] thirdHead = new String[2];
List<String> thirdList = Arrays.asList("培训项目:" + courseName, "培训平台:有课互联系统");
ii = 0;
for (int i = 0; i < 2; i++) {
secondHead[ii] = secondList.get(i);
int bytes = secondList.get(i).getBytes().length;
secondWidth[ii] = bytes < minBytes ? minBytes : bytes;
sheet.setColumnWidth(ii, secondWidth[ii] * 256);
ii++;
}
ii = 0;
for (int i = 0; i < 2; i++) {
thirdHead[ii] = thirdList.get(i);
int bytes = thirdList.get(i).getBytes().length;
thirdWidth[ii] = bytes < minBytes ? minBytes : bytes;
sheet.setColumnWidth(ii, thirdWidth[ii] * 256);
ii++;
}
// 遍历集合数据,产生数据行
//标题 0
SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0
titleRow.createCell(0).setCellValue(title);
setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框
titleRow.getCell(0).setCellStyle(titleStyle);
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1));
//第二行 1
SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1
CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 3);
sheet.addMergedRegion(cellRangeAddress21);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 8);
sheet.addMergedRegion(cellRangeAddress22);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框
secondRow.createCell(0).setCellValue(secondHead[0]);
secondRow.getCell(0).setCellStyle(secondStyle);
secondRow.createCell(4).setCellValue(secondHead[1]);
secondRow.getCell(4).setCellStyle(secondStyle);
//第三行 2
SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1
CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3);
sheet.addMergedRegion(cellRangeAddress31);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 8);
sheet.addMergedRegion(cellRangeAddress32);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框
thirdRow.createCell(0).setCellValue(thirdHead[0]);
thirdRow.getCell(0).setCellStyle(thirdStyle);
thirdRow.createCell(4).setCellValue(thirdHead[1]);
thirdRow.getCell(4).setCellStyle(thirdStyle);
//标题 3
SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1
for (int i = 0; i < headers.length; i++) {
headerRow.createCell(i).setCellValue(headers[i]);
headerRow.getCell(i).setCellStyle(headerStyle);
}
int seq = 1;
//内容
int rowIndex = 0;
for (ExportSocialExerciseTestVO exportSocialExerciseTestVO : list) {
if (rowIndex == 65535 || rowIndex == 0) {
if (rowIndex != 0) {
sheet = workbook.createSheet();//如果数据超过了,则在第二页显示
}
rowIndex = 4;//数据内容从 rowIndex=2开始
}
SXSSFRow dataRow = sheet.createRow(rowIndex);
SXSSFCell newCell = dataRow.createCell(0);
cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(seq);
newCell = dataRow.createCell(1);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(exportSocialExerciseTestVO.getUserName());
newCell = dataRow.createCell(2);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(exportSocialExerciseTestVO.getIdCard());
newCell = dataRow.createCell(3);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(exportSocialExerciseTestVO.getTelephone());
newCell = dataRow.createCell(4);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(exportSocialExerciseTestVO.getVodName());
//次数
newCell = dataRow.createCell(5);
newCell.setCellStyle(cellStyle);
if (null != exportSocialExerciseTestVO.getScore()) {
newCell.setCellValue(exportSocialExerciseTestVO.getScore());
}else {
newCell.setCellValue(0);
}
//次数
newCell = dataRow.createCell(6);
newCell.setCellStyle(cellStyle);
if (null != exportSocialExerciseTestVO.getScore()) {
newCell.setCellValue(exportSocialExerciseTestVO.getStartDate());
}
//次数
newCell = dataRow.createCell(7);
newCell.setCellStyle(cellStyle);
if (null != exportSocialExerciseTestVO.getScore()) {
newCell.setCellValue(exportSocialExerciseTestVO.getEndDate());
}
newCell = dataRow.createCell(8);
newCell.setCellStyle(cellStyle);
if (null != exportSocialExerciseTestVO.getScore() && exportSocialExerciseTestVO.getScore() >= 60) {
newCell.setCellValue("合格");
} else {
newCell.setCellValue("不合格");
}
rowIndex++;
seq++;
}
try {
OutputStream outputStream = response.getOutputStream();
workbook.write(outputStream);
workbook.close();
workbook.dispose();
} catch (IOException e) {
e.printStackTrace();
}
}
public static <T> void writeAnswerExcel(String companyName, String studyDate, String courseName, String title, List<AnswerRecordVO> list, List<String> headerList) throws Exception {
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
......
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import com.subsidy.common.ResponseData;
import com.subsidy.common.exception.HttpException;
import com.subsidy.mapper.ClassDictMapper;
import com.subsidy.mapper.ClassVodFaceCheckMapper;
import com.subsidy.mapper.MemberMapper;
import com.subsidy.mapper.OprMemDictMapper;
import com.subsidy.model.OprMemDictDO;
......@@ -33,7 +34,7 @@ import java.util.concurrent.*;
public class WebSocketUtil implements WebSocketHandler {
@Autowired
private OprMemDictMapper oprMemDictMapper;
private ClassVodFaceCheckMapper classVodFaceCheckMapper;
@Autowired
private ClassDictMapper classDictMapper;
......@@ -46,7 +47,7 @@ public class WebSocketUtil implements WebSocketHandler {
private int reconnectionSeconds = 30; //每次断连间隔重新连接秒
/**
selfExport
* selfExport
* 存放建立连接webSocket对象 Map<memberId,session>
*/
public static ConcurrentHashMap<Long, WebSocketSession> webSocketMap = new ConcurrentHashMap();
......@@ -86,6 +87,12 @@ public class WebSocketUtil implements WebSocketHandler {
// 数据操作
SystemSettings systemSettings = memberMapper.companySettings(id); //公司配置
List<ClassSettingsVO> classSettings = classDictMapper.getClassSettings(id);
for (ClassSettingsVO csv : classSettings) {
//配置的视频id
List<Long> longs = classVodFaceCheckMapper.faceVodIds(csv.getId());
csv.setVodIds(longs);
}
systemSettings.setClassSettingsVOS(classSettings);
if (CollectionUtils.isNotEmpty(classSettings)) {
String data = JSONObject.toJSONString(ResponseData.generateCreatedResponse(0, systemSettings), SerializerFeature.WriteMapNullValue);
......
......@@ -36,4 +36,8 @@ public class ExerciseTestVO {
private String companyName;
private Integer ttl;
private Integer ps;
}
package com.subsidy.vo.administer;
import com.subsidy.util.excel.ExcelColumn;
import lombok.Data;
@Data
public class ExportSocialExerciseTestVO {
private Long id;
@ExcelColumn(col = 1,value = "成员名称")
private String userName;
@ExcelColumn(col = 2,value = "身份证号码")
private String idCard;
@ExcelColumn(col = 3,value = "联系方式")
private String telephone;
@ExcelColumn(col = 4,value = "课节名称")
private String vodName;
@ExcelColumn(col = 5,value = "测试成绩")
private Integer score;
@ExcelColumn(col = 6,value = "开始时间")
private String startDate;
@ExcelColumn(col = 7,value = "结束时间")
private String endDate;
@ExcelColumn(col = 8,value = "评价")
private String result;
}
package com.subsidy.vo.classdict;
import com.subsidy.model.ClassDictDO;
import lombok.Data;
import java.util.List;
@Data
public class ClassDetail extends ClassDictDO {
private List<Long> vodIds;
}
......@@ -2,6 +2,8 @@ package com.subsidy.vo.classdict;
import lombok.Data;
import java.util.List;
@Data
public class ClassSettingsVO {
......@@ -69,4 +71,13 @@ public class ClassSettingsVO {
private Integer timeLimit;
private Integer activityFlag;
private List<Long> vodIds;
private Integer paperTime;
private Integer faceCheck;
private Integer paperTimeLimit;
}
package com.subsidy.vo.classdict;
import lombok.Data;
@Data
public class SocialTestDetailVO {
private Long id;
private String vodName;
private String paperName;
private Integer score;
private Integer cnt;
private String result;
private String startDate;
private String createDate;
}
package com.subsidy.vo.classdict;
import lombok.Data;
@Data
public class SocialTestRecordVO {
private Long id;
private String vodName;
private String paperName;
private Integer rightCounts;
private Integer totalCounts;
private String result;
private String createDate;
private String startDate;
}
package com.subsidy.vo.classdict;
import lombok.Data;
@Data
public class VodPassRateVO {
private Integer ttl;
private Integer ps;
}
......@@ -58,6 +58,11 @@ public class QueryCoursesVO {
private Integer paperCount;
/**
* 企业线上培训/学徒制
*/
private Integer courseDataType;
/**
* 开放状态
*/
private Integer openStatus;
......
package com.subsidy.vo.dudao;
import lombok.Data;
@Data
public class ClassBaseInfoVO {
private String downCode;
private String shortName;
private Long learnHour;
private Long courseHour;
private Long startDate;
private Long endDate;
private String areaName;
private String trainingName;
private String trainingCode;
}
package com.subsidy.vo.dudao;
import lombok.Data;
@Data
public class DailyActivitiesVO {
private Integer access;
private Long activityTime;
private Integer checkType;
}
package com.subsidy.vo.dudao;
import lombok.Data;
@Data
public class DailyAnswerVO {
private Long id;
private Long askId;
private String downCode;
private String identity;
private Long answer;
private Long question;
}
package com.subsidy.vo.dudao;
import lombok.Data;
@Data
public class DailyStudyInfoVO {
private Long classId;
private Long memberId;
/**
* 临时班级(临时项目)编号
*/
private String classCode;
/**
* 学员身份证号,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】
*/
private String phone;
/**
* 当日累计学习时长,视频暂停时间不计入【秒】
*/
private long learnTime;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】
*/
private long loginTime;
/**
* 学员姓名
*/
private String studentName;
}
package com.subsidy.vo.dudao;
import com.subsidy.dto.dudao.ChapterList2;
import lombok.Data;
import java.util.List;
@Data
public class EpidemicSituationClassBasic {
private String areaName;
private List<ChapterList2> chapterList;
private Long courseHour;
private String downCode;
private Long endDate;
private Long learnHour;
private String shortName;
private Long startDate;
private List<MemberVO> studentList;
private String trainingCode;
private String trainingName;
}
package com.subsidy.vo.dudao;
import lombok.Data;
@Data
public class ExamActivitiesVO {
private Integer access;
private Long activityTime;
}
package com.subsidy.vo.dudao;
import lombok.Data;
@Data
public class MemberVO {
private String name;
private String phone;
private String identity;
}
package com.subsidy.vo.dudao;
import lombok.Data;
@Data
public class RensheResponseVO {
/**
* 响应码
*/
private long c;
/**
* 响应体
*/
private Object ctt;
/**
* 响应信息
*/
private String msg;
}
package com.subsidy.vo.member;
import lombok.Data;
@Data
public class CheckItemVO {
/**
* 1 通过 0 不通过
*/
private Integer nextFlag;
}
package com.subsidy.vo.member;
import com.subsidy.dto.member.ImportClassMemberDTO;
import lombok.Data;
import java.util.List;
......
......@@ -9,10 +9,10 @@ public class MemberVodVO {
private Integer vodLength;
private String percent;
private Integer percent;
/**
* 解锁状态
* 解锁状态 true:已解锁 false:未解锁
*/
private Boolean status;
......
......@@ -20,6 +20,8 @@ public class MyCoursesVO {
private String endDate;
private String classType;
private Integer totalCnt;
private Integer studyCnt;
......
package com.subsidy.vo.member;
import lombok.Data;
import java.util.List;
@Data
public class SocialContentVodNewVO {
//最新的视频id
private Long id;
//最新的视频记录
private Integer playRecord;
private Integer isFastPlay;
private Integer testRule;
private Integer isOrder;
private List<SocialContentVodVO> socialContentVodVOS;
}
package com.subsidy.vo.member;
import lombok.Data;
import java.util.List;
@Data
public class SocialContentVodVO {
private String content;
private Integer totalVods;
private Integer playVods;
private List<SocialVodTestVO> socialVodTestVOS;
}
package com.subsidy.vo.member;
import lombok.Data;
@Data
public class SocialCourseTestVO {
/**
* 试卷id
*/
private Long id;
/**
* 视频别名/卷子名称
*/
private String itemName;
/**
* 做对题数
*/
private Integer rightCount;
/**
* 总体数
*/
private Integer totalCount;
private String testStatus;
}
package com.subsidy.vo.member;
import lombok.Data;
@Data
public class SocialVodTestVO {
/**
* 视频id、题目id
*/
private Long id;
/**
* 视频别名/卷子名称
*/
private String itemName;
/**
* 类型 0:视频 1考试
*/
private Integer itemType;
private Integer vodLength;
/**
* 做对题数
*/
private Integer rightCount;
/**
* 总体数
*/
private Integer totalCount;
/**
* 视频进度
*/
private Integer percent;
private Integer playRecord;
private String leftLength;
private String vodUrl;
private Boolean activityStatus;
private String testStatus;
private Boolean status;
private Boolean vodFaceCheckFlag;
}
package com.subsidy.vo.paper;
import lombok.Data;
@Data
public class MemberMaxScoreVO {
private Long paperId;
private Integer rightCounts;
private Integer totalCounts;
private String result;
}
......@@ -9,6 +9,8 @@ public class QueryPapersVO {
private String paperName;
private String vodName;
private String paperStatus;
private Integer completeCnt;
......@@ -25,4 +27,6 @@ public class QueryPapersVO {
private Integer checkResult;
private Integer exerciseCnt;
}
......@@ -24,6 +24,11 @@ public class DailyStudyInfoVO {
private String phone;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】
*/
private long loginTime;
/**
* 学员姓名
*/
private String studentName;
......
package com.subsidy.vo.vod;
import lombok.Data;
@Data
public class VodInfoVO {
private Long id;
private Long labelId;
private String vodName;
}
package com.subsidy.vo.vodLabel;
import com.subsidy.model.VodDictDO;
import com.subsidy.vo.vod.VodInfoVO;
import lombok.Data;
import java.util.List;
@Data
......@@ -11,5 +12,5 @@ public class VodLabelTreeVO {
private String labelName;
private List<VodDictDO> vods;
private List<VodInfoVO> vods;
}
......@@ -65,4 +65,9 @@ qxueyou.url=https://dev.qxueyou.com/auth/user/token
renshe.url = https://test.shzypxy.com
renshe.secretKey = ad927f0b-6a39-43a7-bac7-163baef1fff7
renshe.putuo = http://180.167.195.117:18015/ddproject
\ No newline at end of file
renshe.putuo = http://180.167.195.117:18015/ddproject
#renshe.url = https://api.shzypxy.com
#renshe.url = http://trial.shzypxy.com/api
#renshe.secretKey = ad927f0b-6a39-43a7-bac7-163baef1fff7
#renshe.putuo = http://180.167.195.117:18025/ddproject
\ No newline at end of file
......@@ -22,6 +22,7 @@ meishu.code-message[10025]=身份证识别错误
meishu.code-message[10026]=姓名或身份证号格式不正确
meishu.code-message[10027]=该手机号已注册
meishu.code-message[10028]=该成员已在其他公司入职
meishu.code-message[10029]=该账号未被授权
meishu.code-message[20001]=该课程已存在
......@@ -30,6 +31,7 @@ meishu.code-message[20002]=该成员已存在
meishu.code-message[30001]=该部门已存在
meishu.code-message[40001]=该目录已存在
meishu.code-message[40002]=该类型已存在
meishu.code-message[50001]=该试卷已存在
......
......@@ -110,6 +110,140 @@
order by t2.account_name ASC
</select>
<select id="vodPassRate" resultType="com.subsidy.vo.classdict.VodPassRateVO">
SELECT
count( t1.id ) AS ttl,
count( t2.paper_id ) AS ps
FROM
(
SELECT
t1.id
FROM
paper_dict t1
LEFT JOIN class_dict t3 ON t3.course_id = t1.course_id
WHERE
t1.delete_date IS NULL
AND t3.delete_date IS NULL
AND t3.id = #{classId}
) t1
LEFT JOIN (
SELECT DISTINCT
t1.member_id,
t1.paper_id
FROM
exercise_done_result t1
WHERE
t1.member_id = #{memberId}
AND t1.class_id = #{classId}
AND t1.result = "合格"
AND t1.delete_date IS NULL
) t2 ON t1.id = t2.paper_id
</select>
<select id="socialTestDetail" resultType="com.subsidy.vo.classdict.SocialTestDetailVO">
SELECT
t1.id,
t1.vodName,
t1.paper_name,
t2.score,
t3.cnt,
t2.result,
t2.start_date,
t2.create_date
FROM
(
SELECT
t1.id,
t1.id AS paper_id,
IFNULL( t6.vod_alias_name, t7.vod_name ) AS vodName,
t1.paper_name
FROM
class_dict t3
LEFT JOIN paper_dict t1 ON t3.course_id = t1.course_id
LEFT JOIN course_content t5 ON t3.course_id = t5.course_id
LEFT JOIN content_vod_mapping t6 ON t5.id = t6.content_id
AND t1.vod_id = t6.vod_id
left join vod_dict t7 on t1.vod_id = t7.id
WHERE
t1.delete_date IS NULL
AND t3.delete_date IS NULL
AND t3.id = #{classId}
AND t5.delete_date IS NULL
AND t6.delete_date IS NULL
AND t6.id IS NOT NULL
) t1
LEFT JOIN (
SELECT
c.paper_id,
c.member_id,
c.start_date,
c.create_date,
c.score,
c.result
FROM
exercise_done_result c
INNER JOIN (
SELECT
max( id ) id1,
a.paper_id
FROM
exercise_done_result a
INNER JOIN ( SELECT paper_id, member_id, max( score ) AS score FROM exercise_done_result WHERE class_id = #{classId} AND member_id = #{memberId} GROUP BY paper_id, member_id ) b ON a.paper_id = b.paper_id
AND a.score = b.score
GROUP BY
a.paper_id
) t ON c.id = t.id1
AND c.paper_id = t.paper_id
) t2 ON t1.id = t2.paper_id
LEFT JOIN (
SELECT
count( 1 ) AS cnt,
paper_id,
member_id
FROM
exercise_done_result t
WHERE
t.delete_date IS NULL
AND t.class_id = #{classId}
AND t.member_id = #{memberId}
GROUP BY
paper_id,
member_id
) t3 ON t2.paper_id = t3.paper_id
</select>
<select id="socialTestRecord" resultType="com.subsidy.vo.classdict.SocialTestRecordVO">
SELECT
t.id,
IFNULL( t4.vod_alias_name, t5.vod_name ) AS vodName,
t2.paper_name,
t.right_counts,
t.total_counts,
t.result,
t.create_date,
t.start_date
FROM
exercise_done_result t
LEFT JOIN paper_dict t2 ON t.paper_id = t2.id
LEFT JOIN course_content t3 ON t.course_id = t3.course_id
LEFT JOIN content_vod_mapping t4 ON t3.id = t4.content_id
AND t4.vod_id = t2.vod_id
LEFT JOIN vod_dict t5 ON t2.vod_id = t5.id
WHERE
t.class_id = #{classId}
AND t.member_id = #{memberId}
AND t2.delete_date IS NULL
AND t.delete_date IS NULL
AND t2.delete_date IS NULL
and t3.delete_date is null
and t4.delete_date is null
and t5.delete_date is null
AND t4.id IS NOT NULL
ORDER BY
t.create_date DESC
</select>
<select id="answerRecord" resultType="com.subsidy.vo.sign.AnswerRecordVO">
SELECT
t.id,
......@@ -335,6 +469,8 @@
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.administer_id = #{administerId}
order by t2.id
</select>
<select id="administerCompanyIds" parameterType="long" resultType="long">
......
......@@ -52,6 +52,22 @@
and t.end_date >= DATE_FORMAT( #{startDate}, '%Y-%m-%d' )
and t.start_date &lt; DATE_FORMAT( #{endDate}, '%Y-%m-%d' )
</if>
<if test="openStatus != '' and openStatus == 0">
and t.end_date >= DATE_FORMAT(now(), '%Y-%m-%d' )
and t.start_date &lt; DATE_FORMAT(now(), '%Y-%m-%d' )
</if>
<if test="openStatus != '' and openStatus == 1">
and t.start_date > DATE_FORMAT(now(), '%Y-%m-%d' )
</if>
<if test="openStatus != '' and openStatus == 2">
and t.end_date &lt; DATE_FORMAT(now(), '%Y-%m-%d' )
</if>
<if test="classType == 2">
and t5.class_type = '社会化、学徒制'
</if>
<if test="classType == 0">
and t5.class_type != '社会化、学徒制'
</if>
order by t.create_date desc
</select>
......@@ -264,4 +280,22 @@
AND t1.delete_date IS NULL
</select>
<select id="classVods" parameterType="long" resultType="com.subsidy.vo.vod.VodInfoVO">
SELECT
t4.id,
t4.vod_name
FROM
class_dict t
LEFT JOIN course_content t2 ON t.course_id = t2.course_id
LEFT JOIN content_vod_mapping t3 ON t2.id = t3.content_id
LEFT JOIN vod_dict t4 ON t3.vod_id = t4.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
AND t4.delete_date IS NULL
AND t.id = #{classId}
order by t2.id,t4.id
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.ClassVodFaceCheckMapper">
<select id="faceVodIds" parameterType="long" resultType="long">
SELECT
t.vod_id
FROM
class_vod_face_check t
WHERE
t.delete_date IS NULL
AND t.class_id = #{classId}
</select>
</mapper>
......@@ -2,23 +2,27 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.ContentVodMappingMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.ContentVodMappingDO">
<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="content_id" property="contentId" />
<result column="vod_id" property="vodId" />
<result column="order_no" property="orderNo" />
</resultMap>
<select id="getCourseByContentId" parameterType="long" resultType="com.subsidy.model.CourseDictDO">
SELECT
t2.*
FROM
course_content t
LEFT JOIN course_dict t2 ON t.course_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.id = #{contentId}
</select>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, content_id, vod_id, vod_alias_name, order_no
</sql>
<select id="oldVodIds" parameterType="long" resultType="long">
SELECT
t.vod_id
FROM
paper_dict t
LEFT JOIN course_content t2 ON t.course_id = t2.course_id
WHERE
t.delete_date IS NULL
AND t2.id = #{contentId}
</select>
</mapper>
......@@ -21,7 +21,8 @@
t.course_type,
t.open_status,
t.cover_page,
t.remark
t.remark,
t.course_data_type
FROM
course_dict t
LEFT JOIN course_field_mapping t2 ON t.id = t2.course_id
......@@ -66,6 +67,9 @@
<if test="businessId != null and businessId != ''">
and t6.business_id = #{businessId}
</if>
<if test="courseDataType != null">
and t.course_data_type = #{courseDataType}
</if>
</select>
<sql id="Base_Column_List">
......
......@@ -88,7 +88,7 @@
AND t.delete_date IS NULL
</select>
<select id="dailyStudyInfo" resultType="com.subsidy.vo.renshe.DailyStudyInfoVO">
<select id="dailyStudyInfo" resultType="com.subsidy.vo.dudao.DailyStudyInfoVO">
SELECT
t2.class_id as downCode,
t2.member_id,
......@@ -177,7 +177,7 @@
and t3.area_name = '普陀'
</select>
<select id="dailyAnswer" resultType="com.subsidy.vo.renshe.DailyAnswerVO">
<select id="dailyAnswer" resultType="com.subsidy.vo.dudao.DailyAnswerVO">
SELECT
t1.id,
t1.ask_id,
......@@ -217,7 +217,7 @@
and t3.area_name = '普陀'
</select>
<select id="classBaseInfo" parameterType="long" resultType="com.subsidy.vo.renshe.ClassBaseInfoVO">
<select id="classBaseInfo" parameterType="long" resultType="com.subsidy.vo.dudao.ClassBaseInfoVO">
SELECT
t2.id AS downCode,
t2.class_code,
......@@ -246,7 +246,7 @@
AND t7.delete_date IS NULL
</select>
<select id="classChapters" parameterType="long" resultType="com.subsidy.dto.renshe.ChapterList2">
<select id="classChapters" parameterType="long" resultType="com.subsidy.dto.dudao.ChapterList2">
SELECT
t7.id AS chapterCode,
IFNULL( t6.vod_alias_name, t7.vod_name ) as chapterName,
......@@ -272,7 +272,7 @@
t7.order_no
</select>
<select id="classMembers" parameterType="long" resultType="com.subsidy.vo.renshe.MemberVO">
<select id="classMembers" parameterType="long" resultType="com.subsidy.vo.dudao.MemberVO">
SELECT
t2.user_name as name,
t2.telephone as phone,
......@@ -287,9 +287,9 @@
</select>
<select id="dailyStudyInfo1" resultType="com.subsidy.vo.renshe.DailyStudyInfoVO">
<select id="dailyStudyInfo1" resultType="com.subsidy.vo.dudao.DailyStudyInfoVO">
SELECT
t.class_id AS downCode,
t.class_id,
t3.id AS member_id,
t3.user_name AS studentName,
t3.telephone AS phone,
......@@ -392,7 +392,7 @@
order by id
</select>
<select id="dailyStudyRecords" resultType="com.subsidy.dto.renshe.ChapterList3">
<select id="dailyStudyRecords" resultType="com.subsidy.dto.dudao.ChapterList3">
SELECT
t2.id as chapterCode,
t.play_length AS chapterTime,
......@@ -410,7 +410,7 @@
and t.class_id = #{classId}
</select>
<select id="dailyActivities" resultType="com.subsidy.vo.renshe.DailyActivitiesVO">
<select id="dailyActivities" resultType="com.subsidy.vo.dudao.DailyActivitiesVO">
SELECT
t1.`status` as access,
unix_timestamp( t1.create_date )*1000 as activityTime,
......@@ -475,7 +475,7 @@
AND member_id = #{memberId}
</select>
<select id="examActivities" resultType="com.subsidy.vo.renshe.ExamActivitiesVO">
<select id="examActivities" resultType="com.subsidy.vo.dudao.ExamActivitiesVO">
SELECT
t1.result AS access,
UNIX_TIMESTAMP( t1.create_date )* 1000 AS activityTime
......
......@@ -69,6 +69,7 @@
t3.course_name,
t2.start_date,
t2.end_date,
t9.class_type,
t4.cnt AS totalCnt,
t5.result AS studyCnt,
t6.ttlMember,
......@@ -89,6 +90,7 @@
GROUP BY t.class_id ) t6 ON t.class_id = t6.class_id
LEFT JOIN class_dict t2 ON t.class_id = t2.id
LEFT JOIN course_dict t3 ON t2.course_id = t3.id
left join class_type_dict t9 on t2.class_type_id = t9.id
LEFT JOIN (
SELECT
t.course_id,
......@@ -123,6 +125,7 @@
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t.member_id = #{memberId}
and t.delete_date IS NULL
GROUP BY
t.member_id,
t.vod_id,
......@@ -468,4 +471,38 @@
and t2.live_id IS not NULL
AND t.member_id = #{memberId}
</select>
<select id="checkClassVodPlayStatus" resultType="integer">
SELECT
IF
( t.play_length > t2.vod_length, 1, 0 ) AS result
FROM
(
SELECT
t.vod_id,
sum( t.play_length ) AS play_length
FROM
vod_play_history t
WHERE
t.delete_date IS NULL
AND t.class_id = #{classId}
AND t.member_id = #{memberId}
AND t.vod_id = #{vodId}
) t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
</select>
<select id="checkClassPaperPassStatus" resultType="integer">
SELECT
IF
( count( 1 )> 0, 1, 0 ) AS result
FROM
exercise_done_result t
WHERE
t.delete_date IS NULL
AND t.class_id = #{classId}
AND t.member_id = #{memberId}
AND t.paper_id = #{paperId}
AND t.result = '合格'
</select>
</mapper>
......@@ -146,69 +146,125 @@
</select>
<select id="insertLastStudyRecord" resultType="com.subsidy.vo.opr.InsertLastStudyRecordVO">
SELECT
t1.member_id,
t1.sign_in_date,
t1.ip_address,
DATE_ADD(t2.mt,INTERVAL FLOOR(RAND()*100) SECOND) as mt
FROM
(
SELECT DISTINCT
t.sign_in_date,
t.member_id,
t.ip_address
FROM
sign_in_record t
WHERE
t.delete_date IS NULL
AND DATE_FORMAT( t.sign_in_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )) t1
LEFT JOIN (
SELECT
t1.member_id,
max( t1.maxtime ) AS mt
FROM
(
SELECT
member_id,
max( create_date ) AS maxtime
FROM
vod_play_history
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id UNION ALL
SELECT
member_id,
max( create_date ) AS maxtime
FROM
exercise_done_result
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id UNION ALL
SELECT
ask_id,
max( create_date ) AS maxtime
FROM
answering_question
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
ask_id UNION ALL
SELECT member_id,
max( create_date ) AS maxtime
from
activity_detection
where delete_date is null
and DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY member_id
) t1
GROUP BY
t1.member_id
) t2 ON t1.member_id = t2.member_id
SELECT DISTINCT
t1.mintime AS sign_in_date,
t1.member_id,
t3.ip_address,
DATE_ADD( t2.mt, INTERVAL FLOOR( RAND()* 100 ) SECOND ) AS mt
FROM
(
SELECT
t.member_id,
min( t.mintime ) AS mintime
FROM
(
SELECT
member_id,
DATE_SUB( min( create_date ), INTERVAL ( play_length + suspend_length ) SECOND ) AS mintime
FROM
vod_play_history
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id UNION ALL
SELECT
member_id,
min( create_date ) AS mintime
FROM
exercise_done_result
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id UNION ALL
SELECT
ask_id,
min( create_date ) AS mintime
FROM
answering_question
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
ask_id UNION ALL
SELECT
member_id,
min( create_date ) AS mintime
FROM
activity_detection
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id
) t
GROUP BY
t.member_id
) t1
LEFT JOIN (
SELECT
t1.member_id,
max( t1.maxtime ) AS mt
FROM
(
SELECT
member_id,
max( create_date ) AS maxtime
FROM
vod_play_history
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id UNION ALL
SELECT
member_id,
max( create_date ) AS maxtime
FROM
exercise_done_result
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id UNION ALL
SELECT
ask_id,
max( create_date ) AS maxtime
FROM
answering_question
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
ask_id UNION ALL
SELECT
member_id,
max( create_date ) AS maxtime
FROM
activity_detection
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id
) t1
GROUP BY
t1.member_id
) t2 ON t1.member_id = t2.member_id
LEFT JOIN (
SELECT
member_id,
min( sign_in_date ) AS sign_in_date,
ip_address
FROM
sign_in_record
WHERE
delete_date IS NULL
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
GROUP BY
member_id
) t3 ON t1.member_id = t3.member_id
</select>
<select id="shutdownUser" resultType="long">
......
......@@ -2,32 +2,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.PaperDictMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.PaperDictDO">
<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="course_id" property="courseId" />
<result column="paper_name" property="paperName" />
<result column="paper_status" property="paperStatus" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, course_id, paper_name, paper_status
</sql>
<select id="queryPapers" parameterType="com.subsidy.model.PaperDictDO" resultType="com.subsidy.vo.paper.QueryPapersVO">
SELECT
id,
t.id,
t2.vod_name,
paper_name,
paper_status
FROM
paper_dict t
left join vod_dict t2 on t.vod_id = t2.id
WHERE
t.delete_date is null
and t.course_id = #{courseId}
......@@ -60,4 +43,59 @@
AND t.course_id = #{courseId}
</select>
<select id="memberMaxScore" resultType="com.subsidy.vo.paper.MemberMaxScoreVO">
SELECT
t4.right_counts,
t4.total_counts,
t4.result,
t3.paper_id
FROM
(
SELECT
t.class_id,
t.paper_id,
t.member_id,
t2.paper_name,
max( score ) AS score
FROM
exercise_done_result t
LEFT JOIN paper_dict t2 ON t.paper_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.class_id = #{classId}
AND t2.vod_id = #{vodId}
AND t.member_id = #{memberId}
GROUP BY
t.class_id,
t.paper_id,
t.member_id,
t2.paper_name
) t3
LEFT JOIN exercise_done_result t4 ON t3.score = t4.score
AND t3.member_id = t4.member_id
AND t3.paper_id = t4.paper_id
AND t3.class_id = t4.class_id
LIMIT 1
</select>
<select id="lastPaper" parameterType="long" resultType="long">
SELECT
t4.*
FROM
course_content t
LEFT JOIN content_vod_mapping t2 ON t.id = t2.content_id
LEFT JOIN vod_dict t3 ON t2.vod_id = t3.id
LEFT JOIN paper_dict t4 ON t.course_id = t4.course_id
AND t4.vod_id = t3.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
AND t4.delete_date IS NULL
AND t.course_id = #{courseId}
ORDER BY
t2.order_no DESC,
t3.id DESC
</select>
</mapper>
......@@ -488,5 +488,25 @@
AND t.delete_date IS NULL
</select>
<select id="post6plus" parameterType="long" resultType="com.subsidy.vo.renshe.ClassImageChecksVO">
SELECT
t1.class_id,
t1.member_id,
t1.photo AS image,
t2.user_name AS studentName,
t2.id_card AS identity,
t2.telephone AS phone,
UNIX_TIMESTAMP( t1.create_date )* 1000 AS activityTime,
t1.detectionType,
t1.processType
FROM
image_check_record t1
LEFT JOIN member t2 ON t1.member_id = t2.id
WHERE
t1.delete_date is null
and class_id = #{classId}
AND t1.result = 1
ORDER BY t1.create_date desc
</select>
</mapper>
......@@ -140,4 +140,17 @@
AND delete_date IS NULL
</where>
</select>
<select id="vodInfo" parameterType="long" resultType="com.subsidy.vo.vod.VodInfoVO">
SELECT
t.id,
t.label_id,
t.vod_name
FROM
vod_dict t
WHERE
t.delete_date IS NULL
AND t.label_id = #{labelId}
order by t.order_no
</select>
</mapper>
......@@ -20,7 +20,7 @@
</sql>
<select id="queryVodLabel" resultType="com.subsidy.vo.vodLabel.VodLabelTreeVO">
SELECT * FROM vod_label_dict WHERE delete_date IS NULL
SELECT id,label_name FROM vod_label_dict WHERE delete_date IS NULL
</select>
</mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!