|
@@ -95,16 +95,19 @@ public class KuaishouLiveAccountReportDailyServiceImpl implements IKuaishouLiveA
|
|
|
@Override
|
|
|
public void getKuaishouAccountHourReport(Long accountId, String token) {
|
|
|
try {
|
|
|
- getAccountReportHour(accountId, token, 1);
|
|
|
- Thread.sleep(200);
|
|
|
+ String beforeYesterday = DateUtils.getSubtractTime(new Date(), 3);
|
|
|
+ long startDate = DateUtils.timeToStamp(beforeYesterday + " 00:00:00");
|
|
|
String date = DateUtils.getDate();
|
|
|
- sendTips("hourly", accountId, date, date);
|
|
|
+ long endDate = new Date().getTime();
|
|
|
+ getAccountReportHour(accountId, startDate, endDate, token, 1);
|
|
|
+ Thread.sleep(1000);
|
|
|
+ sendTips("hourly", accountId, beforeYesterday, date);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void getAccountReportHour(Long accountId, String token, int pageNum) {
|
|
|
+ private void getAccountReportHour(Long accountId, long startDate, long endDate, String token, int pageNum) {
|
|
|
log.info("------getKuaishouAccountHourReport(获取直播账户时报)---账户:{},---page:{}", accountId, pageNum);
|
|
|
Result<Object> result = new Result<>();
|
|
|
Map<String, Object> param = new HashMap<String, Object>();
|
|
@@ -114,8 +117,8 @@ public class KuaishouLiveAccountReportDailyServiceImpl implements IKuaishouLiveA
|
|
|
Integer hourNumber = DateUtils.getHourNumber();
|
|
|
//当日当时整点时间
|
|
|
String date = DateUtils.getDate() + " 00:00:00";
|
|
|
- params.put("start_time", DateUtils.timeToStamp(date));
|
|
|
- params.put("end_time", new Date().getTime());
|
|
|
+ params.put("start_time", startDate);
|
|
|
+ params.put("end_time", endDate);
|
|
|
params.put("view_type", 1);
|
|
|
params.put("group_type", 2);
|
|
|
JSONObject pageInfo = new JSONObject();
|
|
@@ -140,7 +143,7 @@ public class KuaishouLiveAccountReportDailyServiceImpl implements IKuaishouLiveA
|
|
|
mapper.replaceBatchHour(list);
|
|
|
}
|
|
|
if (data.size() == 500) {
|
|
|
- getAccountReportHour(accountId, token, pageNum + 1);
|
|
|
+ getAccountReportHour(accountId, startDate, endDate, token, pageNum + 1);
|
|
|
}
|
|
|
} else {
|
|
|
log.error("获取直播账户报表,账户{},{}", accountId, apiResult.toJSONString());
|