Commit 3a53359c by 涂亚平

1106版本上线

1 parent 56870d91
Showing with 1315 additions and 266 deletions
......@@ -266,6 +266,12 @@
<artifactId>okio</artifactId>
<version>1.13.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies>
<build>
......
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.service.PushDataService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 问题答疑表 前端控制器
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@RestController
@Api(tags = "推数据回显")
@RequestMapping("/pushData")
public class PushDataController {
@Autowired
private PushDataService pushDataService;
@PostMapping("post4")
@ApiOperation("学时数据回显")
public void post4() {
pushDataService.post4();
}
@PostMapping("post5")
@ApiOperation("考试数据回显")
public void post5() {
pushDataService.post5();
}
@PostMapping("post6")
@ApiOperation("答疑数据回显")
public void post6() {
pushDataService.post6();
}
@PostMapping("post7")
@ApiOperation("人脸数据回显")
public void post7() {
pushDataService.post7();
}
@GetMapping("check")
@ApiOperation("核对数据")
public ResponseVO check(){
return ResponseData.generateCreatedResponse(0,pushDataService.check());
}
}
......@@ -21,56 +21,50 @@ public class RenSheJuController {
@Autowired
private RenSheJuService renSheJuService;
@PostMapping("getClassCodeByPrivateKey")
@ApiOperation("POST-2 获取培训待绑定的(班级编号,项目编号)列表")
public RensheResponseVO getClassCodeByPrivateKey()throws IOException {
return renSheJuService.getClassCodeByPrivateKey();
}
@PostMapping("classBaseInfo")
@ApiOperation("POST-2:班级基本信息信息采集接口")
@ApiOperation("POST-3:班级基本信息信息采集接口")
public RensheResponseVO classBaseInfo() throws IOException {
return renSheJuService.classBaseInfo();
}
@PostMapping("classHourBehavior")
@ApiOperation("POST-3:学时信息采集接口")
@ApiOperation("POST-4:学时信息采集接口")
public RensheResponseVO classHourBehavior() throws IOException {
return renSheJuService.classHourBehavior();
}
@PostMapping("uploadChapterBehavior")
@ApiOperation("POST-4:考试信息采集接口")
@ApiOperation("POST-5:考试信息采集接口")
public RensheResponseVO uploadChapterBehavior() throws IOException {
return renSheJuService.uploadChapterBehavior();
}
@PostMapping("uploadClassAnswerQuestionBehavior")
@ApiOperation("POST-5:答疑辅导采集接口")
@ApiOperation("POST-6:答疑辅导采集接口")
public RensheResponseVO uploadClassAnswerQuestionBehavior() throws IOException {
return renSheJuService.uploadClassAnswerQuestionBehavior();
}
@PostMapping("uploadImage")
@ApiOperation("POST-6 班级活跃度/实名认证照片信息采集接口")
@ApiOperation("POST-7 班级活跃度/实名认证照片信息采集接口")
public List<RensheResponseVO> uploadImage()throws IOException {
return renSheJuService.uploadImage();
}
@PostMapping("getClassCodeByPrivateKey")
@ApiOperation("POST-7 获取培训待绑定的(班级编号,项目编号)列表")
public RensheResponseVO getClassCodeByPrivateKey()throws IOException {
return renSheJuService.getClassCodeByPrivateKey();
}
@PostMapping("uploadClassCode")
@ApiOperation("POST-8 上下游班级数据绑定接口")
public RensheResponseVO uploadClassCode()throws IOException {
return renSheJuService.uploadClassCode();
}
@PostMapping("getErrorClass")
@ApiOperation("POST-9 获取推送失败班级列表")
@ApiOperation("POST-8 获取推送失败班级列表")
public RensheResponseVO getErrorClass()throws IOException{
return renSheJuService.getErrorClass();
}
@PostMapping("clear")
@ApiOperation("POST-10 清除推送失败班级缓存")
@ApiOperation("POST-9 清除推送失败班级缓存")
public RensheStringVO clear()throws IOException{
return renSheJuService.clear();
}
......
......@@ -40,7 +40,7 @@ public class VodPlayHistoryController {
"memberId 成员id playLength 播放时长 playRecord 位点 suspendLength暂停时长 ")
@LoginRequired
@TimeRequired
public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO, HttpServletRequest request){
public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO, HttpServletRequest request)throws Exception{
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistory(vodPlayHistoryDO,request));
}
......@@ -48,7 +48,7 @@ public class VodPlayHistoryController {
@ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id " +
"playLength 播放时长 playRecord 位点 suspendLength")
@TimeRequired
public ResponseVO insertHistoryNew(@RequestBody String param,HttpServletRequest request){
public ResponseVO insertHistoryNew(@RequestBody String param,HttpServletRequest request)throws Exception{
InsertHistoryNewDTO insertHistoryNewDTO = JSON.parseObject(param, InsertHistoryNewDTO.class);
return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(insertHistoryNewDTO,request));
}
......
......@@ -17,4 +17,5 @@ public class GetPaperExerciseDTO {
private String title;
private Long userId;
}
......@@ -11,7 +11,7 @@ public class AnswerBasic {
* 答疑辅导,提问和回答都存在值时才进行传递
*/
private List<AnswerAndQuestionList> answerAndQuestionList;
private String downCode;
private String classCode;
private String identity;
......
......@@ -7,10 +7,10 @@ import java.util.List;
@Data
public class ChapterExamBasic {
/**
* 是否通过,0通过1未通过
*/
private Long access;
// /**
// * 是否通过,0通过1未通过
// */
// private Long access;
/**
* 活跃度列表(数组),【数组】
*/
......@@ -22,7 +22,7 @@ public class ChapterExamBasic {
/**
* 临时班级(项目)编号
*/
private String downCode;
private String classCode;
/**
* 章节(课程)考试时间列表,【数组】
*/
......
......@@ -9,21 +9,18 @@ public class ChapterList3 {
* 章节(课程)编码,与基本信息内的章节(课程)编码相对应
*/
private String chapterCode;
/**
* 章节(课程)学习时长,该学习时间段内本章节学习累计时长【秒】
*/
private long chapterTime;
/**
* 学习结束时间(视频播放结束时间),【13位时间戳】【精确到毫秒】
*/
private long endTime;
private Long endTime;
/**
* 章节(课程)暂停时长,该学习时间段内本章节播放暂停累计时长【秒】(2023年2月1日开始实行)
*/
private long pauseTime;
private Long pauseTime;
/**
* 学习开始时间(视频播放开始时间),【13位时间戳】【精确到毫秒】
*/
private long startTime;
private Long startTime;
}
......@@ -11,7 +11,7 @@ public class ClassHourBasic {
/**
* 临时班级(临时项目)编号
*/
private String downCode;
private String classCode;
/**
* 学员姓名
......@@ -25,16 +25,8 @@ public class ClassHourBasic {
* 学员身份证号,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* 当日累计学习时长,视频暂停时间不计入【秒】
*/
private long learnTime;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】
*/
private long loginTime;
/**
* 当日累计播放时长,视频暂停时间计入【秒】
*/
private Long playTime;
......
......@@ -8,28 +8,16 @@ import java.util.List;
@Data
public class EpidemicSituationClassBasic {
private String areaName;
private List<ChapterList2> chapterList;
private Long courseHour;
private String downCode;
private String classCode;
private Long endDate;
private Long learnHour;
// private String professionName;
private String shortName;
private Long startDate;
private List<MemberVO> studentList;
private String trainingCode;
private String trainingName;
}
......@@ -10,7 +10,7 @@ public class UploadImageDTO {
/**
* 临时班级(项目)编码
*/
private String downCode;
private String classCode;
/**
* 活跃度照片列表,【数组】
*/
......
package com.subsidy.jobs;
import com.subsidy.service.PushDataService;
import com.subsidy.service.impl.PushDataServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
* 核对数据定时任务
*/
@Component
public class PushJob {
@Value("${spring.profiles.active}")
private String env;
@Autowired
private PushDataService pushDataService;
/**
* POST-4:学时
*/
@Scheduled(cron = "0 0 4 * * ?")
public void post4() throws IOException {
if ("prod".equals(env)) {
pushDataService.post4();
}
}
/**
* POST-5: 考试
*/
@Scheduled(cron = "0 10 4 * * ?")
public void post5() throws IOException {
if ("prod".equals(env)) {
pushDataService.post5();
}
}
/**
* POST-6: 答疑
*/
@Scheduled(cron = "0 20 4 * * ?")
public void post6() throws IOException {
if ("prod".equals(env)) {
pushDataService.post6();
}
}
/**
* POST-7:人脸
*/
@Scheduled(cron = "0 30 4 * * ?")
public void post7() throws IOException {
if ("prod".equals(env)) {
pushDataService.post7();
}
}
}
......@@ -65,7 +65,7 @@ public class RenSheJuJob {
/**
// * POST-2:班级基本信息信息采集接口
// * POST-3:班级基本信息信息采集接口
// */
@Scheduled(cron = "0 0 1 * * ?")
public void classBaseInfo() throws IOException {
......@@ -75,7 +75,7 @@ public class RenSheJuJob {
}
/**
* POST-3:学时信息采集接口
* POST-4:学时信息采集接口
*/
@Scheduled(cron = "0 5 1 * * ?")
public void classHourBehavior() throws IOException {
......@@ -85,7 +85,7 @@ public class RenSheJuJob {
}
/**
* POST-4:考试信息采集接口
* POST-5:考试信息采集接口
*/
@Scheduled(cron = "0 10 1 * * ?")
public void uploadChapterBehavior() throws IOException {
......@@ -95,7 +95,7 @@ public class RenSheJuJob {
}
/**
* POST-5:答疑辅导采集接口
* POST-6:答疑辅导采集接口
*/
@Scheduled(cron = "0 15 1 * * ?")
public void uploadClassAnswerQuestionBehavior() throws IOException {
......@@ -105,7 +105,7 @@ public class RenSheJuJob {
}
/**
* POST-6 班级活跃度/实名认证照片信息采集接口
* POST-7 班级活跃度/实名认证照片信息采集接口
*/
@Scheduled(cron = "0 20 1 * * ?")
public void uploadImage() throws IOException {
......@@ -115,7 +115,7 @@ public class RenSheJuJob {
}
/**
* POST-7 获取培训待绑定的(班级编号,项目编号)列表
* POST-8 获取培训待绑定的(班级编号,项目编号)列表
*/
@Scheduled(cron = "0 25 1 * * ?")
public void getClassCodeByPrivateKey() throws IOException {
......@@ -124,16 +124,16 @@ public class RenSheJuJob {
}
}
/**
* POST-8 上下游班级数据绑定接口
*/
@Scheduled(cron = "0 30 1 * * ?")
public void uploadClassCode() throws IOException {
if ("prod".equals(env)) {
renSheJuService.uploadClassCode();
}
System.gc();
}
// /**
// * POST-8 上下游班级数据绑定接口
// */
// @Scheduled(cron = "0 30 1 * * ?")
// public void uploadClassCode() throws IOException {
// if ("prod".equals(env)) {
// renSheJuService.uploadClassCode();
// }
// System.gc();
// }
// /**
// * POST-9 获取推送失败班级列表
......@@ -299,7 +299,6 @@ public class RenSheJuJob {
});
}
/**
* 补登录登出数据
*/
......
package com.subsidy.mapper;
import com.subsidy.vo.renshe.DailyAnswerVO;
import com.subsidy.vo.renshe.DailyStudyInfoVO;
import com.subsidy.dto.renshe.ChapterList2;
import com.subsidy.dto.renshe.ChapterList3;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.MemberDO;
import com.subsidy.model.OprMemDictDO;
import com.subsidy.vo.renshe.*;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -49,8 +53,70 @@ public interface DudaoMapper {
*/
List<Long> newClasses(String classType);
/**
* 查询班级基本信息
*/
ClassBaseInfoVO classBaseInfo(Long classId);
/**
* 课程下章节信息
*/
List<ChapterList2> classChapters(Long classId);
/**
* 查询班级学员信息
*/
List<MemberVO> classMembers(Long classId);
/**
* 前一天新增视频学习数据
*/
List<DailyStudyInfoVO> dailyStudyInfo1(Long classId);
/**
* 查看某人前一天上线的时间
*/
List<OprMemDictDO> loginRecords(Long memberId);
/**
* 查看某人前一天下线的时间
*/
List<OprMemDictDO> loginOutRecords(Long memberId);
/**
* 某个人某时间段的学习记录
*/
List<ChapterList3> dailyStudyRecords(Long memberId, Long classId, String startDate, String endDate);
/**
* 前一天活跃度检测列表
*/
List<DailyActivitiesVO> dailyActivities(Long classId, Long memberId);
/**
* 前一天做过考试通过数据
*/
List<MemberDO> memberIds(Long classId);
/**
* 查找课程最后一个视频
*/
String classVodName(Long classId);
/**
* 查出考试时间
*/
Long examLength(Long memberId,Long classId);
/**
* 考试活跃度检测--人脸
*/
List<ExamActivitiesVO> examActivities(Long classId,Long memberId);
/**
* 找到某人某个时间段内的测评记录
*/
List<ExerciseDoneResultDO> dailyExerciseDone(Long memberId, String startDate, String endDate, Long classId);
}
package com.subsidy.mapper;
import com.subsidy.model.PushAnsweringDataDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
/**
* <p>
* 问题答疑表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public interface PushAnsweringDataMapper extends BaseMapper<PushAnsweringDataDO> {
void insertAnswerData(Long classId, Long userId, Date question,Date answer);
List<Long> answerList();
}
package com.subsidy.mapper;
import com.subsidy.model.PushDetectionDataDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
/**
* <p>
* 活跃度检测表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public interface PushDetectionDataMapper extends BaseMapper<PushDetectionDataDO> {
void insertData(Long classId, Integer checkType, Long memberId, Date createDate);
List<Long> activityList();
}
package com.subsidy.mapper;
import com.subsidy.model.PushExerciseDataDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
/**
* <p>
* 学生课程习题完成情况 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public interface PushExerciseDataMapper extends BaseMapper<PushExerciseDataDO> {
void pushExamData(Long classId, Date startDate, Long memberId, Date createDate, Integer examTime);
List<Long> examList();
}
package com.subsidy.mapper;
import com.subsidy.model.PushImageDataDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
/**
* <p>
* 人脸识别记录表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public interface PushImageDataMapper extends BaseMapper<PushImageDataDO> {
void pushImageData(Long classId, Long detectionType, Long memberId, Long processType, Date activityTime);
List<Long> imageList();
}
package com.subsidy.mapper;
import com.subsidy.model.PushOprDataDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.Date;
/**
* <p>
* 审计表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public interface PushOprDataMapper extends BaseMapper<PushOprDataDO> {
void insertData(Long userId, String opr, String ipAddress, Date createDate);
}
package com.subsidy.mapper;
import com.subsidy.model.PushVodDataDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
/**
* <p>
* 视频播放历史记录表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Repository
public interface PushVodDataMapper extends BaseMapper<PushVodDataDO> {
void insertData(Long classId, Long vodId, Long memberId, Integer playLength, Integer suspendLength, Integer playRecord, Date createDate, String ipAddress);
List<Long> vodIds();
}
......@@ -42,7 +42,7 @@ public interface RenSheJuMapper {
/**
* 前一天活跃度检测列表
*/
List<DailyActivitiesVO > dailyActivities(String classId, Long memberId);
List<DailyActivitiesVO > dailyActivities(Long classId, Long memberId);
/**
* 考试活跃度检测--人脸
......@@ -67,7 +67,7 @@ public interface RenSheJuMapper {
/**
* 某个人某时间段的学习记录
*/
List<ChapterList3> dailyStudyRecords(Long memberId,String classId,String startDate, String endDate);
List<ChapterList3> dailyStudyRecords(Long memberId,Long classId,String startDate, String endDate);
/**
* 前一天考试通过数据
......@@ -145,4 +145,5 @@ public interface RenSheJuMapper {
*/
List<Long> imageClassIds(String classType);
}
......@@ -4,6 +4,8 @@ import com.subsidy.model.RenshejuHistoryDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 人社局推送失败记录表 Mapper 接口
......@@ -12,7 +14,18 @@ import org.springframework.stereotype.Repository;
* @author Tuyp
* @since 2023-02-07
*/
@Repository
@Repository
public interface RenshejuHistoryMapper extends BaseMapper<RenshejuHistoryDO> {
/**
* 查找当天推出去的数据 POST456
*/
RenshejuHistoryDO dailyData(String post);
/**
* 人脸有多个
*/
List<RenshejuHistoryDO> dailyDatas(String post);
}
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 2023-12-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("push_answering_data")
public class PushAnsweringDataDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 科目id
*/
private Long classId;
/**
* 提问id
*/
private Long askId;
/**
* 回答人id
*/
private Long answerId;
/**
* 问题
*/
private String title;
/**
* 答案
*/
private String answer;
}
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 2023-12-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("push_detection_data")
public class PushDetectionDataDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 班级id
*/
private Long classId;
/**
* 检测类型:0:滑块 1:人脸
*/
private Integer checkType;
/**
* 人员id
*/
private Long memberId;
private Long vodId;
/**
* 成功/失败
*/
private Integer status;
/**
* RequestId
*/
private String requestId;
/**
* 人脸识别id
*/
private Integer faceCheckId;
}
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 java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 学生课程习题完成情况
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("push_exercise_data")
public class PushExerciseDataDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Long paperId;
/**
* 成员id
*/
private Long memberId;
/**
* 班级id
*/
private Long classId;
/**
* 课程id
*/
private Long courseId;
/**
* 正确个数
*/
private Integer rightCounts;
/**
* 总共个数
*/
private Integer totalCounts;
/**
* 时长
*/
private Integer length;
private Integer score;
private String result;
private LocalDateTime startDate;
}
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 java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 人脸识别记录表
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("push_image_data")
public class PushImageDataDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 班级id
*/
private Long classId;
/**
* 试卷id
*/
private Long paperId;
/**
* 学员id
*/
private Long memberId;
/**
* 活体检测得分
*/
private String liveRate;
/**
* 人脸比对得分
*/
private String similarity;
/**
* 刷脸时间
*/
private LocalDateTime occurredTime;
/**
* 图片
*/
private String photo;
/**
* 流水号
*/
private String bizSeqNo;
/**
* 检测类型 1,权威库 0照片比对
*/
private Integer checkType;
/**
* 检测地点 1,签到页 0 班级内
*/
private Integer checkPlace;
/**
* 1:视频的时候检测 2:测评的时候检测
*/
private Integer classPlace;
/**
* 结果
*/
private Integer result;
}
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 2023-12-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("push_opr_data")
public class PushOprDataDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 用户id
*/
private Long userId;
/**
* 操作类型
*/
private String oprType;
/**
* 1:成功,0:失败
*/
private Integer result;
/**
* 登录ip
*/
private String ipAddress;
}
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 java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 视频播放历史记录表
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("push_vod_data")
public class PushVodDataDO 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;
/**
* 学生id
*/
private Long memberId;
/**
* 观看时长
*/
private Integer playLength;
/**
* 播放视频位置
*/
private Integer playRecord;
private LocalDateTime playDate;
/**
* 暂停时长
*/
private Integer suspendLength;
private String ipAddress;
}
package com.subsidy.service;
import com.subsidy.model.PushAnsweringDataDO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 问题答疑表 服务类
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
public interface PushDataService extends IService<PushAnsweringDataDO> {
void post4();
void post5();
void post6();
void post7();
HashMap<String, List<Long>> check();
}
......@@ -20,8 +20,6 @@ public interface RenSheJuService {
RensheResponseVO getClassCodeByPrivateKey()throws IOException;
RensheResponseVO uploadClassCode()throws IOException;
RensheResponseVO getErrorClass()throws IOException;
RensheStringVO clear()throws IOException;
......
......@@ -23,9 +23,9 @@ import java.util.List;
*/
public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> {
String insertHistory(VodPlayHistoryDO vodPlayHistoryDO,HttpServletRequest request);
String insertHistory(VodPlayHistoryDO vodPlayHistoryDO,HttpServletRequest request)throws Exception;
String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDT,HttpServletRequest request);
String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDT,HttpServletRequest request)throws Exception;
void dataFix(SignDatePlaysDTO dataFixDTO);
......
......@@ -305,6 +305,11 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
.lambda()
.eq(RoleAdministerMappingDO::getAdministerId, administerDO.getId()));
administerPermissionVO.setRole(roleAdministerMappingDO.getRoleId());
CompanyDictDO companyDictDO = companyDictMapper.selectById(administerDO.getCompanyId());
administerPermissionVO.setCompanyName(companyDictDO.getCompanyName());
administerPermissionVO.setShortName(companyDictDO.getShortName());
return administerPermissionVO;
}
......@@ -1391,7 +1396,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
memberDO1.setAccountName(accountName.replace("u:", "v"));
}
} catch (Exception ex) {
System.out.println(ex.getStackTrace());
}
memberDO1.setCompanyId(companyId);
memberDO1.setFirstLogin(0);
......
......@@ -38,9 +38,6 @@ public class DudaoServiceImpl implements DudaoService {
private RenSheConfig renSheConfig;
@Autowired
private RenSheJuMapper renSheJuMapper;
@Autowired
private ClassDictMapper classDictMapper;
@Autowired
......@@ -49,6 +46,9 @@ public class DudaoServiceImpl implements DudaoService {
@Autowired
private DudaoMapper dudaoMapper;
// @Autowired
// private RenSheJuMapper renSheJuMapper;
public RensheResponseVO all()throws IOException{
classBaseInfo();
......@@ -98,18 +98,18 @@ public class DudaoServiceImpl implements DudaoService {
for (Long classId : classIds) {
EpidemicSituationClassBasic epidemicSituationClassBasic = new EpidemicSituationClassBasic();
//班级基本信息
ClassBaseInfoVO classBaseInfoVO = renSheJuMapper.classBaseInfo(classId);
ClassBaseInfoVO classBaseInfoVO = dudaoMapper.classBaseInfo(classId);
BeanUtils.copyProperties(classBaseInfoVO, epidemicSituationClassBasic);
epidemicSituationClassBasic.setDownCode(classBaseInfoVO.getDownCode());
epidemicSituationClassBasic.setClassCode(classBaseInfoVO.getDownCode());
//章节
List<ChapterList2> chapterLists = renSheJuMapper.classChapters(classId);
List<ChapterList2> chapterLists = dudaoMapper.classChapters(classId);
ChapterList2 chapterList2 = chapterLists.get(chapterLists.size() - 1);
chapterList2.setIsExam(1);
epidemicSituationClassBasic.setChapterList(chapterLists);
//学员列表
List<MemberVO> memberVOS = renSheJuMapper.classMembers(classId);
List<MemberVO> memberVOS = dudaoMapper.classMembers(classId);
epidemicSituationClassBasic.setStudentList(memberVOS);
epidemicSituationClassBasics.add(epidemicSituationClassBasic);
......@@ -182,21 +182,21 @@ public class DudaoServiceImpl implements DudaoService {
for (Long classId : vodClassIds){
//产生数据的班级
List<DailyStudyInfoVO> dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo(classId);
List<DailyStudyInfoVO> dailyStudyInfoVOS = dudaoMapper.dailyStudyInfo1(classId);
result.addAll(dailyStudyInfoVOS);
}
for (DailyStudyInfoVO dailyStudyInfoVO : result) {
ClassHourBasic classHourBasic = new ClassHourBasic();
BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic);
classHourBasic.setDownCode(dailyStudyInfoVO.getDownCode());
classHourBasic.setClassCode(dailyStudyInfoVO.getDownCode());
//上线时间列表
//找到当天每次上线下线时间
//上线时间
List<OprMemDictDO> loginRecords = renSheJuMapper.loginRecords(dailyStudyInfoVO.getMemberId());
List<OprMemDictDO> loginRecords = dudaoMapper.loginRecords(dailyStudyInfoVO.getMemberId());
//下线时间
List<OprMemDictDO> loginOutRecords = renSheJuMapper.loginOutRecords(dailyStudyInfoVO.getMemberId());
List<OprMemDictDO> loginOutRecords = dudaoMapper.loginOutRecords(dailyStudyInfoVO.getMemberId());
List<LoginList> loginLists = new ArrayList<>();
for (int i = 0; i < loginRecords.size(); i++) {
......@@ -206,7 +206,7 @@ public class DudaoServiceImpl implements DudaoService {
loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime());
//查看这个人该时间段的学习记录
List<ChapterList3> chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
List<ChapterList3> chapterList3s = dudaoMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getClassId(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
if (chapterList3s.size() > 0) {
loginList.setChapterList(chapterList3s);
loginLists.add(loginList);
......@@ -216,7 +216,7 @@ public class DudaoServiceImpl implements DudaoService {
//活跃度列表
List<ActivityList> activityLists = new ArrayList<>();
List<DailyActivitiesVO> activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getDownCode(), dailyStudyInfoVO.getMemberId());
List<DailyActivitiesVO> activityDetectionDOS = dudaoMapper.dailyActivities(dailyStudyInfoVO.getClassId(), dailyStudyInfoVO.getMemberId());
for (DailyActivitiesVO dailyActivitiesVO : activityDetectionDOS) {
ActivityList activityList = new ActivityList();
......@@ -311,16 +311,18 @@ public class DudaoServiceImpl implements DudaoService {
for (Long classId : classIds) {
//具体哪些人做了
List<MemberDO> memberDOList = renSheJuMapper.memberIds(classId);
List<MemberDO> memberDOList = dudaoMapper.memberIds(classId);
ClassDictDO classDictDO = classDictMapper.selectById(classId);
for (MemberDO memberDO : memberDOList) {
//章节课程考试时间列表
ChapterExamBasic chapterExamBasic = new ChapterExamBasic();
chapterExamBasic.setDownCode(String.valueOf(classId));
chapterExamBasic.setClassCode(classDictDO.getClassCode());
//最后一节课作为chapterCode
String vodId = renSheJuMapper.classVodName(classId);
String vodId = dudaoMapper.classVodName(classId);
chapterExamBasic.setChapterCode(vodId);
chapterExamBasic.setStudentName(memberDO.getUserName());
......@@ -328,12 +330,12 @@ public class DudaoServiceImpl implements DudaoService {
chapterExamBasic.setIdentity(memberDO.getIdCard());
//考试花了多长时间
Long examLength = renSheJuMapper.examLength(memberDO.getId(), classId);
Long examLength = dudaoMapper.examLength(memberDO.getId(), classId);
chapterExamBasic.setExamTime(examLength);
//考试活跃度列表
List<ActivityList> activityLists = new ArrayList<>();
List<ExamActivitiesVO> activityDetectionDOS = renSheJuMapper.examActivities(classId, memberDO.getId());
List<ExamActivitiesVO> activityDetectionDOS = dudaoMapper.examActivities(classId, memberDO.getId());
for (ExamActivitiesVO dailyActivitiesVO : activityDetectionDOS) {
ActivityList activityList = new ActivityList();
......@@ -352,31 +354,31 @@ public class DudaoServiceImpl implements DudaoService {
List<ExamList> examLists = new ArrayList<>();
//上线时间
List<OprMemDictDO> loginRecords = renSheJuMapper.loginRecords(memberDO.getId());
List<OprMemDictDO> loginRecords = dudaoMapper.loginRecords(memberDO.getId());
//下线时间
List<OprMemDictDO> loginOutRecords = renSheJuMapper.loginOutRecords(memberDO.getId());
List<OprMemDictDO> loginOutRecords = dudaoMapper.loginOutRecords(memberDO.getId());
boolean flag = false;
// boolean flag = false;
for (int i = 0; i < loginRecords.size(); i++) {
//找到该时间段内的测评
List<ExerciseDoneResultDO> exerciseDoneResultDOS = renSheJuMapper.dailyExerciseDone(memberDO.getId(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "), classId);
List<ExerciseDoneResultDO> exerciseDoneResultDOS = dudaoMapper.dailyExerciseDone(memberDO.getId(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "), classId);
for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) {
ExamList examList = new ExamList();
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);
}
......@@ -471,7 +473,7 @@ public class DudaoServiceImpl implements DudaoService {
AnswerBasic answerBasic = new AnswerBasic();
String downCode = key.split(":")[0];
String identity = key.split(":")[1];
answerBasic.setDownCode(downCode);
answerBasic.setClassCode(downCode);
answerBasic.setIdentity(identity);
answerBasic.setAnswerAndQuestionList(hashMap.get(key));
answerBasics.add(answerBasic);
......
......@@ -953,27 +953,17 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
public String checkTimes(ExerciseDoneResultDO exerciseDoneResultDO) {
MemberDO memberDO = this.baseMapper.selectById(exerciseDoneResultDO.getMemberId());
ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne(new QueryWrapper<ClassHourDictDO>()
//查看这个人这个卷子做了几次
Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
.eq(ClassHourDictDO::getCompanyId, memberDO.getCompanyId()));
if (null != classHourDictDO) {
Integer status = classHourDictDO.getRepeatStatus();
if (1 == status) {
int cnt = classHourDictDO.getRepeatTime();
//查看这个人这个卷子做了几次
Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
.eq(ExerciseDoneResultDO::getMemberId, exerciseDoneResultDO.getMemberId())
.eq(ExerciseDoneResultDO::getPaperId, exerciseDoneResultDO.getPaperId()));
.eq(ExerciseDoneResultDO::getMemberId, exerciseDoneResultDO.getMemberId())
.eq(ExerciseDoneResultDO::getPaperId, exerciseDoneResultDO.getPaperId())
.eq(ExerciseDoneResultDO::getClassId, exerciseDoneResultDO.getClassId()));
if (cnt <= count) {
throw new HttpException(60001);
}
}
if (count > 3) {
throw new HttpException(60001);
}
return ConstantUtils.CHECK_STATUS;
}
......
package com.subsidy.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.gson.Gson;
import com.subsidy.dto.renshe.*;
import com.subsidy.mapper.*;
import com.subsidy.model.*;
import com.subsidy.service.PushDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.service.RenshejuHistoryService;
import com.subsidy.util.RenSheJuConstant;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.configurationprocessor.json.JSONObject;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 问题答疑表 服务实现类
* </p>
*
* @author Tuyp
* @since 2023-12-01
*/
@Service
public class PushDataServiceImpl extends ServiceImpl<PushAnsweringDataMapper, PushAnsweringDataDO> implements PushDataService {
@Autowired
private RenshejuHistoryMapper renshejuHistoryMapper;
@Autowired
private MemberMapper memberMapper;
@Autowired
private PushOprDataMapper pushOprDataMapper;
@Autowired
private PushVodDataMapper pushVodDataMapper;
@Autowired
private ClassDictMapper classDictMapper;
@Autowired
private PushDetectionDataMapper pushDetectionDataMapper;
@Autowired
private PushExerciseDataMapper pushExerciseDataMapper;
@Autowired
private PushImageDataMapper pushImageDataMapper;
@Autowired
private PushAnsweringDataMapper pushAnsweringDataMapper;
@Transactional(rollbackFor = Exception.class)
public void post4() {
RenshejuHistoryDO renshejuHistoryDO = renshejuHistoryMapper.dailyData(RenSheJuConstant.POST_4);
// RenshejuHistoryDO renshejuHistoryDO =renshejuHistoryMapper.selectById(5362);
String input = renshejuHistoryDO.getInputParam();
Gson gson = new Gson();
ClassHourBehaviorDTO classHourBehaviorDTO = gson.fromJson(input, ClassHourBehaviorDTO.class);
List<ClassHourBasic> classHourBasics = classHourBehaviorDTO.getClassHourBasic();
for (ClassHourBasic chb : classHourBasics) {
MemberDO memberDO = memberMapper.selectOne(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getIdCard, chb.getIdentity())
);
ClassDictDO classDictDO = classDictMapper.selectOne(new QueryWrapper<ClassDictDO>()
.lambda()
.eq(ClassDictDO::getClassCode, chb.getClassCode()));
List<LoginList> loginLists = chb.getLoginList();
if (loginLists.size() > 0) {
LoginList loginList = loginLists.get(0);
Date loginInTime = new Date(loginList.getStartTime());
Date loginOutTime = new Date(loginList.getEndTime());
String ip = loginList.getIp();
//opr
pushOprDataMapper.insertData(memberDO.getId(), "登录", ip, loginInTime);
pushOprDataMapper.insertData(memberDO.getId(), "登出", null, loginOutTime);
//回写视频数据
List<ChapterList3> chapterList = loginList.getChapterList();
for (ChapterList3 chapter : chapterList) {
pushVodDataMapper.insertData(classDictDO.getId(), Long.valueOf(chapter.getChapterCode()), memberDO.getId(), (chapter.getEndTime().intValue() - chapter.getStartTime().intValue()) / 1000, chapter.getPauseTime().intValue(), 0, new Date(chapter.getEndTime()), ip);
}
}
//回写活跃度数据
List<ActivityList> activityLists = chb.getActivityList();
for (ActivityList activityList : activityLists) {
pushDetectionDataMapper.insertData(classDictDO.getId(), activityList.getActivityDetection(), memberDO.getId(), new Date(activityList.getActivityTime()));
}
}
}
@Transactional(rollbackFor = Exception.class)
public void post5() {
RenshejuHistoryDO renshejuHistoryDO = renshejuHistoryMapper.dailyData(RenSheJuConstant.POST_5);
// RenshejuHistoryDO renshejuHistoryDO = renshejuHistoryMapper.selectById(5365);
String input = renshejuHistoryDO.getInputParam();
Gson gson = new Gson();
UploadChapterBehaviorDTO uploadChapterBehaviorDTO = gson.fromJson(input, UploadChapterBehaviorDTO.class);
System.out.println(uploadChapterBehaviorDTO);
List<ChapterExamBasic> chapterExamBasics = uploadChapterBehaviorDTO.getChapterExamBasic();
for (ChapterExamBasic ceb : chapterExamBasics) {
MemberDO memberDO = memberMapper.selectOne(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getIdCard, ceb.getIdentity())
);
ClassDictDO classDictDO = classDictMapper.selectOne(new QueryWrapper<ClassDictDO>()
.lambda()
.eq(ClassDictDO::getClassCode, ceb.getClassCode()));
//考试活跃度 学时里已经推过全部的活跃度了
// List<ActivityList> activityLists = ceb.getActivityList();
// for (ActivityList activityList : activityLists) {
// pushDetectionDataMapper.insertData(classDictDO.getId(), activityList.getActivityDetection(), memberDO.getId(), new Date(activityList.getActivityTime()));
// }
//考试表
List<ExamList> examLists = ceb.getExamList();
for (ExamList examList : examLists) {
pushExerciseDataMapper.pushExamData(classDictDO.getId(), new Date(examList.getStartTime()), memberDO.getId(), new Date(examList.getEndTime()), ceb.getExamTime().intValue());
}
}
}
@Transactional(rollbackFor = Exception.class)
public void post6() {
RenshejuHistoryDO renshejuHistoryDO = renshejuHistoryMapper.dailyData(RenSheJuConstant.POST_6);
// RenshejuHistoryDO renshejuHistoryDO = renshejuHistoryMapper.selectById(5366);
String input = renshejuHistoryDO.getInputParam();
Gson gson = new Gson();
UploadClassAnswerQuestionBehaviorDTO uploadClassAnswerQuestionBehaviorDTO = gson.fromJson(input, UploadClassAnswerQuestionBehaviorDTO.class);
System.out.println(uploadClassAnswerQuestionBehaviorDTO);
List<AnswerBasic> answerBasics = uploadClassAnswerQuestionBehaviorDTO.getAnswerBasic();
for (AnswerBasic ab : answerBasics) {
ClassDictDO classDictDO = classDictMapper.selectOne(new QueryWrapper<ClassDictDO>()
.lambda()
.eq(ClassDictDO::getClassCode, ab.getClassCode()));
MemberDO memberDO = memberMapper.selectOne(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getIdCard, ab.getIdentity())
);
List<AnswerAndQuestionList> answerAndQuestionLists = ab.getAnswerAndQuestionList();
for (AnswerAndQuestionList aaql : answerAndQuestionLists) {
pushAnsweringDataMapper.insertAnswerData(classDictDO.getId(), memberDO.getId(), new Date(aaql.getQuestion()), new Date(aaql.getAnswer()));
}
}
}
@Transactional(rollbackFor = Exception.class)
public void post7() {
List<RenshejuHistoryDO> renshejuHistoryDOS = renshejuHistoryMapper.dailyDatas(RenSheJuConstant.POST_7);
// List<Long> longs = new ArrayList<Long>();
// longs.add(5370L);
// longs.add(5372L);
// longs.add(5373L);
// longs.add(5376L);
// longs.add(5377L);
// List<RenshejuHistoryDO> renshejuHistoryDOS = renshejuHistoryMapper.selectList(new QueryWrapper<RenshejuHistoryDO>()
// .lambda()
// .in(RenshejuHistoryDO::getId,longs));
for (RenshejuHistoryDO renshejuHistoryDO : renshejuHistoryDOS){
String input = renshejuHistoryDO.getInputParam();
Gson gson = new Gson();
UploadImageDTO uploadImageDTO = gson.fromJson(input, UploadImageDTO.class);
System.out.println(uploadImageDTO);
ClassDictDO classDictDO = classDictMapper.selectOne(new QueryWrapper<ClassDictDO>()
.lambda()
.eq(ClassDictDO::getClassCode, uploadImageDTO.getClassCode()));
List<ImageDetailList> imageDetailList = uploadImageDTO.getImageDetailList();
for (ImageDetailList idl : imageDetailList) {
MemberDO memberDO = memberMapper.selectOne(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getIdCard, idl.getIdentity())
);
pushImageDataMapper.pushImageData(classDictDO.getId(), idl.getDetectionType(), memberDO.getId(), idl.getProcessType(), new Date(idl.getActivityTime()));
}
}
}
public HashMap<String, List<Long>> check(){
HashMap<String, List<Long>> hashMap = new HashMap();
//视频
List<Long> vodList = pushVodDataMapper.vodIds();
hashMap.put("视频",vodList);
//答疑
List<Long> answerList = pushAnsweringDataMapper.answerList();
hashMap.put("答疑",answerList);
//考试
List<Long> examList = pushExerciseDataMapper.examList();
hashMap.put("考试",examList);
//活跃度
List<Long> activityList = pushDetectionDataMapper.activityList();
hashMap.put("活跃度",activityList);
//人脸
List<Long> imageList = pushImageDataMapper.imageList();
hashMap.put("人脸",imageList);
return hashMap;
}
}
......@@ -21,7 +21,9 @@ import org.springframework.transaction.annotation.Transactional;
import sun.util.calendar.CalendarDate;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
/**
......@@ -63,16 +65,30 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
private ExerciseDoneResultMapper exerciseDoneResultMapper;
@Transactional(rollbackFor = Exception.class)
public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO, HttpServletRequest request) {
public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO, HttpServletRequest request) throws Exception {
Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
.eq(ExerciseDoneResultDO::getClassId, vodPlayHistoryDO.getClassId())
.eq(ExerciseDoneResultDO::getMemberId, vodPlayHistoryDO.getMemberId()));
if (count == 0) {
//只有开始学习时间晚于签到时间的数据才会插进去
Date date = new Date();
Boolean flag = false;
SignInRecordDO dailySignInRecord = signInRecordMapper.getDailySignInRecord(vodPlayHistoryDO.getMemberId(), vodPlayHistoryDO.getClassId());
if (null != dailySignInRecord) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String formatDateTime = dailySignInRecord.getSignInDate().format(formatter);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date signInDate = sdf.parse(formatDateTime);
if (signInDate.getTime() < date.getTime() - (vodPlayHistoryDO.getSuspendLength() + vodPlayHistoryDO.getPlayLength())) {
flag = true;
}
}
if (count == 0 && flag) {
Date date = new Date();
if (vodPlayHistoryDO.getPlayLength() > 8 && vodPlayHistoryDO.getSuspendLength() <= 3000) {
Date latestDailyDate = this.baseMapper.latestDailyStudyRecord(vodPlayHistoryDO.getMemberId());
......@@ -120,15 +136,29 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
}
@Transactional(rollbackFor = Exception.class)
public String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO, HttpServletRequest request) {
public String insertHistoryNew(InsertHistoryNewDTO insertHistoryNewDTO, HttpServletRequest request) throws Exception {
Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
.eq(ExerciseDoneResultDO::getClassId, insertHistoryNewDTO.getClassId())
.eq(ExerciseDoneResultDO::getMemberId, insertHistoryNewDTO.getMemberId()));
if (count == 0) {
Date date = new Date();
//只有开始学习时间晚于签到时间的数据才会插进去
Date date = new Date();
Boolean flag = false;
SignInRecordDO dailySignInRecord = signInRecordMapper.getDailySignInRecord(insertHistoryNewDTO.getMemberId(), insertHistoryNewDTO.getClassId());
if (null != dailySignInRecord) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String formatDateTime = dailySignInRecord.getSignInDate().format(formatter);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date signInDate = sdf.parse(formatDateTime);
if (signInDate.getTime() < date.getTime() - (insertHistoryNewDTO.getSuspendLength() + insertHistoryNewDTO.getPlayLength())) {
flag = true;
}
}
if (count == 0 && flag) {
if (insertHistoryNewDTO.getPlayLength() > 8 && insertHistoryNewDTO.getSuspendLength() <= 3000) {
VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO();
BeanUtils.copyProperties(insertHistoryNewDTO, vodPlayHistoryDO);
......
......@@ -5,37 +5,37 @@ public class RenSheJuConstant {
/**
* POST-2:班级基本信息信息采集接口
*/
public static final String POST_2 = "POST_2_classBaseInfo";
public static final String POST_3 = "POST3_班级基本信息";
/**
* POST-3:学时信息采集接口
*/
public static final String POST_3 = "POST_3_classHourBehavior";
public static final String POST_4 = "POST4_学时信息";
/**
* POST-4:考试信息采集接口
*/
public static final String POST_4 = "POST_4_uploadChapterBehavior";
public static final String POST_5 = "POST5_考试信息";
/**
* POST-5:答疑辅导采集接口
*/
public static final String POST_5 = "POST_5_uploadClassAnswerQuestionBehavior";
public static final String POST_6 = "POST6_答疑辅导";
/**
* POST-6 班级活跃度/实名认证照片信息采集接口
*/
public static final String POST_6 = "POST_6_uploadImage";
public static final String POST_7 = "POST7_实名认证/活跃度";
/**
* POST-7 获取培训待绑定的(班级编号,项目编号)列表
*/
public static final String POST_7 = "POST_7_getClassCodeByPrivateKey";
// public static final String POST_7 = "POST_7_getClassCodeByPrivateKey";
/**
* POST-8 上下游班级数据绑定接口
*/
public static final String POST_8 = "POST_8_uploadClassCode";
public static final String POST_8 = "POST8_待绑定的班级";
/**
* POST-9 获取推送失败班级列表
......
......@@ -17,5 +17,9 @@ public class AdministerPermissionVO {
private Boolean isRole;
private String companyName;
private String shortName;
private List<PermissionsVO> permissions;
}
......@@ -7,20 +7,10 @@ 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;
}
......@@ -5,9 +5,9 @@ import lombok.Data;
@Data
public class DailyStudyInfoVO {
private Long memberId;
private Long classId;
// private Long classId;
private Long memberId;
/**
* 临时班级(临时项目)编号
......@@ -17,23 +17,12 @@ public class DailyStudyInfoVO {
* 学员身份证号,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* 当日累计学习时长,视频暂停时间不计入【秒】
*/
private long learnTime;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】
*/
private long loginTime;
/**
* 学员电话号,会对学生手机号长度、格式进行校验
*/
private String phone;
/**
* 当日累计播放时长,视频暂停时间计入【秒】
*/
private Long playTime;
/**
* 学员姓名
*/
......
<?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.PushAnsweringDataMapper">
<select id="insertAnswerData">
insert into push_answering_data (class_id,ask_id,create_date,update_date)
VALUES (#{classId},#{userId}, #{question}, #{answer})
</select>
<select id="answerList" resultType="long">
SELECT
t2.id AS 答疑id
FROM
answering_question t2
LEFT JOIN push_answering_data t1 ON t1.class_id = t2.class_id
AND t1.ask_id = t2.ask_id
AND t1.create_date = t2.create_date
AND t1.update_date = t2.update_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.update_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.create_date IS NULL
</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.PushDetectionDataMapper">
<select id="insertData">
insert into push_detection_data (class_id,check_type,member_id,create_date)
VALUES (#{classId}, #{checkType}, #{memberId}, #{createDate})
</select>
<select id="activityList" resultType="long">
SELECT
t2.id 活跃度id
FROM
activity_detection t2
LEFT JOIN push_detection_data t1 ON t1.class_id = t2.class_id
AND t1.member_id = t2.member_id
AND t1.create_date = t2.create_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.create_date IS NULL
</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.PushExerciseDataMapper">
<select id="pushExamData">
insert into push_exercise_data (class_id,start_date,member_id,create_date,length)
VALUES (#{classId}, #{startDate}, #{memberId}, #{createDate},#{examTime})
</select>
<select id="examList" resultType="long">
SELECT
t2.id as 考试id
FROM
exercise_done_result t2
LEFT JOIN push_exercise_data t1 ON t1.class_id = t2.class_id
AND t1.member_id = t2.member_id
AND t1.start_date = t2.start_date
AND t1.create_date = t2.create_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.create_date IS NULL
</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.PushImageDataMapper">
<select id="pushImageData">
insert into push_image_data (class_id,check_type,member_id,check_place,occurred_time)
VALUES (#{classId}, #{detectionType}, #{memberId},#{processType}, #{activityTime})
</select>
<select id="imageList" resultType="long">
SELECT
t2.id 人脸id
FROM
image_check_record t2
LEFT JOIN push_image_data t1 ON t1.class_id = t2.class_id
AND t1.member_id = t2.member_id
AND t1.occurred_time = t2.create_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.id IS NULL
AND t2.result = 1
</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.PushOprDataMapper">
<select id="insertData">
insert into push_opr_data (user_id,opr_type,result,ip_address,create_date)
VALUES (#{userId}, #{opr}, 1, #{ipAddress},#{createDate})
</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.PushVodDataMapper">
<insert id="insertData">
insert into push_vod_data (class_id,vod_id,member_id,play_length,suspend_length,play_record,create_date,ip_address)
VALUES (#{classId}, #{vodId}, #{memberId}, #{playLength},#{suspendLength},#{playRecord},#{createDate},#{ipAddress})
</insert>
<select id="vodIds" resultType="long">
SELECT
t2.id as 视频id
FROM
vod_play_history t2
LEFT JOIN push_vod_data t1 ON t1.class_id = t2.class_id
AND t1.vod_id = t2.vod_id
AND t1.member_id = t2.member_id
AND t1.play_length = t2.play_length + t2.suspend_length
AND t1.suspend_length = t2.suspend_length
AND t1.create_date = t2.create_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.create_date IS NULL
</select>
</mapper>
......@@ -4,16 +4,11 @@
<select id="classBaseInfo" parameterType="long" resultType="com.subsidy.vo.renshe.ClassBaseInfoVO">
SELECT
t2.id AS downCode,
t2.class_code,
t2.class_name AS shortName,
FLOOR( sum( t7.vod_length )/ 60 ) AS learnHour,
FLOOR( sum( t7.vod_length )/ 2700 ) AS courseHour,
t2.id,
t2.class_code downCode,
sum( t7.vod_length ) AS learnHour,
REPLACE ( unix_timestamp( t2.start_date ), '.', '' )/ 1000 AS startDate,
REPLACE ( unix_timestamp( t2.end_date ), '.', '' )/ 1000 AS endDate,
t3.area_name AS areaName,
t3.company_name AS trainingName,
t3.company_code AS trainingCode
REPLACE ( unix_timestamp( t2.end_date ), '.', '' )/ 1000 AS endDate
FROM
class_dict t2
LEFT JOIN company_dict t3 ON t2.company_id = t3.id
......@@ -49,9 +44,9 @@
SELECT
t7.id AS chapterCode,
IFNULL( t6.vod_alias_name, t7.vod_name ) as chapterName,
FLOOR( t7.vod_length / 60 ) as chapterTime,
t7.vod_length as chapterTime,
0 as isExam,
120 as examTime
120*60 as examTime
FROM
class_dict t2
LEFT JOIN course_dict t4 ON t2.course_id = t4.id
......@@ -87,74 +82,20 @@
<select id="dailyStudyInfo" resultType="com.subsidy.vo.renshe.DailyStudyInfoVO">
SELECT
t.class_id AS downCode,
t.class_id,
t5.class_code AS downCode,
t3.id AS member_id,
t3.user_name AS studentName,
t3.telephone AS phone,
t3.id_card identity,
IFNULL( t4.learnTime, 0 ) learnTime,
IFNULL( t4.playTime, 0 ) playTime,
t2.loginTime
t3.id_card identity
FROM
class_member_mapping t
LEFT JOIN (
SELECT
t3.user_id,
login - logout AS loginTime
FROM
(
SELECT
user_id,
sum(
unix_timestamp( t1.create_date )) AS login
FROM
opr_mem_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, interval 1 day ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND opr_type = "登出"
AND result = 1
GROUP BY
user_id
) t3
LEFT JOIN (
SELECT
user_id,
sum(
unix_timestamp( t1.create_date )) AS logout
FROM
opr_mem_dict t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, interval 1 day ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND opr_type = "登录"
AND result = 1
GROUP BY
user_id
) t2 ON t3.user_id = t2.user_id
) t2 ON t2.user_id = t.member_id
left join class_dict t5 on t.class_id = t5.id
LEFT JOIN member t3 ON t.member_id = t3.id
LEFT JOIN (
SELECT
t1.class_id,
t1.member_id,
sum( t1.play_length ) AS learnTime,
sum( t1.play_length + t1.suspend_length ) AS playTime
FROM
vod_play_history t1
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, interval 1 day ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.delete_date IS NULL
AND t1.class_id = #{classId}
GROUP BY
t1.class_id,
t1.member_id
) t4 ON t.member_id = t4.member_id
WHERE
t.delete_date IS NULL
AND t3.delete_date IS NULL
AND t.class_id = #{classId}
AND t2.loginTime IS NOT NULL
</select>
......@@ -257,7 +198,6 @@
<select id="dailyStudyRecords" resultType="com.subsidy.dto.renshe.ChapterList3">
SELECT
t2.id as chapterCode,
t.play_length AS chapterTime,
t.suspend_length AS pauseTime,
unix_timestamp(subdate( t.create_date, INTERVAL (t.play_length+t.suspend_length)SECOND ))*1000 AS startTime,
unix_timestamp(t.create_date)*1000 AS endTime
......@@ -354,10 +294,10 @@
SELECT
t1.id,
t1.ask_id,
t2.id AS downCode,
t2.class_code AS downCode,
t3.id_card AS identity,
UNIX_TIMESTAMP( t1.create_date )*1000 AS answer,
UNIX_TIMESTAMP( t1.update_date )*1000 AS question
UNIX_TIMESTAMP( t1.create_date )*1000 AS question,
UNIX_TIMESTAMP( t1.update_date )*1000 AS answer
FROM
answering_question t1
LEFT JOIN class_dict t2 ON t1.class_id = t2.id
......@@ -386,7 +326,6 @@
<if test="classType != null and classType != ''">
and t2.class_type = #{classType}
</if>
</select>
<select id="classImageChecks" parameterType="long" resultType="com.subsidy.vo.renshe.ClassImageChecksVO">
......@@ -549,4 +488,5 @@
AND t.delete_date IS NULL
</select>
</mapper>
......@@ -2,23 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.RenshejuHistoryMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.RenshejuHistoryDO">
<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="interface_name" property="interfaceName" />
<result column="input_param" property="inputParam" />
<result column="output_param" property="outputParam" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, interface_name, input_param, output_param
</sql>
<select id="dailyData" parameterType="string" resultType="com.subsidy.model.RenshejuHistoryDO">
SELECT
*
FROM
rensheju_history t
WHERE
t.delete_date IS NULL
AND DATE_FORMAT( t.create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
AND t.interface_name = #{post}
</select>
<select id="dailyDatas" parameterType="string" resultType="com.subsidy.model.RenshejuHistoryDO">
SELECT
*
FROM
rensheju_history t
WHERE
t.delete_date IS NULL
AND DATE_FORMAT( t.create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
AND t.interface_name = #{post}
</select>
</mapper>
......@@ -6,7 +6,7 @@ setParent=com.subsidy
# mapper.xml文件生成路径
mapperPath=/src/main/resources/mapper/
# 数据库地址
url=jdbc:mysql://116.62.57.92:3306/subsidy_test?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
url=jdbc:mysql://139.224.253.21:3306/subsidy?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
driverName=com.mysql.cj.jdbc.Driver
userName=devloper
password=dev@1553$
\ No newline at end of file
userName=root
password=ykhladmin302
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!