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 62041049
authored
Jan 14, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化后版本,跑数据脚本
1 parent
9e3c2b72
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
View file @
6204104
...
@@ -65,7 +65,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
...
@@ -65,7 +65,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
public
void
dataFix
()
{
public
void
dataFix
()
{
//班级ids
//班级ids
List
<
String
>
classIds
=
Arrays
.
asList
(
new
String
[]{
"28"
});
List
<
String
>
classIds
=
Arrays
.
asList
(
new
String
[]{
"
17"
,
"
28"
});
Random
random
=
new
Random
();
Random
random
=
new
Random
();
...
@@ -105,16 +105,18 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
...
@@ -105,16 +105,18 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
//时间点
//时间点
VodPlayHistoryDO
vodPlayHistoryDO1
=
vodPlayHistoryDOS
.
get
(
0
);
VodPlayHistoryDO
vodPlayHistoryDO1
=
vodPlayHistoryDOS
.
get
(
0
);
int
total
=
0
;
int
total
=
0
;
int
playCounts
=
random
.
nextInt
(
vodDictDOS
.
size
())
;
int
playCounts
=
random
.
nextInt
(
2
)+
1
;
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
();
int
j
=
random1
.
nextInt
(
vodDictDOS
.
size
());
vodPlayHistoryDO
.
setPlayCount
(
1
);
vodPlayHistoryDO
.
setPlayCount
(
1
);
vodPlayHistoryDO
.
setClassId
(
Long
.
valueOf
(
str
));
vodPlayHistoryDO
.
setClassId
(
Long
.
valueOf
(
str
));
vodPlayHistoryDO
.
setMemberId
(
classMemberMappingDO
.
getMemberId
());
vodPlayHistoryDO
.
setMemberId
(
classMemberMappingDO
.
getMemberId
());
vodPlayHistoryDO
.
setPlayRecord
(
random
.
nextInt
(
vodDictDOS
.
get
(
i
).
getVodLength
()-
10
)+
1
);
vodPlayHistoryDO
.
setPlayRecord
(
random
.
nextInt
(
vodDictDOS
.
get
(
j
).
getVodLength
()-
10
)+
1
);
vodPlayHistoryDO
.
setPlayLength
(
random
.
nextInt
(
vodPlayHistoryDO
.
getPlayRecord
()));
vodPlayHistoryDO
.
setPlayLength
(
random
.
nextInt
(
vodPlayHistoryDO
.
getPlayRecord
()));
vodPlayHistoryDO
.
setVodId
(
vodDictDOS
.
get
(
i
).
getId
());
vodPlayHistoryDO
.
setVodId
(
vodDictDOS
.
get
(
j
).
getId
());
total
+=
vodPlayHistoryDO
.
getPlayLength
()+
random
.
nextInt
(
10
);
total
+=
vodPlayHistoryDO
.
getPlayLength
()+
random
.
nextInt
(
10
);
vodPlayHistoryDO
.
setPlayDate
(
vodPlayHistoryDO1
.
getPlayDate
().
plusSeconds
(
total
));
vodPlayHistoryDO
.
setPlayDate
(
vodPlayHistoryDO1
.
getPlayDate
().
plusSeconds
(
total
));
vodPlayHistoryMapper
.
insert
(
vodPlayHistoryDO
);
vodPlayHistoryMapper
.
insert
(
vodPlayHistoryDO
);
...
...
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