diff --git a/pom.xml b/pom.xml index 0daf981..1dcdf9d 100644 --- a/pom.xml +++ b/pom.xml @@ -266,6 +266,12 @@ okio 1.13.0 + + + com.google.code.gson + gson + 2.8.6 + diff --git a/src/main/java/com/subsidy/controller/PushDataController.java b/src/main/java/com/subsidy/controller/PushDataController.java new file mode 100644 index 0000000..be4e624 --- /dev/null +++ b/src/main/java/com/subsidy/controller/PushDataController.java @@ -0,0 +1,62 @@ +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; + +/** + *

+ * 问题答疑表 前端控制器 + *

+ * + * @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()); + } + +} diff --git a/src/main/java/com/subsidy/controller/RenSheJuController.java b/src/main/java/com/subsidy/controller/RenSheJuController.java index 7e7b743..fc1d0ad 100644 --- a/src/main/java/com/subsidy/controller/RenSheJuController.java +++ b/src/main/java/com/subsidy/controller/RenSheJuController.java @@ -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 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(); } diff --git a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java index cee9a3c..cc0fc42 100644 --- a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java +++ b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java @@ -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)); } diff --git a/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java b/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java index 3612d04..d700767 100644 --- a/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java +++ b/src/main/java/com/subsidy/dto/exercise/GetPaperExerciseDTO.java @@ -17,4 +17,5 @@ public class GetPaperExerciseDTO { private String title; + private Long userId; } diff --git a/src/main/java/com/subsidy/dto/renshe/AnswerBasic.java b/src/main/java/com/subsidy/dto/renshe/AnswerBasic.java index 2b2b177..550abe9 100644 --- a/src/main/java/com/subsidy/dto/renshe/AnswerBasic.java +++ b/src/main/java/com/subsidy/dto/renshe/AnswerBasic.java @@ -11,7 +11,7 @@ public class AnswerBasic { * 答疑辅导,提问和回答都存在值时才进行传递 */ private List answerAndQuestionList; - private String downCode; + private String classCode; private String identity; diff --git a/src/main/java/com/subsidy/dto/renshe/ChapterExamBasic.java b/src/main/java/com/subsidy/dto/renshe/ChapterExamBasic.java index 1dba752..1509a1f 100644 --- a/src/main/java/com/subsidy/dto/renshe/ChapterExamBasic.java +++ b/src/main/java/com/subsidy/dto/renshe/ChapterExamBasic.java @@ -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; /** * 章节(课程)考试时间列表,【数组】 */ diff --git a/src/main/java/com/subsidy/dto/renshe/ChapterList3.java b/src/main/java/com/subsidy/dto/renshe/ChapterList3.java index 511ed4a..546394a 100644 --- a/src/main/java/com/subsidy/dto/renshe/ChapterList3.java +++ b/src/main/java/com/subsidy/dto/renshe/ChapterList3.java @@ -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; } diff --git a/src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java b/src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java index 8335ec0..fdfb26a 100644 --- a/src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java +++ b/src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java @@ -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; diff --git a/src/main/java/com/subsidy/dto/renshe/EpidemicSituationClassBasic.java b/src/main/java/com/subsidy/dto/renshe/EpidemicSituationClassBasic.java index f51cd96..6e7392c 100644 --- a/src/main/java/com/subsidy/dto/renshe/EpidemicSituationClassBasic.java +++ b/src/main/java/com/subsidy/dto/renshe/EpidemicSituationClassBasic.java @@ -8,28 +8,16 @@ import java.util.List; @Data public class EpidemicSituationClassBasic { - private String areaName; - private List 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 studentList; - private String trainingCode; - - private String trainingName; - } diff --git a/src/main/java/com/subsidy/dto/renshe/UploadImageDTO.java b/src/main/java/com/subsidy/dto/renshe/UploadImageDTO.java index c0b96dc..84b7bf4 100644 --- a/src/main/java/com/subsidy/dto/renshe/UploadImageDTO.java +++ b/src/main/java/com/subsidy/dto/renshe/UploadImageDTO.java @@ -10,7 +10,7 @@ public class UploadImageDTO { /** * 临时班级(项目)编码 */ - private String downCode; + private String classCode; /** * 活跃度照片列表,【数组】 */ diff --git a/src/main/java/com/subsidy/jobs/PushJob.java b/src/main/java/com/subsidy/jobs/PushJob.java new file mode 100644 index 0000000..668bcc5 --- /dev/null +++ b/src/main/java/com/subsidy/jobs/PushJob.java @@ -0,0 +1,64 @@ +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(); + } + } + +} diff --git a/src/main/java/com/subsidy/jobs/RenSheJuJob.java b/src/main/java/com/subsidy/jobs/RenSheJuJob.java index 530cb2b..c396f67 100644 --- a/src/main/java/com/subsidy/jobs/RenSheJuJob.java +++ b/src/main/java/com/subsidy/jobs/RenSheJuJob.java @@ -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 { }); } - /** * 补登录登出数据 */ diff --git a/src/main/java/com/subsidy/mapper/DudaoMapper.java b/src/main/java/com/subsidy/mapper/DudaoMapper.java index 84c3c0b..9d98311 100644 --- a/src/main/java/com/subsidy/mapper/DudaoMapper.java +++ b/src/main/java/com/subsidy/mapper/DudaoMapper.java @@ -1,7 +1,11 @@ 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 newClasses(String classType); + /** + * 查询班级基本信息 + */ + ClassBaseInfoVO classBaseInfo(Long classId); + + /** + * 课程下章节信息 + */ + List classChapters(Long classId); + /** + * 查询班级学员信息 + */ + List classMembers(Long classId); + /** + * 前一天新增视频学习数据 + */ + List dailyStudyInfo1(Long classId); + + /** + * 查看某人前一天上线的时间 + */ + List loginRecords(Long memberId); + + /** + * 查看某人前一天下线的时间 + */ + List loginOutRecords(Long memberId); + + /** + * 某个人某时间段的学习记录 + */ + List dailyStudyRecords(Long memberId, Long classId, String startDate, String endDate); + + /** + * 前一天活跃度检测列表 + */ + List dailyActivities(Long classId, Long memberId); + + /** + * 前一天做过考试通过数据 + */ + List memberIds(Long classId); + + /** + * 查找课程最后一个视频 + */ + String classVodName(Long classId); + + /** + * 查出考试时间 + */ + Long examLength(Long memberId,Long classId); + + /** + * 考试活跃度检测--人脸 + */ + List examActivities(Long classId,Long memberId); + + /** + * 找到某人某个时间段内的测评记录 + */ + List dailyExerciseDone(Long memberId, String startDate, String endDate, Long classId); } diff --git a/src/main/java/com/subsidy/mapper/PushAnsweringDataMapper.java b/src/main/java/com/subsidy/mapper/PushAnsweringDataMapper.java new file mode 100644 index 0000000..d6a911a --- /dev/null +++ b/src/main/java/com/subsidy/mapper/PushAnsweringDataMapper.java @@ -0,0 +1,25 @@ +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; + +/** + *

+ * 问题答疑表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2023-12-01 + */ +@Repository +public interface PushAnsweringDataMapper extends BaseMapper { + + void insertAnswerData(Long classId, Long userId, Date question,Date answer); + + List answerList(); + +} diff --git a/src/main/java/com/subsidy/mapper/PushDetectionDataMapper.java b/src/main/java/com/subsidy/mapper/PushDetectionDataMapper.java new file mode 100644 index 0000000..487cc0e --- /dev/null +++ b/src/main/java/com/subsidy/mapper/PushDetectionDataMapper.java @@ -0,0 +1,24 @@ +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; + +/** + *

+ * 活跃度检测表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2023-12-01 + */ + @Repository +public interface PushDetectionDataMapper extends BaseMapper { + + void insertData(Long classId, Integer checkType, Long memberId, Date createDate); + + List activityList(); +} diff --git a/src/main/java/com/subsidy/mapper/PushExerciseDataMapper.java b/src/main/java/com/subsidy/mapper/PushExerciseDataMapper.java new file mode 100644 index 0000000..361b7a4 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/PushExerciseDataMapper.java @@ -0,0 +1,24 @@ +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; + +/** + *

+ * 学生课程习题完成情况 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2023-12-01 + */ +@Repository +public interface PushExerciseDataMapper extends BaseMapper { + + void pushExamData(Long classId, Date startDate, Long memberId, Date createDate, Integer examTime); + + List examList(); +} diff --git a/src/main/java/com/subsidy/mapper/PushImageDataMapper.java b/src/main/java/com/subsidy/mapper/PushImageDataMapper.java new file mode 100644 index 0000000..46344fb --- /dev/null +++ b/src/main/java/com/subsidy/mapper/PushImageDataMapper.java @@ -0,0 +1,24 @@ +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; + +/** + *

+ * 人脸识别记录表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2023-12-01 + */ +@Repository +public interface PushImageDataMapper extends BaseMapper { + + void pushImageData(Long classId, Long detectionType, Long memberId, Long processType, Date activityTime); + + List imageList(); +} diff --git a/src/main/java/com/subsidy/mapper/PushOprDataMapper.java b/src/main/java/com/subsidy/mapper/PushOprDataMapper.java new file mode 100644 index 0000000..5015c1a --- /dev/null +++ b/src/main/java/com/subsidy/mapper/PushOprDataMapper.java @@ -0,0 +1,22 @@ +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; + +/** + *

+ * 审计表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2023-12-01 + */ +@Repository +public interface PushOprDataMapper extends BaseMapper { + + void insertData(Long userId, String opr, String ipAddress, Date createDate); + +} diff --git a/src/main/java/com/subsidy/mapper/PushVodDataMapper.java b/src/main/java/com/subsidy/mapper/PushVodDataMapper.java new file mode 100644 index 0000000..5773659 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/PushVodDataMapper.java @@ -0,0 +1,25 @@ +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; + +/** + *

+ * 视频播放历史记录表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2023-12-01 + */ +@Repository +public interface PushVodDataMapper extends BaseMapper { + + void insertData(Long classId, Long vodId, Long memberId, Integer playLength, Integer suspendLength, Integer playRecord, Date createDate, String ipAddress); + + + List vodIds(); +} diff --git a/src/main/java/com/subsidy/mapper/RenSheJuMapper.java b/src/main/java/com/subsidy/mapper/RenSheJuMapper.java index b11f288..59bebde 100644 --- a/src/main/java/com/subsidy/mapper/RenSheJuMapper.java +++ b/src/main/java/com/subsidy/mapper/RenSheJuMapper.java @@ -42,7 +42,7 @@ public interface RenSheJuMapper { /** * 前一天活跃度检测列表 */ - List dailyActivities(String classId, Long memberId); + List dailyActivities(Long classId, Long memberId); /** * 考试活跃度检测--人脸 @@ -67,7 +67,7 @@ public interface RenSheJuMapper { /** * 某个人某时间段的学习记录 */ - List dailyStudyRecords(Long memberId,String classId,String startDate, String endDate); + List dailyStudyRecords(Long memberId,Long classId,String startDate, String endDate); /** * 前一天考试通过数据 @@ -145,4 +145,5 @@ public interface RenSheJuMapper { */ List 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 @@ 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 @@ -257,7 +198,6 @@ + diff --git a/src/main/resources/mapper/RenshejuHistoryMapper.xml b/src/main/resources/mapper/RenshejuHistoryMapper.xml index 1095cf9..803f3c1 100644 --- a/src/main/resources/mapper/RenshejuHistoryMapper.xml +++ b/src/main/resources/mapper/RenshejuHistoryMapper.xml @@ -2,23 +2,25 @@ - - - - - - - - - - - - - - create_date, - update_date, - delete_date, - id, interface_name, input_param, output_param - + + diff --git a/src/main/resources/mybatis-plus.properties b/src/main/resources/mybatis-plus.properties index a1b3cbc..bb9710a 100644 --- a/src/main/resources/mybatis-plus.properties +++ b/src/main/resources/mybatis-plus.properties @@ -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