Commit 70bfd420 by 涂亚平

人社局测试

1 parent c7dc8010
...@@ -51,7 +51,7 @@ public class AdministerController { ...@@ -51,7 +51,7 @@ public class AdministerController {
return ResponseData.generateCreatedResponse(0,administerService.login(administerDO)); return ResponseData.generateCreatedResponse(0,administerService.login(administerDO));
} }
@PostMapping("/getPermissions") @PostMapping("/getPermissions")
@ApiOperation("权限查询") @ApiOperation("权限查询")
@LoginRequired @LoginRequired
public ResponseVO getPermissions() { public ResponseVO getPermissions() {
......
package com.subsidy.jobs; //package com.subsidy.jobs;
//
import com.alibaba.fastjson.JSONObject; //import com.alibaba.fastjson.JSONObject;
import com.subsidy.common.ResponseData; //import com.subsidy.common.ResponseData;
import com.subsidy.service.RenSheJuService; //import com.subsidy.mapper.OprMemDictMapper;
import com.subsidy.service.RenshejuHistoryService; //import com.subsidy.model.OprMemDictDO;
import com.subsidy.service.impl.RenshejuHistoryServiceImpl; //import com.subsidy.service.RenSheJuService;
import com.subsidy.util.websocket.WebSocketUtil; //import com.subsidy.service.RenshejuHistoryService;
import org.springframework.beans.factory.annotation.Autowired; //import com.subsidy.service.impl.RenshejuHistoryServiceImpl;
import org.springframework.scheduling.annotation.Scheduled; //import com.subsidy.util.websocket.WebSocketUtil;
import org.springframework.stereotype.Component; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.socket.TextMessage; //import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.socket.WebSocketSession; //import org.springframework.stereotype.Component;
//import org.springframework.web.socket.TextMessage;
import java.io.IOException; //import org.springframework.web.socket.WebSocketSession;
import java.util.concurrent.ConcurrentHashMap; //
//import java.io.IOException;
/** //import java.util.List;
* 人社局数据对接 //import java.util.concurrent.ConcurrentHashMap;
*/ //
@Component ///**
public class RenSheJuJob { // * 人社局数据对接
// */
//@Component
@Autowired //public class RenSheJuJob {
private RenSheJuService renSheJuService; //
//
/** // @Autowired
* POST-2:班级基本信息信息采集接口 // private RenSheJuService renSheJuService;
*/ //
@Scheduled(cron = "0 0 1 * * ?") // @Autowired
public void classBaseInfo()throws IOException { // private OprMemDictMapper oprMemDictMapper;
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 获取推送失败班级列表 // * POST-2:班级基本信息信息采集接口
// */ // */
// @Scheduled(cron = "0 35 1 * * ?") // @Scheduled(cron = "0 0 1 * * ?")
// public void getErrorClass()throws IOException{ // public void classBaseInfo()throws IOException {
// renSheJuService.getErrorClass(); // renSheJuService.classBaseInfo();
// } // }
//
@Scheduled(cron = "00 58 23 * * ?") // /**
public void cancelLogin()throws IOException{ // * POST-3:学时信息采集接口
ConcurrentHashMap<Long, WebSocketSession> webSocketMap = WebSocketUtil.webSocketMap; // */
for (Long key : webSocketMap.keySet()){ // @Scheduled(cron = "0 5 1 * * ?")
webSocketMap.get(key).sendMessage(new TextMessage(JSONObject.toJSONString(ResponseData.generateCreatedResponse(17001)))); // 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<Long, WebSocketSession> webSocketMap = WebSocketUtil.webSocketMap;
//
// List<Long> 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();
// }
// }
// }
//
//}
...@@ -23,8 +23,27 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> { ...@@ -23,8 +23,27 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> {
List<OprMemDictDO> getRecordByDate(); List<OprMemDictDO> getRecordByDate();
/**
* 当天最后一次登录记录
*/
OprMemDictDO getLatestLoginInfo(Long userId); OprMemDictDO getLatestLoginInfo(Long userId);
void deleteData(OprMemDictDO oprMemDictDO);
// /**
// * 当天最后一次登录
// */
// OprMemDictDO getLatestLogoutInfo(Long userId);
// void deleteData(OprMemDictDO oprMemDictDO);
/**
* 查看当天还在线的用户
*/
List<Long> onlineUsers();
// /**
// * 根据最后一次看视频时间随机去写几秒登出
// */
// void insertLastStudyRecord();
} }
...@@ -4,10 +4,7 @@ import com.subsidy.dto.renshe.ChapterExamBasic; ...@@ -4,10 +4,7 @@ import com.subsidy.dto.renshe.ChapterExamBasic;
import com.subsidy.dto.renshe.ChapterList2; import com.subsidy.dto.renshe.ChapterList2;
import com.subsidy.dto.renshe.ChapterList3; import com.subsidy.dto.renshe.ChapterList3;
import com.subsidy.dto.renshe.ClassHourBasic; import com.subsidy.dto.renshe.ClassHourBasic;
import com.subsidy.model.ActivityDetectionDO; import com.subsidy.model.*;
import com.subsidy.model.ClassMemberMappingDO;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.OprMemDictDO;
import com.subsidy.vo.renshe.*; import com.subsidy.vo.renshe.*;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -50,7 +47,9 @@ public interface RenSheJuMapper { ...@@ -50,7 +47,9 @@ public interface RenSheJuMapper {
/** /**
* 考试活跃度检测--人脸 * 考试活跃度检测--人脸
*/ */
List<ExamActivitiesVO> examActivities(String classId,Long memberId); List<ExamActivitiesVO> examActivities(Long classId,Long memberId);
/** /**
* 某人某天累计在线时长 * 某人某天累计在线时长
...@@ -75,17 +74,28 @@ public interface RenSheJuMapper { ...@@ -75,17 +74,28 @@ public interface RenSheJuMapper {
/** /**
* 前一天考试通过数据 * 前一天考试通过数据
*/ */
List<DailyExamBasicVO> dailyExamBasic(); List<Long> dailyExamBasic();
/**
* 前一天做过考试通过数据
*/
List<MemberDO> memberIds(Long classId);
/** /**
* 查找课程最后一个视频 * 查找课程最后一个视频
*/ */
String classVodName(String classId); String classVodName(Long classId);
/**
* 查出考试时间
*/
Long examLength(Long memberId,Long classId);
/** /**
* 找到某人某个时间段内的测评记录 * 找到某人某个时间段内的测评记录
*/ */
List<ExerciseDoneResultDO> dailyExerciseDone(Long memberId, String startDate, String endDate); List<ExerciseDoneResultDO> dailyExerciseDone(Long memberId, String startDate, String endDate,Long classId);
/** /**
* 找到某人当天答疑的记录 * 找到某人当天答疑的记录
...@@ -108,8 +118,13 @@ public interface RenSheJuMapper { ...@@ -108,8 +118,13 @@ public interface RenSheJuMapper {
List<ClassImageChecksVO> passExamCheck(Long classId); List<ClassImageChecksVO> passExamCheck(Long classId);
/** /**
* 进入到课程第二次做人脸识别 * 进入到课程第二次做人脸识别 弃用
*/ */
List<ClassImageChecksVO> studyCheck(Long classId); List<ClassImageChecksVO> studyCheck(Long classId);
/**
* 考试数据
*/
List<ClassImageChecksVO> examCheck(Long classId);
} }
...@@ -133,12 +133,17 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -133,12 +133,17 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
signList1.add(NONCE); signList1.add(NONCE);
String sign = sign(signList1, idCardTicketsVO.getValue()); String sign = sign(signList1, idCardTicketsVO.getValue());
ClassMemberMappingDO classMemberMappingDO = classMemberMappingMapper.selectOne(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getMemberId, memberDO.getId())
.eq(ClassMemberMappingDO::getClassId, classId));
//合作方后台上送身份信息 //合作方后台上送身份信息
SendIdCardInfoVO sendIdCardInfoVO = null; SendIdCardInfoVO sendIdCardInfoVO = null;
if (StringUtils.isEmpty(memberDO.getCheckImage())) { if (StringUtils.isEmpty(classMemberMappingDO.getPhoto())) {
sendIdCardInfoVO = this.h5SendIdCardInfo(imageCheckRecordDO.getBizSeqNo(), memberDO, sign); sendIdCardInfoVO = this.h5SendIdCardInfo(imageCheckRecordDO.getBizSeqNo(), memberDO, sign);
} else { } else {
sendIdCardInfoVO = this.h5SendIdCardInfoCompare(imageCheckRecordDO.getBizSeqNo(), memberDO, sign); sendIdCardInfoVO = this.h5SendIdCardInfoCompare(imageCheckRecordDO.getBizSeqNo(), memberDO, sign, OSSUtils.image2Base64(classMemberMappingDO.getPhoto()));
} }
if (!"0".equals(sendIdCardInfoVO.getCode())) { if (!"0".equals(sendIdCardInfoVO.getCode())) {
...@@ -205,14 +210,21 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -205,14 +210,21 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//合作方后台上送身份信息 //合作方后台上送身份信息
// 查看之前是否有验证过,没有的话就调取权威库,有的话就进行两个图片对比 // 查看之前是否有验证过,没有的话就调取权威库,有的话就进行两个图片对比
SendIdCardInfoVO sendIdCardInfoVO = null; SendIdCardInfoVO sendIdCardInfoVO = null;
if (StringUtils.isEmpty(memberDO.getCheckImage())) {
ClassMemberMappingDO classMemberMappingDO = classMemberMappingMapper.selectOne(new QueryWrapper<ClassMemberMappingDO>()
.lambda()
.eq(ClassMemberMappingDO::getMemberId, memberDO.getId())
.eq(ClassMemberMappingDO::getClassId, classId));
if (StringUtils.isEmpty(classMemberMappingDO.getPhoto())) {
signList1.add(memberDO.getUserName()); signList1.add(memberDO.getUserName());
signList1.add(memberDO.getIdCard()); signList1.add(memberDO.getIdCard());
sign = sign(signList1, idCardTicketsVO.getValue()); sign = sign(signList1, idCardTicketsVO.getValue());
sendIdCardInfoVO = this.sendIdCardInfo(imageCheckRecordDO.getBizSeqNo(), memberDO, sign); sendIdCardInfoVO = this.sendIdCardInfo(imageCheckRecordDO.getBizSeqNo(), memberDO, sign);
} else { } else {
sign = sign(signList1, idCardTicketsVO.getValue()); sign = sign(signList1, idCardTicketsVO.getValue());
sendIdCardInfoVO = this.sendIdCardInfoCompare(imageCheckRecordDO.getBizSeqNo(), memberDO, sign); sendIdCardInfoVO = this.sendIdCardInfoCompare(imageCheckRecordDO.getBizSeqNo(), memberDO, sign, OSSUtils.image2Base64(classMemberMappingDO.getPhoto()));
} }
if (!"0".equals(sendIdCardInfoVO.getCode())) { if (!"0".equals(sendIdCardInfoVO.getCode())) {
...@@ -255,8 +267,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -255,8 +267,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//存数据库 //存数据库
ImageCheckRecordDO imageCheckRecordDO = imageCheckRecordMapper.selectOne(new QueryWrapper<ImageCheckRecordDO>() ImageCheckRecordDO imageCheckRecordDO = imageCheckRecordMapper.selectOne(new QueryWrapper<ImageCheckRecordDO>()
.lambda() .lambda()
.eq(ImageCheckRecordDO::getBizSeqNo,checkResultDTO.getId())); .eq(ImageCheckRecordDO::getBizSeqNo, checkResultDTO.getId()));
if (!StringUtils.isEmpty(resultVO.getSimilarity())) { if (!StringUtils.isEmpty(resultVO.getSimilarity())) {
BeanUtils.copyProperties(resultVO, imageCheckRecordDO); BeanUtils.copyProperties(resultVO, imageCheckRecordDO);
ActivityDetectionDO activityDetectionDO = new ActivityDetectionDO(); ActivityDetectionDO activityDetectionDO = new ActivityDetectionDO();
...@@ -265,7 +277,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -265,7 +277,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
activityDetectionDO.setCheckType(1); activityDetectionDO.setCheckType(1);
activityDetectionDO.setFaceCheckId(imageCheckRecordDO.getId()); activityDetectionDO.setFaceCheckId(imageCheckRecordDO.getId());
try { try {
imageCheckRecordDO.setPhoto(OSSUtils.uploadOneFile(resultVO.getPhotoList().get(resultVO.getPhotoList().size()-1))); imageCheckRecordDO.setPhoto(OSSUtils.uploadOneFile(resultVO.getPhotoList().get(resultVO.getPhotoList().size() - 1)));
if ((Double.valueOf(imageCheckRecordDO.getSimilarity()) > 50)) { if ((Double.valueOf(imageCheckRecordDO.getSimilarity()) > 50)) {
imageCheckRecordDO.setResult(1); imageCheckRecordDO.setResult(1);
activityDetectionDO.setStatus(1); activityDetectionDO.setStatus(1);
...@@ -276,7 +288,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -276,7 +288,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
.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())){ if (StringUtils.isEmpty(classMemberMappingDO.getPhoto())) {
classMemberMappingDO.setPhoto(imageCheckRecordDO.getPhoto()); classMemberMappingDO.setPhoto(imageCheckRecordDO.getPhoto());
classMemberMappingMapper.updateById(classMemberMappingDO); classMemberMappingMapper.updateById(classMemberMappingDO);
} }
...@@ -291,6 +303,10 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -291,6 +303,10 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
activityDetectionDO.setStatus(0); activityDetectionDO.setStatus(0);
e.printStackTrace(); e.printStackTrace();
} }
if (null != imageCheckRecordDO.getPaperId()) {
activityDetectionDO.setCheckType(2);
}
activityDetectionMapper.insert(activityDetectionDO); activityDetectionMapper.insert(activityDetectionDO);
imageCheckRecordMapper.updateById(imageCheckRecordDO); imageCheckRecordMapper.updateById(imageCheckRecordDO);
} }
...@@ -374,13 +390,13 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -374,13 +390,13 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
/** /**
* PC端 合作方后台上送身份信息 POST请求 图片对比 * PC端 合作方后台上送身份信息 POST请求 图片对比
*/ */
public SendIdCardInfoVO sendIdCardInfoCompare(String orderNo, MemberDO memberDO, String sign) { public SendIdCardInfoVO sendIdCardInfoCompare(String orderNo, MemberDO memberDO, String sign, String sourceImg) {
String url = "https://miniprogram-kyc.tencentcloudapi.com/api/server/h5/geth5faceid?orderNo=" + orderNo; String url = "https://miniprogram-kyc.tencentcloudapi.com/api/server/h5/geth5faceid?orderNo=" + orderNo;
String input = "{\n" + String input = "{\n" +
" \"webankAppId\":\"" + WBAPPID + "\",\n" + " \"webankAppId\":\"" + WBAPPID + "\",\n" +
" \"orderNo\":\"" + orderNo + "\",\n" + " \"orderNo\":\"" + orderNo + "\",\n" +
" \"sourcePhotoStr\":\"" + memberDO.getCheckImage() + "\"," + " \"sourcePhotoStr\":\"" + sourceImg + "\"," +
" \"sourcePhotoType\":\"" + 2 + "\"," + " \"sourcePhotoType\":\"" + 2 + "\"," +
" \"userId\":\"" + memberDO.getId() + "\"," + " \"userId\":\"" + memberDO.getId() + "\"," +
" \"version\":\"1.0.0\"," + " \"version\":\"1.0.0\"," +
...@@ -421,13 +437,13 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -421,13 +437,13 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
/** /**
* H5端 合作方后台上送身份信息 POST请求 图片对比 * H5端 合作方后台上送身份信息 POST请求 图片对比
*/ */
public SendIdCardInfoVO h5SendIdCardInfoCompare(String orderNo, MemberDO memberDO, String sign) { public SendIdCardInfoVO h5SendIdCardInfoCompare(String orderNo, MemberDO memberDO, String sign, String sourceImg) {
String url = "https://kyc.qcloud.com/api/server/getAdvFaceId?orderNo=" + orderNo; String url = "https://kyc.qcloud.com/api/server/getAdvFaceId?orderNo=" + orderNo;
String input = "{\n" + String input = "{\n" +
" \"appId\":\"" + WBAPPID + "\",\n" + " \"appId\":\"" + WBAPPID + "\",\n" +
" \"orderNo\":\"" + orderNo + "\",\n" + " \"orderNo\":\"" + orderNo + "\",\n" +
" \"sourcePhotoStr\":\"" + memberDO.getCheckImage() + "\"," + " \"sourcePhotoStr\":\"" + sourceImg + "\"," +
" \"sourcePhotoType\":\"" + 2 + "\"," + " \"sourcePhotoType\":\"" + 2 + "\"," +
" \"userId\":\"" + memberDO.getId() + "\"," + " \"userId\":\"" + memberDO.getId() + "\"," +
" \"version\":\"1.0.0\"," + " \"version\":\"1.0.0\"," +
......
...@@ -1164,8 +1164,11 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple ...@@ -1164,8 +1164,11 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
.eq(MemberTokensDO::getMemberId, memberDO.getId())); .eq(MemberTokensDO::getMemberId, memberDO.getId()));
OprMemDictDO oprMemDictDO = oprMemDictMapper.getLatestLoginInfo(memberDO.getId()); OprMemDictDO oprMemDictDO = oprMemDictMapper.getLatestLoginInfo(memberDO.getId());
if (oprMemDictDO.getResult() == 1 && "登出".equals(oprMemDictDO.getOprType())) { if (null != oprMemDictDO){
oprMemDictMapper.deleteData(oprMemDictDO); if (oprMemDictDO.getResult() == 1 && "登出".equals(oprMemDictDO.getOprType())) {
oprMemDictMapper.deleteById(oprMemDictDO.getId());
// oprMemDictMapper.deleteData(oprMemDictDO);
}
} }
oprMemDictDO.setUserId(memberDO.getId()); oprMemDictDO.setUserId(memberDO.getId());
oprMemDictDO.setResult(1); oprMemDictDO.setResult(1);
......
...@@ -36,7 +36,11 @@ class Base64Util { ...@@ -36,7 +36,11 @@ class Base64Util {
BASE64Encoder decoder = new BASE64Encoder(); BASE64Encoder decoder = new BASE64Encoder();
return replaceEnter(decoder.encode(image)); return replaceEnter(decoder.encode(image));
} }
public static void main(String[] args) {
System.out.println(encode("http://ykhl-bigger.oss-cn-beijing.aliyuncs.com/2023-02-1618cb936b-4825-429c-9fdd-dd9d0de97ed7.jpg?x-oss-process=image/auto-orient,1/resize,m_pad,w_500,h_500/quality,Q_100/format,jpg"));
}
public static String encode(String uri){ public static String encode(String uri){
BASE64Encoder encoder = new BASE64Encoder(); BASE64Encoder encoder = new BASE64Encoder();
return replaceEnter(encoder.encode(uri.getBytes())); return replaceEnter(encoder.encode(uri.getBytes()));
......
...@@ -37,7 +37,7 @@ public class MathUtil { ...@@ -37,7 +37,7 @@ public class MathUtil {
//习题/视频 ==> 秒钟向下取整 //习题/视频 ==> 秒钟向下取整
public static String floorSecond(int length) { public static String floorSecond(int length) {
return String.valueOf((int) Math.ceil((double) length / 60)); return String.valueOf((int) Math.floor((double) length / 60));
} }
//视频秒数处理 //视频秒数处理
......
...@@ -115,6 +115,7 @@ public class OSSUtils { ...@@ -115,6 +115,7 @@ public class OSSUtils {
} }
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(image2Base64("https://shixischool.oss-cn-beijing.aliyuncs.com/2022-12-219df5b721-99b7-48c4-916e-e474a4eca946.jpg?x-oss-process=image/auto-orient,1/resize,m_pad,w_500,h_500/quality,Q_100/format,jpg")); // System.out.println(image2Base64("https://shixischool.oss-cn-beijing.aliyuncs.com/2022-12-219df5b721-99b7-48c4-916e-e474a4eca946.jpg?x-oss-process=image/auto-orient,1/resize,m_pad,w_500,h_500/quality,Q_100/format,jpg"));
System.out.println(image2Base64("http://ykhl-bigger.oss-cn-beijing.aliyuncs.com/2023-02-1618cb936b-4825-429c-9fdd-dd9d0de97ed7.jpg?x-oss-process=image/auto-orient,1/resize,m_pad,w_500,h_500/quality,Q_100/format,jpg"));
} }
} }
...@@ -68,16 +68,66 @@ ...@@ -68,16 +68,66 @@
t.delete_date IS NULL t.delete_date IS NULL
AND t.result = 1 AND t.result = 1
AND t.user_id =#{userId} AND t.user_id =#{userId}
order by t.create_date desc and DATE_FORMAT( create_date, '%Y-%m-%d' ) = DATE_FORMAT( now(), '%Y-%m-%d' )
order by t.id desc
limit 1 limit 1
</select> </select>
<delete id="deleteData" parameterType="com.subsidy.model.OprMemDictDO">
DELETE
<!-- <update id="deleteData" parameterType="com.subsidy.model.OprMemDictDO">-->
<!-- DELETE-->
<!-- FROM-->
<!-- opr_mem_dict-->
<!-- WHERE-->
<!-- delete_date IS NULL-->
<!-- AND id = #{id}-->
<!-- </update>-->
<select id="onlineUsers" resultType="long">
SELECT
t1.user_id
FROM FROM
opr_mem_dict (
SELECT
id,
user_id,
opr_type,
max( create_date ) AS time1
FROM
opr_mem_dict
WHERE WHERE
delete_date IS NULL DATE_FORMAT( create_date, '%Y-%m-%d ' ) = DATE_FORMAT( now(), '%Y-%m-%d ' )
AND id = #{id} AND result = 1
</delete> AND opr_type = "登录"
GROUP BY
user_id
ORDER BY
create_date DESC
) t1
LEFT JOIN (
SELECT
id,
user_id,
opr_type,
max( create_date ) AS time2
FROM
opr_mem_dict
WHERE
DATE_FORMAT( create_date, '%Y-%m-%d ' ) = DATE_FORMAT( now(), '%Y-%m-%d ' )
AND result = 1
AND opr_type = "登出"
GROUP BY
user_id
ORDER BY
create_date DESC
) t2 ON t1.user_id = t2.user_id
WHERE
t2.id IS NULL
OR t2.time2 &lt; t1.time1
</select>
<!-- <update id="insertLastStudyRecord">-->
<!-- -->
<!-- </update>-->
</mapper> </mapper>
...@@ -182,13 +182,14 @@ ...@@ -182,13 +182,14 @@
<select id="examActivities" resultType="com.subsidy.vo.renshe.ExamActivitiesVO"> <select id="examActivities" resultType="com.subsidy.vo.renshe.ExamActivitiesVO">
SELECT SELECT
t1.result AS access, t1.result AS access,
UNIX_TIMESTAMP( t1.create_date )* 1000 AS activityTime UNIX_TIMESTAMP( t1.update_date )* 1000 AS activityTime
FROM FROM
image_check_record t1 image_check_record t1
WHERE WHERE
class_id =#{classId} class_id =#{classId}
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 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.paper_id IS NOT NULL
and t1.result =1
AND t1.member_id=#{memberId} AND t1.member_id=#{memberId}
</select> </select>
...@@ -276,26 +277,35 @@ ...@@ -276,26 +277,35 @@
and t.class_id = #{classId} and t.class_id = #{classId}
</select> </select>
<select id="dailyExamBasic" resultType="com.subsidy.vo.renshe.DailyExamBasicVO"> <select id="dailyExamBasic" resultType="long">
SELECT SELECT DISTINCT
t3.id as downCode, class_id
t2.id as memberId, FROM
t3.class_code, exercise_done_result t1
t2.user_name AS studentName, WHERE
t2.telephone AS phone, t1.delete_date IS NULL
t2.id_card AS identity, AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT(
IF NOW(),
( t1.result = "合格", 0, 1 ) AS access, '%Y-%m-%d'
unix_timestamp( t1.create_date )- unix_timestamp( t1.start_date ) AS examTime )
FROM
exercise_done_result t1
LEFT JOIN member t2 ON t1.member_id = t2.id
LEFT JOIN class_dict t3 ON t1.class_id = t3.id
WHERE
DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
</select> </select>
<select id="classVodName" parameterType="string" resultType="string"> <select id="memberIds" parameterType="long" resultType="com.subsidy.model.MemberDO">
SELECT DISTINCT
member_id as id,
t2.id_card,
t2.telephone,
t2.user_name
FROM
exercise_done_result t1
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 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
And class_id = #{classId}
</select>
<select id="classVodName" parameterType="long" resultType="string">
SELECT SELECT
t7.id AS chapterCode t7.id AS chapterCode
FROM FROM
...@@ -318,6 +328,18 @@ ...@@ -318,6 +328,18 @@
limit 1 limit 1
</select> </select>
<select id="examLength" resultType="long">
SELECT
SUM(unix_timestamp( t1.create_date )- unix_timestamp( t1.start_date ) ) AS examTime
FROM
exercise_done_result t1
WHERE
t1.delete_date IS NULL
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}
</select>
<select id="dailyExerciseDone" resultType="com.subsidy.model.ExerciseDoneResultDO"> <select id="dailyExerciseDone" resultType="com.subsidy.model.ExerciseDoneResultDO">
SELECT SELECT
* *
...@@ -328,6 +350,7 @@ ...@@ -328,6 +350,7 @@
AND t.member_id = #{memberId} AND t.member_id = #{memberId}
AND t.create_date BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%s' ) AND t.create_date BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%s' )
AND DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%s' ) AND DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%s' )
and t.class_id = #{classId}
</select> </select>
<select id="dailyAnswer" resultType="com.subsidy.vo.renshe.DailyAnswerVO"> <select id="dailyAnswer" resultType="com.subsidy.vo.renshe.DailyAnswerVO">
...@@ -360,6 +383,7 @@ ...@@ -360,6 +383,7 @@
NOW(), NOW(),
'%Y-%m-%d' '%Y-%m-%d'
) )
and class_id is not null
</select> </select>
<select id="classImageChecks" parameterType="long" resultType="com.subsidy.vo.renshe.ClassImageChecksVO"> <select id="classImageChecks" parameterType="long" resultType="com.subsidy.vo.renshe.ClassImageChecksVO">
...@@ -414,7 +438,8 @@ ...@@ -414,7 +438,8 @@
image_check_record t1 image_check_record t1
LEFT JOIN member t2 ON t1.member_id = t2.id LEFT JOIN member t2 ON t1.member_id = t2.id
WHERE WHERE
class_id = #{classId} t1.delete_date is null
and class_id = #{classId}
AND DATE_FORMAT( DATE_ADD( t1.create_date, INTERVAL 1 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 NULL AND t1.paper_id IS NULL
AND t1.result = 1 AND t1.result = 1
...@@ -424,4 +449,27 @@ ...@@ -424,4 +449,27 @@
</select> </select>
<select id="examCheck" parameterType="long" resultType="com.subsidy.vo.renshe.ClassImageChecksVO">
SELECT
t1.class_id,
t1.member_id,
t1.photo AS image,
t2.user_name AS studentName,
t2.id_card AS identity,
t2.telephone AS phone,
UNIX_TIMESTAMP( t1.update_date )* 1000 AS activityTime
FROM
image_check_record t1
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 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
and class_id = #{classId}
AND t1.paper_id IS not NULL
AND t1.result = 1
and t1.member_id
GROUP BY t1.class_id,t1.member_id
ORDER BY t1.create_date desc
</select>
</mapper> </mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!