imageClassIds(String classType);
+
}
diff --git a/src/main/java/com/subsidy/mapper/RenshejuHistoryMapper.java b/src/main/java/com/subsidy/mapper/RenshejuHistoryMapper.java
index d71c37f..54dac41 100644
--- a/src/main/java/com/subsidy/mapper/RenshejuHistoryMapper.java
+++ b/src/main/java/com/subsidy/mapper/RenshejuHistoryMapper.java
@@ -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;
+
/**
*
* 人社局推送失败记录表 Mapper 接口
@@ -12,7 +14,18 @@ import org.springframework.stereotype.Repository;
* @author Tuyp
* @since 2023-02-07
*/
- @Repository
+@Repository
public interface RenshejuHistoryMapper extends BaseMapper {
+ /**
+ * 查找当天推出去的数据 POST456
+ */
+ RenshejuHistoryDO dailyData(String post);
+
+ /**
+ * 人脸有多个
+ */
+ List dailyDatas(String post);
+
+
}
diff --git a/src/main/java/com/subsidy/model/PushAnsweringDataDO.java b/src/main/java/com/subsidy/model/PushAnsweringDataDO.java
new file mode 100644
index 0000000..761f7f8
--- /dev/null
+++ b/src/main/java/com/subsidy/model/PushAnsweringDataDO.java
@@ -0,0 +1,54 @@
+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;
+
+/**
+ *
+ * 问题答疑表
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/model/PushDetectionDataDO.java b/src/main/java/com/subsidy/model/PushDetectionDataDO.java
new file mode 100644
index 0000000..de0016e
--- /dev/null
+++ b/src/main/java/com/subsidy/model/PushDetectionDataDO.java
@@ -0,0 +1,61 @@
+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;
+
+/**
+ *
+ * 活跃度检测表
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/model/PushExerciseDataDO.java b/src/main/java/com/subsidy/model/PushExerciseDataDO.java
new file mode 100644
index 0000000..a088e12
--- /dev/null
+++ b/src/main/java/com/subsidy/model/PushExerciseDataDO.java
@@ -0,0 +1,68 @@
+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;
+
+/**
+ *
+ * 学生课程习题完成情况
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/model/PushImageDataDO.java b/src/main/java/com/subsidy/model/PushImageDataDO.java
new file mode 100644
index 0000000..7102d7a
--- /dev/null
+++ b/src/main/java/com/subsidy/model/PushImageDataDO.java
@@ -0,0 +1,90 @@
+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;
+
+/**
+ *
+ * 人脸识别记录表
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/model/PushOprDataDO.java b/src/main/java/com/subsidy/model/PushOprDataDO.java
new file mode 100644
index 0000000..f5e406c
--- /dev/null
+++ b/src/main/java/com/subsidy/model/PushOprDataDO.java
@@ -0,0 +1,49 @@
+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;
+
+/**
+ *
+ * 审计表
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/model/PushVodDataDO.java b/src/main/java/com/subsidy/model/PushVodDataDO.java
new file mode 100644
index 0000000..2ad19e7
--- /dev/null
+++ b/src/main/java/com/subsidy/model/PushVodDataDO.java
@@ -0,0 +1,64 @@
+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;
+
+/**
+ *
+ * 视频播放历史记录表
+ *
+ *
+ * @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;
+
+
+}
diff --git a/src/main/java/com/subsidy/service/PushDataService.java b/src/main/java/com/subsidy/service/PushDataService.java
new file mode 100644
index 0000000..8ba4a96
--- /dev/null
+++ b/src/main/java/com/subsidy/service/PushDataService.java
@@ -0,0 +1,28 @@
+package com.subsidy.service;
+
+import com.subsidy.model.PushAnsweringDataDO;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ *
+ * 问题答疑表 服务类
+ *
+ *
+ * @author Tuyp
+ * @since 2023-12-01
+ */
+public interface PushDataService extends IService {
+
+ void post4();
+
+ void post5();
+
+ void post6();
+
+ void post7();
+
+ HashMap> check();
+}
diff --git a/src/main/java/com/subsidy/service/RenSheJuService.java b/src/main/java/com/subsidy/service/RenSheJuService.java
index 8e00e96..a21e4a8 100644
--- a/src/main/java/com/subsidy/service/RenSheJuService.java
+++ b/src/main/java/com/subsidy/service/RenSheJuService.java
@@ -20,8 +20,6 @@ public interface RenSheJuService {
RensheResponseVO getClassCodeByPrivateKey()throws IOException;
- RensheResponseVO uploadClassCode()throws IOException;
-
RensheResponseVO getErrorClass()throws IOException;
RensheStringVO clear()throws IOException;
diff --git a/src/main/java/com/subsidy/service/VodPlayHistoryService.java b/src/main/java/com/subsidy/service/VodPlayHistoryService.java
index debe16b..acefce3 100644
--- a/src/main/java/com/subsidy/service/VodPlayHistoryService.java
+++ b/src/main/java/com/subsidy/service/VodPlayHistoryService.java
@@ -23,9 +23,9 @@ import java.util.List;
*/
public interface VodPlayHistoryService extends IService {
- 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);
diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
index 0029f4b..336ab60 100644
--- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
@@ -305,6 +305,11 @@ public class AdministerServiceImpl extends ServiceImpl chapterLists = renSheJuMapper.classChapters(classId);
+ List chapterLists = dudaoMapper.classChapters(classId);
ChapterList2 chapterList2 = chapterLists.get(chapterLists.size() - 1);
chapterList2.setIsExam(1);
epidemicSituationClassBasic.setChapterList(chapterLists);
//学员列表
- List memberVOS = renSheJuMapper.classMembers(classId);
+ List memberVOS = dudaoMapper.classMembers(classId);
epidemicSituationClassBasic.setStudentList(memberVOS);
epidemicSituationClassBasics.add(epidemicSituationClassBasic);
@@ -182,21 +182,21 @@ public class DudaoServiceImpl implements DudaoService {
for (Long classId : vodClassIds){
//产生数据的班级
- List dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo(classId);
+ List 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 loginRecords = renSheJuMapper.loginRecords(dailyStudyInfoVO.getMemberId());
+ List loginRecords = dudaoMapper.loginRecords(dailyStudyInfoVO.getMemberId());
//下线时间
- List loginOutRecords = renSheJuMapper.loginOutRecords(dailyStudyInfoVO.getMemberId());
+ List loginOutRecords = dudaoMapper.loginOutRecords(dailyStudyInfoVO.getMemberId());
List 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 chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
+ List 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 activityLists = new ArrayList<>();
- List activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getDownCode(), dailyStudyInfoVO.getMemberId());
+ List 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 memberDOList = renSheJuMapper.memberIds(classId);
+ List 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 activityLists = new ArrayList<>();
- List activityDetectionDOS = renSheJuMapper.examActivities(classId, memberDO.getId());
+ List activityDetectionDOS = dudaoMapper.examActivities(classId, memberDO.getId());
for (ExamActivitiesVO dailyActivitiesVO : activityDetectionDOS) {
ActivityList activityList = new ActivityList();
@@ -352,31 +354,31 @@ public class DudaoServiceImpl implements DudaoService {
List examLists = new ArrayList<>();
//上线时间
- List loginRecords = renSheJuMapper.loginRecords(memberDO.getId());
+ List loginRecords = dudaoMapper.loginRecords(memberDO.getId());
//下线时间
- List loginOutRecords = renSheJuMapper.loginOutRecords(memberDO.getId());
+ List loginOutRecords = dudaoMapper.loginOutRecords(memberDO.getId());
- boolean flag = false;
+// boolean flag = false;
for (int i = 0; i < loginRecords.size(); i++) {
//找到该时间段内的测评
- List exerciseDoneResultDOS = renSheJuMapper.dailyExerciseDone(memberDO.getId(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "), classId);
+ List 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);
diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
index 823e2ab..9b01dfa 100644
--- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
@@ -953,27 +953,17 @@ public class MemberServiceImpl extends ServiceImpl imple
public String checkTimes(ExerciseDoneResultDO exerciseDoneResultDO) {
- MemberDO memberDO = this.baseMapper.selectById(exerciseDoneResultDO.getMemberId());
- ClassHourDictDO classHourDictDO = classHourDictMapper.selectOne(new QueryWrapper()
+ //查看这个人这个卷子做了几次
+ Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper()
.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()
- .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;
}
diff --git a/src/main/java/com/subsidy/service/impl/PushDataServiceImpl.java b/src/main/java/com/subsidy/service/impl/PushDataServiceImpl.java
new file mode 100644
index 0000000..cc61257
--- /dev/null
+++ b/src/main/java/com/subsidy/service/impl/PushDataServiceImpl.java
@@ -0,0 +1,226 @@
+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;
+
+/**
+ *
+ * 问题答疑表 服务实现类
+ *
+ *
+ * @author Tuyp
+ * @since 2023-12-01
+ */
+@Service
+public class PushDataServiceImpl extends ServiceImpl 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 classHourBasics = classHourBehaviorDTO.getClassHourBasic();
+ for (ClassHourBasic chb : classHourBasics) {
+ MemberDO memberDO = memberMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(MemberDO::getIdCard, chb.getIdentity())
+ );
+ ClassDictDO classDictDO = classDictMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(ClassDictDO::getClassCode, chb.getClassCode()));
+
+ List 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 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 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 chapterExamBasics = uploadChapterBehaviorDTO.getChapterExamBasic();
+ for (ChapterExamBasic ceb : chapterExamBasics) {
+
+ MemberDO memberDO = memberMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(MemberDO::getIdCard, ceb.getIdentity())
+ );
+ ClassDictDO classDictDO = classDictMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(ClassDictDO::getClassCode, ceb.getClassCode()));
+
+ //考试活跃度 学时里已经推过全部的活跃度了
+// List activityLists = ceb.getActivityList();
+// for (ActivityList activityList : activityLists) {
+// pushDetectionDataMapper.insertData(classDictDO.getId(), activityList.getActivityDetection(), memberDO.getId(), new Date(activityList.getActivityTime()));
+// }
+
+ //考试表
+ List 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 answerBasics = uploadClassAnswerQuestionBehaviorDTO.getAnswerBasic();
+ for (AnswerBasic ab : answerBasics) {
+
+ ClassDictDO classDictDO = classDictMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(ClassDictDO::getClassCode, ab.getClassCode()));
+
+ MemberDO memberDO = memberMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(MemberDO::getIdCard, ab.getIdentity())
+ );
+ List 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 renshejuHistoryDOS = renshejuHistoryMapper.dailyDatas(RenSheJuConstant.POST_7);
+// List longs = new ArrayList();
+// longs.add(5370L);
+// longs.add(5372L);
+// longs.add(5373L);
+// longs.add(5376L);
+// longs.add(5377L);
+// List renshejuHistoryDOS = renshejuHistoryMapper.selectList(new QueryWrapper()
+// .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()
+ .lambda()
+ .eq(ClassDictDO::getClassCode, uploadImageDTO.getClassCode()));
+
+ List imageDetailList = uploadImageDTO.getImageDetailList();
+ for (ImageDetailList idl : imageDetailList) {
+ MemberDO memberDO = memberMapper.selectOne(new QueryWrapper()
+ .lambda()
+ .eq(MemberDO::getIdCard, idl.getIdentity())
+ );
+ pushImageDataMapper.pushImageData(classDictDO.getId(), idl.getDetectionType(), memberDO.getId(), idl.getProcessType(), new Date(idl.getActivityTime()));
+ }
+ }
+ }
+
+ public HashMap> check(){
+
+ HashMap> hashMap = new HashMap();
+
+ //视频
+ List vodList = pushVodDataMapper.vodIds();
+ hashMap.put("视频",vodList);
+
+ //答疑
+ List answerList = pushAnsweringDataMapper.answerList();
+ hashMap.put("答疑",answerList);
+
+ //考试
+ List examList = pushExerciseDataMapper.examList();
+ hashMap.put("考试",examList);
+
+ //活跃度
+ List activityList = pushDetectionDataMapper.activityList();
+ hashMap.put("活跃度",activityList);
+
+ //人脸
+ List imageList = pushImageDataMapper.imageList();
+ hashMap.put("人脸",imageList);
+
+ return hashMap;
+ }
+}
diff --git a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
index edbabeb..923359f 100644
--- a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
@@ -43,9 +43,6 @@ public class RenSheJuServiceImpl implements RenSheJuService {
@Autowired
private ImageCheckRecordMapper imageCheckRecordMapper;
- @Autowired
- private SMSUtils smsUtils;
-
public RensheResponseVO classBaseInfo() throws IOException {
OkHttpClient client = new OkHttpClient().newBuilder()
@@ -87,7 +84,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
//班级基本信息
ClassBaseInfoVO classBaseInfoVO = renSheJuMapper.classBaseInfo(classId);
BeanUtils.copyProperties(classBaseInfoVO, epidemicSituationClassBasic);
- epidemicSituationClassBasic.setDownCode(classBaseInfoVO.getDownCode());
+ epidemicSituationClassBasic.setClassCode(classBaseInfoVO.getDownCode());
//章节
List chapterLists = renSheJuMapper.classChapters(classId);
@@ -116,7 +113,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString());
if (200 == response.code()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
@@ -128,7 +125,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
// return null;
} else {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.NO_DATA);
renshejuHistoryMapper.insert(renshejuHistoryDO);
@@ -138,7 +135,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
} catch (Exception e) {
e.printStackTrace();
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
@@ -168,6 +165,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
List result = new ArrayList<>();
// List vodClassIds = new ArrayList<>();
+// vodClassIds.add(477L);
try {
for (Long classId : vodClassIds) {
@@ -178,7 +176,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
for (DailyStudyInfoVO dailyStudyInfoVO : result) {
ClassHourBasic classHourBasic = new ClassHourBasic();
BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic);
- classHourBasic.setDownCode(dailyStudyInfoVO.getDownCode());
+ classHourBasic.setClassCode(dailyStudyInfoVO.getDownCode());
//找到当天每次上线下线时间
//上线时间
@@ -194,7 +192,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime());
//查看这个人该时间段的学习记录
- List chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "));
+ List chapterList3s = renSheJuMapper.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);
@@ -204,16 +202,10 @@ public class RenSheJuServiceImpl implements RenSheJuService {
//活跃度列表
List activityLists = new ArrayList<>();
- List activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getDownCode(), dailyStudyInfoVO.getMemberId());
+ List activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getClassId(), dailyStudyInfoVO.getMemberId());
for (DailyActivitiesVO dailyActivitiesVO : activityDetectionDOS) {
ActivityList activityList = new ActivityList();
- if (null == dailyActivitiesVO.getAccess() || 0 == dailyActivitiesVO.getAccess()) {
- activityList.setAccess(1);
- activityList.setErrorInfo(2);
- } else {
- activityList.setAccess(0);
- }
if (0 == dailyActivitiesVO.getCheckType()) {
activityList.setActivityDetection(2);
@@ -243,7 +235,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
if (200 == response.code()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
@@ -252,10 +244,9 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
renshejuHistoryMapper.insert(renshejuHistoryDO);
return rensheResponseVO;
-// return null;
} else {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.NO_DATA);
renshejuHistoryMapper.insert(renshejuHistoryDO);
@@ -264,7 +255,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
} catch (Exception e) {
e.printStackTrace();
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
@@ -292,18 +283,21 @@ public class RenSheJuServiceImpl implements RenSheJuService {
//找出前一天产生考试数据的班级
List classIds = renSheJuMapper.dailyExamBasic("0");
+// List classIds = new ArrayList<>();
+// classIds.add(439L);
+
try {
if (classIds.size() > 0) {
for (Long classId : classIds) {
//具体哪些人做了
List memberDOList = renSheJuMapper.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);
@@ -323,12 +317,6 @@ public class RenSheJuServiceImpl implements RenSheJuService {
for (ExamActivitiesVO dailyActivitiesVO : activityDetectionDOS) {
ActivityList activityList = new ActivityList();
- if (null == dailyActivitiesVO.getAccess() || 0 == dailyActivitiesVO.getAccess()) {
- activityList.setAccess(1);
- activityList.setErrorInfo(1);
- } else {
- activityList.setAccess(0);
- }
activityList.setActivityDetection(1);
activityList.setActivityTime(dailyActivitiesVO.getActivityTime());
activityLists.add(activityList);
@@ -342,8 +330,6 @@ public class RenSheJuServiceImpl implements RenSheJuService {
//下线时间
List loginOutRecords = renSheJuMapper.loginOutRecords(memberDO.getId());
- boolean flag = false;
-
for (int i = 0; i < loginRecords.size(); i++) {
//找到该时间段内的测评
List exerciseDoneResultDOS = renSheJuMapper.dailyExerciseDone(memberDO.getId(), loginRecords.get(i).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " "), classId);
@@ -352,17 +338,10 @@ public class RenSheJuServiceImpl implements RenSheJuService {
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;
- }
examLists.add(examList);
}
}
- if (flag == true) {
- chapterExamBasic.setAccess(0L);
- } else {
- chapterExamBasic.setAccess(1L);
- }
+
chapterExamBasic.setExamList(examLists);
chapterExamBasics.add(chapterExamBasic);
}
@@ -384,7 +363,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
System.out.println(rensheResponseVO);
if (200 == response.code()) {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_5);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString());
if (200 == response.code()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
@@ -396,7 +375,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
return rensheResponseVO;
} else {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_5);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.NO_DATA);
renshejuHistoryMapper.insert(renshejuHistoryDO);
@@ -404,7 +383,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
} catch (Exception e) {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_5);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
@@ -430,9 +409,6 @@ public class RenSheJuServiceImpl implements RenSheJuService {
List dailyAnswerVOS = renSheJuMapper.dailyAnswer("0");
-// List dailyAnswerVOS = new ArrayList<>();
-
-
try {
if (dailyAnswerVOS.size() > 0) {
HashMap> hashMap = new HashMap<>();
@@ -461,7 +437,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
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);
@@ -480,7 +456,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_5);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_6);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString());
if (200 == response.code()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
@@ -492,7 +468,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
return rensheResponseVO;
} else {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_5);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_6);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.NO_DATA);
renshejuHistoryMapper.insert(renshejuHistoryDO);
@@ -500,7 +476,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
} catch (Exception e) {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_5);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_6);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
@@ -527,7 +503,8 @@ public class RenSheJuServiceImpl implements RenSheJuService {
UploadImageDTO uploadImage = new UploadImageDTO();
uploadImage.setPrivateKey(getSecret());
- uploadImage.setDownCode(String.valueOf(classId));
+ ClassDictDO classDictDO = classDictMapper.selectById(classId);
+ uploadImage.setClassCode(classDictDO.getClassCode());
List imageDetailLists = new ArrayList();
try {
@@ -591,7 +568,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_6);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_7);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString());
if (null != rensheResponseVO.getCtt()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
@@ -602,7 +579,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
rensheResponseVOS.add(rensheResponseVO);
} else {
RenshejuHistoryDO renshejuHistoryDO1 = new RenshejuHistoryDO();
- renshejuHistoryDO1.setInterfaceName(RenSheJuConstant.POST_6);
+ renshejuHistoryDO1.setInterfaceName(RenSheJuConstant.POST_7);
renshejuHistoryDO1.setInputParam(JSONObject.fromObject(uploadImage).toString());
renshejuHistoryDO1.setOutputParam(RenSheJuConstant.NO_DATA);
renshejuHistoryMapper.insert(renshejuHistoryDO1);
@@ -611,7 +588,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
} catch (Exception e) {
e.printStackTrace();
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_6);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_7);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
@@ -643,7 +620,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_7);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_8);
renshejuHistoryDO.setInputParam(getSecret());
if (200 == response.code()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
@@ -655,7 +632,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
} catch (Exception e) {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_7);
+ renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_8);
renshejuHistoryDO.setInputParam(getSecret());
renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
renshejuHistoryMapper.insert(renshejuHistoryDO);
@@ -664,67 +641,6 @@ public class RenSheJuServiceImpl implements RenSheJuService {
}
- public RensheResponseVO uploadClassCode() throws IOException {
-
- OkHttpClient client = new OkHttpClient().newBuilder()
- .build();
- MediaType mediaType = MediaType.parse("application/json");
-
- UploadClassCodeDTO uploadClassCodeDTO = new UploadClassCodeDTO();
-
- uploadClassCodeDTO.setPrivateKey(getSecret());
-
- //所有班级
- List classIds = renSheJuMapper.newClasses("0");
-
- List classCodeBasics = new ArrayList();
- for (Long classId : classIds) {
- ClassCodeBasic classCodeBasic = new ClassCodeBasic();
- ClassDictDO classDictDO = classDictMapper.selectById(classId);
- classCodeBasic.setDownCode(String.valueOf(classDictDO.getId()));
- classCodeBasic.setClassCode(classDictDO.getClassCode());
- classCodeBasics.add(classCodeBasic);
- }
- uploadClassCodeDTO.setClassCodeBasic(classCodeBasics);
-
- System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadClassCodeDTO));
- try {
- RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadClassCodeDTO).toString());
- Request request = new Request.Builder()
- .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassCode")
- .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);
- System.out.println(rensheResponseVO);
-
- RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_8);
- renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassCodeDTO).toString());
- if (200 == response.code()) {
- if (null != rensheResponseVO.getCtt()) {
- renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
- } else {
- renshejuHistoryDO.setOutputParam(response.body().toString());
- }
- } else {
- renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR);
- }
- renshejuHistoryMapper.insert(renshejuHistoryDO);
- return rensheResponseVO;
-// return null;
- } catch (Exception e) {
- RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
- renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_8);
- renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassCodeDTO).toString());
- renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL);
- renshejuHistoryMapper.insert(renshejuHistoryDO);
- }
- return null;
- }
-
public RensheResponseVO getErrorClass() throws IOException {
OkHttpClient client = new OkHttpClient().newBuilder()
diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
index a34e104..0997f66 100644
--- a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
+++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
@@ -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()
.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()
.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);
diff --git a/src/main/java/com/subsidy/util/RenSheJuConstant.java b/src/main/java/com/subsidy/util/RenSheJuConstant.java
index 6ad1e17..8e16e6d 100644
--- a/src/main/java/com/subsidy/util/RenSheJuConstant.java
+++ b/src/main/java/com/subsidy/util/RenSheJuConstant.java
@@ -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 获取推送失败班级列表
diff --git a/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java b/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java
index 39fc8cc..9c50ed2 100644
--- a/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java
+++ b/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java
@@ -17,5 +17,9 @@ public class AdministerPermissionVO {
private Boolean isRole;
+ private String companyName;
+
+ private String shortName;
+
private List permissions;
}
diff --git a/src/main/java/com/subsidy/vo/renshe/ClassBaseInfoVO.java b/src/main/java/com/subsidy/vo/renshe/ClassBaseInfoVO.java
index 5f0e434..eecc3ba 100644
--- a/src/main/java/com/subsidy/vo/renshe/ClassBaseInfoVO.java
+++ b/src/main/java/com/subsidy/vo/renshe/ClassBaseInfoVO.java
@@ -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;
-
}
diff --git a/src/main/java/com/subsidy/vo/renshe/DailyStudyInfoVO.java b/src/main/java/com/subsidy/vo/renshe/DailyStudyInfoVO.java
index eb488d3..afe49d5 100644
--- a/src/main/java/com/subsidy/vo/renshe/DailyStudyInfoVO.java
+++ b/src/main/java/com/subsidy/vo/renshe/DailyStudyInfoVO.java
@@ -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;
+
/**
* 学员姓名
*/
diff --git a/src/main/resources/mapper/DudaoMapper.xml b/src/main/resources/mapper/DudaoMapper.xml
index 7125819..c491f72 100644
--- a/src/main/resources/mapper/DudaoMapper.xml
+++ b/src/main/resources/mapper/DudaoMapper.xml
@@ -224,4 +224,290 @@
and t3.area_name = '普陀'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/mapper/PushAnsweringDataMapper.xml b/src/main/resources/mapper/PushAnsweringDataMapper.xml
new file mode 100644
index 0000000..8c19fa7
--- /dev/null
+++ b/src/main/resources/mapper/PushAnsweringDataMapper.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/mapper/PushDetectionDataMapper.xml b/src/main/resources/mapper/PushDetectionDataMapper.xml
new file mode 100644
index 0000000..1855ca0
--- /dev/null
+++ b/src/main/resources/mapper/PushDetectionDataMapper.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/mapper/PushExerciseDataMapper.xml b/src/main/resources/mapper/PushExerciseDataMapper.xml
new file mode 100644
index 0000000..7cd5676
--- /dev/null
+++ b/src/main/resources/mapper/PushExerciseDataMapper.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/mapper/PushImageDataMapper.xml b/src/main/resources/mapper/PushImageDataMapper.xml
new file mode 100644
index 0000000..bbc542d
--- /dev/null
+++ b/src/main/resources/mapper/PushImageDataMapper.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/mapper/PushOprDataMapper.xml b/src/main/resources/mapper/PushOprDataMapper.xml
new file mode 100644
index 0000000..f495d3f
--- /dev/null
+++ b/src/main/resources/mapper/PushOprDataMapper.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
diff --git a/src/main/resources/mapper/PushVodDataMapper.xml b/src/main/resources/mapper/PushVodDataMapper.xml
new file mode 100644
index 0000000..7bc16ea
--- /dev/null
+++ b/src/main/resources/mapper/PushVodDataMapper.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ 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})
+
+
+
+
+
diff --git a/src/main/resources/mapper/RenSheJuMapper.xml b/src/main/resources/mapper/RenSheJuMapper.xml
index 735cdca..85278ac 100644
--- a/src/main/resources/mapper/RenSheJuMapper.xml
+++ b/src/main/resources/mapper/RenSheJuMapper.xml
@@ -4,16 +4,11 @@