Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 70bfd420
authored
Mar 03, 2023
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人社局测试
1 parent
c7dc8010
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
319 additions
and
143 deletions
src/main/java/com/subsidy/controller/AdministerController.java
src/main/java/com/subsidy/jobs/RenSheJuJob.java
src/main/java/com/subsidy/mapper/OprMemDictMapper.java
src/main/java/com/subsidy/mapper/RenSheJuMapper.java
src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
src/main/java/com/subsidy/util/Base64Util.java
src/main/java/com/subsidy/util/MathUtil.java
src/main/java/com/subsidy/util/OSSUtils.java
src/main/resources/mapper/OprMemDictMapper.xml
src/main/resources/mapper/RenSheJuMapper.xml
src/main/java/com/subsidy/controller/AdministerController.java
View file @
70bfd42
src/main/java/com/subsidy/jobs/RenSheJuJob.java
View file @
70bfd42
package
com
.
subsidy
.
jobs
;
import
com.alibaba.fastjson.JSONObject
;
import
com.subsidy.common.ResponseData
;
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.concurrent.ConcurrentHashMap
;
/**
* 人社局数据对接
*/
@Component
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
();
}
//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;
//
// /**
// * 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-
9 获取推送失败班级列表
// * POST-
5:答疑辅导采集接口
// */
// @Scheduled(cron = "0 35 1 * * ?")
// public void getErrorClass()throws IOException{
// renSheJuService.getErrorClass();
// @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();
// }
// }
// }
@Scheduled
(
cron
=
"00 58 23 * * ?"
)
public
void
cancelLogin
()
throws
IOException
{
ConcurrentHashMap
<
Long
,
WebSocketSession
>
webSocketMap
=
WebSocketUtil
.
webSocketMap
;
for
(
Long
key
:
webSocketMap
.
keySet
()){
webSocketMap
.
get
(
key
).
sendMessage
(
new
TextMessage
(
JSONObject
.
toJSONString
(
ResponseData
.
generateCreatedResponse
(
17001
))));
}
}
}
//
//}
src/main/java/com/subsidy/mapper/OprMemDictMapper.java
View file @
70bfd42
...
...
@@ -23,8 +23,27 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> {
List
<
OprMemDictDO
>
getRecordByDate
();
/**
* 当天最后一次登录记录
*/
OprMemDictDO
getLatestLoginInfo
(
Long
userId
);
void
deleteData
(
OprMemDictDO
oprMemDictDO
);
// /**
// * 当天最后一次登录
// */
// OprMemDictDO getLatestLogoutInfo(Long userId);
// void deleteData(OprMemDictDO oprMemDictDO);
/**
* 查看当天还在线的用户
*/
List
<
Long
>
onlineUsers
();
// /**
// * 根据最后一次看视频时间随机去写几秒登出
// */
// void insertLastStudyRecord();
}
src/main/java/com/subsidy/mapper/RenSheJuMapper.java
View file @
70bfd42
...
...
@@ -4,10 +4,7 @@ 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.model.*
;
import
com.subsidy.vo.renshe.*
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -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 {
/**
* 前一天考试通过数据
*/
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 {
List
<
ClassImageChecksVO
>
passExamCheck
(
Long
classId
);
/**
* 进入到课程第二次做人脸识别
* 进入到课程第二次做人脸识别
弃用
*/
List
<
ClassImageChecksVO
>
studyCheck
(
Long
classId
);
/**
* 考试数据
*/
List
<
ClassImageChecksVO
>
examCheck
(
Long
classId
);
}
src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java
View file @
70bfd42
...
...
@@ -133,12 +133,17 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
signList1
.
add
(
NONCE
);
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
;
if
(
StringUtils
.
isEmpty
(
memberDO
.
getCheckImage
()))
{
if
(
StringUtils
.
isEmpty
(
classMemberMappingDO
.
getPhoto
()))
{
sendIdCardInfoVO
=
this
.
h5SendIdCardInfo
(
imageCheckRecordDO
.
getBizSeqNo
(),
memberDO
,
sign
);
}
else
{
sendIdCardInfoVO
=
this
.
h5SendIdCardInfoCompare
(
imageCheckRecordDO
.
getBizSeqNo
(),
memberDO
,
sign
);
sendIdCardInfoVO
=
this
.
h5SendIdCardInfoCompare
(
imageCheckRecordDO
.
getBizSeqNo
(),
memberDO
,
sign
,
OSSUtils
.
image2Base64
(
classMemberMappingDO
.
getPhoto
())
);
}
if
(!
"0"
.
equals
(
sendIdCardInfoVO
.
getCode
()))
{
...
...
@@ -205,14 +210,21 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//合作方后台上送身份信息
// 查看之前是否有验证过,没有的话就调取权威库,有的话就进行两个图片对比
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
.
getIdCard
());
sign
=
sign
(
signList1
,
idCardTicketsVO
.
getValue
());
sendIdCardInfoVO
=
this
.
sendIdCardInfo
(
imageCheckRecordDO
.
getBizSeqNo
(),
memberDO
,
sign
);
}
else
{
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
()))
{
...
...
@@ -256,7 +268,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//存数据库
ImageCheckRecordDO
imageCheckRecordDO
=
imageCheckRecordMapper
.
selectOne
(
new
QueryWrapper
<
ImageCheckRecordDO
>()
.
lambda
()
.
eq
(
ImageCheckRecordDO:
:
getBizSeqNo
,
checkResultDTO
.
getId
()));
.
eq
(
ImageCheckRecordDO:
:
getBizSeqNo
,
checkResultDTO
.
getId
()));
if
(!
StringUtils
.
isEmpty
(
resultVO
.
getSimilarity
()))
{
BeanUtils
.
copyProperties
(
resultVO
,
imageCheckRecordDO
);
ActivityDetectionDO
activityDetectionDO
=
new
ActivityDetectionDO
();
...
...
@@ -265,7 +277,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
activityDetectionDO
.
setCheckType
(
1
);
activityDetectionDO
.
setFaceCheckId
(
imageCheckRecordDO
.
getId
());
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
))
{
imageCheckRecordDO
.
setResult
(
1
);
activityDetectionDO
.
setStatus
(
1
);
...
...
@@ -276,7 +288,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
.
lambda
()
.
eq
(
ClassMemberMappingDO:
:
getMemberId
,
imageCheckRecordDO
.
getMemberId
())
.
eq
(
ClassMemberMappingDO:
:
getClassId
,
imageCheckRecordDO
.
getClassId
()));
if
(
StringUtils
.
isEmpty
(
classMemberMappingDO
.
getPhoto
())){
if
(
StringUtils
.
isEmpty
(
classMemberMappingDO
.
getPhoto
()))
{
classMemberMappingDO
.
setPhoto
(
imageCheckRecordDO
.
getPhoto
());
classMemberMappingMapper
.
updateById
(
classMemberMappingDO
);
}
...
...
@@ -291,6 +303,10 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
activityDetectionDO
.
setStatus
(
0
);
e
.
printStackTrace
();
}
if
(
null
!=
imageCheckRecordDO
.
getPaperId
())
{
activityDetectionDO
.
setCheckType
(
2
);
}
activityDetectionMapper
.
insert
(
activityDetectionDO
);
imageCheckRecordMapper
.
updateById
(
imageCheckRecordDO
);
}
...
...
@@ -374,13 +390,13 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
/**
* 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
input
=
"{\n"
+
" \"webankAppId\":\""
+
WBAPPID
+
"\",\n"
+
" \"orderNo\":\""
+
orderNo
+
"\",\n"
+
" \"sourcePhotoStr\":\""
+
memberDO
.
getCheckImage
()
+
"\","
+
" \"sourcePhotoStr\":\""
+
sourceImg
+
"\","
+
" \"sourcePhotoType\":\""
+
2
+
"\","
+
" \"userId\":\""
+
memberDO
.
getId
()
+
"\","
+
" \"version\":\"1.0.0\","
+
...
...
@@ -421,13 +437,13 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
/**
* 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
input
=
"{\n"
+
" \"appId\":\""
+
WBAPPID
+
"\",\n"
+
" \"orderNo\":\""
+
orderNo
+
"\",\n"
+
" \"sourcePhotoStr\":\""
+
memberDO
.
getCheckImage
()
+
"\","
+
" \"sourcePhotoStr\":\""
+
sourceImg
+
"\","
+
" \"sourcePhotoType\":\""
+
2
+
"\","
+
" \"userId\":\""
+
memberDO
.
getId
()
+
"\","
+
" \"version\":\"1.0.0\","
+
...
...
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
View file @
70bfd42
...
...
@@ -1164,8 +1164,11 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
.
eq
(
MemberTokensDO:
:
getMemberId
,
memberDO
.
getId
()));
OprMemDictDO
oprMemDictDO
=
oprMemDictMapper
.
getLatestLoginInfo
(
memberDO
.
getId
());
if
(
null
!=
oprMemDictDO
){
if
(
oprMemDictDO
.
getResult
()
==
1
&&
"登出"
.
equals
(
oprMemDictDO
.
getOprType
()))
{
oprMemDictMapper
.
deleteData
(
oprMemDictDO
);
oprMemDictMapper
.
deleteById
(
oprMemDictDO
.
getId
());
// oprMemDictMapper.deleteData(oprMemDictDO);
}
}
oprMemDictDO
.
setUserId
(
memberDO
.
getId
());
oprMemDictDO
.
setResult
(
1
);
...
...
src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
View file @
70bfd42
This diff is collapsed.
Click to expand it.
src/main/java/com/subsidy/util/Base64Util.java
View file @
70bfd42
...
...
@@ -37,6 +37,10 @@ class Base64Util {
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
){
BASE64Encoder
encoder
=
new
BASE64Encoder
();
return
replaceEnter
(
encoder
.
encode
(
uri
.
getBytes
()));
...
...
src/main/java/com/subsidy/util/MathUtil.java
View file @
70bfd42
...
...
@@ -37,7 +37,7 @@ public class MathUtil {
//习题/视频 ==> 秒钟向下取整
public
static
String
floorSecond
(
int
length
)
{
return
String
.
valueOf
((
int
)
Math
.
ceil
((
double
)
length
/
60
));
return
String
.
valueOf
((
int
)
Math
.
floor
((
double
)
length
/
60
));
}
//视频秒数处理
...
...
src/main/java/com/subsidy/util/OSSUtils.java
View file @
70bfd42
...
...
@@ -115,6 +115,7 @@ public class OSSUtils {
}
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"
));
}
}
src/main/resources/mapper/OprMemDictMapper.xml
View file @
70bfd42
...
...
@@ -68,16 +68,66 @@
t.delete_date IS NULL
AND t.result = 1
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
</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
(
SELECT
id,
user_id,
opr_type,
max( create_date ) AS time1
FROM
opr_mem_dict
WHERE
delete_date IS NULL
AND id = #{id}
</delete>
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
) 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
<
t1.time1
</select>
<!-- <update id="insertLastStudyRecord">-->
<!-- -->
<!-- </update>-->
</mapper>
src/main/resources/mapper/RenSheJuMapper.xml
View file @
70bfd42
...
...
@@ -182,13 +182,14 @@
<select
id=
"examActivities"
resultType=
"com.subsidy.vo.renshe.ExamActivitiesVO"
>
SELECT
t1.result AS access,
UNIX_TIMESTAMP( t1.
cre
ate_date )* 1000 AS activityTime
UNIX_TIMESTAMP( t1.
upd
ate_date )* 1000 AS activityTime
FROM
image_check_record t1
WHERE
class_id =#{classId}
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}
</select>
...
...
@@ -276,26 +277,35 @@
and t.class_id = #{classId}
</select>
<select
id=
"dailyExamBasic"
resultType=
"com.subsidy.vo.renshe.DailyExamBasicVO"
>
SELECT
t3.id as downCode,
t2.id as memberId,
t3.class_code,
t2.user_name AS studentName,
t2.telephone AS phone,
t2.id_card AS identity,
IF
( t1.result = "合格", 0, 1 ) AS access,
unix_timestamp( t1.create_date )- unix_timestamp( t1.start_date ) AS examTime
<select
id=
"dailyExamBasic"
resultType=
"long"
>
SELECT DISTINCT
class_id
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'
)
</select>
<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
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' )
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=
"
stri
ng"
resultType=
"string"
>
<select
id=
"classVodName"
parameterType=
"
lo
ng"
resultType=
"string"
>
SELECT
t7.id AS chapterCode
FROM
...
...
@@ -318,6 +328,18 @@
limit 1
</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
*
...
...
@@ -328,6 +350,7 @@
AND t.member_id = #{memberId}
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 t.class_id = #{classId}
</select>
<select
id=
"dailyAnswer"
resultType=
"com.subsidy.vo.renshe.DailyAnswerVO"
>
...
...
@@ -360,6 +383,7 @@
NOW(),
'%Y-%m-%d'
)
and class_id is not null
</select>
<select
id=
"classImageChecks"
parameterType=
"long"
resultType=
"com.subsidy.vo.renshe.ClassImageChecksVO"
>
...
...
@@ -414,7 +438,8 @@
image_check_record t1
LEFT JOIN member t2 ON t1.member_id = t2.id
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 t1.paper_id IS NULL
AND t1.result = 1
...
...
@@ -424,4 +449,27 @@
</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>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment