|
|
@@ -1,8 +1,10 @@
|
|
|
package cn.com.ctop.job.kuaishou.controller;
|
|
|
|
|
|
+import cn.com.ctop.job.kuaishou.data.mapper.KuaiShouAccountReportMapper;
|
|
|
import cn.com.ctop.job.kuaishou.data.service.IKuaiShouAccountReportService;
|
|
|
import cn.com.ctop.job.kuaishou.data.service.IKuaiShouGroupReportService;
|
|
|
import cn.com.ctop.job.kuaishou.data.service.IKuaiShouRefreshTokenService;
|
|
|
+import cn.com.ctop.job.kuaishou.data.utils.DateUtils;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -37,7 +39,8 @@ public class KuaiShouController {
|
|
|
@Autowired
|
|
|
private IKuaiShouAccountReportService kuaiShouAccountReportService;
|
|
|
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private KuaiShouAccountReportMapper kuaiShouAccountReportMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private IKuaiShouAccountReportService accountReportService;
|
|
|
@@ -77,8 +80,19 @@ public class KuaiShouController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/dailyFlows")
|
|
|
- public void queryAccountDailyFlows(String accessToken, Long advertiserId, String startDate, String endDate) {
|
|
|
- accountReportService.queryAccountDailyFlows(accessToken, advertiserId, startDate, endDate, 1,null,null,2);
|
|
|
+ public void queryAccountDailyFlows(String startDate, String endDate) {
|
|
|
+ List<String> perDay = DateUtils.getPerDay(startDate, endDate);
|
|
|
+ for (String day : perDay) {
|
|
|
+ Integer intDay = Integer.valueOf(day.replace("-", ""));
|
|
|
+ List<JSONObject> jsonObjects = kuaiShouAccountReportMapper.queryCostAccount(intDay, intDay);
|
|
|
+ for (JSONObject jsonObject : jsonObjects) {
|
|
|
+ Long advertiserId = jsonObject.getLong("advertiser_id");
|
|
|
+ String accessToken = jsonObject.getString("access_token");
|
|
|
+ accountReportService.queryAccountDailyFlows(accessToken, advertiserId, day, day, 1,1,null,2);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|