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 4f1af516
authored
Sep 28, 2023
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
中秋代码备份
1 parent
f09aa192
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
167 additions
and
21 deletions
src/main/java/com/subsidy/controller/MemberController.java
src/main/java/com/subsidy/controller/VodPlayHistoryController.java
src/main/java/com/subsidy/dto/member/KexinkuLoginDTO.java
src/main/java/com/subsidy/jobs/WarningJob.java
src/main/java/com/subsidy/mapper/OprMemDictMapper.java
src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
src/main/java/com/subsidy/service/MemberService.java
src/main/java/com/subsidy/service/VodPlayHistoryService.java
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
src/main/resources/mapper/AdministerMapper.xml
src/main/resources/mapper/ClassMemberMappingMapper.xml
src/main/resources/mapper/OprMemDictMapper.xml
src/main/resources/mapper/RenSheJuMapper.xml
src/main/resources/mapper/VodPlayHistoryMapper.xml
src/main/java/com/subsidy/controller/MemberController.java
View file @
4f1af51
...
...
@@ -91,6 +91,14 @@ public class MemberController {
return
ResponseData
.
generateCreatedResponse
(
0
,
memberService
.
kunchiLogin
(
qingxuetangLoginDTO
,
request
));
}
@PostMapping
(
"kexinkuLogin"
)
@ApiOperation
(
"可信库登录 idCard 身份证号 timestamp 时间戳 sign"
)
@TimeRequired
public
ResponseVO
kexinkuLogin
(
@RequestBody
KexinkuLoginDTO
kexinkuLoginDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
memberService
.
kexinkuLogin
(
kexinkuLoginDTO
));
}
@PostMapping
(
"checkStatus"
)
@ApiOperation
(
"实名制验证状态 id"
)
@TimeRequired
...
...
src/main/java/com/subsidy/controller/VodPlayHistoryController.java
View file @
4f1af51
...
...
@@ -16,6 +16,8 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* <p>
* 视频播放历史记录表 前端控制器
...
...
@@ -96,4 +98,13 @@ public class VodPlayHistoryController {
vodPlayHistoryService
.
warning
();
}
@PostMapping
(
"criticalData"
)
@ApiOperation
(
"找出临界那条数据 classId"
)
public
List
<
Long
>
criticalData
(
@RequestBody
VodPlayHistoryDO
vodPlayHistoryDO
){
return
vodPlayHistoryService
.
criticalData
(
vodPlayHistoryDO
);
}
}
src/main/java/com/subsidy/dto/member/KexinkuLoginDTO.java
0 → 100644
View file @
4f1af51
package
com
.
subsidy
.
dto
.
member
;
import
lombok.Data
;
@Data
public
class
KexinkuLoginDTO
{
private
String
appId
;
private
String
authCorpId
;
private
String
openId
;
private
String
idCard
;
private
Long
timestamp
;
private
String
sign
;
}
src/main/java/com/subsidy/jobs/WarningJob.java
View file @
4f1af51
...
...
@@ -69,7 +69,7 @@ public class WarningJob {
// }
//
// if (result.size()>0){
// List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812"
, "18217669021"
});
// List<String> telephones = Arrays.asList(new String[]{"15201936167", "18201963812"});
// for (String telephone : telephones){
// smsUtils.sendWarning("SMS_460945631", telephone, result.toString());
// }
...
...
src/main/java/com/subsidy/mapper/OprMemDictMapper.java
View file @
4f1af51
package
com
.
subsidy
.
mapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.subsidy.model.OprAdmDictDO
;
import
com.subsidy.model.OprMemDictDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.subsidy.vo.opr.GetHistoryVO
;
...
...
@@ -56,5 +57,13 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> {
*/
void
insertOrUpdate
(
Long
userId
,
String
oprType
,
Integer
result
,
String
ipAddress
,
Date
createDate
);
/**
* 查看某为成员最近登录情况 五天超过次数
*/
List
<
OprMemDictDO
>
getLoginInfo
(
Long
userId
);
/**
* 清除今天登录失败的记录
*/
void
clearTodayLoginData
(
Long
userId
);
}
src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
View file @
4f1af51
...
...
@@ -2,6 +2,7 @@ package com.subsidy.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.subsidy.model.VodDictDO
;
import
com.subsidy.model.VodPlayHistoryDO
;
import
com.subsidy.vo.administer.MemberStudyLogVO
;
import
com.subsidy.vo.member.ContentVodNewVO
;
...
...
@@ -126,4 +127,9 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
*/
List
<
DailyClassMembersVO
>
dailyClassMembers
();
/**
* 找出这个课程学习的人
*/
List
<
Long
>
vodMembers
(
Long
classId
);
}
src/main/java/com/subsidy/service/MemberService.java
View file @
4f1af51
...
...
@@ -43,6 +43,8 @@ public interface MemberService extends IService<MemberDO> {
UserRoleVO
kunchiLogin
(
QingxuetangLoginDTO
qingxuetangLoginDTO
,
HttpServletRequest
request
);
UserRoleVO
kexinkuLogin
(
KexinkuLoginDTO
kexinkuLoginDTO
);
CheckStatusVO
checkStatus
(
MemberDO
memberDO
);
String
updatePassword
(
MemberDO
memberDO
);
...
...
src/main/java/com/subsidy/service/VodPlayHistoryService.java
View file @
4f1af51
...
...
@@ -40,4 +40,6 @@ public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> {
void
warning
();
List
<
Long
>
criticalData
(
VodPlayHistoryDO
vodPlayHistoryDO
);
}
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
View file @
4f1af51
...
...
@@ -243,11 +243,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
oprAdmDictDO
.
setOprType
(
"登录"
);
oprAdmDictDO
.
setResult
(
0
);
oprAdmDictMapper
.
insert
(
oprAdmDictDO
);
//oprAdmDictDO.setCreateDate(System.currentTimeMillis() + "");
//oprAdmDictDO.setLoginDateFormat(DateFormatUtil.format(new Date(), "yyyyMMdd"));
//oprAdmDictDO.setUserName(administerDO1.getUserName());
//oprAdmDictDO.setCompanyId(administerDO1.getCompanyId());
//mongoTemplate.insert(oprAdmDictDO);
int
i
=
0
;
...
...
@@ -1402,7 +1398,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
memberDO1
.
setTelephone
(
s
.
getTelephone
());
memberDO1
.
setIdCard
(
s
.
getIdCard
());
memberDO1
.
setStatus
(
"启用"
);
memberDO1
.
setPassword
(
"123456"
);
memberDO1
.
setPassword
(
"
Ykhl
123456"
);
memberDO1
.
setAccountNameEn
(
s
.
getAccountNameEn
());
memberMapper
.
insert
(
memberDO1
);
...
...
@@ -2095,22 +2091,29 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
exerciseTestVO
.
getCount
());
//
次数
//
开始时间
newCell
=
dataRow
.
createCell
(
6
);
newCell
.
setCellStyle
(
cellStyle
);
if
(
exerciseTestVO
.
getScore
()
!=
0
)
{
newCell
.
setCellValue
(
exerciseTestVO
.
getStartDate
());
}
//
次数
//
结束时间
newCell
=
dataRow
.
createCell
(
7
);
newCell
.
setCellStyle
(
cellStyle
);
if
(
exerciseTestVO
.
getScore
()
!=
0
)
{
newCell
.
setCellValue
(
exerciseTestVO
.
getEndDate
());
}
//次数
newCell
=
dataRow
.
createCell
(
8
);
newCell
.
setCellStyle
(
cellStyle
);
if
(
exerciseTestVO
.
getScore
()
!=
0
)
{
newCell
.
setCellValue
(
exerciseTestVO
.
getPeriod
());
}
newCell
=
dataRow
.
createCell
(
9
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
exerciseTestVO
.
getScore
()
>=
60
?
"合格"
:
"不合格"
);
rowIndex
++;
...
...
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
View file @
4f1af51
This diff is collapsed.
Click to expand it.
src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
View file @
4f1af51
This diff is collapsed.
Click to expand it.
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
View file @
4f1af51
...
...
@@ -55,9 +55,19 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
@Autowired
private
SMSUtils
smsUtils
;
@Autowired
private
ExerciseDoneResultMapper
exerciseDoneResultMapper
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
insertHistory
(
VodPlayHistoryDO
vodPlayHistoryDO
)
{
// Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
// .lambda()
// .eq(ExerciseDoneResultDO::getClassId, vodPlayHistoryDO.getClassId())
// .eq(ExerciseDoneResultDO::getMemberId, vodPlayHistoryDO.getMemberId())
// .eq(ExerciseDoneResultDO::getResult, "合格"));
// if (count == 0){
Date
date
=
new
Date
();
if
(
vodPlayHistoryDO
.
getPlayLength
()
>
8
&&
vodPlayHistoryDO
.
getSuspendLength
()
<=
3000
)
{
//查看系统设定的时长
...
...
@@ -94,11 +104,21 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
// this.baseMapper.insert(vodPlayHistoryDO);
}
}
// }
return
ConstantUtils
.
ADD_SUCCESS
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
insertHistoryNew
(
InsertHistoryNewDTO
insertHistoryNewDTO
)
{
// Integer count = exerciseDoneResultMapper.selectCount(new QueryWrapper<ExerciseDoneResultDO>()
// .lambda()
// .eq(ExerciseDoneResultDO::getClassId, insertHistoryNewDTO.getClassId())
// .eq(ExerciseDoneResultDO::getMemberId, insertHistoryNewDTO.getMemberId())
// .eq(ExerciseDoneResultDO::getResult, "合格"));
//
// if (count == 0){
Date
date
=
new
Date
();
if
(
insertHistoryNewDTO
.
getPlayLength
()
>
8
&&
insertHistoryNewDTO
.
getSuspendLength
()
<=
3000
)
{
VodPlayHistoryDO
vodPlayHistoryDO
=
new
VodPlayHistoryDO
();
...
...
@@ -136,6 +156,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
// this.baseMapper.insert(vodPlayHistoryDO);
}
}
// }
return
ConstantUtils
.
ADD_SUCCESS
;
}
...
...
@@ -688,13 +709,41 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
System
.
out
.
println
(
result
.
toString
());
if
(
result
.
size
()
>
0
)
{
List
<
String
>
telephones
=
Arrays
.
asList
(
new
String
[]{
"15201936167"
,
"18201963812"
,
"18217669021"
});
List
<
String
>
telephones
=
Arrays
.
asList
(
new
String
[]{
"15201936167"
,
"18201963812"
});
for
(
String
telephone
:
telephones
)
{
smsUtils
.
sendWarning
(
"SMS_460945631"
,
telephone
,
result
.
toString
());
}
}
}
public
List
<
Long
>
criticalData
(
VodPlayHistoryDO
vodPlayHistoryDO
)
{
List
<
Long
>
result
=
new
ArrayList
<>();
List
<
Long
>
vodMembers
=
vodPlayHistoryMapper
.
vodMembers
(
vodPlayHistoryDO
.
getClassId
());
VodDictDO
vodDictDO
=
vodDictMapper
.
selectById
(
vodPlayHistoryDO
.
getVodId
());
for
(
Long
memberId
:
vodMembers
){
List
<
VodPlayHistoryDO
>
vodPlayHistoryDOS
=
this
.
baseMapper
.
selectList
(
new
QueryWrapper
<
VodPlayHistoryDO
>()
.
lambda
()
.
eq
(
VodPlayHistoryDO:
:
getClassId
,
vodPlayHistoryDO
.
getClassId
())
.
eq
(
VodPlayHistoryDO:
:
getMemberId
,
memberId
)
.
eq
(
VodPlayHistoryDO:
:
getVodId
,
vodPlayHistoryDO
.
getVodId
())
.
orderByAsc
(
VodPlayHistoryDO:
:
getCreateDate
));
int
i
=
0
;
for
(
VodPlayHistoryDO
vodPlayHistoryDO1
:
vodPlayHistoryDOS
){
i
+=
vodPlayHistoryDO1
.
getPlayLength
();
if
(
i
>=
vodDictDO
.
getVodLength
()){
result
.
add
(
vodPlayHistoryDO1
.
getId
());
break
;
}
}
}
return
result
;
}
//19为基数的话,3次签到6.5到8,4次签到4.8-6,
// 5次4-6,6次3.2-6,7次及以上2.5-6吧
//int randNumber =rand.nextInt(MAX - MIN + 1) + MIN;
...
...
@@ -738,13 +787,13 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
* 随机0-9秒
*/
public
int
random0to9
()
{
return
(
int
)
(
Math
.
random
()
*
10
+
3
);
return
(
int
)
(
Math
.
random
()
*
10
+
3
);
}
public
static
void
main
(
String
[]
args
)
{
for
(
int
i
=
0
;
i
<
50
;
i
++)
{
System
.
out
.
println
((
int
)
(
Math
.
random
()
*
10
)
+
3
);
System
.
out
.
println
((
int
)
(
Math
.
random
()
*
10
)
+
3
);
}
// List<Long> list = new ArrayList<Long>();
...
...
src/main/resources/mapper/AdministerMapper.xml
View file @
4f1af51
...
...
@@ -62,7 +62,7 @@
<if
test=
"userName != null and userName !=''"
>
and t2.user_name like concat('%',#{userName} ,'%')
</if>
order by
CONVERT(t2.user_name USING gbk)
ASC
order by
t2.account_name
ASC
</select>
<select
id=
"classSign"
resultType=
"com.subsidy.vo.member.ClassSignVO"
>
...
...
@@ -83,7 +83,7 @@
<if
test=
"userName != null and userName !=''"
>
and t2.user_name like concat('%',#{userName} ,'%')
</if>
order by
CONVERT(t2.user_name USING gbk)
ASC
order by
t2.account_name
ASC
</select>
<select
id=
"exerciseTest"
resultType=
"com.subsidy.vo.administer.ExerciseTestVO"
>
...
...
@@ -104,7 +104,7 @@
<if
test=
"userName != null and userName !=''"
>
and t2.user_name like concat('%',#{userName} ,'%')
</if>
order by
CONVERT(t2.user_name USING gbk)
ASC
order by
t2.account_name
ASC
</select>
<select
id=
"answerRecord"
resultType=
"com.subsidy.vo.sign.AnswerRecordVO"
>
...
...
@@ -126,7 +126,7 @@
<if
test=
"userName !=null and userName !=''"
>
AND t2.user_name LIKE concat('%',#{userName} ,'%')
</if>
order by
CONVERT(t2.user_name USING gbk)
ASC
order by
t2.account_name
ASC
</select>
<select
id=
"classActivityDetection"
resultType=
"com.subsidy.vo.administer.MemberDetectionRecordVO"
>
...
...
@@ -152,7 +152,7 @@
</if>
GROUP BY
t.member_id
order by
CONVERT(t2.user_name USING gbk)
ASC
order by
t2.account_name
ASC
</select>
<select
id=
"imageCheckDetail"
resultType=
"com.subsidy.vo.administer.ImageCheckDetailVO"
>
...
...
@@ -205,7 +205,7 @@
t2.member_id,
t2.class_id
) t2 ON t1.id = t2.member_id
order by
CONVERT(t1.user_name USING gbk)
ASC
order by
t1.account_name
ASC
</select>
<select
id=
"operators"
parameterType=
"string"
resultType=
"com.subsidy.vo.administer.OperatorsVO"
>
...
...
src/main/resources/mapper/ClassMemberMappingMapper.xml
View file @
4f1af51
...
...
@@ -61,7 +61,7 @@
<if
test=
"userName !=null and userName !=''"
>
and t2.user_name like concat('%',#{userName} ,'%')
</if>
order by
CONVERT(t2.user_name USING gbk)
ASC
order by
t2.account_name
ASC
</select>
<select
id=
"getMemberClassCount"
parameterType=
"long"
resultType=
"long"
>
...
...
src/main/resources/mapper/OprMemDictMapper.xml
View file @
4f1af51
...
...
@@ -258,4 +258,32 @@
create_date=values(create_date)
</insert>
<select
id=
"getLoginInfo"
parameterType=
"long"
resultType=
"com.subsidy.model.OprMemDictDO"
>
SELECT
*
FROM
(
SELECT
*
FROM
opr_mem_dict t
where t.delete_date is null
and t.user_id = #{userId}
and DATE_FORMAT(t.create_date,'%Y-%m-%d') =DATE_FORMAT(now(), '%Y-%m-%d')
and TIMESTAMPDIFF(SECOND,t.create_date,now())
<
= 300
ORDER BY
t.create_date DESC
LIMIT 5)t2
</select>
<select
id=
"clearTodayLoginData"
parameterType=
"long"
>
DELETE
FROM
opr_mem_dict
WHERE
delete_date IS NULL
AND user_id = #{userId}
AND DATE_FORMAT( create_date, '%Y-%m-%d' ) = CURRENT_DATE
</select>
</mapper>
src/main/resources/mapper/RenSheJuMapper.xml
View file @
4f1af51
...
...
@@ -467,7 +467,6 @@
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
and t1.member_id
GROUP BY t1.class_id,t1.member_id
ORDER BY t1.create_date desc
</select>
...
...
@@ -491,7 +490,6 @@
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>
...
...
src/main/resources/mapper/VodPlayHistoryMapper.xml
View file @
4f1af51
...
...
@@ -550,4 +550,14 @@
t.class_id
</select>
<select
id=
"vodMembers"
parameterType=
"long"
resultType=
"long"
>
SELECT DISTINCT
t.member_id
FROM
vod_play_history t
WHERE
t.delete_date IS NULL
and t.class_id = #{classId}
</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