|
@@ -19,7 +19,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.jeecg.common.util.DateUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -62,7 +61,7 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
|
|
|
private KuaishouReportDailyCreativeMapper reportDailyCreativeMapper;
|
|
|
|
|
|
@Override
|
|
|
- public void createTask(Long accountId, String token) {
|
|
|
+ public void createTask(Long accountId, String token, String date) {
|
|
|
if (Check.isNull(accountId) || Check.isNull(token)) {
|
|
|
log.error("token或accountId为空");
|
|
|
return;
|
|
@@ -74,11 +73,9 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
|
|
|
headers.put("Access-Token", token);
|
|
|
JSONObject param = new JSONObject();
|
|
|
param.put("advertiser_id", accountId);
|
|
|
- String endDate = DateUtils.getDate("yyyy-MM-dd");
|
|
|
- String startDate = DateUtils.addMonth(endDate, -6);
|
|
|
JSONObject taskParams = new JSONObject();
|
|
|
- taskParams.put("start_date", "2020-03-11");
|
|
|
- taskParams.put("end_date", "2020-03-11");
|
|
|
+ taskParams.put("start_date", date);
|
|
|
+ taskParams.put("end_date", date);
|
|
|
|
|
|
if (Check.isNull(typeList)) {
|
|
|
getTypeList();
|
|
@@ -97,8 +94,8 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
|
|
|
JSONObject dataJson = resultJson.getJSONObject("data");
|
|
|
KuaiShouHistoryReportTask reportTask = new KuaiShouHistoryReportTask();
|
|
|
reportTask.setAccountId(accountId);
|
|
|
- reportTask.setStartDate(startDate);
|
|
|
- reportTask.setEndDate(endDate);
|
|
|
+ reportTask.setStartDate(date);
|
|
|
+ reportTask.setEndDate(date);
|
|
|
reportTask.setTaskId(dataJson.getString("task_id"));
|
|
|
reportTask.setViewType(type);
|
|
|
reportTask.setTaskStatus(0);
|
|
@@ -208,7 +205,7 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
|
|
|
|
|
|
private void getTypeList() {
|
|
|
typeList = new ArrayList<>();
|
|
|
- typeList.add(1);
|
|
|
+// typeList.add(1);
|
|
|
typeList.add(2);
|
|
|
typeList.add(3);
|
|
|
typeList.add(4);
|