Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
reyun
manager
Commits
914b8387
Commit
914b8387
authored
Feb 26, 2018
by
manxiaoqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app排序
parent
af967d85
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
17 deletions
+20
-17
workspace.xml
.idea/workspace.xml
+0
-0
SyncAppDataTask.java
src/main/java/common/task/SyncAppDataTask.java
+19
-16
applicationContext-schedule.xml
src/main/resources/spring/applicationContext-schedule.xml
+1
-1
No files found.
.idea/workspace.xml
View file @
914b8387
This diff is collapsed.
Click to expand it.
src/main/java/common/task/SyncAppDataTask.java
View file @
914b8387
...
...
@@ -146,22 +146,25 @@ public class SyncAppDataTask
}*/
public
void
syncAppDeviceNum
()
{
String
ds
=
DateUtil
.
getBeforeDays
(
2
);
//ds = "2017-12-22";
System
.
out
.
println
(
ds
);
String
skey
=
"export/pkg_dev_stats/ds="
+
ds
+
"/"
;
for
(
int
j
=
4
;
j
<
9
;
j
++){
String
ds
=
DateUtil
.
getBeforeDays
(
j
);
//ds = "2018-02-20";
System
.
out
.
println
(
ds
);
String
skey
=
"export/pkg_dev_stats/ds="
+
ds
+
"/"
;
final
AwsS3Util
s3Util
=
AwsS3Util
.
getInstance
();
List
itemList
=
AwsS3Util
.
getInstance
().
getS3Keys
(
"reyunbpu"
,
skey
);
if
(
itemList
==
null
||
itemList
.
size
()
==
0
)
{
System
.
out
.
println
(
"pkg_dev_stats null"
);
return
;
}
final
AwsS3Util
s3Util
=
AwsS3Util
.
getInstance
();
List
itemList
=
AwsS3Util
.
getInstance
().
getS3Keys
(
"reyunbpu"
,
skey
);
if
(
itemList
==
null
||
itemList
.
size
()
==
0
)
{
System
.
out
.
println
(
"pkg_dev_stats null"
);
return
;
}
for
(
int
i
=
0
;
i
<
itemList
.
size
();
i
++)
{
String
s3key
=
String
.
valueOf
(
itemList
.
get
(
i
));
readS3File
(
s3Util
,
s3key
,
"deviceNum"
);
for
(
int
i
=
0
;
i
<
itemList
.
size
();
i
++)
{
String
s3key
=
String
.
valueOf
(
itemList
.
get
(
i
));
readS3File
(
s3Util
,
s3key
,
"deviceNum"
);
}
}
System
.
out
.
println
(
"pkg_dev_stats end"
);
}
...
...
@@ -233,7 +236,7 @@ public class SyncAppDataTask
List
<
OtPkgDevStats
>
resultList
=
new
ArrayList
<>();
List
<
AppInfo
>
appResultList
=
new
ArrayList
<>();
while
((
line
=
br
.
readLine
())
!=
null
)
{
//
System.out.println(line);
System
.
out
.
println
(
line
);
Object
[]
array
=
Splitter
.
on
(
"\t"
).
trimResults
().
splitToList
(
line
).
toArray
();
if
(
array
.
length
==
3
)
{
OtPkgDevStats
opds
=
new
OtPkgDevStats
();
...
...
@@ -242,7 +245,7 @@ public class SyncAppDataTask
opds
.
setDs
(
array
[
2
].
toString
());
resultList
.
add
(
opds
);
if
(
resultList
.
size
()
>=
2000
)
{
//
System.out.println(resultList);
System
.
out
.
println
(
resultList
);
otPkgDevStatsRepository
.
save
(
resultList
);
resultList
=
new
ArrayList
<>();
}
...
...
@@ -263,7 +266,7 @@ public class SyncAppDataTask
appInfoRepository
.
save
(
appResultList
);
}
//
System.out.println(newCategorys);
System
.
out
.
println
(
newCategorys
);
if
(
newCategorys
.
size
()
>
0
)
{
appCategoryRepository
.
save
(
newCategorys
);
}
...
...
src/main/resources/spring/applicationContext-schedule.xml
View file @
914b8387
...
...
@@ -42,7 +42,7 @@
<task:scheduled-tasks>
<!--//定时同步短链数据(每5分钟执行一次)-->
<task:scheduled
ref=
"SyncAppDataTask"
method=
"syncAppInfo"
cron=
"0 31 0 * * ?"
/>
<task:scheduled
ref=
"SyncAppDataTask"
method=
"syncAppDeviceNum"
cron=
"0
11 0
* * ?"
/>
<task:scheduled
ref=
"SyncAppDataTask"
method=
"syncAppDeviceNum"
cron=
"0
43 14
* * ?"
/>
</task:scheduled-tasks>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment