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 858a7caf
authored
Jul 07, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20220707 备个份
1 parent
e4b76240
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
12 deletions
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
src/main/resources/application.properties
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
View file @
858a7ca
...
...
@@ -65,8 +65,8 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
@Autowired
private
MemberMapper
memberMapper
;
@Autowired
private
RedisUtil
redisUtil
;
//
@Autowired
//
private RedisUtil redisUtil;
public
String
insertHistory
(
VodPlayHistoryDO
vodPlayHistoryDO
)
{
...
...
@@ -81,11 +81,18 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
//查看当天这个人看了多少时间
Integer
total
=
vodPlayHistoryMapper
.
memberDailyStudyLength
(
memberDO
.
getId
());
if
(
total
==
classHourDictDO
.
getClassHour
()
*
3600
){
throw
new
HttpException
(
13001
);
}
//是否超过时长 没超过 false 超过 true
if
(
total
+
vodPlayHistoryDO
.
getPlayLength
()
>
=
classHourDictDO
.
getClassHour
()
*
3600
)
{
if
(
total
+
vodPlayHistoryDO
.
getPlayLength
()
>
classHourDictDO
.
getClassHour
()
*
3600
)
{
int
playLength
=
classHourDictDO
.
getClassHour
()
*
3600
-
total
;
vodPlayHistoryDO
.
setPlayLength
(
playLength
);
vodPlayHistoryDO
.
setPlayCount
(
1
);
if
(
playLength
>
3
){
this
.
baseMapper
.
insert
(
vodPlayHistoryDO
);
}
throw
new
HttpException
(
13001
);
}
}
...
...
@@ -98,11 +105,6 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
public
String
insertHistoryNew
(
InsertHistoryNewDTO
insertHistoryNewDTO
)
{
if
(
insertHistoryNewDTO
.
getPlayLength
()
>
3
)
{
//对比redis上的token
String
token
=
redisUtil
.
get
(
"mobile_"
+
insertHistoryNewDTO
.
getMemberId
()).
toString
();
if
(!
insertHistoryNewDTO
.
getToken
().
equals
(
token
))
{
throw
new
HttpException
(
1010
);
}
VodPlayHistoryDO
vodPlayHistoryDO
=
new
VodPlayHistoryDO
();
BeanUtils
.
copyProperties
(
insertHistoryNewDTO
,
vodPlayHistoryDO
);
...
...
@@ -117,11 +119,18 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
//查看当天这个人看了多少时间
Integer
total
=
vodPlayHistoryMapper
.
memberDailyStudyLength
(
memberDO
.
getId
());
if
(
total
==
classHourDictDO
.
getClassHour
()
*
3600
){
throw
new
HttpException
(
13001
);
}
//是否超过时长 没超过 false 超过 true
if
(
total
+
vodPlayHistoryDO
.
getPlayLength
()
>
=
classHourDictDO
.
getClassHour
()
*
3600
)
{
if
(
total
+
vodPlayHistoryDO
.
getPlayLength
()
>
classHourDictDO
.
getClassHour
()
*
3600
)
{
int
playLength
=
classHourDictDO
.
getClassHour
()
*
3600
-
total
;
vodPlayHistoryDO
.
setPlayLength
(
playLength
);
vodPlayHistoryDO
.
setPlayCount
(
1
);
if
(
playLength
>
3
){
this
.
baseMapper
.
insert
(
vodPlayHistoryDO
);
}
throw
new
HttpException
(
13001
);
}
}
...
...
@@ -624,7 +633,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
public
List
<
Long
>
testPlays
(
VodPlayHistoryDO
vodPlayHistoryDO
)
{
String
classIds
=
"2
54
"
;
String
classIds
=
"2
61
"
;
// String classIds = "122,150";
List
<
String
>
classIdArr
=
Arrays
.
asList
(
classIds
.
split
(
","
));
...
...
@@ -652,7 +661,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
// LocalDateTime dateTmp = vph1.getCreateDate().minusSeconds(-vph2.getPlayLength() - getRandom1_2());
// vph2.setCreateDate(dateTmp);
// this.baseMapper.updateById(vph2);
//
result.add(vodPlayStateVO.getId());
result
.
add
(
vodPlayStateVO
.
getId
());
// }
}
}
...
...
src/main/resources/application.properties
View file @
858a7ca
# 环境配置
spring.profiles.active
=
prod
spring.profiles.active
=
dev
#和CPU数
spring.server.acceptorThreadCount
=
600
spring.server.minSpareThreads
=
100
...
...
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