Commit 27a4934c by 涂亚平

人社局对接测试

1 parent 23ad1fb2
Showing with 1465 additions and 34 deletions
...@@ -259,7 +259,12 @@ ...@@ -259,7 +259,12 @@
<dependency> <dependency>
<groupId>com.squareup.okhttp3</groupId> <groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId> <artifactId>okhttp</artifactId>
<version>4.10.0</version> <version>3.10.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>1.13.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -5,6 +5,8 @@ import com.subsidy.util.websocket.WebSocketUtil; ...@@ -5,6 +5,8 @@ import com.subsidy.util.websocket.WebSocketUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.web.socket.config.annotation.EnableWebSocket; import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer; import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
...@@ -58,4 +60,11 @@ public class WebSocketConfig extends ServerEndpointConfig.Configurator implemen ...@@ -58,4 +60,11 @@ public class WebSocketConfig extends ServerEndpointConfig.Configurator implemen
return new ServerEndpointExporter(); return new ServerEndpointExporter();
} }
@Bean
public TaskScheduler taskScheduler(){
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.setPoolSize(10);
taskScheduler.initialize();
return taskScheduler;
}
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.subsidy.common.ResponseVO; ...@@ -6,6 +6,7 @@ import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.TimeRequired; import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.detection.GetCheckHistoryDTO; import com.subsidy.dto.detection.GetCheckHistoryDTO;
import com.subsidy.dto.detection.VerifyDTO; import com.subsidy.dto.detection.VerifyDTO;
import com.subsidy.model.ActivityDetectionDO;
import com.subsidy.service.ActivityDetectionService; import com.subsidy.service.ActivityDetectionService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -47,4 +48,10 @@ public class ActivityDetectionController { ...@@ -47,4 +48,10 @@ public class ActivityDetectionController {
return ResponseData.generateCreatedResponse(0,activityDetectionService.getCheckHistory(getCheckHistoryDTO)); return ResponseData.generateCreatedResponse(0,activityDetectionService.getCheckHistory(getCheckHistoryDTO));
} }
@PostMapping("verifyError")
@ApiOperation("验证失败记录 classId memberId")
public ResponseVO verifyError(@RequestBody ActivityDetectionDO activityDetectionDO){
return ResponseData.generateCreatedResponse(0,activityDetectionService.verifyError(activityDetectionDO));
}
} }
package com.subsidy.controller; package com.subsidy.controller;
import com.squareup.okhttp.*; import com.subsidy.service.RenSheJuService;
import com.subsidy.vo.renshe.RensheResponseVO;
import com.subsidy.vo.renshe.RensheStringVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.util.List;
@RestController @RestController
@Api(tags = "人社局数据对接") @Api(tags = "人社局数据对接")
@RequestMapping("/rensheju") @RequestMapping("/rensheju")
public class RenSheJuController { public class RenSheJuController {
@Autowired
private RenSheJuService renSheJuService;
@PostMapping("getSecret") @PostMapping("classBaseInfo")
@ApiOperation("获取秘钥") @ApiOperation("POST-2:班级基本信息信息采集接口")
public String getSecret(){ public RensheResponseVO classBaseInfo() throws IOException {
return renSheJuService.classBaseInfo();
}
MediaType mediaType = MediaType.parse("text/plain"); @PostMapping("classHourBehavior")
@ApiOperation("POST-3:学时信息采集接口")
public RensheResponseVO classHourBehavior() throws IOException {
return renSheJuService.classHourBehavior();
}
OkHttpClient client = new OkHttpClient(); @PostMapping("uploadChapterBehavior")
RequestBody body = RequestBody.create(mediaType, "json"); @ApiOperation("POST-4:考试信息采集接口")
Request request = new Request.Builder() public RensheResponseVO uploadChapterBehavior() throws IOException {
.url("https://api.shzypxy.com/token/accessPrivateKey") return renSheJuService.uploadChapterBehavior();
.post(body) }
.build();
try {
Response response = client.newCall(request).execute();
return response.body().string();
}catch (Exception e){
e.printStackTrace();
}
return null; @PostMapping("uploadClassAnswerQuestionBehavior")
@ApiOperation("POST-5:答疑辅导采集接口")
public RensheResponseVO uploadClassAnswerQuestionBehavior() throws IOException {
return renSheJuService.uploadClassAnswerQuestionBehavior();
} }
@PostMapping("classBaseInfo") @PostMapping("uploadImage")
@ApiOperation("班级基本信息信息采集接口") @ApiOperation("POST-6 班级活跃度/实名认证照片信息采集接口")
public String classBaseInfo(){ public List<RensheResponseVO> uploadImage()throws IOException {
return renSheJuService.uploadImage();
}
@PostMapping("getClassCodeByPrivateKey")
@ApiOperation("POST-7 获取培训待绑定的(班级编号,项目编号)列表")
public RensheResponseVO getClassCodeByPrivateKey()throws IOException {
return renSheJuService.getClassCodeByPrivateKey();
}
@PostMapping("uploadClassCode")
@ApiOperation("POST-8 上下游班级数据绑定接口")
public RensheResponseVO uploadClassCode()throws IOException {
return renSheJuService.uploadClassCode();
}
@PostMapping("getErrorClass")
@ApiOperation("POST-9 获取推送失败班级列表")
public RensheResponseVO getErrorClass()throws IOException{
return renSheJuService.getErrorClass();
}
return null; @PostMapping("clear")
@ApiOperation("POST-10 清除推送失败班级缓存")
public RensheStringVO clear()throws IOException{
return renSheJuService.clear();
} }
} }
package com.subsidy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 人社局推送失败记录表 前端控制器
* </p>
*
* @author Tuyp
* @since 2023-02-07
*/
@RestController
@Api(tags = "人社局推送失败记录表")
@RequestMapping("/rensheju-history-do")
public class RenshejuHistoryController {
}
...@@ -37,7 +37,7 @@ public class VodPlayHistoryController { ...@@ -37,7 +37,7 @@ public class VodPlayHistoryController {
@PostMapping("insertHistory") @PostMapping("insertHistory")
@ApiOperation("记录学生看视频位置 ajax请求 classId班级id vodId 视频id " + @ApiOperation("记录学生看视频位置 ajax请求 classId班级id vodId 视频id " +
"memberId 成员id playLength 播放时长 playRecord 位点 ") "memberId 成员id playLength 播放时长 playRecord 位点 suspendLength暂停时长 ")
@LoginRequired @LoginRequired
@TimeRequired @TimeRequired
public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){ public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){
...@@ -46,7 +46,7 @@ public class VodPlayHistoryController { ...@@ -46,7 +46,7 @@ public class VodPlayHistoryController {
@RequestMapping("insertHistoryNew") @RequestMapping("insertHistoryNew")
@ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id " + @ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id " +
"playLength 播放时长 playRecord 位点 ") "playLength 播放时长 playRecord 位点 suspendLength")
@TimeRequired @TimeRequired
public ResponseVO insertHistoryNew(@RequestBody String param){ public ResponseVO insertHistoryNew(@RequestBody String param){
InsertHistoryNewDTO insertHistoryNewDTO = JSON.parseObject(param, InsertHistoryNewDTO.class); InsertHistoryNewDTO insertHistoryNewDTO = JSON.parseObject(param, InsertHistoryNewDTO.class);
......
package com.subsidy.dto.renshe;
import lombok.Data;
@Data
public class ActivityList {
/**
* 是否通过,0.通过 1.未通过
*/
private Integer access;
/**
* 检验类型,1.人脸识别 2.弹出框点击事件 3.课堂答题 4.其他
*/
private Integer activityDetection;
/**
* 活跃度检测时间,【13位时间戳】【精确到毫秒】
*/
private Long activityTime;
/**
* 错误类型,1.人脸识别未通过2.弹出框未点击3.没有做课堂答题4.课堂答题合格率不达标
*/
private Integer errorInfo;
}
package com.subsidy.dto.renshe;
import lombok.Data;
@Data
public class AnswerAndQuestionList {
/**
* 回答时间
*/
private long answer;
/**
* 提问时间
*/
private long question;
}
package com.subsidy.dto.renshe;
import lombok.Data;
import java.util.List;
@Data
public class AnswerBasic {
/**
* 答疑辅导,提问和回答都存在值时才进行传递
*/
private List<AnswerAndQuestionList> answerAndQuestionList;
private String downCode;
private String identity;
}
package com.subsidy.dto.renshe;
import lombok.Data;
import java.util.List;
@Data
public class ChapterExamBasic {
/**
* 是否通过,0通过1未通过
*/
private Long access;
/**
* 活跃度列表(数组),【数组】
*/
private List<ActivityList> activityList;
/**
* 章节(课程)编码
*/
private String chapterCode;
/**
* 临时班级(项目)编号
*/
private String downCode;
/**
* 章节(课程)考试时间列表,【数组】
*/
private List<ExamList> examList;
/**
* 章节(课程)考试总时长,该字段数据应为当日产生examList列表内多条结束时间-开始时间累加和【秒】
*/
private Long examTime;
/**
* 学员身份证号,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* 学员电话号,会对学生手机号长度、格式进行校验
*/
private String phone;
/**
* 学员姓名
*/
private String studentName;
}
package com.subsidy.dto.renshe;
import lombok.Data;
@Data
public class ChapterList2 {
private String chapterCode;
private String chapterName;
private Integer isExam;
private String chapterTime;
private String examTime;
}
package com.subsidy.dto.renshe;
import lombok.Data;
@Data
public class ChapterList3 {
/**
* 章节(课程)编码,与基本信息内的章节(课程)编码相对应
*/
private String chapterCode;
/**
* 章节(课程)学习时长,该学习时间段内本章节学习累计时长【秒】
*/
private long chapterTime;
/**
* 学习结束时间(视频播放结束时间),【13位时间戳】【精确到毫秒】
*/
private long endTime;
/**
* 章节(课程)暂停时长,该学习时间段内本章节播放暂停累计时长【秒】(2023年2月1日开始实行)
*/
private long pauseTime;
/**
* 学习开始时间(视频播放开始时间),【13位时间戳】【精确到毫秒】
*/
private long startTime;
}
package com.subsidy.dto.renshe;
import lombok.Data;
import java.util.List;
@Data
public class ClassBaseInfoDTO {
private List<EpidemicSituationClassBasic> epidemicSituationClassBasic;
private String privateKey;
}
package com.subsidy.dto.renshe;
import lombok.Data;
@Data
public class ClassCodeBasic {
/**
* 班级(项目)编号
*/
private String classCode;
/**
* 临时班级(项目)编号
*/
private String downCode;
}
package com.subsidy.dto.renshe;
import lombok.Data;
import java.util.List;
@Data
public class ClassHourBasic {
/**
* 活跃度列表,【数组】
*/
private List<ActivityList> activityList;
/**
* 临时班级(临时项目)编号
*/
private String downCode;
/**
* 学员身份证号,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* 当日累计学习时长,视频暂停时间不计入【秒】
*/
private long learnTime;
/**
* 上线时间列表,【数组】
*/
private List<LoginList> loginList;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】
*/
private long loginTime;
/**
* 学员电话号,会对学生手机号长度、格式进行校验
*/
private String phone;
/**
* 当日累计播放时长,视频暂停时间计入【秒】
*/
private Long playTime;
/**
* 学员姓名
*/
private String studentName;
}
package com.subsidy.dto.renshe;
import lombok.Data;
import java.util.List;
@Data
public class ClassHourBehaviorDTO {
/**
* 班级(项目)学时列表,【数组】班级(项目)学时列表
*/
private List<ClassHourBasic> classHourBasic;
/**
* 私钥
*/
private String privateKey;
}
package com.subsidy.dto.renshe;
import com.subsidy.vo.renshe.MemberVO;
import lombok.Data;
import java.util.List;
@Data
public class EpidemicSituationClassBasic {
private String areaName;
private List<ChapterList2> chapterList;
private Long courseHour;
private String downCode;
private Long endDate;
private Long learnHour;
// private String professionName;
private String shortName;
private Long startDate;
private List<MemberVO> studentList;
private String trainingCode;
private String trainingName;
}
package com.subsidy.dto.renshe;
import lombok.Data;
@Data
public class ExamList {
/**
* 章节(课程)考试时间列表,【13位时间戳】【精确到毫秒】
*/
private long endTime;
/**
* 登录ip,会对IP进行校验
*/
private String ip;
/**
* 章节(课程)考试开始时间,【13位时间戳】【精确到毫秒】
*/
private long startTime;
}
package com.subsidy.dto.renshe;
import lombok.Data;
@Data
public class ImageDetailList {
/**
* 检测时间,【13位时间戳】【精确到毫秒】如检测类型为活跃度检测则与【学时信息采集接口】、【考试信息采集接口】activityTime时间保持一致
*/
private Long activityTime;
/**
* 检测类型,0.实名认证 1活跃度检测 (实名认证第一次必须是活体采集)
*/
private Long detectionType;
/**
* 学员身份证,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* Base64图片,【jpg】【30kb~50kb】【413*295】
*/
private String imageBase64;
/**
* 学员电话号,会对学生手机号长度、格式进行校验
*/
private String phone;
/**
* 行为类型,0实名认证 1 学时行为类型的活跃度检测 2 考试行为类型的活跃度检测
*/
private Long processType;
/**
* 学员姓名
*/
private String studentName;
}
package com.subsidy.dto.renshe;
import lombok.Data;
import java.util.List;
@Data
public class LoginList {
/**
* 章节(课程)学时列表
*/
private List<ChapterList3> chapterList;
/**
* 下线时间,【13位时间戳】【精确到毫秒】
*/
private long endTime;
/**
* 登录ip,会对IP进行校验
*/
private String ip;
/**
* 上线时间,【13位时间戳】【精确到毫秒】
*/
private long startTime;
}
package com.subsidy.dto.renshe;
import lombok.Data;
import java.util.List;
@Data
public class UploadChapterBehaviorDTO {
/**
* 章节(课程)考试列表,【数组】
*/
private List<ChapterExamBasic> chapterExamBasic;
/**
* 私钥
*/
private String privateKey;
}
package com.subsidy.dto.renshe;
import lombok.Data;
import java.util.List;
@Data
public class UploadClassAnswerQuestionBehaviorDTO {
private List<AnswerBasic> answerBasic;
private String privateKey;
}
package com.subsidy.dto.renshe;
import lombok.Data;
import java.util.List;
@Data
public class UploadClassCodeDTO {
private List<ClassCodeBasic> classCodeBasic;
/**
* 私钥
*/
private String privateKey;
}
package com.subsidy.dto.renshe;
import lombok.Data;
import java.util.List;
@Data
public class UploadImageDTO {
/**
* 临时班级(项目)编码
*/
private String downCode;
/**
* 活跃度照片列表,【数组】
*/
private List<ImageDetailList> imageDetailList;
/**
* 私钥
*/
private String privateKey;
}
package com.subsidy.jobs; package com.subsidy.jobs;
import com.subsidy.service.RenSheJuService;
import com.subsidy.service.RenshejuHistoryService;
import com.subsidy.service.impl.RenshejuHistoryServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.io.IOException;
/** /**
* 人社局数据对接 * 人社局数据对接
*/ */
...@@ -9,4 +16,72 @@ import org.springframework.stereotype.Component; ...@@ -9,4 +16,72 @@ import org.springframework.stereotype.Component;
public class RenSheJuJob { public class RenSheJuJob {
@Autowired
private RenSheJuService renSheJuService;
/**
* 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-9 获取推送失败班级列表
// */
// @Scheduled(cron = "0 35 1 * * ?")
// public void getErrorClass()throws IOException{
// renSheJuService.getErrorClass();
// }
} }
...@@ -66,4 +66,10 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> { ...@@ -66,4 +66,10 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> {
* 获取证书的全部班级 * 获取证书的全部班级
*/ */
List<GetAllClassesVO> getAllCertClasses(ClassDictDO classDictDO); List<GetAllClassesVO> getAllCertClasses(ClassDictDO classDictDO);
/**
* 前一天产生视频学习数据的班级信息
*/
List<Long> dailyClassInfo();
} }
package com.subsidy.mapper;
import com.subsidy.dto.renshe.ChapterExamBasic;
import com.subsidy.dto.renshe.ChapterList2;
import com.subsidy.dto.renshe.ChapterList3;
import com.subsidy.dto.renshe.ClassHourBasic;
import com.subsidy.model.ActivityDetectionDO;
import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.OprMemDictDO;
import com.subsidy.vo.renshe.*;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.List;
@Repository
public interface RenSheJuMapper {
/**
* 查询班级基本信息
*/
ClassBaseInfoVO classBaseInfo(Long classId);
/**
* 查询班级学员信息
*/
List<MemberVO> classMembers(Long classId);
/**
* 课程下章节信息
*/
List<ChapterList2> classChapters(Long classId);
/**
* 新增班级
*/
List<Long> newClasses();
/**
* 前一天新增视频学习数据
*/
List<DailyStudyInfoVO> dailyStudyInfo();
/**
* 前一天活跃度检测列表
*/
List<DailyActivitiesVO > dailyActivities(String classId, Long memberId);
/**
* 考试活跃度检测--人脸
*/
List<ExamActivitiesVO> examActivities(String classId,Long memberId);
/**
* 某人某天累计在线时长
*/
Long dailyStayLength(Long memberId);
/**
* 查看某人前一天上线的时间
*/
List<OprMemDictDO> loginRecords(Long memberId);
/**
* 查看某人前一天下线的时间
*/
List<OprMemDictDO> loginOutRecords(Long memberId);
/**
* 某个人某时间段的学习记录
*/
List<ChapterList3> dailyStudyRecords(Long memberId,String classId,String startDate, String endDate);
/**
* 前一天考试通过数据
*/
List<DailyExamBasicVO> dailyExamBasic();
/**
* 查找课程最后一个视频
*/
String classVodName(String classId);
/**
* 找到某人某个时间段内的测评记录
*/
List<ExerciseDoneResultDO> dailyExerciseDone(Long memberId, String startDate, String endDate);
/**
* 找到某人当天答疑的记录
*/
List<DailyAnswerVO> dailyAnswer();
/**
* 查找前一天做过人脸识别的班级
*/
List<Long> checkClassIds();
/**
* 查看某个班级的成员做过的人脸识别记录
*/
List<ClassImageChecksVO> classImageChecks(Long classId);
/**
* 前一天做过考试验证并且通过的人
*/
List<ClassImageChecksVO> passExamCheck(Long classId);
}
package com.subsidy.mapper;
import com.subsidy.model.RenshejuHistoryDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 人社局推送失败记录表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2023-02-07
*/
@Repository
public interface RenshejuHistoryMapper extends BaseMapper<RenshejuHistoryDO> {
}
...@@ -96,6 +96,10 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> { ...@@ -96,6 +96,10 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
*/ */
List<VodPlayHistoryDO> getVodPlayDay(Long classId, Long memberId, Date endDate); List<VodPlayHistoryDO> getVodPlayDay(Long classId, Long memberId, Date endDate);
/**
* 找到某个人最新的学习记录
*/
// Long memberLatestRecord(Long memberId);
double getStudyTotal(); double getStudyTotal();
......
...@@ -56,6 +56,11 @@ public class CompanyDictDO extends BaseModel { ...@@ -56,6 +56,11 @@ public class CompanyDictDO extends BaseModel {
private String address; private String address;
/** /**
* 区域
*/
private String areaName;
/**
* 是否需要跳转到Q学友 * 是否需要跳转到Q学友
*/ */
private Boolean qxyStatus; private Boolean qxyStatus;
......
package com.subsidy.model;
import com.subsidy.util.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 人社局推送失败记录表
* </p>
*
* @author Tuyp
* @since 2023-02-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("rensheju_history")
public class RenshejuHistoryDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 接口名称
*/
private String interfaceName;
/**
* 入参
*/
private String inputParam;
/**
* 出参
*/
private Object outputParam;
}
...@@ -48,6 +48,11 @@ public class VodPlayHistoryDO extends BaseModel { ...@@ -48,6 +48,11 @@ public class VodPlayHistoryDO extends BaseModel {
private Integer playLength; private Integer playLength;
/** /**
* 暂停时长
*/
private Integer suspendLength;
/**
* 播放视频位置 * 播放视频位置
*/ */
private Integer playRecord; private Integer playRecord;
......
...@@ -23,4 +23,5 @@ public interface ActivityDetectionService extends IService<ActivityDetectionDO> ...@@ -23,4 +23,5 @@ public interface ActivityDetectionService extends IService<ActivityDetectionDO>
IPage<GetCheckHistoryVO> getCheckHistory(GetCheckHistoryDTO getCheckHistoryDTO); IPage<GetCheckHistoryVO> getCheckHistory(GetCheckHistoryDTO getCheckHistoryDTO);
String verifyError(ActivityDetectionDO activityDetectionDO);
} }
package com.subsidy.service;
import com.subsidy.dto.renshe.*;
import com.subsidy.vo.renshe.RensheResponseVO;
import com.subsidy.vo.renshe.RensheStringVO;
import java.io.IOException;
import java.util.List;
public interface RenSheJuService {
RensheResponseVO classBaseInfo() throws IOException;
RensheResponseVO classHourBehavior() throws IOException;
RensheResponseVO uploadChapterBehavior() throws IOException;
RensheResponseVO uploadClassAnswerQuestionBehavior()throws IOException;
List<RensheResponseVO> uploadImage()throws IOException;
RensheResponseVO getClassCodeByPrivateKey()throws IOException;
RensheResponseVO uploadClassCode()throws IOException;
RensheResponseVO getErrorClass()throws IOException;
RensheStringVO clear()throws IOException;
void test();
}
package com.subsidy.service;
import com.subsidy.model.RenshejuHistoryDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 人社局推送失败记录表 服务类
* </p>
*
* @author Tuyp
* @since 2023-02-07
*/
public interface RenshejuHistoryService extends IService<RenshejuHistoryDO> {
}
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.common.exception.HttpException; import com.subsidy.common.exception.HttpException;
import com.subsidy.dto.detection.GetCheckHistoryDTO; import com.subsidy.dto.detection.GetCheckHistoryDTO;
import com.subsidy.dto.detection.VerifyDTO; import com.subsidy.dto.detection.VerifyDTO;
import com.subsidy.mapper.VodPlayHistoryMapper;
import com.subsidy.model.ActivityDetectionDO; import com.subsidy.model.ActivityDetectionDO;
import com.subsidy.mapper.ActivityDetectionMapper; import com.subsidy.mapper.ActivityDetectionMapper;
import com.subsidy.service.ActivityDetectionService; import com.subsidy.service.ActivityDetectionService;
...@@ -13,6 +14,7 @@ import com.subsidy.util.ActivityDetectionUtils; ...@@ -13,6 +14,7 @@ import com.subsidy.util.ActivityDetectionUtils;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.activity.GetCheckHistoryVO; import com.subsidy.vo.activity.GetCheckHistoryVO;
import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultResponse; import com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -28,6 +30,9 @@ import javax.servlet.http.HttpServletRequest; ...@@ -28,6 +30,9 @@ import javax.servlet.http.HttpServletRequest;
@Service @Service
public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionMapper, ActivityDetectionDO> implements ActivityDetectionService { public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionMapper, ActivityDetectionDO> implements ActivityDetectionService {
@Autowired
private VodPlayHistoryMapper vodPlayHistoryMapper;
public String verify(VerifyDTO verifyDTO, HttpServletRequest request){ public String verify(VerifyDTO verifyDTO, HttpServletRequest request){
try{ try{
...@@ -47,6 +52,11 @@ public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionM ...@@ -47,6 +52,11 @@ public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionM
//失败 //失败
activityDetectionDO.setStatus(0); activityDetectionDO.setStatus(0);
this.baseMapper.insert(activityDetectionDO); this.baseMapper.insert(activityDetectionDO);
//
// //失败的话删掉这个人最新的学习数据
// Long latestRecord = vodPlayHistoryMapper.memberLatestRecord(verifyDTO.getMemberId());
// vodPlayHistoryMapper.deleteById(latestRecord);
throw new HttpException(19001); throw new HttpException(19001);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -60,4 +70,10 @@ public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionM ...@@ -60,4 +70,10 @@ public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionM
return this.baseMapper.getCheckHistory(pager,getCheckHistoryDTO.getClassId(),getCheckHistoryDTO.getMemberId()); return this.baseMapper.getCheckHistory(pager,getCheckHistoryDTO.getClassId(),getCheckHistoryDTO.getMemberId());
} }
public String verifyError(ActivityDetectionDO activityDetectionDO){
activityDetectionDO.setStatus(0);
activityDetectionDO.setCheckType(0);
this.baseMapper.insert(activityDetectionDO);
return ConstantUtils.ADD_SUCCESS;
}
} }
...@@ -270,15 +270,16 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -270,15 +270,16 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
imageCheckRecordDO.setResult(1); imageCheckRecordDO.setResult(1);
activityDetectionDO.setStatus(1); activityDetectionDO.setStatus(1);
//如果是签到页的认证,则把图片写到member表里 //如果是签到页的认证,则把图片写到member表里
if (imageCheckRecordDO.getCheckPlace() == 1) { if (imageCheckRecordDO.getCheckPlace() == 0) {
//写到学生班级映射表里去 //写到学生班级映射表里去
ClassMemberMappingDO classMemberMappingDO = classMemberMappingMapper.selectOne(new QueryWrapper<ClassMemberMappingDO>() ClassMemberMappingDO classMemberMappingDO = classMemberMappingMapper.selectOne(new QueryWrapper<ClassMemberMappingDO>()
.lambda() .lambda()
.eq(ClassMemberMappingDO::getMemberId, imageCheckRecordDO.getMemberId()) .eq(ClassMemberMappingDO::getMemberId, imageCheckRecordDO.getMemberId())
.eq(ClassMemberMappingDO::getClassId, imageCheckRecordDO.getClassId())); .eq(ClassMemberMappingDO::getClassId, imageCheckRecordDO.getClassId()));
if (StringUtils.isEmpty(classMemberMappingDO.getPhoto())){
classMemberMappingDO.setPhoto(imageCheckRecordDO.getPhoto()); classMemberMappingDO.setPhoto(imageCheckRecordDO.getPhoto());
classMemberMappingMapper.updateById(classMemberMappingDO); classMemberMappingMapper.updateById(classMemberMappingDO);
}
} }
} else { } else {
activityDetectionDO.setStatus(0); activityDetectionDO.setStatus(0);
......
package com.subsidy.service.impl;
import com.subsidy.model.RenshejuHistoryDO;
import com.subsidy.mapper.RenshejuHistoryMapper;
import com.subsidy.service.RenshejuHistoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 人社局推送失败记录表 服务实现类
* </p>
*
* @author Tuyp
* @since 2023-02-07
*/
@Service
public class RenshejuHistoryServiceImpl extends ServiceImpl<RenshejuHistoryMapper, RenshejuHistoryDO> implements RenshejuHistoryService {
}
package com.subsidy.util;
public class RenSheJuConstant {
/**
* POST-2:班级基本信息信息采集接口
*/
public static final String POST_2 = "POST_2_classBaseInfo";
/**
* POST-3:学时信息采集接口
*/
public static final String POST_3 = "POST_3_classHourBehavior";
/**
* POST-4:考试信息采集接口
*/
public static final String POST_4 = "POST_4_uploadChapterBehavior";
/**
* POST-5:答疑辅导采集接口
*/
public static final String POST_5 = "POST_5_uploadClassAnswerQuestionBehavior";
/**
* POST-6 班级活跃度/实名认证照片信息采集接口
*/
public static final String POST_6 = "POST_6_uploadImage";
/**
* POST-7 获取培训待绑定的(班级编号,项目编号)列表
*/
public static final String POST_7 = "POST_7_getClassCodeByPrivateKey";
/**
* POST-8 上下游班级数据绑定接口
*/
public static final String POST_8 = "POST_8_uploadClassCode";
/**
* POST-9 获取推送失败班级列表
*/
public static final String POST_9 = "POST_9_getErrorClass";
/**
* POST-10 清除推送失败班级缓存
*/
public static final String POST_10 = "POST_10_clear";
}
...@@ -35,4 +35,6 @@ public class OperatorsVO { ...@@ -35,4 +35,6 @@ public class OperatorsVO {
private String superviseName; private String superviseName;
private String companyCode; private String companyCode;
private String areaName;
} }
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class ActivityList9 {
/**
* 活跃度是否通过
*/
private String access;
/**
* 活跃度检测依据
*/
private String activityDetection;
/**
* 活跃度检测时间
*/
private String activityTime;
/**
* 活跃度未通过原因
*/
private String errorInfo;
/**
* 未通过详情
*/
private String errorMessage;
/**
* 修改日期
*/
private String updateDate;
/**
* 同步状态
*/
private String updateStatus;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class ChapterList9 {
/**
* 章节(课程)编码,与基本信息内的章节(课程)编码相对应
*/
private String chapterCode;
/**
* 章节(课程)学习时长,本次登录时间段内本章节学习累计时长【分】
*/
private long chapterTime;
/**
* 学习结束时间
*/
private String endTime;
/**
* 未通过详情
*/
private String errorMessage;
/**
* 学习开始时间
*/
private String startTime;
/**
* 修改日期
*/
private String updateDate;
/**
* 同步状态
*/
private String updateStatus;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class ClassBaseInfoVO {
private String downCode;
private String shortName;
private Long learnHour;
private Long courseHour;
private Long startDate;
private Long endDate;
private String areaName;
private String trainingName;
private String trainingCode;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class ClassImageChecksVO {
/**
* 检测时间,【13位时间戳】【精确到毫秒】如检测类型为活跃度检测则与【学时信息采集接口】、【考试信息采集接口】activityTime时间保持一致
*/
private Long activityTime;
/**
* 检测类型,0.实名认证 1活跃度检测 (实名认证第一次必须是活体采集)
*/
private Long detectionType;
/**
* 学员身份证,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* Base64图片,【jpg】【30kb~50kb】【413*295】
*/
private String image;
/**
* 学员电话号,会对学生手机号长度、格式进行校验
*/
private String phone;
/**
* 行为类型,0实名认证 1 学时行为类型的活跃度检测 2 考试行为类型的活跃度检测
*/
private Long processType;
/**
* 学员姓名
*/
private String studentName;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class Ctt7 {
/**
* 所在区域名称
*/
private String areaName;
/**
* 班级(项目)编号
*/
private String classCode;
/**
* 项目(项目)名称
*/
private String name;
/**
* 所属企业名称
*/
private String trainingUnit;
}
package com.subsidy.vo.renshe;
import com.subsidy.dto.renshe.LoginList;
import lombok.Data;
import java.util.List;
@Data
public class Ctt9 {
/**
* 活跃度列表,【数组】
*/
private List<ActivityList9> activityList;
/**
* 班级(项目)编码
*/
private Object downCode;
/**
* 未通过详情
*/
private String errorMessage;
/**
* 学员身份证,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* 当日累计学习时长,视频暂停时间不计入【分】
*/
private Object learnTime;
/**
* 上线时间列表,【数组】
*/
private List<LoginList> loginList;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【分】
*/
private Object loginTime;
/**
* 学员电话,会对手机号长度、格式进行校验
*/
private String phone;
/**
* 当日累计播放时长,视频暂停时间计入【分】
*/
private Object playTime;
/**
* 学员姓名
*/
private String studentName;
/**
* 修改日期
*/
private Long updateDate;
/**
* 同步状态
*/
private String updateStatus;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class DailyActivitiesVO {
private Integer access;
private Long activityTime;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class DailyAnswerVO {
private Long id;
private Long askId;
private String downCode;
private String identity;
private Long answer;
private Long question;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class DailyExamBasicVO {
private Long memberId;
private String downCode;
private String studentName;
private String phone;
private String identity;
private Long access;
private Long examTime;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class DailyStudyInfoVO {
private Long memberId;
// private Long classId;
/**
* 临时班级(临时项目)编号
*/
private String downCode;
/**
* 学员身份证号,会对身份证号长度、格式进行校验、X用大写
*/
private String identity;
/**
* 当日累计学习时长,视频暂停时间不计入【秒】
*/
private long learnTime;
/**
* 当日累计登陆时长,该字段数据应为当日产生LoginList列表内多条下线时间-上线时间累加和【秒】
*/
private long loginTime;
/**
* 学员电话号,会对学生手机号长度、格式进行校验
*/
private String phone;
/**
* 当日累计播放时长,视频暂停时间计入【秒】
*/
private Long playTime;
/**
* 学员姓名
*/
private String studentName;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class ExamActivitiesVO {
private Integer access;
private Long activityTime;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class GetSecretChildVO {
private String privateKey;
private String validTime;
private String ip;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class GetSecretVO {
private Integer c;
private String msg;
private GetSecretChildVO ctt;
}
package com.subsidy.vo.renshe;
import lombok.Data;
import java.util.List;
@Data
public class LoginList9 {
/**
* 章节(课程)学时列表
*/
private List<ChapterList9> chapterList;
/**
* 下线时间,【13位时间戳】【精确到毫秒】
*/
private long endTime;
/**
* 未通过详情
*/
private String errorMessage;
/**
* 登录ip,会对IP进行校验
*/
private String ip;
/**
* 上线时间,【13位时间戳】【精确到毫秒】
*/
private long startTime;
/**
* 修改日期
*/
private String updateDate;
/**
* 同步状态
*/
private String updateStatus;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class MemberVO {
private String name;
private String phone;
private String identity;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class RensheResponseVO {
/**
* 响应码
*/
private long c;
/**
* 响应体
*/
private Object ctt;
/**
* 响应信息
*/
private String msg;
}
package com.subsidy.vo.renshe;
import lombok.Data;
@Data
public class RensheStringVO {
/**
* 响应码
*/
private long c;
/**
* 响应体
*/
private Object ctt;
/**
* 响应信息
*/
private String msg;
}
...@@ -57,4 +57,4 @@ qxueyou.securityKey=626737T1-65K0-5xC2-0Y0V-2Aq95qxy ...@@ -57,4 +57,4 @@ qxueyou.securityKey=626737T1-65K0-5xC2-0Y0V-2Aq95qxy
qxueyou.url=https://dev.qxueyou.com/auth/user/token qxueyou.url=https://dev.qxueyou.com/auth/user/token
renshe.url = https://test.shzypxy.com renshe.url = https://test.shzypxy.com
renshe.secretKey = 111 renshe.secretKey = ad927f0b-6a39-43a7-bac7-163baef1fff7
\ No newline at end of file \ No newline at end of file
...@@ -54,4 +54,7 @@ spring.redis.lettuce.pool.min-idle=8 ...@@ -54,4 +54,7 @@ spring.redis.lettuce.pool.min-idle=8
qxueyou.appId=qxywz5nnWMI77CM3Tx qxueyou.appId=qxywz5nnWMI77CM3Tx
qxueyou.securityKey=626737T1-65K0-5xC2-0Y0V-2Aq95qxy qxueyou.securityKey=626737T1-65K0-5xC2-0Y0V-2Aq95qxy
qxueyou.url=https://dev.qxueyou.com/auth/user/token qxueyou.url=https://dev.qxueyou.com/auth/user/token
\ No newline at end of file
renshe.url = https://api.shzypxy.com
renshe.secretKey = 111
\ No newline at end of file
...@@ -250,4 +250,14 @@ ...@@ -250,4 +250,14 @@
order by t.create_date desc order by t.create_date desc
</select> </select>
<select id="dailyClassInfo" resultType="long">
SELECT DISTINCT
t1.class_id
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
</select>
</mapper> </mapper>
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
t2.logo, t2.logo,
t2.address, t2.address,
t2.supervise_name, t2.supervise_name,
t2.company_code t2.company_code,
t2.area_name
FROM FROM
administer t administer t
left join role_administer_mapping t4 on t.id = t4.administer_id left join role_administer_mapping t4 on t.id = t4.administer_id
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.RenshejuHistoryMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.RenshejuHistoryDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="interface_name" property="interfaceName" />
<result column="input_param" property="inputParam" />
<result column="output_param" property="outputParam" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, interface_name, input_param, output_param
</sql>
</mapper>
...@@ -399,6 +399,18 @@ ...@@ -399,6 +399,18 @@
t.create_date t.create_date
</select> </select>
<!-- <select id="memberLatestRecord" parameterType="long" resultType="long">-->
<!-- SELECT-->
<!-- t.id-->
<!-- FROM-->
<!-- vod_play_history t-->
<!-- WHERE-->
<!-- t.member_id = #{memberId}-->
<!-- ORDER BY-->
<!-- t.create_date DESC-->
<!-- LIMIT 1-->
<!-- </select>-->
<select id="getStudyTotal" resultType="java.lang.Double"> <select id="getStudyTotal" resultType="java.lang.Double">
SELECT SELECT
sum( play_length ) sum( play_length )
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!