Commit 914b8387 by manxiaoqiang

app排序

parent af967d85
......@@ -146,8 +146,9 @@ public class SyncAppDataTask
}*/
public void syncAppDeviceNum() {
String ds = DateUtil.getBeforeDays(2);
//ds = "2017-12-22";
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 + "/";
......@@ -162,6 +163,8 @@ public class SyncAppDataTask
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);
}
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment