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 eefbce7c
authored
Mar 09, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
签到数据删除了历史数据
1 parent
b17282a8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
16 deletions
pom.xml
src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
src/main/resources/application.properties
pom.xml
View file @
eefbce7
...
@@ -133,11 +133,11 @@
...
@@ -133,11 +133,11 @@
<version>
${swagger2.version}
</version>
<version>
${swagger2.version}
</version>
</dependency>
</dependency>
<dependency
>
<!-- <dependency>--
>
<groupId>
com.amdelamar
</groupId
>
<!-- <groupId>com.amdelamar</groupId>--
>
<artifactId>
jhash
</artifactId
>
<!-- <artifactId>jhash</artifactId>--
>
<version>
${jhash.version}
</version
>
<!-- <version>${jhash.version}</version>--
>
</dependency
>
<!-- </dependency>--
>
<dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<groupId>
org.apache.poi
</groupId>
...
...
src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java
View file @
eefbce7
...
@@ -56,9 +56,6 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
...
@@ -56,9 +56,6 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
//private RedisUtil redisUtil;
//private RedisUtil redisUtil;
@Autowired
@Autowired
private
SignInRecordMapper
signInRecordMapper
;
@Autowired
private
ClassDictMapper
classDictMapper
;
private
ClassDictMapper
classDictMapper
;
@Autowired
@Autowired
...
@@ -89,10 +86,10 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
...
@@ -89,10 +86,10 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
//}
//}
//redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + classDictDO.getId() + ":" + DateFormatUtil.format(new Date(), "yyyy-MM-dd") + ":" + System.currentTimeMillis(), null);
//redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + classDictDO.getId() + ":" + DateFormatUtil.format(new Date(), "yyyy-MM-dd") + ":" + System.currentTimeMillis(), null);
signInRecord
Mapper
.
delete
(
new
QueryWrapper
<
SignInRecordDO
>()
this
.
base
Mapper
.
delete
(
new
QueryWrapper
<
SignInRecordDO
>()
.
lambda
()
.
lambda
()
.
eq
(
SignInRecordDO:
:
getMemberId
,
signInRecordDO
.
getMemberId
())
.
eq
(
SignInRecordDO:
:
getMemberId
,
signInRecordDO
.
getMemberId
())
.
eq
(
SignInRecordDO:
:
getClassId
,
classDictDO
.
getId
()));
.
gt
(
SignInRecordDO:
:
getSignInDate
,
LocalDate
.
now
()));
// 存储到缓存到同时保存到数据库
// 存储到缓存到同时保存到数据库
SignInRecordDO
sign
=
this
.
baseMapper
.
selectOne
(
new
QueryWrapper
<
SignInRecordDO
>()
SignInRecordDO
sign
=
this
.
baseMapper
.
selectOne
(
new
QueryWrapper
<
SignInRecordDO
>()
...
@@ -138,7 +135,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
...
@@ -138,7 +135,7 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
for
(
ClassMemberMappingDO
classMemberMappingDO
:
classMemberMappingDOS
)
{
for
(
ClassMemberMappingDO
classMemberMappingDO
:
classMemberMappingDOS
)
{
//签到
//签到
Integer
signCount
=
signInRecord
Mapper
.
selectCount
(
new
QueryWrapper
<
SignInRecordDO
>()
Integer
signCount
=
this
.
base
Mapper
.
selectCount
(
new
QueryWrapper
<
SignInRecordDO
>()
.
lambda
()
.
lambda
()
.
eq
(
SignInRecordDO:
:
getMemberId
,
classMemberMappingDO
.
getMemberId
())
.
eq
(
SignInRecordDO:
:
getMemberId
,
classMemberMappingDO
.
getMemberId
())
.
eq
(
SignInRecordDO:
:
getClassId
,
dataViewVO
.
getClassId
()));
.
eq
(
SignInRecordDO:
:
getClassId
,
dataViewVO
.
getClassId
()));
...
...
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
View file @
eefbce7
...
@@ -366,12 +366,16 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
...
@@ -366,12 +366,16 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
.
eq
(
SignInRecordDO:
:
getMemberId
,
classMemberMappingDO
.
getMemberId
())
.
eq
(
SignInRecordDO:
:
getMemberId
,
classMemberMappingDO
.
getMemberId
())
.
eq
(
SignInRecordDO:
:
getClassId
,
classId
));
.
eq
(
SignInRecordDO:
:
getClassId
,
classId
));
//确定每日最大学习时长
int
maxLength
=
memberStudyLengthDO
.
getTotalLength
()/
signInRecordDOS
.
size
()+
650
;
for
(
int
k
=
signInRecordDOS
.
size
()
-
1
;
k
>=
0
;
k
--)
{
for
(
int
k
=
signInRecordDOS
.
size
()
-
1
;
k
>=
0
;
k
--)
{
//查看当天这人已经看的视频时长
//查看当天这人已经看的视频时长
List
<
VodPlayHistoryDO
>
vodPlayHistoryDOS
=
vodPlayHistoryMapper
.
exPlayInfo
(
classMemberMappingDO
.
getMemberId
(),
String
.
valueOf
(
classId
),
signInRecordDOS
.
get
(
k
).
getSignInDate
());
List
<
VodPlayHistoryDO
>
vodPlayHistoryDOS
=
vodPlayHistoryMapper
.
exPlayInfo
(
classMemberMappingDO
.
getMemberId
(),
String
.
valueOf
(
classId
),
signInRecordDOS
.
get
(
k
).
getSignInDate
());
//查看学生
一
看视频时长
//查看学生
已
看视频时长
int
totalLength
=
0
;
int
totalLength
=
0
;
System
.
out
.
println
(
"111111111111111"
);
System
.
out
.
println
(
"111111111111111"
);
List
<
VodPlayHistoryDO
>
vodPlayHistoryDOS1
=
vodPlayHistoryMapper
.
selectList
(
new
QueryWrapper
<
VodPlayHistoryDO
>()
List
<
VodPlayHistoryDO
>
vodPlayHistoryDOS1
=
vodPlayHistoryMapper
.
selectList
(
new
QueryWrapper
<
VodPlayHistoryDO
>()
...
@@ -398,12 +402,13 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
...
@@ -398,12 +402,13 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
playLength
+=
vodPlayHistoryDOS
.
get
(
m
).
getPlayLength
();
playLength
+=
vodPlayHistoryDOS
.
get
(
m
).
getPlayLength
();
}
}
System
.
out
.
println
(
"33333333333333333333"
);
if
(
maxLength
>
playLength
){
if
(
leftLength
>
0
)
{
if
(
leftLength
>
0
)
{
//随机看几个视频
//随机看几个视频
int
playCounts
=
new
Random
().
nextInt
(
4
)
+
2
;
int
playCounts
=
new
Random
().
nextInt
(
4
)
+
2
;
System
.
out
.
println
(
"4444444444444444"
);
System
.
out
.
println
(
"4444444444444444"
);
for
(
int
i
=
0
;
i
<
playCounts
;
i
++)
{
for
(
int
i
=
0
;
i
<
playCounts
;
i
++)
{
VodPlayHistoryDO
vodPlayHistoryDO
=
new
VodPlayHistoryDO
();
VodPlayHistoryDO
vodPlayHistoryDO
=
new
VodPlayHistoryDO
();
Random
random1
=
new
Random
();
Random
random1
=
new
Random
();
System
.
out
.
println
(
"55555555555555555555"
);
System
.
out
.
println
(
"55555555555555555555"
);
...
@@ -432,6 +437,8 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
...
@@ -432,6 +437,8 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
}
}
}
}
}
}
System
.
out
.
println
(
"33333333333333333333"
);
}
}
}
}
}
...
...
src/main/resources/application.properties
View file @
eefbce7
# 环境配置
# 环境配置
spring.profiles.active
=
dev
spring.profiles.active
=
prod
# 端口号
# 端口号
spring.server.port
=
2345
7
spring.server.port
=
2345
9
#嵌入tomcat配置
#嵌入tomcat配置
#和CPU数
#和CPU数
spring.server.acceptorThreadCount
=
600
spring.server.acceptorThreadCount
=
600
...
...
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