From 1177d0dffb54ecfc9a17e674afec374c63de5b9b Mon Sep 17 00:00:00 2001 From: tuyp Date: Wed, 8 Mar 2023 17:46:21 +0800 Subject: [PATCH] 15天数据全部推送备份 --- src/main/java/com/subsidy/controller/AdministerController.java | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------- src/main/java/com/subsidy/controller/RenSheJuController.java | 2 +- src/main/java/com/subsidy/controller/ShehuihuaController.java | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java | 32 ++++++++++++++++++-------------- src/main/java/com/subsidy/dto/renshe/UploadChapterBehaviorDTO.java | 1 + src/main/java/com/subsidy/dto/renshe/UploadClassAnswerQuestionBehaviorDTO.java | 1 + src/main/java/com/subsidy/dto/shehuihua/AnswerBasic6.java | 19 +++++++++++++++++++ src/main/java/com/subsidy/dto/shehuihua/ChapterExamBasic5.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/dto/shehuihua/ChapterList22.java | 12 ++++++++++++ src/main/java/com/subsidy/dto/shehuihua/ClassHourBasic4DTO.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/dto/shehuihua/ClassHourBehavior4DTO.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/dto/shehuihua/ClassInfoBasicDTO.java | 21 +++++++++++++++++++++ src/main/java/com/subsidy/dto/shehuihua/UploadChapterBehavior5DTO.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/dto/shehuihua/UploadClassAnswerQuestionBehavior6DTO.java | 14 ++++++++++++++ src/main/java/com/subsidy/dto/shehuihua/UploadClassDTO.java | 14 ++++++++++++++ src/main/java/com/subsidy/dto/shehuihua/UploadImageDTO7.java | 24 ++++++++++++++++++++++++ src/main/java/com/subsidy/jobs/RenSheJuJob.java | 232 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------- src/main/java/com/subsidy/jobs/ShehuihuaJob.java | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/RenSheJuMapper.java | 6 +++--- src/main/java/com/subsidy/model/ClassDictDO.java | 10 ++++++++++ src/main/java/com/subsidy/service/ShehuihuaService.java | 30 ++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java | 222 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------ src/main/java/com/subsidy/service/impl/ShehuihuaServiceImpl.java | 707 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/util/ShehuihuaConstant.java | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/RenSheJuMapper.xml | 40 +++++++++++++++++++++++++--------------- 25 files changed, 1532 insertions(+), 314 deletions(-) create mode 100644 src/main/java/com/subsidy/controller/ShehuihuaController.java create mode 100644 src/main/java/com/subsidy/dto/shehuihua/AnswerBasic6.java create mode 100644 src/main/java/com/subsidy/dto/shehuihua/ChapterExamBasic5.java create mode 100644 src/main/java/com/subsidy/dto/shehuihua/ChapterList22.java create mode 100644 src/main/java/com/subsidy/dto/shehuihua/ClassHourBasic4DTO.java create mode 100644 src/main/java/com/subsidy/dto/shehuihua/ClassHourBehavior4DTO.java create mode 100644 src/main/java/com/subsidy/dto/shehuihua/ClassInfoBasicDTO.java create mode 100644 src/main/java/com/subsidy/dto/shehuihua/UploadChapterBehavior5DTO.java create mode 100644 src/main/java/com/subsidy/dto/shehuihua/UploadClassAnswerQuestionBehavior6DTO.java create mode 100644 src/main/java/com/subsidy/dto/shehuihua/UploadClassDTO.java create mode 100644 src/main/java/com/subsidy/dto/shehuihua/UploadImageDTO7.java create mode 100644 src/main/java/com/subsidy/jobs/ShehuihuaJob.java create mode 100644 src/main/java/com/subsidy/service/ShehuihuaService.java create mode 100644 src/main/java/com/subsidy/service/impl/ShehuihuaServiceImpl.java create mode 100644 src/main/java/com/subsidy/util/ShehuihuaConstant.java diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index 74772dc..df1229f 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -47,11 +47,11 @@ public class AdministerController { @PostMapping("/login") @ApiOperation("登录接口 accountName password") - public ResponseVO login(@RequestBody AdministerDO administerDO){ - return ResponseData.generateCreatedResponse(0,administerService.login(administerDO)); + public ResponseVO login(@RequestBody AdministerDO administerDO) { + return ResponseData.generateCreatedResponse(0, administerService.login(administerDO)); } - @PostMapping("/getPermissions") + @PostMapping("/getPermissions") @ApiOperation("权限查询") @LoginRequired public ResponseVO getPermissions() { @@ -61,64 +61,64 @@ public class AdministerController { @PostMapping("/administers") @ApiOperation("查询所有运营者 { userName pageNum pageSize }") // @LoginRequired - public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){ - return ResponseData.generateCreatedResponse(0,administerService.operators(operatorsDTO)); + public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO) { + return ResponseData.generateCreatedResponse(0, administerService.operators(operatorsDTO)); } @PostMapping("addAdminister") @ApiOperation("添加运营者 id userName 名称 accountName 账号 ") @LoginRequired - public ResponseVO addAdminister(@RequestBody AdministerDO administerDO){ - return ResponseData.generateCreatedResponse(0,administerService.addAdminister(administerDO)); + public ResponseVO addAdminister(@RequestBody AdministerDO administerDO) { + return ResponseData.generateCreatedResponse(0, administerService.addAdminister(administerDO)); } @PostMapping("deleteAdminister") @ApiOperation("添加运营者 id ") @LoginRequired - public ResponseVO deleteAdminister(@RequestBody AdministerDO administerDO){ - return ResponseData.generateCreatedResponse(0,administerService.deleteAdminister(administerDO)); + public ResponseVO deleteAdminister(@RequestBody AdministerDO administerDO) { + return ResponseData.generateCreatedResponse(0, administerService.deleteAdminister(administerDO)); } @PostMapping("updateAdminister") @ApiOperation("编辑运营者 id userName 名称 accountName 账号 password") @LoginRequired - public ResponseVO updateAdminister(@RequestBody AdministerDO administerDO){ - return ResponseData.generateCreatedResponse(0,administerService.updateAdminister(administerDO)); + public ResponseVO updateAdminister(@RequestBody AdministerDO administerDO) { + return ResponseData.generateCreatedResponse(0, administerService.updateAdminister(administerDO)); } @PostMapping("classSummary") @ApiOperation("班级详情--数据概览 id 班级id ") // @LoginRequired - public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO){ - return ResponseData.generateCreatedResponse(0,administerService.classSummary(classDetailDTO)); + public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO) { + return ResponseData.generateCreatedResponse(0, administerService.classSummary(classDetailDTO)); } @PostMapping("classDetail") @ApiOperation("班级管理--班级成员 id 班级id userName pageSize pageNum") @LoginRequired - public ResponseVO classDetail(@RequestBody ClassDetailDTO classDetailDTO){ - return ResponseData.generateCreatedResponse(0,administerService.classDetail(classDetailDTO)); + public ResponseVO classDetail(@RequestBody ClassDetailDTO classDetailDTO) { + return ResponseData.generateCreatedResponse(0, administerService.classDetail(classDetailDTO)); } @PostMapping("exportClassDetail") @ApiOperation("班级管理--班级成员--导出 id 班级id userName") @LoginRequired - public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO) throws Exception { classDetailDTO.setFlag(true); - administerService.exportClassDetail(classDetailDTO); + administerService.exportClassDetail(classDetailDTO); } @PostMapping("signDetail") @ApiOperation("班级管理--注册签到 id 班级id userName pageSize pageNum") @LoginRequired - public ResponseVO signDetail(@RequestBody ClassDetailDTO classDetailDTO){ - return ResponseData.generateCreatedResponse(0,administerService.signDetail(classDetailDTO)); + public ResponseVO signDetail(@RequestBody ClassDetailDTO classDetailDTO) { + return ResponseData.generateCreatedResponse(0, administerService.signDetail(classDetailDTO)); } @PostMapping("exportSignDetail") @ApiOperation("班级管理--注册签到 id 班级id userName") @LoginRequired - public void exportSignDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + public void exportSignDetail(@RequestBody ClassDetailDTO classDetailDTO) throws Exception { classDetailDTO.setFlag(true); administerService.exportSignDetail(classDetailDTO); } @@ -126,14 +126,14 @@ public class AdministerController { @PostMapping("exerciseTest") @ApiOperation("班级管理--测评成绩 id 班级id userName paperId pageSize pageNum") @LoginRequired - public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){ - return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO)); + public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO) { + return ResponseData.generateCreatedResponse(0, administerService.exerciseTest(classDetailDTO)); } @PostMapping("exportExerciseTest") @ApiOperation("班级管理--测评成绩 id 班级id userName paperId") @LoginRequired - public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO) throws Exception { classDetailDTO.setFlag(true); administerService.exportExerciseTest(classDetailDTO); } @@ -141,28 +141,28 @@ public class AdministerController { @PostMapping("getMemberPapers") @ApiOperation("获取某个成员某个卷子的做题历史 memberId paperId") @LoginRequired - public ResponseVO getMemberPapers(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){ - return ResponseData.generateCreatedResponse(0,administerService.getMemberPapers(exerciseDoneResultDO)); + public ResponseVO getMemberPapers(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO) { + return ResponseData.generateCreatedResponse(0, administerService.getMemberPapers(exerciseDoneResultDO)); } @PostMapping("getPaperDetail") @ApiOperation("获取某个卷子做题详情 doneId getMemberPapers接口返回id memberId成员id") @LoginRequired - public ResponseVO getPaperDetail(@RequestBody ExerciseDoneHistoryDO exerciseDoneHistoryDO){ - return ResponseData.generateCreatedResponse(0,administerService.getPaperDetail(exerciseDoneHistoryDO)); + public ResponseVO getPaperDetail(@RequestBody ExerciseDoneHistoryDO exerciseDoneHistoryDO) { + return ResponseData.generateCreatedResponse(0, administerService.getPaperDetail(exerciseDoneHistoryDO)); } @PostMapping("answerRecord") @ApiOperation("班级管理--答疑 id 班级id userName") @LoginRequired - public ResponseVO answerRecord(@RequestBody ClassDetailDTO classDetailDTO){ - return ResponseData.generateCreatedResponse(0,administerService.answerRecord(classDetailDTO)); + public ResponseVO answerRecord(@RequestBody ClassDetailDTO classDetailDTO) { + return ResponseData.generateCreatedResponse(0, administerService.answerRecord(classDetailDTO)); } @PostMapping("exportAnswerRecord") @ApiOperation("班级管理--答疑 id 班级id userName") @LoginRequired - public void exportAnswerRecord(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + public void exportAnswerRecord(@RequestBody ClassDetailDTO classDetailDTO) throws Exception { classDetailDTO.setFlag(true); administerService.exportAnswerRecord(classDetailDTO); } @@ -170,112 +170,112 @@ public class AdministerController { @PostMapping("classVodInfo") @ApiOperation("学习记录---课件进度提醒 {courseId 课程id classId 班级id vodName视频名称}") @LoginRequired - public ResponseVO classVodInfo(@RequestBody ClassVodInfoDTO classVodInfoDTO){ - return ResponseData.generateCreatedResponse(0,administerService.classVodInfo(classVodInfoDTO)); + public ResponseVO classVodInfo(@RequestBody ClassVodInfoDTO classVodInfoDTO) { + return ResponseData.generateCreatedResponse(0, administerService.classVodInfo(classVodInfoDTO)); } @PostMapping("classDailyInfo") @ApiOperation("学习记录---每日学习时长 {courseId 课程id classId 班级id userName startDate endDate}") @LoginRequired - public ResponseVO classDailyInfo(@RequestBody ClassDailyInfoDTO classDailyInfoDTO){ - return ResponseData.generateCreatedResponse(0,administerService.classDailyInfo(classDailyInfoDTO)); + public ResponseVO classDailyInfo(@RequestBody ClassDailyInfoDTO classDailyInfoDTO) { + return ResponseData.generateCreatedResponse(0, administerService.classDailyInfo(classDailyInfoDTO)); } @PostMapping("exportClassDailyInfo") @ApiParam("每日学习日志") @LoginRequired - public void exportVodInfo(@RequestBody ClassDailyInfoDTO classDailyInfoDTO){ + public void exportVodInfo(@RequestBody ClassDailyInfoDTO classDailyInfoDTO) { administerService.exportClassDailyInfo(classDailyInfoDTO); } @PostMapping("classVodDailyInfo") @ApiOperation("学习记录---每日学习时长(视频维度)") @LoginRequired - public ResponseVO classVodDailyInfo(@RequestBody ClassVodDailyInfoDTO classVodDailyInfoDTO ){ - return ResponseData.generateCreatedResponse(0,administerService.classVodDailyInfo(classVodDailyInfoDTO)); + public ResponseVO classVodDailyInfo(@RequestBody ClassVodDailyInfoDTO classVodDailyInfoDTO) { + return ResponseData.generateCreatedResponse(0, administerService.classVodDailyInfo(classVodDailyInfoDTO)); } @PostMapping("exportClassVodDailyInfo") @ApiOperation("学习记录---每日学习时长(视频维度) pageSize pageNum userName classId") @LoginRequired - public void exportClassVodDailyInfo(@RequestBody ClassVodDailyInfoDTO classVodDailyInfoDTO ){ + public void exportClassVodDailyInfo(@RequestBody ClassVodDailyInfoDTO classVodDailyInfoDTO) { administerService.exportClassVodDailyInfo(classVodDailyInfoDTO); } @PostMapping("memberStudy") @ApiOperation("学员学习日志 pageSize pageNum classId memberId") @LoginRequired - public ResponseVO memberStudy(@RequestBody MemberStudyLogDTO memberStudyLogDTO){ - return ResponseData.generateCreatedResponse(0,administerService.memberStudy(memberStudyLogDTO)); + public ResponseVO memberStudy(@RequestBody MemberStudyLogDTO memberStudyLogDTO) { + return ResponseData.generateCreatedResponse(0, administerService.memberStudy(memberStudyLogDTO)); } @PostMapping("memberDetectionRecord") @ApiOperation("获取某个班级活跃度检测记录 id userName pageSize pageNum ") @LoginRequired - public ResponseVO memberDetectionRecord(@RequestBody ClassDetailDTO classDetailDTO ){ - return ResponseData.generateCreatedResponse(0,administerService.memberDetectionRecord(classDetailDTO)); + public ResponseVO memberDetectionRecord(@RequestBody ClassDetailDTO classDetailDTO) { + return ResponseData.generateCreatedResponse(0, administerService.memberDetectionRecord(classDetailDTO)); } @PostMapping("exportMemberDetectionRecord") @ApiOperation("获取某个班级活跃度检测记录 id userName ") @LoginRequired - public void exportMemberDetectionRecord(@RequestBody ClassDetailDTO classDetailDTO ){ - administerService.exportMemberDetectionRecord(classDetailDTO); + public void exportMemberDetectionRecord(@RequestBody ClassDetailDTO classDetailDTO) { + administerService.exportMemberDetectionRecord(classDetailDTO); } @PostMapping("imageCheckDetail") @ApiOperation("实名制验证详情 id 班级id userName pageSize pageNum") @LoginRequired - public ResponseVO imageCheckDetail(@RequestBody ClassDetailDTO classDetailDTO){ - return ResponseData.generateCreatedResponse(0,administerService.imageCheckDetail(classDetailDTO)); + public ResponseVO imageCheckDetail(@RequestBody ClassDetailDTO classDetailDTO) { + return ResponseData.generateCreatedResponse(0, administerService.imageCheckDetail(classDetailDTO)); } @PostMapping("getMemberCheckDetail") @ApiOperation("查看某个学生的验证详情 memberId 学员id classId") @LoginRequired - public ResponseVO getMemberCheckDetail(@RequestBody ImageCheckRecordDO imageCheckRecordDO){ - return ResponseData.generateCreatedResponse(0,administerService.getMemberCheckDetail(imageCheckRecordDO)); + public ResponseVO getMemberCheckDetail(@RequestBody ImageCheckRecordDO imageCheckRecordDO) { + return ResponseData.generateCreatedResponse(0, administerService.getMemberCheckDetail(imageCheckRecordDO)); } @PostMapping("exportZip") @ApiOperation("下载压缩包 id 班级id") @CrossOrigin // @LoginRequired - public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + public void exportZip(@RequestBody ClassDetailDTO classDetailDTO) throws Exception { administerService.export(classDetailDTO); } @PostMapping("memberStudyLog") @ApiOperation("学员学习日志 classId memberId") @LoginRequired - public void memberStudyLog(@RequestBody MemberStudyLogDTO memberStudyLogDTO) throws Exception{ + public void memberStudyLog(@RequestBody MemberStudyLogDTO memberStudyLogDTO) throws Exception { administerService.memberStudyLog(memberStudyLogDTO); } @PostMapping("importMember") @ApiOperation("导入学生 {companyId 公司id file}") // @LoginRequired - public ResponseVO importMember(Long companyId,@RequestParam("file") MultipartFile file)throws Exception{ - return ResponseData.generateCreatedResponse(0,administerService.importMember(companyId,file)); + public ResponseVO importMember(Long companyId, @RequestParam("file") MultipartFile file) throws Exception { + return ResponseData.generateCreatedResponse(0, administerService.importMember(companyId, file)); } @PostMapping("manageMember") @ApiOperation("用户管理 {pageSize pageNum userName:名字 }") @LoginRequired - public ResponseVO manageMember(@RequestBody ManageMemberDTO manageMemberDTO){ - return ResponseData.generateCreatedResponse(0,administerService.manageMember(manageMemberDTO)); + public ResponseVO manageMember(@RequestBody ManageMemberDTO manageMemberDTO) { + return ResponseData.generateCreatedResponse(0, administerService.manageMember(manageMemberDTO)); } @PostMapping("exportManageMember") @ApiOperation("导出认证信息 {pageSize pageNum userName:名字 } ") @LoginRequired - public void exportManageMember(@RequestBody ManageMemberDTO manageMemberDTO){ + public void exportManageMember(@RequestBody ManageMemberDTO manageMemberDTO) { administerService.exportManageMember(manageMemberDTO); } @PostMapping("selfExport") @ApiOperation("自助导出 id导出") - public void selfExport(@RequestBody ClassDictDO classDictDO){ + public void selfExport(@RequestBody ClassDictDO classDictDO) { administerService.selfExport(classDictDO); } diff --git a/src/main/java/com/subsidy/controller/RenSheJuController.java b/src/main/java/com/subsidy/controller/RenSheJuController.java index e4bbde0..7e7b743 100644 --- a/src/main/java/com/subsidy/controller/RenSheJuController.java +++ b/src/main/java/com/subsidy/controller/RenSheJuController.java @@ -14,7 +14,7 @@ import java.io.IOException; import java.util.List; @RestController -@Api(tags = "人社局数据对接") +@Api(tags = "企业职工线上培训") @RequestMapping("/rensheju") public class RenSheJuController { diff --git a/src/main/java/com/subsidy/controller/ShehuihuaController.java b/src/main/java/com/subsidy/controller/ShehuihuaController.java new file mode 100644 index 0000000..bb4e16a --- /dev/null +++ b/src/main/java/com/subsidy/controller/ShehuihuaController.java @@ -0,0 +1,72 @@ +package com.subsidy.controller; + +import com.subsidy.service.ShehuihuaService; +import com.subsidy.vo.renshe.RensheResponseVO; +import com.subsidy.vo.renshe.RensheStringVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.io.IOException; +import java.util.List; + +@RestController +@Api(tags = "社会化、学徒制") +@RequestMapping("/social") +public class ShehuihuaController { + + @Autowired + private ShehuihuaService shehuihuaService; + + @PostMapping("getClassCodeByPrivateKey") + @ApiOperation("POST-2 获取培训待绑定的(班级编号,项目编号)列表") + public RensheResponseVO getClassCodeByPrivateKey()throws IOException { + return shehuihuaService.getClassCodeByPrivateKey(); + } + + @PostMapping("uploadClass") + @ApiOperation("POST-3:班级基本信息信息采集接口") + public RensheResponseVO uploadClass() throws IOException { + return shehuihuaService.uploadClass(); + } + + @PostMapping("classHourBehavior") + @ApiOperation("POST-4:学时信息采集接口") + public RensheResponseVO classHourBehavior() throws IOException { + return shehuihuaService.classHourBehavior(); + } + + @PostMapping("uploadChapterBehavior") + @ApiOperation("POST-5:考试信息采集接口") + public RensheResponseVO uploadChapterBehavior() throws IOException { + return shehuihuaService.uploadChapterBehavior(); + } + + @PostMapping("uploadClassAnswerQuestionBehavior") + @ApiOperation("POST-6:答疑辅导采集接口") + public RensheResponseVO uploadClassAnswerQuestionBehavior() throws IOException { + return shehuihuaService.uploadClassAnswerQuestionBehavior(); + } + + @PostMapping("uploadImage") + @ApiOperation("POST-7 班级活跃度/实名认证照片信息采集接口") + public List uploadImage()throws IOException { + return shehuihuaService.uploadImage(); + } + + @PostMapping("getErrorClass") + @ApiOperation("POST-8 获取推送失败班级列表") + public RensheResponseVO getErrorClass()throws IOException{ + return shehuihuaService.getErrorClass(); + } + + @PostMapping("clear") + @ApiOperation("POST-9 清除推送失败班级缓存") + public RensheStringVO clear()throws IOException{ + return shehuihuaService.clear(); + } + +} diff --git a/src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java b/src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java index 7b81722..8335ec0 100644 --- a/src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java +++ b/src/main/java/com/subsidy/dto/renshe/ClassHourBasic.java @@ -7,14 +7,20 @@ import java.util.List; @Data public class ClassHourBasic { - /** - * 活跃度列表,【数组】 - */ - private List activityList; + /** * 临时班级(临时项目)编号 */ private String downCode; + + /** + * 学员姓名 + */ + private String studentName; + /** + * 学员电话号,会对学生手机号长度、格式进行校验 + */ + private String phone; /** * 学员身份证号,会对身份证号长度、格式进行校验、X用大写 */ @@ -23,25 +29,23 @@ public class ClassHourBasic { * 当日累计学习时长,视频暂停时间不计入【秒】 */ private long learnTime; - /** - * 上线时间列表,【数组】 - */ - private List loginList; + /** * 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】 */ private long loginTime; /** - * 学员电话号,会对学生手机号长度、格式进行校验 - */ - private String phone; - /** * 当日累计播放时长,视频暂停时间计入【秒】 */ private Long playTime; /** - * 学员姓名 + * 上线时间列表,【数组】 */ - private String studentName; + private List loginList; + /** + * 活跃度列表,【数组】 + */ + private List activityList; + } diff --git a/src/main/java/com/subsidy/dto/renshe/UploadChapterBehaviorDTO.java b/src/main/java/com/subsidy/dto/renshe/UploadChapterBehaviorDTO.java index 139a6c9..1a04b01 100644 --- a/src/main/java/com/subsidy/dto/renshe/UploadChapterBehaviorDTO.java +++ b/src/main/java/com/subsidy/dto/renshe/UploadChapterBehaviorDTO.java @@ -1,5 +1,6 @@ package com.subsidy.dto.renshe; +import com.subsidy.dto.shehuihua.ChapterExamBasic5; import lombok.Data; import java.util.List; diff --git a/src/main/java/com/subsidy/dto/renshe/UploadClassAnswerQuestionBehaviorDTO.java b/src/main/java/com/subsidy/dto/renshe/UploadClassAnswerQuestionBehaviorDTO.java index 67b9842..7879954 100644 --- a/src/main/java/com/subsidy/dto/renshe/UploadClassAnswerQuestionBehaviorDTO.java +++ b/src/main/java/com/subsidy/dto/renshe/UploadClassAnswerQuestionBehaviorDTO.java @@ -1,5 +1,6 @@ package com.subsidy.dto.renshe; +import com.subsidy.dto.shehuihua.AnswerBasic6; import lombok.Data; import java.util.List; diff --git a/src/main/java/com/subsidy/dto/shehuihua/AnswerBasic6.java b/src/main/java/com/subsidy/dto/shehuihua/AnswerBasic6.java new file mode 100644 index 0000000..c78e0e1 --- /dev/null +++ b/src/main/java/com/subsidy/dto/shehuihua/AnswerBasic6.java @@ -0,0 +1,19 @@ +package com.subsidy.dto.shehuihua; + +import com.subsidy.dto.renshe.AnswerAndQuestionList; +import lombok.Data; + +import java.util.List; + +@Data +public class AnswerBasic6 { + + /** + * 答疑辅导,提问和回答都存在值时才进行传递 + */ + private List answerAndQuestionList; + private String classCode; + private String identity; + + +} diff --git a/src/main/java/com/subsidy/dto/shehuihua/ChapterExamBasic5.java b/src/main/java/com/subsidy/dto/shehuihua/ChapterExamBasic5.java new file mode 100644 index 0000000..95f104b --- /dev/null +++ b/src/main/java/com/subsidy/dto/shehuihua/ChapterExamBasic5.java @@ -0,0 +1,48 @@ +package com.subsidy.dto.shehuihua; + +import com.subsidy.dto.renshe.ActivityList; +import com.subsidy.dto.renshe.ExamList; +import lombok.Data; + +import java.util.List; + +@Data +public class ChapterExamBasic5 { + /** + * 是否通过,0通过1未通过 + */ + private long access; + /** + * 活跃度列表,【数组】 + */ + private List activityList; + /** + * 章节(课程)编码,11 + */ + private String chapterCode; + /** + * 班级(项目)编号 + */ + private String classCode; + /** + * 章节(课程)考试时间列表,【数组】 + */ + private List examList; + /** + * 章节(课程)考试总时长,该字段数据应为当日产生examList列表内多条结束时间-开始时间累加和【秒】 + */ + private long examTime; + /** + * 学员身份证号,会对身份证号长度、格式进行校验、X用大写 + */ + private String identity; + /** + * 学员手机号,会对手机号长度、格式进行校验 + */ + private String phone; + /** + * 学员姓名 + */ + private String studentName; + +} diff --git a/src/main/java/com/subsidy/dto/shehuihua/ChapterList22.java b/src/main/java/com/subsidy/dto/shehuihua/ChapterList22.java new file mode 100644 index 0000000..41d81a6 --- /dev/null +++ b/src/main/java/com/subsidy/dto/shehuihua/ChapterList22.java @@ -0,0 +1,12 @@ +package com.subsidy.dto.shehuihua; + +import lombok.Data; + +@Data +public class ChapterList22 { + + private String chapterCode; + + private String chapterName; + +} diff --git a/src/main/java/com/subsidy/dto/shehuihua/ClassHourBasic4DTO.java b/src/main/java/com/subsidy/dto/shehuihua/ClassHourBasic4DTO.java new file mode 100644 index 0000000..89ef2a2 --- /dev/null +++ b/src/main/java/com/subsidy/dto/shehuihua/ClassHourBasic4DTO.java @@ -0,0 +1,53 @@ +package com.subsidy.dto.shehuihua; + +import com.subsidy.dto.renshe.ActivityList; +import com.subsidy.dto.renshe.LoginList; +import lombok.Data; + +import java.util.List; + +@Data +public class ClassHourBasic4DTO { + + + /** + * 临时班级(临时项目)编号 + */ + private String classCode; + + /** + * 学员姓名 + */ + private String studentName; + /** + * 学员电话号,会对学生手机号长度、格式进行校验 + */ + private String phone; + /** + * 学员身份证号,会对身份证号长度、格式进行校验、X用大写 + */ + private String identity; + /** + * 当日累计学习时长,视频暂停时间不计入【秒】 + */ + private long learnTime; + + /** + * 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】 + */ + private long loginTime; + /** + * 当日累计播放时长,视频暂停时间计入【秒】 + */ + private Long playTime; + /** + * 上线时间列表,【数组】 + */ + private List loginList; + /** + * 活跃度列表,【数组】 + */ + private List activityList; + + +} diff --git a/src/main/java/com/subsidy/dto/shehuihua/ClassHourBehavior4DTO.java b/src/main/java/com/subsidy/dto/shehuihua/ClassHourBehavior4DTO.java new file mode 100644 index 0000000..80fceb9 --- /dev/null +++ b/src/main/java/com/subsidy/dto/shehuihua/ClassHourBehavior4DTO.java @@ -0,0 +1,20 @@ +package com.subsidy.dto.shehuihua; + +import com.subsidy.dto.renshe.ClassHourBasic; +import lombok.Data; + +import java.util.List; + +@Data +public class ClassHourBehavior4DTO { + + /** + * 班级(项目)学时列表,【数组】班级(项目)学时列表 + */ + private List classHourBasic; + /** + * 私钥 + */ + private String privateKey; + +} diff --git a/src/main/java/com/subsidy/dto/shehuihua/ClassInfoBasicDTO.java b/src/main/java/com/subsidy/dto/shehuihua/ClassInfoBasicDTO.java new file mode 100644 index 0000000..abcb3b2 --- /dev/null +++ b/src/main/java/com/subsidy/dto/shehuihua/ClassInfoBasicDTO.java @@ -0,0 +1,21 @@ +package com.subsidy.dto.shehuihua; + +import com.subsidy.dto.renshe.ChapterList2; +import com.subsidy.vo.renshe.MemberVO; +import lombok.Data; + +import java.util.List; + +@Data +public class ClassInfoBasicDTO { + + private String classCode; + + private String shortName; + + private Long learnHour; + + private List chapterList; + + private List studentList; +} diff --git a/src/main/java/com/subsidy/dto/shehuihua/UploadChapterBehavior5DTO.java b/src/main/java/com/subsidy/dto/shehuihua/UploadChapterBehavior5DTO.java new file mode 100644 index 0000000..c415be4 --- /dev/null +++ b/src/main/java/com/subsidy/dto/shehuihua/UploadChapterBehavior5DTO.java @@ -0,0 +1,20 @@ +package com.subsidy.dto.shehuihua; + +import com.subsidy.dto.renshe.ChapterExamBasic; +import lombok.Data; + +import java.util.List; + +@Data +public class UploadChapterBehavior5DTO { + + /** + * 章节(课程)考试列表,【数组】 + */ + private List chapterExamBasic; + /** + * 私钥 + */ + private String privateKey; + +} diff --git a/src/main/java/com/subsidy/dto/shehuihua/UploadClassAnswerQuestionBehavior6DTO.java b/src/main/java/com/subsidy/dto/shehuihua/UploadClassAnswerQuestionBehavior6DTO.java new file mode 100644 index 0000000..7252fef --- /dev/null +++ b/src/main/java/com/subsidy/dto/shehuihua/UploadClassAnswerQuestionBehavior6DTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.shehuihua; + +import lombok.Data; + +import java.util.List; + +@Data +public class UploadClassAnswerQuestionBehavior6DTO { + + private List answerBasic; + + private String privateKey; + +} diff --git a/src/main/java/com/subsidy/dto/shehuihua/UploadClassDTO.java b/src/main/java/com/subsidy/dto/shehuihua/UploadClassDTO.java new file mode 100644 index 0000000..e2c538a --- /dev/null +++ b/src/main/java/com/subsidy/dto/shehuihua/UploadClassDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.shehuihua; + +import lombok.Data; + +import java.util.List; + +@Data +public class UploadClassDTO { + + private String privateKey; + + private List classInfoBasic; + +} diff --git a/src/main/java/com/subsidy/dto/shehuihua/UploadImageDTO7.java b/src/main/java/com/subsidy/dto/shehuihua/UploadImageDTO7.java new file mode 100644 index 0000000..ae4c6f3 --- /dev/null +++ b/src/main/java/com/subsidy/dto/shehuihua/UploadImageDTO7.java @@ -0,0 +1,24 @@ +package com.subsidy.dto.shehuihua; + +import com.subsidy.dto.renshe.ImageDetailList; +import lombok.Data; + +import java.util.List; + +@Data +public class UploadImageDTO7 { + + /** + * 临时班级(项目)编码 + */ + private String classCode; + /** + * 活跃度照片列表,【数组】 + */ + private List imageDetailList; + /** + * 私钥 + */ + private String privateKey; + +} diff --git a/src/main/java/com/subsidy/jobs/RenSheJuJob.java b/src/main/java/com/subsidy/jobs/RenSheJuJob.java index 307104f..800699f 100644 --- a/src/main/java/com/subsidy/jobs/RenSheJuJob.java +++ b/src/main/java/com/subsidy/jobs/RenSheJuJob.java @@ -1,120 +1,118 @@ -//package com.subsidy.jobs; -// -//import com.alibaba.fastjson.JSONObject; -//import com.subsidy.common.ResponseData; -//import com.subsidy.mapper.OprMemDictMapper; -//import com.subsidy.model.OprMemDictDO; -//import com.subsidy.service.RenSheJuService; -//import com.subsidy.service.RenshejuHistoryService; -//import com.subsidy.service.impl.RenshejuHistoryServiceImpl; -//import com.subsidy.util.websocket.WebSocketUtil; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.scheduling.annotation.Scheduled; -//import org.springframework.stereotype.Component; -//import org.springframework.web.socket.TextMessage; -//import org.springframework.web.socket.WebSocketSession; -// -//import java.io.IOException; -//import java.util.List; -//import java.util.concurrent.ConcurrentHashMap; -// -///** -// * 人社局数据对接 -// */ -//@Component -//public class RenSheJuJob { -// -// -// @Autowired -// private RenSheJuService renSheJuService; -// -// @Autowired -// private OprMemDictMapper oprMemDictMapper; -// +package com.subsidy.jobs; + +import com.alibaba.fastjson.JSONObject; +import com.subsidy.common.ResponseData; +import com.subsidy.mapper.OprMemDictMapper; +import com.subsidy.model.OprMemDictDO; +import com.subsidy.service.RenSheJuService; +import com.subsidy.util.websocket.WebSocketUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.web.socket.TextMessage; +import org.springframework.web.socket.WebSocketSession; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 企业职工线上培训 + */ +@Component +public class RenSheJuJob { + + + @Autowired + private RenSheJuService renSheJuService; + + @Autowired + private OprMemDictMapper oprMemDictMapper; + + /** + * POST-2:班级基本信息信息采集接口 + */ + @Scheduled(cron = "0 0 1 * * ?") + public void classBaseInfo()throws IOException { + renSheJuService.classBaseInfo(); + } + + /** + * POST-3:学时信息采集接口 + */ + @Scheduled(cron = "0 5 1 * * ?") + public void classHourBehavior() throws IOException { + renSheJuService.classHourBehavior(); + } + + /** + * POST-4:考试信息采集接口 + */ + @Scheduled(cron = "0 10 1 * * ?") + public void uploadChapterBehavior() throws IOException { + renSheJuService.uploadChapterBehavior(); + } + + /** + * POST-5:答疑辅导采集接口 + */ + @Scheduled(cron = "0 15 1 * * ?") + public void uploadClassAnswerQuestionBehavior() throws IOException { + renSheJuService.uploadClassAnswerQuestionBehavior(); + } + + /** + * POST-6 班级活跃度/实名认证照片信息采集接口 + */ + @Scheduled(cron = "0 20 1 * * ?") + public void uploadImage()throws IOException { + renSheJuService.uploadImage(); + } + + /** + * POST-7 获取培训待绑定的(班级编号,项目编号)列表 + */ + @Scheduled(cron = "0 25 1 * * ?") + public void getClassCodeByPrivateKey()throws IOException { + renSheJuService.getClassCodeByPrivateKey(); + } + + /** + * POST-8 上下游班级数据绑定接口 + */ + @Scheduled(cron = "0 30 1 * * ?") + public void uploadClassCode()throws IOException { + renSheJuService.uploadClassCode(); + } + // /** -// * POST-2:班级基本信息信息采集接口 +// * POST-9 获取推送失败班级列表 // */ -// @Scheduled(cron = "0 0 1 * * ?") -// public void classBaseInfo()throws IOException { -// renSheJuService.classBaseInfo(); +// @Scheduled(cron = "0 35 1 * * ?") +// public void getErrorClass()throws IOException{ +// renSheJuService.getErrorClass(); // } -// -// /** -// * POST-3:学时信息采集接口 -// */ -// @Scheduled(cron = "0 5 1 * * ?") -// public void classHourBehavior() throws IOException { -// renSheJuService.classHourBehavior(); -// } -// -// /** -// * POST-4:考试信息采集接口 -// */ -// @Scheduled(cron = "0 10 1 * * ?") -// public void uploadChapterBehavior() throws IOException { -// renSheJuService.uploadChapterBehavior(); -// } -// -// /** -// * POST-5:答疑辅导采集接口 -// */ -// @Scheduled(cron = "0 15 1 * * ?") -// public void uploadClassAnswerQuestionBehavior() throws IOException { -// renSheJuService.uploadClassAnswerQuestionBehavior(); -// } -// -// /** -// * POST-6 班级活跃度/实名认证照片信息采集接口 -// */ -// @Scheduled(cron = "0 20 1 * * ?") -// public void uploadImage()throws IOException { -// renSheJuService.uploadImage(); -// } -// -// /** -// * POST-7 获取培训待绑定的(班级编号,项目编号)列表 -// */ -// @Scheduled(cron = "0 25 1 * * ?") -// public void getClassCodeByPrivateKey()throws IOException { -// renSheJuService.getClassCodeByPrivateKey(); -// } -// -// /** -// * POST-8 上下游班级数据绑定接口 -// */ -// @Scheduled(cron = "0 30 1 * * ?") -// public void uploadClassCode()throws IOException { -// renSheJuService.uploadClassCode(); -// } -// -//// /** -//// * POST-9 获取推送失败班级列表 -//// */ -//// @Scheduled(cron = "0 35 1 * * ?") -//// public void getErrorClass()throws IOException{ -//// renSheJuService.getErrorClass(); -//// } -// -// @Scheduled(cron = "00 58 23 * * ?") -// public void cancelLogin(){ -// ConcurrentHashMap webSocketMap = WebSocketUtil.webSocketMap; -// -// List onLineUsers = oprMemDictMapper.onlineUsers(); -// -// for (Long key : onLineUsers){ -// try { -// if (null != webSocketMap.get(key)){ -// webSocketMap.get(key).sendMessage(new TextMessage(JSONObject.toJSONString(ResponseData.generateCreatedResponse(17001)))); -// } -// OprMemDictDO oprMemDictDO = new OprMemDictDO(); -// oprMemDictDO.setResult(1); -// oprMemDictDO.setOprType("登出"); -// oprMemDictDO.setUserId(key); -// oprMemDictMapper.insert(oprMemDictDO); -// }catch (Exception e){ -// e.printStackTrace(); -// } -// } -// } -// -//} + + @Scheduled(cron = "00 58 23 * * ?") + public void cancelLogin(){ + ConcurrentHashMap webSocketMap = WebSocketUtil.webSocketMap; + + List onLineUsers = oprMemDictMapper.onlineUsers(); + + for (Long key : onLineUsers){ + try { + if (null != webSocketMap.get(key)){ + webSocketMap.get(key).sendMessage(new TextMessage(JSONObject.toJSONString(ResponseData.generateCreatedResponse(17001)))); + } + OprMemDictDO oprMemDictDO = new OprMemDictDO(); + oprMemDictDO.setResult(1); + oprMemDictDO.setOprType("登出"); + oprMemDictDO.setUserId(key); + oprMemDictMapper.insert(oprMemDictDO); + }catch (Exception e){ + e.printStackTrace(); + } + } + } + +} diff --git a/src/main/java/com/subsidy/jobs/ShehuihuaJob.java b/src/main/java/com/subsidy/jobs/ShehuihuaJob.java new file mode 100644 index 0000000..0130a67 --- /dev/null +++ b/src/main/java/com/subsidy/jobs/ShehuihuaJob.java @@ -0,0 +1,68 @@ +package com.subsidy.jobs; + +import com.subsidy.service.ShehuihuaService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.io.IOException; + +/**` + * 社会化、学徒制数据推送 + */ +@Component +public class ShehuihuaJob { + + + @Autowired + private ShehuihuaService shehuihuaService; + + /** + * POST-2 获取培训待绑定的(班级编号,项目编号)列表 + */ + @Scheduled(cron = "0 0 2 * * ?") + public void getClassCodeByPrivateKey()throws IOException { + shehuihuaService.getClassCodeByPrivateKey(); + } + + /** + * POST-3:班级基本信息信息采集接口 + */ + @Scheduled(cron = "0 5 2 * * ?") + public void uploadClass() throws IOException { + shehuihuaService.uploadClass(); + } + + /** + * POST-4:考试信息采集接口 + */ + @Scheduled(cron = "0 10 2 * * ?") + public void classHourBehavior() throws IOException { + shehuihuaService.classHourBehavior(); + } + + /** + * POST-5:答疑辅导采集接口 + */ + @Scheduled(cron = "0 15 2 * * ?") + public void uploadChapterBehavior() throws IOException { + shehuihuaService.uploadChapterBehavior(); + } + + /** + * POST-6 班级活跃度/实名认证照片信息采集接口 + */ + @Scheduled(cron = "0 20 2 * * ?") + public void uploadClassAnswerQuestionBehavior()throws IOException { + shehuihuaService.uploadClassAnswerQuestionBehavior(); + } + + /** + * POST-7 获取培训待绑定的(班级编号,项目编号)列表 + */ + @Scheduled(cron = "0 25 2 * * ?") + public void uploadImage()throws IOException { + shehuihuaService.uploadImage(); + } + +} diff --git a/src/main/java/com/subsidy/mapper/RenSheJuMapper.java b/src/main/java/com/subsidy/mapper/RenSheJuMapper.java index cdd0d43..02e77b9 100644 --- a/src/main/java/com/subsidy/mapper/RenSheJuMapper.java +++ b/src/main/java/com/subsidy/mapper/RenSheJuMapper.java @@ -32,12 +32,12 @@ public interface RenSheJuMapper { /** * 新增班级 */ - List newClasses(); + List newClasses(String classType); /** * 前一天新增视频学习数据 */ - List dailyStudyInfo(); + List dailyStudyInfo(String classType); /** * 前一天活跃度检测列表 @@ -105,7 +105,7 @@ public interface RenSheJuMapper { /** * 查找前一天做过人脸识别的班级 */ - List checkClassIds(); + List checkClassIds(String classType); /** * 查看某个班级的成员做过的人脸识别记录 弃用 diff --git a/src/main/java/com/subsidy/model/ClassDictDO.java b/src/main/java/com/subsidy/model/ClassDictDO.java index 77c4ae3..e8ec544 100644 --- a/src/main/java/com/subsidy/model/ClassDictDO.java +++ b/src/main/java/com/subsidy/model/ClassDictDO.java @@ -123,4 +123,14 @@ public class ClassDictDO extends BaseModel { */ private Integer playSnap; + /** + * 班级所属职业类型 + */ + private String profession; + + /** + * 班级所属职业等级 + */ + private String professionRank; + } diff --git a/src/main/java/com/subsidy/service/ShehuihuaService.java b/src/main/java/com/subsidy/service/ShehuihuaService.java new file mode 100644 index 0000000..946eb35 --- /dev/null +++ b/src/main/java/com/subsidy/service/ShehuihuaService.java @@ -0,0 +1,30 @@ +package com.subsidy.service; + +import com.subsidy.vo.renshe.RensheResponseVO; +import com.subsidy.vo.renshe.RensheStringVO; + +import java.io.IOException; +import java.util.List; + +public interface ShehuihuaService { + + + RensheResponseVO getClassCodeByPrivateKey()throws IOException; + + RensheResponseVO uploadClass() throws IOException; + + RensheResponseVO classHourBehavior() throws IOException; + + RensheResponseVO uploadChapterBehavior() throws IOException; + + RensheResponseVO uploadClassAnswerQuestionBehavior()throws IOException; + + List uploadImage()throws IOException; + + RensheResponseVO getErrorClass()throws IOException; + + RensheStringVO clear()throws IOException; + + void test(); + +} diff --git a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java index d70f2e0..7e43baf 100644 --- a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java @@ -59,7 +59,11 @@ public class RenSheJuServiceImpl implements RenSheJuService { List epidemicSituationClassBasics = new ArrayList<>(); //查找前一天产生数据的班级 - List classIds = renSheJuMapper.newClasses(); +// List classIds = renSheJuMapper.newClasses("0"); + + List classIds = new ArrayList<>(); + classIds.add(404L); + try { if (classIds.size() > 0) { for (Long classId : classIds) { @@ -105,6 +109,7 @@ public class RenSheJuServiceImpl implements RenSheJuService { } renshejuHistoryMapper.insert(renshejuHistoryDO); return rensheResponseVO; +// return null; } else { RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2); @@ -115,6 +120,7 @@ public class RenSheJuServiceImpl implements RenSheJuService { } } catch (Exception e) { + e.printStackTrace(); RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2); renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString()); @@ -137,7 +143,7 @@ public class RenSheJuServiceImpl implements RenSheJuService { List classHourBasics = new ArrayList<>(); try { //前一天新增视频学习数据的班级 - List dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo(); + List dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo("0"); for (DailyStudyInfoVO dailyStudyInfoVO : dailyStudyInfoVOS) { ClassHourBasic classHourBasic = new ClassHourBasic(); BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic); @@ -196,27 +202,28 @@ public class RenSheJuServiceImpl implements RenSheJuService { System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO)); - RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString()); - - Request request = new Request.Builder() - .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior") - .method("POST", body) - .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") - .addHeader("Content-Type", "application/json") - .build(); - Response response = client.newCall(request).execute(); - - RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); - RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); - renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3); - renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString()); - if (200 == response.code()) { - renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); - } else { - renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); - } - renshejuHistoryMapper.insert(renshejuHistoryDO); - return rensheResponseVO; +// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString()); +// +// Request request = new Request.Builder() +// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior") +// .method("POST", body) +// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") +// .addHeader("Content-Type", "application/json") +// .build(); +// Response response = client.newCall(request).execute(); +// +// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); +// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); +// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3); +// renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString()); +// if (200 == response.code()) { +// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); +// } else { +// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); +// } +// renshejuHistoryMapper.insert(renshejuHistoryDO); +// return rensheResponseVO; + return null; } catch (Exception e) { e.printStackTrace(); RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); @@ -241,10 +248,7 @@ public class RenSheJuServiceImpl implements RenSheJuService { List chapterExamBasics = new ArrayList<>(); //找出前一天产生考试数据的班级 -// List classIds = renSheJuMapper.dailyExamBasic(); - - List classIds = new ArrayList<>(); - classIds.add(404L); + List classIds = renSheJuMapper.dailyExamBasic(); try { if (classIds.size() > 0) { @@ -290,7 +294,7 @@ public class RenSheJuServiceImpl implements RenSheJuService { chapterExamBasic.setActivityList(activityLists); - List examLists = new ArrayList(); + List examLists = new ArrayList<>(); //上线时间 List loginRecords = renSheJuMapper.loginRecords(memberDO.getId()); //下线时间 @@ -326,29 +330,29 @@ public class RenSheJuServiceImpl implements RenSheJuService { System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadChapterBehaviorDTO)); - RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); - Request request = new Request.Builder() - .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadChapterBehavior") - .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); - if (200 == response.code()) { - RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); - renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4); - renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); - if (200 == response.code()) { - renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); - } else { - renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); - } - renshejuHistoryMapper.insert(renshejuHistoryDO); - } - return rensheResponseVO; -// return null; +// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); +// Request request = new Request.Builder() +// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadChapterBehavior") +// .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); +// if (200 == response.code()) { +// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); +// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4); +// renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); +// if (200 == response.code()) { +// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); +// } else { +// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); +// } +// renshejuHistoryMapper.insert(renshejuHistoryDO); +// } +// return rensheResponseVO; + return null; } else { RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_4); @@ -416,27 +420,28 @@ public class RenSheJuServiceImpl implements RenSheJuService { uploadClassAnswerQuestionBehaviorDTO.setAnswerBasic(answerBasics); System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadClassAnswerQuestionBehaviorDTO)); - RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); - Request request = new Request.Builder() - .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassAnswerQuestionBehavior") - .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_5); - renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); - if (200 == response.code()) { - renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); - } else { - renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); - } - renshejuHistoryMapper.insert(renshejuHistoryDO); - - return rensheResponseVO; +// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); +// Request request = new Request.Builder() +// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassAnswerQuestionBehavior") +// .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_5); +// renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); +// if (200 == response.code()) { +// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); +// } else { +// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); +// } +// renshejuHistoryMapper.insert(renshejuHistoryDO); +// +// return rensheResponseVO; + return null; } else { RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_5); @@ -465,10 +470,8 @@ public class RenSheJuServiceImpl implements RenSheJuService { //找到昨天做过人脸识别的班级 -// List classIds = renSheJuMapper.checkClassIds(); + List classIds = renSheJuMapper.checkClassIds("0"); - List classIds = new ArrayList<>(); - classIds.add(404L); for (Long classId : classIds) { UploadImageDTO uploadImage = new UploadImageDTO(); @@ -506,43 +509,43 @@ public class RenSheJuServiceImpl implements RenSheJuService { } -// /** -// * 考试检测数据 -// */ -// List examChecks = renSheJuMapper.examCheck(classId); -// -// if (examChecks.size() > 0) { -// for (ClassImageChecksVO cicon : examChecks) { -// -// ImageDetailList imageDetailList = new ImageDetailList(); -// BeanUtils.copyProperties(cicon, imageDetailList); -// imageDetailList.setImageBase64("data:image/jpeg;base64," + OSSUtils.image2Base64(cicon.getImage())); -// imageDetailList.setProcessType(2L); -// imageDetailList.setDetectionType(1L); -// imageDetailLists.add(imageDetailList); -// } -// } + /** + * 考试检测数据 + */ + List examChecks = renSheJuMapper.examCheck(classId); + + if (examChecks.size() > 0) { + for (ClassImageChecksVO cicon : examChecks) { + + ImageDetailList imageDetailList = new ImageDetailList(); + BeanUtils.copyProperties(cicon, imageDetailList); + imageDetailList.setImageBase64("data:image/jpeg;base64," + OSSUtils.image2Base64(cicon.getImage())); + imageDetailList.setProcessType(2L); + imageDetailList.setDetectionType(1L); + imageDetailLists.add(imageDetailList); + } + } uploadImage.setImageDetailList(imageDetailLists); if (imageDetailLists.size() > 0) { System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadImage)); - RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadImage).toString()); - Request request = new Request.Builder() - .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadImage") - .method("POST", body) - .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") - .addHeader("Content-Type", "application/json") - .build(); - Response response = client.newCall(request).execute(); - RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); - - RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); - renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_6); - renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString()); - renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); - renshejuHistoryMapper.insert(renshejuHistoryDO); - rensheResponseVOS.add(rensheResponseVO); +// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadImage).toString()); +// Request request = new Request.Builder() +// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadImage") +// .method("POST", body) +// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") +// .addHeader("Content-Type", "application/json") +// .build(); +// Response response = client.newCall(request).execute(); +// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); +// +// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); +// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_6); +// renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString()); +// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); +// renshejuHistoryMapper.insert(renshejuHistoryDO); +// rensheResponseVOS.add(rensheResponseVO); System.out.println(111); } else { RenshejuHistoryDO renshejuHistoryDO1 = new RenshejuHistoryDO(); @@ -615,7 +618,9 @@ public class RenSheJuServiceImpl implements RenSheJuService { uploadClassCodeDTO.setPrivateKey(getSecret()); //所有班级 - List classIds = renSheJuMapper.newClasses(); +// List classIds = renSheJuMapper.newClasses("0"); + List classIds = new ArrayList(); + classIds.add(404L); List classCodeBasics = new ArrayList(); for (Long classId : classIds) { @@ -650,6 +655,7 @@ public class RenSheJuServiceImpl implements RenSheJuService { } renshejuHistoryMapper.insert(renshejuHistoryDO); return rensheResponseVO; +// return null; } catch (Exception e) { RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_8); diff --git a/src/main/java/com/subsidy/service/impl/ShehuihuaServiceImpl.java b/src/main/java/com/subsidy/service/impl/ShehuihuaServiceImpl.java new file mode 100644 index 0000000..9c7304d --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/ShehuihuaServiceImpl.java @@ -0,0 +1,707 @@ +package com.subsidy.service.impl; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.configure.RenSheConfig; +import com.subsidy.dto.renshe.*; +import com.subsidy.dto.shehuihua.*; +import com.subsidy.mapper.ClassDictMapper; +import com.subsidy.mapper.ImageCheckRecordMapper; +import com.subsidy.mapper.RenSheJuMapper; +import com.subsidy.mapper.RenshejuHistoryMapper; +import com.subsidy.model.*; +import com.subsidy.service.ShehuihuaService; +import com.subsidy.util.OSSUtils; +import com.subsidy.util.RenSheJuConstant; +import com.subsidy.util.ShehuihuaConstant; +import com.subsidy.vo.renshe.*; +import net.sf.json.JSONObject; +import okhttp3.*; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.IOException; +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +@Service +public class ShehuihuaServiceImpl implements ShehuihuaService { + + @Autowired + private RenSheJuMapper renSheJuMapper; + + @Autowired + private RenSheConfig renSheConfig; + + @Autowired + private ClassDictMapper classDictMapper; + + @Autowired + RenshejuHistoryMapper renshejuHistoryMapper; + + @Autowired + private ImageCheckRecordMapper imageCheckRecordMapper; + + public RensheResponseVO getClassCodeByPrivateKey() throws IOException { + + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + MediaType mediaType = MediaType.parse("text/plain"); + RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM) + .addFormDataPart("privateKey", getSecret()) + .build(); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/social/getClassCodeByPrivateKey") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .build(); + try { + Response response = client.newCall(request).execute(); + RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); + + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_2); + renshejuHistoryDO.setInputParam(getSecret()); + if (200 == response.code()) { + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + } else { + renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); + } + renshejuHistoryMapper.insert(renshejuHistoryDO); + return rensheResponseVO; + + } catch (Exception e) { + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_2); + renshejuHistoryDO.setInputParam(getSecret()); + renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL); + renshejuHistoryMapper.insert(renshejuHistoryDO); + } + return null; + } + + + public RensheResponseVO uploadClass() throws IOException { + + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + MediaType mediaType = MediaType.parse("application/json"); + + //拼数据 + UploadClassDTO classBaseInfoDTO = new UploadClassDTO(); + classBaseInfoDTO.setPrivateKey(getSecret()); + + List classInfoBasicDTOS = new ArrayList<>(); + + //查找前一天产生数据的班级 + List classIds = renSheJuMapper.newClasses("1"); + try { + if (classIds.size() > 0) { + for (Long classId : classIds) { + ClassInfoBasicDTO classInfoBasicDTO = new ClassInfoBasicDTO(); + //班级基本信息 + ClassBaseInfoVO classBaseInfoVO = renSheJuMapper.classBaseInfo(classId); + BeanUtils.copyProperties(classBaseInfoVO, classInfoBasicDTO); + classInfoBasicDTO.setClassCode(classBaseInfoVO.getDownCode()); + + //章节 + List chapterLists = renSheJuMapper.classChapters(classId); + List chapterList22s = new ArrayList<>(); + for (ChapterList2 chapterList2 : chapterLists){ + ChapterList22 chapterList22 = new ChapterList22(); + chapterList22.setChapterName(chapterList2.getChapterName()); + chapterList22.setChapterCode(chapterList2.getChapterCode()); + chapterList22s.add(chapterList22); + } + classInfoBasicDTO.setChapterList(chapterList22s); + + //学员列表 + List memberVOS = renSheJuMapper.classMembers(classId); + classInfoBasicDTO.setStudentList(memberVOS); + + classInfoBasicDTOS.add(classInfoBasicDTO); + } + classBaseInfoDTO.setClassInfoBasic(classInfoBasicDTOS); + + System.out.println(JSONObject.fromObject(classBaseInfoDTO).toString()); + + RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classBaseInfoDTO).toString()); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/social/uploadClass") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .addHeader("Content-Type", "application/json") + .build(); + Response response = client.newCall(request).execute(); + + RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_3); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString()); + if (200 == response.code()) { + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + } else { + renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); + } + renshejuHistoryMapper.insert(renshejuHistoryDO); + return rensheResponseVO; +// return null; + } else { + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_3); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString()); + renshejuHistoryDO.setOutputParam(RenSheJuConstant.NO_DATA); + renshejuHistoryMapper.insert(renshejuHistoryDO); + return null; + } + + } catch (Exception e) { + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_3); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString()); + renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL); + renshejuHistoryMapper.insert(renshejuHistoryDO); + } + return null; + } + + public RensheResponseVO classHourBehavior() throws IOException { + + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + MediaType mediaType = MediaType.parse("application/json"); + + ClassHourBehavior4DTO classHourBehaviorDTO = new ClassHourBehavior4DTO(); + + classHourBehaviorDTO.setPrivateKey(getSecret()); + + List classHourBasics = new ArrayList<>(); + try { + //前一天新增视频学习数据的班级 + List dailyStudyInfoVOS = renSheJuMapper.dailyStudyInfo("1"); + for (DailyStudyInfoVO dailyStudyInfoVO : dailyStudyInfoVOS) { + ClassHourBasic4DTO classHourBasic = new ClassHourBasic4DTO(); + BeanUtils.copyProperties(dailyStudyInfoVO, classHourBasic); + classHourBasic.setClassCode(dailyStudyInfoVO.getDownCode()); + + //上线时间列表 + //找到当天每次上线下线时间 + //上线时间 + List loginRecords = renSheJuMapper.loginRecords(dailyStudyInfoVO.getMemberId()); + //下线时间 + List loginOutRecords = renSheJuMapper.loginOutRecords(dailyStudyInfoVO.getMemberId()); + + List loginLists = new ArrayList<>(); + for (int i = 0; i < loginRecords.size(); i++) { + LoginList loginList = new LoginList(); + loginList.setIp(loginRecords.get(i).getIpAddress()); + loginList.setStartTime(Timestamp.valueOf(loginRecords.get(i).getCreateDate()).getTime()); + loginList.setEndTime(Timestamp.valueOf(loginOutRecords.get(i).getCreateDate()).getTime()); + + //查看这个人该时间段的学习记录 + List chapterList3s = renSheJuMapper.dailyStudyRecords(dailyStudyInfoVO.getMemberId(), dailyStudyInfoVO.getDownCode(), loginRecords.get(0).getCreateDate().toString().replace("T", " "), loginOutRecords.get(i).getCreateDate().toString().replace("T", " ")); + if (chapterList3s.size() > 0) { + loginList.setChapterList(chapterList3s); + loginLists.add(loginList); + } + } + classHourBasic.setLoginList(loginLists); + + //活跃度列表 + List activityLists = new ArrayList<>(); + List activityDetectionDOS = renSheJuMapper.dailyActivities(dailyStudyInfoVO.getDownCode(), dailyStudyInfoVO.getMemberId()); + for (DailyActivitiesVO dailyActivitiesVO : activityDetectionDOS) { + + ActivityList activityList = new ActivityList(); + if (dailyActivitiesVO.getAccess() == 1) { + activityList.setAccess(0); + } else { + activityList.setAccess(1); + activityList.setErrorInfo(2); + } + + if (0 == dailyActivitiesVO.getCheckType()) { + activityList.setActivityDetection(2); + } else if (1 == dailyActivitiesVO.getCheckType()) { + activityList.setActivityDetection(1); + } + + activityList.setActivityTime(dailyActivitiesVO.getActivityTime()); + activityLists.add(activityList); + } + classHourBasic.setActivityList(activityLists); + + classHourBasics.add(classHourBasic); + } + classHourBehaviorDTO.setClassHourBasic(classHourBasics); + + System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO)); + + RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString()); + + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/social/uploadClassHourBehavior") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .addHeader("Content-Type", "application/json") + .build(); + Response response = client.newCall(request).execute(); + + RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_4); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString()); + if (200 == response.code()) { + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + } else { + renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); + } + renshejuHistoryMapper.insert(renshejuHistoryDO); + return rensheResponseVO; +// return null; + } catch (Exception e) { + e.printStackTrace(); + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_4); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString()); + renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL); + renshejuHistoryMapper.insert(renshejuHistoryDO); + } + return null; + } + + public RensheResponseVO uploadChapterBehavior() throws IOException { + + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + MediaType mediaType = MediaType.parse("application/json"); + + UploadChapterBehavior5DTO uploadChapterBehaviorDTO = new UploadChapterBehavior5DTO(); + + uploadChapterBehaviorDTO.setPrivateKey(getSecret()); + + List chapterExamBasics = new ArrayList<>(); + + //找出前一天产生考试数据的班级 + List classIds = renSheJuMapper.dailyExamBasic(); + + try { + if (classIds.size() > 0) { + for (Long classId : classIds) { + + //具体哪些人做了 + List memberDOList = renSheJuMapper.memberIds(classId); + + for (MemberDO memberDO : memberDOList) { + + //章节课程考试时间列表 + ChapterExamBasic5 chapterExamBasic = new ChapterExamBasic5(); + chapterExamBasic.setClassCode(String.valueOf(classId)); + + //最后一节课作为chapterCode + String vodId = renSheJuMapper.classVodName(classId); + chapterExamBasic.setChapterCode(vodId); + + chapterExamBasic.setStudentName(memberDO.getUserName()); + chapterExamBasic.setPhone(memberDO.getTelephone()); + chapterExamBasic.setIdentity(memberDO.getIdCard()); + + //考试花了多长时间 + Long examLength = renSheJuMapper.examLength(memberDO.getId(), classId); + chapterExamBasic.setExamTime(examLength); + + //考试活跃度列表 + List activityLists = new ArrayList<>(); + List activityDetectionDOS = renSheJuMapper.examActivities(classId, memberDO.getId()); + 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); + } + chapterExamBasic.setActivityList(activityLists); + + + List examLists = new ArrayList<>(); + //上线时间 + List loginRecords = renSheJuMapper.loginRecords(memberDO.getId()); + //下线时间 + 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); + 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; + } + examLists.add(examList); + } + } + if (flag == true) { + chapterExamBasic.setAccess(0L); + } else { + chapterExamBasic.setAccess(1L); + } + chapterExamBasic.setExamList(examLists); + chapterExamBasics.add(chapterExamBasic); + } + } + + uploadChapterBehaviorDTO.setChapterExamBasic(chapterExamBasics); + + System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadChapterBehaviorDTO)); + + RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/social/uploadChapterBehavior") + .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); + if (200 == response.code()) { + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_5); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); + if (200 == response.code()) { + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + } else { + renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); + } + renshejuHistoryMapper.insert(renshejuHistoryDO); + } + return rensheResponseVO; +// return null; + } else { + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_5); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); + renshejuHistoryDO.setOutputParam(RenSheJuConstant.NO_DATA); + renshejuHistoryMapper.insert(renshejuHistoryDO); + return null; + } + } catch (Exception e) { + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_5); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadChapterBehaviorDTO).toString()); + renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL); + renshejuHistoryMapper.insert(renshejuHistoryDO); + } + return null; + } + + public RensheResponseVO uploadClassAnswerQuestionBehavior() throws IOException { + + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + MediaType mediaType = MediaType.parse("application/json"); + + UploadClassAnswerQuestionBehavior6DTO uploadClassAnswerQuestionBehaviorDTO = new UploadClassAnswerQuestionBehavior6DTO(); + + //秘钥 + uploadClassAnswerQuestionBehaviorDTO.setPrivateKey(getSecret()); + + List dailyAnswerVOS = renSheJuMapper.dailyAnswer(); + + try { + if (dailyAnswerVOS.size() > 0) { + HashMap> hashMap = new HashMap<>(); + for (DailyAnswerVO dailyAnswerVO : dailyAnswerVOS) { + + if (!hashMap.containsKey(dailyAnswerVO.getDownCode() + ":" + dailyAnswerVO.getIdentity())) { + List answerAndQuestionLists = new ArrayList<>(); + AnswerAndQuestionList answerAndQuestionList = new AnswerAndQuestionList(); + answerAndQuestionList.setAnswer(dailyAnswerVO.getAnswer()); + answerAndQuestionList.setQuestion(dailyAnswerVO.getQuestion()); + answerAndQuestionLists.add(answerAndQuestionList); + hashMap.put(dailyAnswerVO.getDownCode() + ":" + dailyAnswerVO.getIdentity(), answerAndQuestionLists); + } else { + List answerAndQuestionLists = hashMap.get(dailyAnswerVO.getDownCode() + ":" + dailyAnswerVO.getIdentity()); + AnswerAndQuestionList answerAndQuestionList = new AnswerAndQuestionList(); + answerAndQuestionList.setAnswer(dailyAnswerVO.getAnswer()); + answerAndQuestionList.setQuestion(dailyAnswerVO.getQuestion()); + answerAndQuestionLists.add(answerAndQuestionList); + hashMap.put(dailyAnswerVO.getDownCode() + ":" + dailyAnswerVO.getIdentity(), answerAndQuestionLists); + } + } + + List answerBasics = new ArrayList<>(); + + for (String key : hashMap.keySet()) { + AnswerBasic6 answerBasic = new AnswerBasic6(); + String downCode = key.split(":")[0]; + String identity = key.split(":")[1]; + answerBasic.setClassCode(downCode); + answerBasic.setIdentity(identity); + answerBasic.setAnswerAndQuestionList(hashMap.get(key)); + answerBasics.add(answerBasic); + } + + uploadClassAnswerQuestionBehaviorDTO.setAnswerBasic(answerBasics); + System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadClassAnswerQuestionBehaviorDTO)); + RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/social/uploadClassAnswerQuestionBehavior") + .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(ShehuihuaConstant.POST_6); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); + if (200 == response.code()) { + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + } else { + renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); + } + renshejuHistoryMapper.insert(renshejuHistoryDO); + + return rensheResponseVO; +// return null; + } else { + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_6); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); + renshejuHistoryDO.setOutputParam(RenSheJuConstant.NO_DATA); + renshejuHistoryMapper.insert(renshejuHistoryDO); + return null; + } + } catch (Exception e) { + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_6); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassAnswerQuestionBehaviorDTO).toString()); + renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL); + renshejuHistoryMapper.insert(renshejuHistoryDO); + } + return null; + } + + public List uploadImage() throws IOException { + + List rensheResponseVOS = new ArrayList<>(); + + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + MediaType mediaType = MediaType.parse("application/json"); + + + //找到昨天做过人脸识别的班级 + List classIds = renSheJuMapper.checkClassIds("1"); + + for (Long classId : classIds) { + + UploadImageDTO7 uploadImage = new UploadImageDTO7(); + uploadImage.setPrivateKey(getSecret()); + uploadImage.setClassCode(String.valueOf(classId)); + + List imageDetailLists = new ArrayList(); + try { + /** + * 第二次人脸识别 + */ + List classImageChecksVOS2 = renSheJuMapper.studyCheck(classId); + + if (classImageChecksVOS2.size() > 0) { + for (ClassImageChecksVO cicon : classImageChecksVOS2) { + int count = imageCheckRecordMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ImageCheckRecordDO::getResult, 1) + .isNull(ImageCheckRecordDO::getPaperId) + .eq(ImageCheckRecordDO::getMemberId, cicon.getMemberId()) + .eq(ImageCheckRecordDO::getClassId, cicon.getClassId())); + + ImageDetailList imageDetailList = new ImageDetailList(); + BeanUtils.copyProperties(cicon, imageDetailList); + imageDetailList.setImageBase64("data:image/jpeg;base64," + OSSUtils.image2Base64(cicon.getImage())); + if (count == 1) { + imageDetailList.setProcessType(0L); + imageDetailList.setDetectionType(0L); + } else if (count == 2) { + imageDetailList.setProcessType(1L); + imageDetailList.setDetectionType(1L); + } + imageDetailLists.add(imageDetailList); + } + + } + + /** + * 考试检测数据 + */ + List examChecks = renSheJuMapper.examCheck(classId); + + if (examChecks.size() > 0) { + for (ClassImageChecksVO cicon : examChecks) { + + ImageDetailList imageDetailList = new ImageDetailList(); + BeanUtils.copyProperties(cicon, imageDetailList); + imageDetailList.setImageBase64("data:image/jpeg;base64," + OSSUtils.image2Base64(cicon.getImage())); + imageDetailList.setProcessType(2L); + imageDetailList.setDetectionType(1L); + imageDetailLists.add(imageDetailList); + } + } + + uploadImage.setImageDetailList(imageDetailLists); + + if (imageDetailLists.size() > 0) { + System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadImage)); + RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadImage).toString()); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/social/uploadImage") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .addHeader("Content-Type", "application/json") + .build(); + Response response = client.newCall(request).execute(); + RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); + + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_7); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString()); + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + renshejuHistoryMapper.insert(renshejuHistoryDO); + rensheResponseVOS.add(rensheResponseVO); + System.out.println(111); + } else { + RenshejuHistoryDO renshejuHistoryDO1 = new RenshejuHistoryDO(); + renshejuHistoryDO1.setInterfaceName(ShehuihuaConstant.POST_7); + renshejuHistoryDO1.setInputParam(JSONObject.fromObject(uploadImage).toString()); + renshejuHistoryDO1.setOutputParam(RenSheJuConstant.NO_DATA); + renshejuHistoryMapper.insert(renshejuHistoryDO1); + } + + } catch (Exception e) { + e.printStackTrace(); + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_7); + renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadImage).toString()); + renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL); + renshejuHistoryMapper.insert(renshejuHistoryDO); + } + } + + return rensheResponseVOS; + } + + public RensheResponseVO getErrorClass() throws IOException { + + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + MediaType mediaType = MediaType.parse("text/plain"); + RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM) + .addFormDataPart("privateKey", getSecret()) + .build(); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/social/getErrorClass") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .build(); + try { + 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(ShehuihuaConstant.POST_8); + renshejuHistoryDO.setInputParam(getSecret()); + if (200 == response.code()) { + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + } else { + renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); + } + renshejuHistoryMapper.insert(renshejuHistoryDO); + return rensheResponseVO; + } catch (Exception e) { + RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); + renshejuHistoryDO.setInterfaceName(ShehuihuaConstant.POST_8); + renshejuHistoryDO.setInputParam(getSecret()); + renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_FAIL); + renshejuHistoryMapper.insert(renshejuHistoryDO); + } + return null; + } + + public RensheStringVO clear() throws IOException { + + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +// MediaType mediaType = MediaType.parse("text/plain"); + RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM) + .addFormDataPart("privateKey", getSecret()) + .build(); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/import/downstream/social/clear") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .build(); + Response response = client.newCall(request).execute(); + RensheStringVO rensheStringVO = JSON.parseObject(response.body().string(), RensheStringVO.class); + System.out.println(rensheStringVO); + + return rensheStringVO; + } + + + public String getSecret() throws IOException { + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); +// MediaType mediaType = MediaType.parse("text/plain"); + RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM) + .addFormDataPart("publicKey", renSheConfig.getSecretKey()) + .build(); + Request request = new Request.Builder() + .url(renSheConfig.getUrl() + "/token/accessPrivateKey") + .method("POST", body) + .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") + .build(); + Response response = client.newCall(request).execute(); + GetSecretVO getSecretVO = JSON.parseObject(response.body().string(), GetSecretVO.class); + return getSecretVO.getCtt().getPrivateKey(); + } + + public static void main(String[] args) { +// GetSecretVO getSecretVO = new GetSecretVO(); +// +// getSecretVO.setC(1); +// getSecretVO.setMsg("aaaa"); +// GetSecretChildVO getSecretChildVO = new GetSecretChildVO(); +// getSecretChildVO.setIp("1121"); +// getSecretChildVO.setPrivateKey("1111111"); +//// getSecretChildVO.setValidTime("2212"); +// getSecretVO.setCtt(getSecretChildVO); +// String s = JSONObject.fromObject(getSecretVO).toString(); +// System.out.println(s); + + LocalDateTime localDateTime = LocalDateTime.now(); + System.out.println(localDateTime.toString()); + + } + + public void test() { + System.out.println("132222222222222222222222222222"); + } + +} diff --git a/src/main/java/com/subsidy/util/ShehuihuaConstant.java b/src/main/java/com/subsidy/util/ShehuihuaConstant.java new file mode 100644 index 0000000..00797cb --- /dev/null +++ b/src/main/java/com/subsidy/util/ShehuihuaConstant.java @@ -0,0 +1,66 @@ +package com.subsidy.util; + +public class ShehuihuaConstant { + + + /** + * 获取培训正在进行中的(班级编号,项目编号)列表 + */ + public static final String POST_2 = "Shehuihua_2_getClassCodeByPrivateKey"; + + /** + * POST-3:班级基本信息信息采集接口 + */ + public static final String POST_3 = "Shehuihua_3_uploadClass"; + + /** + * POST-4:学时信息采集接口 + */ + public static final String POST_4 = "Shehuihua_4_classHourBehavior"; + + /** + * POST-5:考试信息采集接口 + */ + public static final String POST_5 = "Shehuihua_5_uploadChapterBehavior"; + + + /** + * POST-6:答疑辅导采集接口 + */ + public static final String POST_6 = "Shehuihua_6_uploadClassAnswerQuestionBehavior"; + + /** + * POST-7 班级活跃度/实名认证照片信息采集接口 + */ + public static final String POST_7 = "Shehuihua_7_import/downstream/social/uploadImage"; + + /** + * POST-8 获取推送失败班级列表 + */ + public static final String POST_8 = "Shehuihua_8_getErrorClass"; + + /** + * POST-9 清除推送失败班级缓存 + */ + public static final String POST_9 = "Shehuihua_9_clear"; + + /** + * 调取失败 + */ + public static final String API_ERROR = "调取失败"; + + /** + * 当天没数据 + */ + public static final String NO_DATA = "NO_DATA"; + + /** + * 推送失败 + */ + public static final String PUSH_FAIL = "推送失败"; + + /** + * 推送成功 + */ + public static final String PUSH_SUCCESS = "推送成功"; +} diff --git a/src/main/resources/mapper/RenSheJuMapper.xml b/src/main/resources/mapper/RenSheJuMapper.xml index 719929c..e1d3cc7 100644 --- a/src/main/resources/mapper/RenSheJuMapper.xml +++ b/src/main/resources/mapper/RenSheJuMapper.xml @@ -89,7 +89,7 @@ t7.order_no - SELECT DISTINCT t1.id FROM @@ -98,6 +98,9 @@ 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_code is not NULL + + and t1.class_type = #{classType} + @@ -173,7 +179,7 @@ FROM activity_detection t1 WHERE - DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 7 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + 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.member_id = #{memberId} AND t1.class_id = #{classId} @@ -187,7 +193,7 @@ image_check_record t1 WHERE class_id =#{classId} - AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 7 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND t1.paper_id IS NOT NULL and t1.result =1 AND t1.member_id=#{memberId} @@ -237,7 +243,7 @@ AND t.result = 1 AND t.delete_date IS NULL AND opr_type = "登录" - AND DATE_FORMAT( DATE_ADD( create_date, INTERVAL 7 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( + AND DATE_FORMAT( DATE_ADD( create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) @@ -253,7 +259,7 @@ AND t.result = 1 AND t.delete_date IS NULL AND opr_type = "登出" - AND DATE_FORMAT( DATE_ADD( create_date, INTERVAL 7 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( + AND DATE_FORMAT( DATE_ADD( create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) @@ -301,7 +307,7 @@ LEFT JOIN member t2 ON t1.member_id = t2.id WHERE t1.delete_date IS NULL - AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 7 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) And class_id = #{classId} @@ -335,7 +341,7 @@ exercise_done_result t1 WHERE t1.delete_date IS NULL - AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 7 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) + AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) AND class_id = #{classId} AND member_id = #{memberId} @@ -372,18 +378,23 @@ AND t3.delete_date IS NULL - SELECT distinct class_id FROM - image_check_record + image_check_record t + left join class_dict t2 on t.class_id = t2.id WHERE - delete_date IS NULL - AND DATE_FORMAT( DATE_ADD( update_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( + t.delete_date IS NULL + AND DATE_FORMAT( DATE_ADD( t.update_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' ) and class_id is not null + + and t2.class_type = #{classType} + +