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 0cb59b9a
authored
Jul 15, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
备个份
1 parent
2c9d89b2
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
152 additions
and
38 deletions
src/main/java/com/subsidy/controller/ActivityDetectionController.java
src/main/java/com/subsidy/controller/CompanyDictController.java
src/main/java/com/subsidy/dto/detection/GetCheckHistoryDTO.java
src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java
src/main/java/com/subsidy/model/ClassDictDO.java
src/main/java/com/subsidy/service/ActivityDetectionService.java
src/main/java/com/subsidy/service/CompanyDictService.java
src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
src/main/java/com/subsidy/vo/activity/GetCheckHistoryVO.java
src/main/java/com/subsidy/vo/company/MemberSummaryVO.java
src/main/resources/mapper/ActivityDetectionMapper.xml
src/main/java/com/subsidy/controller/ActivityDetectionController.java
View file @
0cb59b9
...
...
@@ -4,8 +4,8 @@ package com.subsidy.controller;
import
com.subsidy.common.ResponseData
;
import
com.subsidy.common.ResponseVO
;
import
com.subsidy.common.interceptor.TimeRequired
;
import
com.subsidy.dto.detection.GetCheckHistoryDTO
;
import
com.subsidy.dto.detection.VerifyDTO
;
import
com.subsidy.model.ActivityDetectionDO
;
import
com.subsidy.service.ActivityDetectionService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -43,11 +43,8 @@ public class ActivityDetectionController {
@PostMapping
(
"getCheckHistory"
)
@ApiOperation
(
"获取某个人某个课程的活跃度验证详情 memberId classId"
)
public
ResponseVO
getCheckHistory
(
@RequestBody
ActivityDetectionDO
activityDetectionD
O
){
return
ResponseData
.
generateCreatedResponse
(
0
,
activityDetectionService
.
getCheckHistory
(
activityDetectionD
O
));
public
ResponseVO
getCheckHistory
(
@RequestBody
GetCheckHistoryDTO
getCheckHistoryDT
O
){
return
ResponseData
.
generateCreatedResponse
(
0
,
activityDetectionService
.
getCheckHistory
(
getCheckHistoryDT
O
));
}
}
src/main/java/com/subsidy/controller/CompanyDictController.java
View file @
0cb59b9
...
...
@@ -77,4 +77,11 @@ public class CompanyDictController {
return
ResponseData
.
generateCreatedResponse
(
0
,
companyDictService
.
getCompanyMembers
(
getCompanyMembersDTO
));
}
@PostMapping
(
"memberSummary"
)
@ApiOperation
(
"学员认证详情 companyId"
)
@LoginRequired
public
ResponseVO
memberSummary
(
@RequestBody
GetCompanyMembersDTO
getCompanyMembersDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
companyDictService
.
memberSummary
(
getCompanyMembersDTO
));
}
}
src/main/java/com/subsidy/dto/detection/GetCheckHistoryDTO.java
0 → 100644
View file @
0cb59b9
package
com
.
subsidy
.
dto
.
detection
;
import
lombok.Data
;
@Data
public
class
GetCheckHistoryDTO
{
private
Integer
pageSize
;
private
Integer
pageNum
;
private
Long
memberId
;
private
Long
classId
;
}
src/main/java/com/subsidy/mapper/ActivityDetectionMapper.java
View file @
0cb59b9
package
com
.
subsidy
.
mapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.subsidy.model.ActivityDetectionDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.subsidy.vo.activity.GetCheckHistoryVO
;
import
org.springframework.stereotype.Repository
;
/**
...
...
@@ -15,4 +17,6 @@ import org.springframework.stereotype.Repository;
@Repository
public
interface
ActivityDetectionMapper
extends
BaseMapper
<
ActivityDetectionDO
>
{
IPage
<
GetCheckHistoryVO
>
getCheckHistory
(
IPage
iPage
,
Long
classId
,
Long
memberId
);
}
src/main/java/com/subsidy/model/ClassDictDO.java
View file @
0cb59b9
...
...
@@ -78,6 +78,45 @@ public class ClassDictDO extends BaseModel {
*/
private
Integer
testRule
;
/**
* 学习上限时长
*/
private
Integer
limitHour
;
/**
* 首次进入班级时人脸验证
*/
private
Integer
imageClassCheck
;
/**
* 测试前人脸识别验证
*/
private
Integer
imageTestCheck
;
/**
* 活跃度检测开启/关闭
*/
private
Integer
activityDetection
;
/**
* 活跃度检测方式
*/
private
Integer
activityDetectionMethod
;
/**
* 首次播放允许拖曳
*/
private
Integer
firstDragAllowed
;
/**
* 首次播放允许倍速
*/
private
Integer
firstSpeedAllowed
;
/**
* 课时抓拍
*/
private
Integer
playSnap
;
...
...
src/main/java/com/subsidy/service/ActivityDetectionService.java
View file @
0cb59b9
package
com
.
subsidy
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.subsidy.dto.detection.GetCheckHistoryDTO
;
import
com.subsidy.dto.detection.VerifyDTO
;
import
com.subsidy.model.ActivityDetectionDO
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.subsidy.vo.activity.GetCheckHistoryVO
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
* <p>
...
...
@@ -20,6 +21,6 @@ public interface ActivityDetectionService extends IService<ActivityDetectionDO>
String
verify
(
VerifyDTO
verifyDTO
,
HttpServletRequest
request
);
IPage
<
ActivityDetectionDO
>
getCheckHistory
(
ActivityDetectionDO
activityDetectionD
O
);
IPage
<
GetCheckHistoryVO
>
getCheckHistory
(
GetCheckHistoryDTO
getCheckHistoryDT
O
);
}
src/main/java/com/subsidy/service/CompanyDictService.java
View file @
0cb59b9
...
...
@@ -10,6 +10,7 @@ import com.subsidy.model.MemberDO;
import
com.subsidy.vo.administer.OperatorsVO
;
import
com.subsidy.vo.company.GetAllCompanyVO
;
import
com.subsidy.vo.company.GetCompanyMembersVO
;
import
com.subsidy.vo.company.MemberSummaryVO
;
import
java.util.List
;
...
...
@@ -35,4 +36,6 @@ public interface CompanyDictService extends IService<CompanyDictDO> {
IPage
<
GetCompanyMembersVO
>
getCompanyMembers
(
GetCompanyMembersDTO
getCompanyMembersDTO
);
MemberSummaryVO
memberSummary
(
GetCompanyMembersDTO
getCompanyMembersDTO
);
}
src/main/java/com/subsidy/service/impl/ActivityDetectionServiceImpl.java
View file @
0cb59b9
package
com
.
subsidy
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.subsidy.common.configure.ActivityDetectionConfig
;
import
com.subsidy.common.configure.VODConfig
;
import
com.subsidy.
common.configure.WechatConfig
;
import
com.subsidy.
dto.detection.GetCheckHistoryDTO
;
import
com.subsidy.dto.detection.VerifyDTO
;
import
com.subsidy.model.ActivityDetectionDO
;
import
com.subsidy.mapper.ActivityDetectionMapper
;
import
com.subsidy.service.ActivityDetectionService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.subsidy.util.ConstantUtils
;
import
com.subsidy.util.IpAddressUtil
;
import
com.subsidy.vo.activity.GetCheckHistoryVO
;
import
com.tencentcloudapi.captcha.v20190722.CaptchaClient
;
import
com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultRequest
;
import
com.tencentcloudapi.captcha.v20190722.models.DescribeCaptchaResultResponse
;
...
...
@@ -56,18 +59,7 @@ public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionM
// 实例化一个请求对象,每个接口都会对应一个request对象
DescribeCaptchaResultRequest
req
=
new
DescribeCaptchaResultRequest
();
req
.
setCaptchaType
(
9L
);
req
.
setTicket
(
verifyDTO
.
getTicket
());
// String ip = request.getHeader("x-forwarded-for");
String
ip
=
request
.
getHeader
(
" x-forwarded-for "
);
if
(
ip
==
null
||
ip
.
length
()
==
0
||
" unknown "
.
equalsIgnoreCase
(
ip
))
{
ip
=
request
.
getHeader
(
" Proxy-Client-IP "
);
}
if
(
ip
==
null
||
ip
.
length
()
==
0
||
" unknown "
.
equalsIgnoreCase
(
ip
))
{
ip
=
request
.
getHeader
(
" WL-Proxy-Client-IP "
);
}
if
(
ip
==
null
||
ip
.
length
()
==
0
||
" unknown "
.
equalsIgnoreCase
(
ip
))
{
ip
=
request
.
getRemoteAddr
();
}
String
ip
=
IpAddressUtil
.
getIpAddress
(
request
);
req
.
setUserIp
(
ip
);
req
.
setRandstr
(
verifyDTO
.
getRandStr
());
req
.
setCaptchaAppId
(
activityDetectionConfig
.
getCaptchaAppId
());
...
...
@@ -76,7 +68,6 @@ public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionM
// 返回的resp是一个DescribeCaptchaResultResponse的实例,与请求对象对应
DescribeCaptchaResultResponse
resp
=
client
.
DescribeCaptchaResult
(
req
);
// 输出json格式的字符串回包
System
.
out
.
println
(
DescribeCaptchaResultResponse
.
toJsonString
(
resp
));
ActivityDetectionDO
activityDetectionDO
=
new
ActivityDetectionDO
();
activityDetectionDO
.
setClassId
(
verifyDTO
.
getClassId
());
activityDetectionDO
.
setMemberId
(
verifyDTO
.
getMemberId
());
...
...
@@ -91,15 +82,14 @@ public class ActivityDetectionServiceImpl extends ServiceImpl<ActivityDetectionM
return
ConstantUtils
.
FAIL_VERIFY
;
}
}
catch
(
TencentCloudSDKException
e
)
{
System
.
out
.
println
(
e
.
toString
());
//
System.out.println(e.toString());
}
return
null
;
}
public
IPage
<
ActivityDetectionDO
>
getCheckHistory
(
ActivityDetectionDO
activityDetectionDO
){
return
null
;
public
IPage
<
GetCheckHistoryVO
>
getCheckHistory
(
GetCheckHistoryDTO
getCheckHistoryDTO
){
Page
pager
=
new
Page
(
getCheckHistoryDTO
.
getPageNum
(),
getCheckHistoryDTO
.
getPageSize
());
return
this
.
baseMapper
.
getCheckHistory
(
pager
,
getCheckHistoryDTO
.
getClassId
(),
getCheckHistoryDTO
.
getMemberId
());
}
}
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
View file @
0cb59b9
...
...
@@ -9,17 +9,7 @@ import com.subsidy.common.exception.HttpException;
import
com.subsidy.dto.administer.OperatorsDTO
;
import
com.subsidy.dto.company.AddCompanyDTO
;
import
com.subsidy.dto.company.GetCompanyMembersDTO
;
import
com.subsidy.mapper.AdministerMapper
;
import
com.subsidy.mapper.ClassHourDictMapper
;
import
com.subsidy.mapper.ClassTypeDictMapper
;
import
com.subsidy.mapper.CompanyDictMapper
;
import
com.subsidy.mapper.CompanyFieldMappingMapper
;
import
com.subsidy.mapper.DepartmentDictMapper
;
import
com.subsidy.mapper.FieldDictMapper
;
import
com.subsidy.mapper.JobDictMapper
;
import
com.subsidy.mapper.RankDictMapper
;
import
com.subsidy.mapper.RoleAdministerMappingMapper
;
import
com.subsidy.mapper.RotationImgDictMapper
;
import
com.subsidy.mapper.*
;
import
com.subsidy.model.*
;
import
com.subsidy.service.CompanyDictService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
...
@@ -27,6 +17,7 @@ import com.subsidy.util.ConstantUtils;
import
com.subsidy.vo.administer.OperatorsVO
;
import
com.subsidy.vo.company.GetAllCompanyVO
;
import
com.subsidy.vo.company.GetCompanyMembersVO
;
import
com.subsidy.vo.company.MemberSummaryVO
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
...
...
@@ -77,6 +68,9 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
@Autowired
private
RotationImgDictMapper
rotationImgDictMapper
;
@Autowired
private
MemberMapper
memberMapper
;
public
IPage
<
OperatorsVO
>
operators
(
OperatorsDTO
operatorsDTO
)
{
Page
pager
=
new
Page
(
operatorsDTO
.
getPageNum
(),
operatorsDTO
.
getPageSize
());
...
...
@@ -258,5 +252,25 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
return
this
.
baseMapper
.
getCompanyMembers
(
pager
,
getCompanyMembersDTO
.
getCompanyId
(),
getCompanyMembersDTO
.
getUserName
());
}
public
MemberSummaryVO
memberSummary
(
GetCompanyMembersDTO
getCompanyMembersDTO
){
MemberSummaryVO
memberSummaryVO
=
new
MemberSummaryVO
();
//总数
Integer
total
=
memberMapper
.
selectCount
(
new
QueryWrapper
<
MemberDO
>()
.
lambda
()
.
eq
(
MemberDO:
:
getCompanyId
,
getCompanyMembersDTO
.
getCompanyId
()));
memberSummaryVO
.
setTotal
(
total
);
//短信验证
Integer
smsCnt
=
memberMapper
.
selectCount
(
new
QueryWrapper
<
MemberDO
>()
.
lambda
()
.
eq
(
MemberDO:
:
getCompanyId
,
getCompanyMembersDTO
.
getCompanyId
())
.
isNull
(
MemberDO:
:
getFirstLogin
));
memberSummaryVO
.
setSmsCnt
(
smsCnt
);
memberSummaryVO
.
setImgCnt
(
total
-
smsCnt
);
return
memberSummaryVO
;
}
}
src/main/java/com/subsidy/vo/activity/GetCheckHistoryVO.java
0 → 100644
View file @
0cb59b9
package
com
.
subsidy
.
vo
.
activity
;
import
lombok.Data
;
@Data
public
class
GetCheckHistoryVO
{
private
Long
id
;
private
String
createDate
;
private
Integer
status
;
}
src/main/java/com/subsidy/vo/company/MemberSummaryVO.java
0 → 100644
View file @
0cb59b9
package
com
.
subsidy
.
vo
.
company
;
import
lombok.Data
;
@Data
public
class
MemberSummaryVO
{
private
Integer
total
;
private
Integer
smsCnt
;
private
Integer
imgCnt
;
}
src/main/resources/mapper/ActivityDetectionMapper.xml
View file @
0cb59b9
...
...
@@ -21,4 +21,17 @@
id, class_id, member_id, status
</sql>
<select
id=
"getCheckHistory"
resultType=
"com.subsidy.vo.activity.GetCheckHistoryVO"
>
SELECT
t.id,
t.`status`,
t.create_date
FROM
activity_detection t
WHERE
t.delete_date IS NULL
AND t.class_id = #{classId}
AND t.member_id = #{memberId}
</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