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 421d9309
authored
Sep 02, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人脸识别版本备个份
1 parent
6b16f6de
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
233 additions
and
88 deletions
src/main/java/com/subsidy/controller/ImageCheckRecordController.java
src/main/java/com/subsidy/dto/image/ImageCheckDTO.java
src/main/java/com/subsidy/mapper/ClassDictMapper.java
src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java
src/main/java/com/subsidy/mapper/MemberMapper.java
src/main/java/com/subsidy/mapper/OprMemDictMapper.java
src/main/java/com/subsidy/model/ImageCheckRecordDO.java
src/main/java/com/subsidy/model/OprMemDictDO.java
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
src/main/java/com/subsidy/util/websocket/WebSocketUtil.java
src/main/java/com/subsidy/vo/classdict/SystemSettings.java
src/main/java/com/subsidy/vo/image/CheckImageResultVO.java
src/main/java/com/subsidy/vo/member/MyCoursesVO.java
src/main/java/com/subsidy/vo/paper/QueryPapersVO.java
src/main/resources/mapper/ClassDictMapper.xml
src/main/resources/mapper/ImageCheckRecordMapper.xml
src/main/resources/mapper/MemberMapper.xml
src/main/resources/mapper/OprMemDictMapper.xml
src/main/java/com/subsidy/controller/ImageCheckRecordController.java
View file @
421d930
...
...
@@ -43,14 +43,14 @@ public class ImageCheckRecordController {
}
@PostMapping
(
"imageCheck"
)
@ApiOperation
(
"课程/测评人身核验(权威库:身份证) PC端 id 用户id classId 班级id "
)
@ApiOperation
(
"课程/测评人身核验(权威库:身份证) PC端 id 用户id classId 班级id
classPlace 1:视频的时候检测 2:测评的时候检测 paperId
"
)
@TimeRequired
public
ResponseVO
imageCheck
(
@RequestBody
ImageCheckDTO
imageCheckDTO
)
throws
Exception
{
return
ResponseData
.
generateCreatedResponse
(
0
,
imageCheckRecordService
.
imageCheck
(
imageCheckDTO
));
}
@PostMapping
(
"h5ImageCheck"
)
@ApiOperation
(
"课程/测评人脸核验(权威库:身份证) 微信浮层H5 id 用户id classId 班级id"
)
@ApiOperation
(
"课程/测评人脸核验(权威库:身份证) 微信浮层H5 id 用户id classId 班级id
classPlace 1:视频的时候检测 2:测评的时候检测 paperId
"
)
@TimeRequired
public
ResponseVO
h5CheckResult
(
@RequestBody
ImageCheckDTO
imageCheckDTO
)
throws
Exception
{
return
ResponseData
.
generateCreatedResponse
(
0
,
imageCheckRecordService
.
h5CheckResult
(
imageCheckDTO
));
...
...
@@ -64,7 +64,7 @@ public class ImageCheckRecordController {
}
@PostMapping
(
"h5LoginCheck"
)
@ApiOperation
(
"签到页做人脸核验 (权威库:身份证)
PC端
id 用户id"
)
@ApiOperation
(
"签到页做人脸核验 (权威库:身份证) id 用户id"
)
@TimeRequired
public
ResponseVO
h5LoginCheck
(
@RequestBody
ImageCheckDTO
imageCheckDTO
)
throws
Exception
{
return
ResponseData
.
generateCreatedResponse
(
0
,
imageCheckRecordService
.
h5LoginCheck
(
imageCheckDTO
));
...
...
src/main/java/com/subsidy/dto/image/ImageCheckDTO.java
View file @
421d930
...
...
@@ -15,4 +15,14 @@ public class ImageCheckDTO {
*/
private
Long
classId
;
/**
* 试卷id
*/
private
Long
paperId
;
/**
* 1:视频的时候检测 2:测评的时候检测
*/
private
Integer
classPlace
;
}
src/main/java/com/subsidy/mapper/ClassDictMapper.java
View file @
421d930
...
...
@@ -5,10 +5,7 @@ import com.subsidy.dto.classDict.GetSpareMembersDTO;
import
com.subsidy.model.ClassDictDO
;
import
com.subsidy.model.MemberDO
;
import
com.subsidy.model.VodDictDO
;
import
com.subsidy.vo.classdict.ClassAndCompanyInfoVO
;
import
com.subsidy.vo.classdict.ClassSettingsVO
;
import
com.subsidy.vo.classdict.GetAllClassesVO
;
import
com.subsidy.vo.classdict.GetClassBaseInfoVO
;
import
com.subsidy.vo.classdict.*
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -59,4 +56,9 @@ public interface ClassDictMapper extends BaseMapper<ClassDictDO> {
Integer
getClassCount
();
List
<
ClassSettingsVO
>
getClassSettings
(
@Param
(
"userId"
)
Long
userId
);
/**
* 通过班级id查看公司配置
*/
SystemSettings
getCompanySettings
(
Long
classId
);
}
src/main/java/com/subsidy/mapper/ImageCheckRecordMapper.java
View file @
421d930
...
...
@@ -24,4 +24,9 @@ public interface ImageCheckRecordMapper extends BaseMapper<ImageCheckRecordDO> {
*/
List
<
GetMemberCheckDetailVO
>
getMemberCheckDetail
(
Long
memberId
,
Long
classId
);
/**
* 查看某个人某个课程当天做了几次人脸识别
*/
int
checkDailyCount
(
Long
memberId
,
Long
classId
,
Integer
checkPlace
,
Long
paperId
);
}
src/main/java/com/subsidy/mapper/MemberMapper.java
View file @
421d930
...
...
@@ -7,6 +7,7 @@ import com.subsidy.model.DepartmentDictDO;
import
com.subsidy.model.MemberDO
;
import
com.subsidy.vo.administer.ManageMemberVO
;
import
com.subsidy.vo.administer.UserRoleVO
;
import
com.subsidy.vo.classdict.SystemSettings
;
import
com.subsidy.vo.member.GetAllVO
;
import
com.subsidy.vo.member.MyCoursesVO
;
import
com.subsidy.vo.member.StudyPageVO
;
...
...
@@ -76,5 +77,10 @@ public interface MemberMapper extends BaseMapper<MemberDO> {
*/
void
removeCheckImage
(
Long
id
);
/**
* 通过人员id查询公司配置
*/
SystemSettings
companySettings
(
Long
memberId
);
}
src/main/java/com/subsidy/mapper/OprMemDictMapper.java
View file @
421d930
...
...
@@ -23,4 +23,6 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> {
List
<
OprMemDictDO
>
getRecordByDate
();
OprMemDictDO
getLatestLoginInfo
(
Long
userId
);
}
src/main/java/com/subsidy/model/ImageCheckRecordDO.java
View file @
421d930
...
...
@@ -31,6 +31,11 @@ public class ImageCheckRecordDO extends BaseModel {
private
Long
classId
;
/**
* 试卷id
*/
private
Long
paperId
;
/**
* 成员id
*/
private
Long
memberId
;
...
...
@@ -70,5 +75,15 @@ public class ImageCheckRecordDO extends BaseModel {
*/
private
Integer
checkPlace
;
/**
* 1:视频的时候检测 2:测评的时候检测
*/
private
Integer
classPlace
;
/**
* 1 核对通过 0 核对不通过
*/
private
Integer
result
;
}
src/main/java/com/subsidy/model/OprMemDictDO.java
View file @
421d930
...
...
@@ -38,8 +38,8 @@ public class OprMemDictDO extends BaseModel {
private
Integer
result
;
/**
* 登录ip
* 登录ip
==弃用字段
*/
private
String
ipAddress
;
//
private String ipAddress;
}
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
View file @
421d930
...
...
@@ -40,6 +40,7 @@ import com.subsidy.util.websocket.WebSocketUtil;
import
com.subsidy.vo.classdict.ClassSettingsVO
;
import
com.subsidy.vo.classdict.GetAllClassesVO
;
import
com.subsidy.vo.classdict.GetClassBaseInfoVO
;
import
com.subsidy.vo.classdict.SystemSettings
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -163,6 +164,9 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
public
String
updateClass
(
ClassDictDO
classDictDO
)
{
this
.
baseMapper
.
updateById
(
classDictDO
);
//班级所在公司
SystemSettings
systemSettings
=
this
.
baseMapper
.
getCompanySettings
(
classDictDO
.
getId
());
List
<
ClassMemberMappingDO
>
list
=
classMemberMappingMapper
.
selectList
(
new
QueryWrapper
<
ClassMemberMappingDO
>()
.
lambda
()
.
eq
(
ClassMemberMappingDO:
:
getClassId
,
classDictDO
.
getId
()));
...
...
@@ -171,8 +175,10 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
WebSocketSession
webSocketSession
=
WebSocketUtil
.
webSocketMap
.
get
(
classMemberMappingDO
.
getMemberId
());
if
(
null
!=
webSocketSession
&&
webSocketSession
.
isOpen
())
{
try
{
//班级的配置
List
<
ClassSettingsVO
>
classSettings
=
this
.
baseMapper
.
getClassSettings
(
classMemberMappingDO
.
getMemberId
());
String
data
=
JSONObject
.
toJSONString
(
ResponseData
.
generateCreatedResponse
(
0
,
classSettings
),
SerializerFeature
.
WriteMapNullValue
);
systemSettings
.
setClassSettingsVOS
(
classSettings
);
String
data
=
JSONObject
.
toJSONString
(
ResponseData
.
generateCreatedResponse
(
0
,
systemSettings
),
SerializerFeature
.
WriteMapNullValue
);
webSocketSession
.
sendMessage
(
new
TextMessage
(
data
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
View file @
421d930
...
...
@@ -39,6 +39,7 @@ import com.subsidy.util.VodUtil;
import
com.subsidy.util.websocket.WebSocketUtil
;
import
com.subsidy.vo.administer.OperatorsVO
;
import
com.subsidy.vo.classdict.ClassSettingsVO
;
import
com.subsidy.vo.classdict.SystemSettings
;
import
com.subsidy.vo.company.CDNStatDetailsVO
;
import
com.subsidy.vo.company.DataOverviewVO
;
import
com.subsidy.vo.company.GetAllCompanyVO
;
...
...
@@ -293,6 +294,10 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
public
String
updateCompanySettings
(
CompanyDictDO
companyDictDO
)
{
this
.
baseMapper
.
updateById
(
companyDictDO
);
CompanyDictDO
companyDictDO1
=
this
.
baseMapper
.
selectById
(
companyDictDO
.
getId
());
SystemSettings
systemSettings
=
new
SystemSettings
();
BeanUtils
.
copyProperties
(
companyDictDO1
,
systemSettings
);
List
<
ClassMemberMappingDO
>
list
=
classMemberMappingMapper
.
getCLassMemberByCompanyId
(
companyDictDO
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
ClassMemberMappingDO
classMemberMappingDO
:
list
)
{
...
...
@@ -300,7 +305,8 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
if
(
null
!=
webSocketSession
&&
webSocketSession
.
isOpen
())
{
try
{
List
<
ClassSettingsVO
>
classSettings
=
classDictMapper
.
getClassSettings
(
classMemberMappingDO
.
getMemberId
());
String
data
=
JSONObject
.
toJSONString
(
ResponseData
.
generateCreatedResponse
(
0
,
classSettings
),
SerializerFeature
.
WriteMapNullValue
);
systemSettings
.
setClassSettingsVOS
(
classSettings
);
String
data
=
JSONObject
.
toJSONString
(
ResponseData
.
generateCreatedResponse
(
0
,
systemSettings
),
SerializerFeature
.
WriteMapNullValue
);
webSocketSession
.
sendMessage
(
new
TextMessage
(
data
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java
View file @
421d930
...
...
@@ -14,9 +14,7 @@ import com.subsidy.model.AccessTokenDO;
import
com.subsidy.model.ImageCheckRecordDO
;
import
com.subsidy.model.MemberDO
;
import
com.subsidy.service.ImageCheckRecordService
;
import
com.subsidy.util.ConstantUtils
;
import
com.subsidy.util.DateFormatUtil
;
import
com.subsidy.vo.image.CheckImageResultVO
;
import
com.subsidy.vo.token.*
;
import
org.apache.commons.codec.Charsets
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -24,15 +22,11 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.*
;
import
org.springframework.stereotype.Service
;
import
sun.misc.BASE64Decoder
;
import
sun.security.krb5.internal.crypto.Nonce
;
//import org.apache.commons.codec.binary.Base64;
import
java.io.*
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
//import org.apache.commons.codec.binary.Base64
;
/**
* <p>
...
...
@@ -72,19 +66,19 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
}
public
SendIdCardInfoVO
imageCheck
(
ImageCheckDTO
imageCheckDTO
)
throws
Exception
{
return
PCCheckIdCard
(
imageCheckDTO
.
getId
(),
imageCheckDTO
.
getClassId
(),
0
);
return
PCCheckIdCard
(
imageCheckDTO
.
getId
(),
imageCheckDTO
.
getClassId
(),
0
,
imageCheckDTO
.
getClassPlace
(),
imageCheckDTO
.
getPaperId
()
);
}
public
SendIdCardInfoVO
h5CheckResult
(
ImageCheckDTO
imageCheckDTO
)
throws
Exception
{
return
H5IdCheckCard
(
imageCheckDTO
.
getId
(),
imageCheckDTO
.
getClassId
(),
0
);
return
H5IdCheckCard
(
imageCheckDTO
.
getId
(),
imageCheckDTO
.
getClassId
(),
0
,
imageCheckDTO
.
getClassPlace
(),
imageCheckDTO
.
getPaperId
()
);
}
public
SendIdCardInfoVO
loginCheck
(
ImageCheckDTO
imageCheckDTO
)
throws
Exception
{
return
PCCheckIdCard
(
imageCheckDTO
.
getId
(),
null
,
1
);
return
PCCheckIdCard
(
imageCheckDTO
.
getId
(),
null
,
1
,
null
,
null
);
}
public
SendIdCardInfoVO
h5LoginCheck
(
ImageCheckDTO
imageCheckDTO
)
throws
Exception
{
return
H5IdCheckCard
(
imageCheckDTO
.
getId
(),
imageCheckDTO
.
getClassId
(),
1
);
return
H5IdCheckCard
(
imageCheckDTO
.
getId
(),
null
,
1
,
null
,
null
);
}
/**
...
...
@@ -104,7 +98,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
* H5端调取权威库(身份证)验证 权威库
* 1,签到页 0 班级内
*/
public
SendIdCardInfoVO
H5IdCheckCard
(
Long
id
,
Long
classId
,
Integer
checkPlace
)
{
public
SendIdCardInfoVO
H5IdCheckCard
(
Long
id
,
Long
classId
,
Integer
checkPlace
,
Integer
classPlace
,
Long
paperId
)
{
getDailyCheckCnt
(
id
);
//获取这个学生的基本信息
MemberDO
memberDO
=
memberMapper
.
selectById
(
id
);
...
...
@@ -119,6 +113,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
imageCheckRecordDO
.
setClassId
(
classId
);
imageCheckRecordDO
.
setCheckType
(
1
);
imageCheckRecordDO
.
setCheckPlace
(
checkPlace
);
imageCheckRecordDO
.
setPaperId
(
paperId
);
imageCheckRecordDO
.
setClassPlace
(
classPlace
);
imageCheckRecordMapper
.
insert
(
imageCheckRecordDO
);
//获取signTicket
...
...
@@ -169,7 +165,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
* PC端调取权威库(身份证)验证 权威库
* 1,签到页 0 班级内
*/
public
SendIdCardInfoVO
PCCheckIdCard
(
Long
id
,
Long
classId
,
Integer
checkPlace
)
{
public
SendIdCardInfoVO
PCCheckIdCard
(
Long
id
,
Long
classId
,
Integer
checkPlace
,
Integer
classPlace
,
Long
paperId
)
{
getDailyCheckCnt
(
id
);
//获取这个学生的基本信息
...
...
@@ -184,6 +180,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
imageCheckRecordDO
.
setClassId
(
classId
);
imageCheckRecordDO
.
setCheckType
(
1
);
imageCheckRecordDO
.
setCheckPlace
(
checkPlace
);
imageCheckRecordDO
.
setPaperId
(
paperId
);
imageCheckRecordDO
.
setClassPlace
(
classPlace
);
imageCheckRecordMapper
.
insert
(
imageCheckRecordDO
);
//获取signTicket
...
...
@@ -210,8 +208,8 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//获取 NONCE ticket
IdCardTicketsVO
nonceTicket
=
this
.
nonceTicket
(
getLatestAccessToken
(),
memberDO
.
getId
()
+
""
);
//签名2
List
<
String
>
signList2
=
new
ArrayList
(
Arrays
.
asList
(
WBAPPID
,
memberDO
.
getId
()
+
""
,
NONCE
,
"1.0.0"
,
sendIdCardInfoVO
.
getResult
().
get
F
aceId
(),
sendIdCardInfoVO
.
getResult
().
getOrderNo
()));
//签名2
faceId ===>H5FaceId
List
<
String
>
signList2
=
new
ArrayList
(
Arrays
.
asList
(
WBAPPID
,
memberDO
.
getId
()
+
""
,
NONCE
,
"1.0.0"
,
sendIdCardInfoVO
.
getResult
().
get
H5f
aceId
(),
sendIdCardInfoVO
.
getResult
().
getOrderNo
()));
String
sign2
=
sign
(
signList2
,
nonceTicket
.
getValue
());
sendIdCardInfoVO
.
getResult
().
setWbAppId
(
WBAPPID
);
...
...
@@ -223,7 +221,6 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
public
ImageCheckRecordDO
checkResult
(
CheckResultDTO
checkResultDTO
)
throws
Exception
{
CheckImageResultVO
checkImageResultVO
=
new
CheckImageResultVO
();
//获取signTicket
IdCardTicketsVO
idCardTicketsVO
=
this
.
signTickets
(
getLatestAccessToken
());
...
...
@@ -242,21 +239,26 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//存数据库
ImageCheckRecordDO
imageCheckRecordDO
=
imageCheckRecordMapper
.
selectById
(
checkResultDTO
.
getId
());
BeanUtils
.
copyProperties
(
resultVO
,
imageCheckRecordDO
);
imageCheckRecordMapper
.
updateById
(
imageCheckRecordDO
);
BeanUtils
.
copyProperties
(
imageCheckRecordDO
,
checkImageResultVO
);
try
{
if
((
Double
.
valueOf
(
imageCheckRecordDO
.
getSimilarity
())
>
60
))
{
imageCheckRecordDO
.
setResult
(
1
);
//如果是签到页的认证,则把图片写到member表里
if
(
imageCheckRecordDO
.
getCheckPlace
()==
1
){
MemberDO
memberDO
=
memberMapper
.
selectById
(
imageCheckRecordDO
.
getMemberId
());
memberDO
.
setCheckImage
(
imageCheckRecordDO
.
getPhoto
());
memberDO
.
setCheckTime
(
DateFormatUtil
.
format
(
new
Date
(),
DateFormatUtil
.
FMT_sdf14_L
));
memberMapper
.
updateById
(
memberDO
);
}
}
else
{
imageCheckRecordDO
.
setResult
(
0
);
}
}
catch
(
Exception
e
){
imageCheckRecordDO
.
setResult
(
0
);
}
//如果是签到页的认证,则把图片写到member表里
MemberDO
memberDO
=
memberMapper
.
selectById
(
imageCheckRecordDO
.
getMemberId
());
memberDO
.
setImage
(
checkImageResultVO
.
getPhoto
());
memberDO
.
setCheckTime
(
DateFormatUtil
.
format
(
new
Date
(),
DateFormatUtil
.
FMT_sdf14_L
));
memberMapper
.
updateById
(
memberDO
);
imageCheckRecordMapper
.
updateById
(
imageCheckRecordDO
);
if
((
Double
.
valueOf
(
imageCheckRecordDO
.
getSimilarity
())
>
60
))
{
checkImageResultVO
.
setResult
(
true
);
}
else
{
checkImageResultVO
.
setResult
(
false
);
}
return
imageCheckRecordDO
;
}
...
...
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
View file @
421d930
...
...
@@ -9,42 +9,8 @@ import com.subsidy.common.configure.QXueYouConfig;
import
com.subsidy.common.exception.HttpException
;
import
com.subsidy.dto.administer.VerifyCodeDTO
;
import
com.subsidy.dto.member.*
;
import
com.subsidy.mapper.ClassDictMapper
;
import
com.subsidy.mapper.ClassHourDictMapper
;
import
com.subsidy.mapper.ClassMemberMappingMapper
;
import
com.subsidy.mapper.CompanyDictMapper
;
import
com.subsidy.mapper.CourseContentMapper
;
import
com.subsidy.mapper.CourseFieldMappingMapper
;
import
com.subsidy.mapper.DepartmentDictMapper
;
import
com.subsidy.mapper.ExerciseDoneResultMapper
;
import
com.subsidy.mapper.FileDictMapper
;
import
com.subsidy.mapper.JobDictMapper
;
import
com.subsidy.mapper.JobMemberMappingMapper
;
import
com.subsidy.mapper.MemberDepartmentMappingMapper
;
import
com.subsidy.mapper.MemberMapper
;
import
com.subsidy.mapper.OprMemDictMapper
;
import
com.subsidy.mapper.PaperDictMapper
;
import
com.subsidy.mapper.RotationImgDictMapper
;
import
com.subsidy.mapper.SmsVerifyCodeMapper
;
import
com.subsidy.mapper.VodDictMapper
;
import
com.subsidy.mapper.VodPlayHistoryMapper
;
import
com.subsidy.model.ClassDictDO
;
import
com.subsidy.model.ClassHourDictDO
;
import
com.subsidy.model.ClassMemberMappingDO
;
import
com.subsidy.model.CompanyDictDO
;
import
com.subsidy.model.CourseContentDO
;
import
com.subsidy.model.DepartmentDictDO
;
import
com.subsidy.model.ExerciseDoneResultDO
;
import
com.subsidy.model.FieldDictDO
;
import
com.subsidy.model.FileDictDO
;
import
com.subsidy.model.JobDictDO
;
import
com.subsidy.model.JobMemberMappingDO
;
import
com.subsidy.model.MemberDO
;
import
com.subsidy.model.MemberDepartmentMappingDO
;
import
com.subsidy.model.OprMemDictDO
;
import
com.subsidy.model.RotationImgDictDO
;
import
com.subsidy.model.SmsVerifyCodeDO
;
import
com.subsidy.model.VodDictDO
;
import
com.subsidy.mapper.*
;
import
com.subsidy.model.*
;
import
com.subsidy.service.MemberService
;
import
com.subsidy.util.*
;
//import com.subsidy.util.RedisUtil;
...
...
@@ -135,7 +101,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
private
RotationImgDictMapper
rotationImgDictMapper
;
@Autowired
private
VodDictMapper
vodDict
Mapper
;
private
ImageCheckRecordMapper
imageCheckRecord
Mapper
;
@Autowired
private
SmsVerifyCodeMapper
smsVerifyCodeMapper
;
...
...
@@ -719,6 +685,21 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
for
(
MyCoursesVO
myCoursesVO
:
myCoursesVOS
)
{
List
<
FieldDictDO
>
fieldDictDOS
=
courseFieldMappingMapper
.
courseFields
(
myCoursesVO
.
getCourseId
());
myCoursesVO
.
setFieldDictDOS
(
fieldDictDOS
);
int
count
=
imageCheckRecordMapper
.
selectCount
(
new
QueryWrapper
<
ImageCheckRecordDO
>()
.
lambda
()
.
eq
(
ImageCheckRecordDO:
:
getMemberId
,
myCoursesDTO
.
getMemberId
())
.
eq
(
ImageCheckRecordDO:
:
getClassId
,
myCoursesVO
.
getClassId
())
.
eq
(
ImageCheckRecordDO:
:
getCheckPlace
,
1
)
.
eq
(
ImageCheckRecordDO:
:
getResult
,
1
));
int
checkCnt
=
imageCheckRecordMapper
.
checkDailyCount
(
myCoursesDTO
.
getMemberId
(),
myCoursesVO
.
getClassId
(),
1
,
null
);
myCoursesVO
.
setCheckCnt
(
checkCnt
);
if
(
count
>
0
)
{
myCoursesVO
.
setResult
(
1
);
}
else
{
myCoursesVO
.
setResult
(
0
);
}
}
return
myCoursesVOS
;
}
...
...
@@ -855,6 +836,23 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
}
else
{
queryPapersVO
.
setResult
(
"待完成"
);
}
int
count
=
imageCheckRecordMapper
.
selectCount
(
new
QueryWrapper
<
ImageCheckRecordDO
>()
.
lambda
()
.
eq
(
ImageCheckRecordDO:
:
getMemberId
,
contentMemberDTO
.
getMemberId
())
.
eq
(
ImageCheckRecordDO:
:
getClassId
,
contentMemberDTO
.
getClassId
())
.
eq
(
ImageCheckRecordDO:
:
getPaperId
,
queryPapersVO
.
getId
())
.
eq
(
ImageCheckRecordDO:
:
getClassPlace
,
2
)
.
eq
(
ImageCheckRecordDO:
:
getResult
,
1
));
int
checkCnt
=
imageCheckRecordMapper
.
checkDailyCount
(
contentMemberDTO
.
getMemberId
(),
contentMemberDTO
.
getClassId
(),
2
,
queryPapersVO
.
getId
());
queryPapersVO
.
setCheckCnt
(
checkCnt
);
if
(
count
>
0
)
{
queryPapersVO
.
setCheckResult
(
1
);
}
else
{
queryPapersVO
.
setCheckResult
(
0
);
}
//截止时间
queryPapersVO
.
setEndDate
(
classDictDO
.
getEndDate
());
}
...
...
src/main/java/com/subsidy/util/websocket/WebSocketUtil.java
View file @
421d930
This diff is collapsed.
Click to expand it.
src/main/java/com/subsidy/vo/classdict/SystemSettings.java
0 → 100644
View file @
421d930
package
com
.
subsidy
.
vo
.
classdict
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
SystemSettings
{
/**
* 上课时间不晚于23:30,不早于6:30
*/
private
Integer
timeLimit
;
/**
* 签到时记录IP地址
*/
private
Integer
ipAddressRecord
;
/**
* 签到时记录设备型号
*/
private
Integer
deviceNoRecord
;
/**
* 班级配置
*/
private
List
<
ClassSettingsVO
>
classSettingsVOS
;
}
src/main/java/com/subsidy/vo/image/CheckImageResultVO.java
deleted
100644 → 0
View file @
6b16f6d
package
com
.
subsidy
.
vo
.
image
;
import
com.subsidy.model.ImageCheckRecordDO
;
import
lombok.Data
;
@Data
public
class
CheckImageResultVO
extends
ImageCheckRecordDO
{
private
Boolean
result
;
}
src/main/java/com/subsidy/vo/member/MyCoursesVO.java
View file @
421d930
...
...
@@ -32,5 +32,9 @@ public class MyCoursesVO {
private
Integer
isFastPlay
;
private
Integer
result
;
private
Integer
checkCnt
;
private
List
<
FieldDictDO
>
fieldDictDOS
;
}
src/main/java/com/subsidy/vo/paper/QueryPapersVO.java
View file @
421d930
...
...
@@ -21,4 +21,8 @@ public class QueryPapersVO {
private
String
endDate
;
private
Integer
checkCnt
;
private
Integer
checkResult
;
}
src/main/resources/mapper/ClassDictMapper.xml
View file @
421d930
...
...
@@ -197,4 +197,19 @@
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
</select>
<select
id=
"getCompanySettings"
parameterType=
"long"
resultType=
"com.subsidy.vo.classdict.SystemSettings"
>
SELECT
t2.time_limit,
t2.ip_address_record,
t2.device_no_record
FROM
class_dict t
LEFT JOIN company_dict t2 ON t.company_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.id = #{classId}
</select>
</mapper>
src/main/resources/mapper/ImageCheckRecordMapper.xml
View file @
421d930
...
...
@@ -33,4 +33,26 @@
AND t.member_id = #{memberId}
</select>
<select
id=
"checkDailyCount"
resultType=
"int"
>
SELECT
count(1)
FROM
image_check_record t
WHERE
t.delete_date IS NULL
<if
test=
"memberId != null and memberId != ''"
>
AND t.member_id = #{memberId}
</if>
<if
test=
"classId != null and classId != ''"
>
AND t.class_id = #{classId}
</if>
AND DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(t.create_date, '%Y-%m-%d')
<if
test=
"checkPlace != null and checkPlace != ''"
>
and class_place = #{checkPlace}
</if>
<if
test=
"paperId != null and paperId != ''"
>
and paper_id = #{paperId}
</if>
</select>
</mapper>
src/main/resources/mapper/MemberMapper.xml
View file @
421d930
...
...
@@ -330,4 +330,18 @@
<update
id=
"removeCheckImage"
parameterType=
"long"
>
update member set check_image = null,check_time = null where id = #{id}
</update>
<select
id=
"companySettings"
parameterType=
"long"
resultType=
"com.subsidy.vo.classdict.SystemSettings"
>
SELECT
t2.time_limit,
t2.ip_address_record,
t2.device_no_record
FROM
member t
LEFT JOIN company_dict t2 ON t.company_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.id = #{memberId}
</select>
</mapper>
src/main/resources/mapper/OprMemDictMapper.xml
View file @
421d930
...
...
@@ -54,4 +54,18 @@
WHERE
create_date
<
(NOW() - INTERVAL 10 DAY)
</select>
<select
id=
"getLatestLoginInfo"
parameterType=
"long"
resultType=
"com.subsidy.model.OprMemDictDO"
>
SELECT
t.ip_address,
t.opr_type,
t.result,
t.user_id,
max(t.create_date) as create_date
FROM
opr_mem_dict t
WHERE
t.delete_date IS NULL
AND t.user_id = #{userId}
</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