|
@@ -11,6 +11,8 @@ import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouReportTaskMapper;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportTaskService;
|
|
|
import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
|
|
|
import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCampaignMapper;
|
|
|
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
|
|
|
+import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyGroupMapper;
|
|
|
import cn.com.ctop.kuaishou.modules.utils.DownloadUtils;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -52,6 +54,13 @@ public class KuaiShouReportTaskServiceImpl extends ServiceImpl<KuaiShouReportTas
|
|
|
@Autowired
|
|
|
private KuaishouReportDailyCampaignMapper reportDailyCampaignMapper;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private KuaishouReportDailyGroupMapper reportDailyGroupMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private KuaishouReportDailyCreativeMapper reportDailyCreativeMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public void createTask(Long accountId, String token) {
|
|
|
if (Check.isNull(accountId) || Check.isNull(token)) {
|
|
@@ -68,8 +77,8 @@ public class KuaiShouReportTaskServiceImpl extends ServiceImpl<KuaiShouReportTas
|
|
|
String endDate = DateUtils.getDate("yyyy-MM-dd");
|
|
|
String startDate = DateUtils.addMonth(endDate, -6);
|
|
|
JSONObject taskParams = new JSONObject();
|
|
|
- taskParams.put("start_date", startDate);
|
|
|
- taskParams.put("end_date", endDate);
|
|
|
+ taskParams.put("start_date", "2020-03-11");
|
|
|
+ taskParams.put("end_date", "2020-03-11");
|
|
|
|
|
|
if (Check.isNull(typeList)) {
|
|
|
getTypeList();
|
|
@@ -173,11 +182,18 @@ public class KuaiShouReportTaskServiceImpl extends ServiceImpl<KuaiShouReportTas
|
|
|
if (!Check.isNull(localPath)) {
|
|
|
if (task.getViewType() == 1) {
|
|
|
reportDailyAccountMapper.loadAccountDailyReport(task.getAccountId(), localPath);
|
|
|
- }else if(task.getViewType() == 2){
|
|
|
+ } else if (task.getViewType() == 2) {
|
|
|
reportDailyCampaignMapper.loadCampaignDailyReport(task.getAccountId(), localPath);
|
|
|
|
|
|
+ } else if (task.getViewType() == 3) {
|
|
|
+ reportDailyGroupMapper.loadGroupDailyReport(task.getAccountId(), localPath);
|
|
|
+
|
|
|
+ } else if (task.getViewType() == 4) {
|
|
|
+ reportDailyCreativeMapper.loadCreativeDailyReport(task.getAccountId(), localPath);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
task.setTaskStatus(4);
|
|
|
this.updateById(task);
|