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 056b9d23
authored
Dec 30, 2021
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
程序处理改成了sql处理
1 parent
168678a9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
11 deletions
src/main/java/com/subsidy/controller/MemberController.java
src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java
src/main/resources/application.properties
src/main/resources/mapper/CourseContentMapper.xml
src/main/resources/mapper/VodPlayHistoryMapper.xml
src/main/java/com/subsidy/controller/MemberController.java
View file @
056b9d2
...
...
@@ -103,7 +103,7 @@ public class MemberController {
}
@PostMapping
(
"studyHistory"
)
@ApiOperation
(
"** 学习记录
i
d 成员id pageSize pageNum"
)
@ApiOperation
(
"** 学习记录
memberI
d 成员id pageSize pageNum"
)
public
ResponseVO
studyHistory
(
@RequestBody
StudyHistoryDTO
studyHistoryDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
memberService
.
studyHistory
(
studyHistoryDTO
));
}
...
...
src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
View file @
056b9d2
...
...
@@ -41,4 +41,9 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
* 查看某人当天看了多少时间
*/
int
memberDailyStudyLength
(
Long
memberId
);
/**
* 查看学生是否完成了某个视频
*/
int
completeVodOrNot
(
Long
memberId
,
Long
vodId
);
}
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
View file @
056b9d2
This diff is collapsed.
Click to expand it.
src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java
View file @
056b9d2
...
...
@@ -222,10 +222,9 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
//获取有效课程
long
count
=
classMemberMappingMapper
.
getMemberClassCount
(
signInRecordDO
.
getMemberId
());
long
size
=
redisUtil
.
keys
(
RedisPrefixConstant
.
SUBSIDY_SIGN_INFO_PREFIX
+
"memberId_"
+
signInRecordDO
.
getMemberId
()
+
"*_"
+
DateFormatUtil
.
format
(
new
Date
(),
"yyyyMMdd"
)).
stream
().
count
();
if
(
size
!=
count
)
{
if
(
size
!=
count
)
{
signInStatusVO
.
setStatus
(
flag
);
}
...
...
@@ -247,8 +246,8 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
//}
List
<
ClassHourDictDO
>
classHourDictDOS
=
classHourDictMapper
.
selectList
(
null
);
for
(
ClassHourDictDO
classHourDictDO
:
classHourDictDOS
){
redisUtil
.
set
(
"subsidySettings_"
+
classHourDictDO
.
getCompanyId
(),
classHourDictDO
);
for
(
ClassHourDictDO
classHourDictDO
:
classHourDictDOS
)
{
redisUtil
.
set
(
"subsidySettings_"
+
classHourDictDO
.
getCompanyId
(),
classHourDictDO
);
}
}
...
...
src/main/resources/application.properties
View file @
056b9d2
...
...
@@ -4,14 +4,14 @@ spring.profiles.active=dev
spring.server.port
=
23457
#嵌入tomcat配置
#和CPU数
spring.server.acceptorThreadCount
=
2
00
spring.server.acceptorThreadCount
=
6
00
spring.server.minSpareThreads
=
100
spring.server.maxSpareThreads
=
500
spring.server.maxThreads
=
8
00
spring.server.maxConnections
=
50
000
spring.server.maxThreads
=
5
00
spring.server.maxConnections
=
1
000
#10秒超时
spring.server.connectionTimeout
=
20000
spring.server.protocol
=
org.apache.coyote.http11.Http11
Nio2
Protocol
spring.server.protocol
=
org.apache.coyote.http11.Http11
Apr
Protocol
spring.server.redirectPort
=
8443
spring.server.compression
=
on
#文件请求大小
...
...
src/main/resources/mapper/CourseContentMapper.xml
View file @
056b9d2
...
...
@@ -23,7 +23,16 @@
<select
id=
"getCourseVods"
parameterType=
"integer"
resultType=
"com.subsidy.model.VodDictDO"
>
SELECT
t2.*
t2.id,
t2.content_id,
t2.vod_name,
t2.vod_length,
t2.vod_type,
t2.vod_size,
t2.vod_url,
t2.vod_code,
t2.teacher_name,
t2.cover_page
FROM
course_content t
LEFT JOIN vod_dict t2 ON t.id = t2.content_id
...
...
src/main/resources/mapper/VodPlayHistoryMapper.xml
View file @
056b9d2
...
...
@@ -35,7 +35,7 @@
t2.vod_url,
t2.vod_name,
t3.play_record,
round( t3.play_record * 100 / t2.vod_length, 0 ) AS percent
,
if(round( t3.play_record * 100 / t2.vod_length, 0 )>=80,'true','false') as status
,
t.playDate
FROM
(
...
...
@@ -113,4 +113,17 @@
AND t.member_id = #{memberId}
</select>
<select
id=
"completeVodOrNot"
resultType=
"integer"
>
SELECT
IF
( max( t.play_record ) > t2.vod_length, 1, 0 ) AS count
FROM
vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t.delete_date is null
and t2.delete_date is null
t.member_id = #{memberId}
AND t.vod_id = #{vodId}
</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