|
@@ -14,7 +14,6 @@ import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.xxl.job.core.log.XxlJobLogger;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -68,7 +67,6 @@ public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDail
|
|
taskQueryWrapper.eq("task_status", 0);
|
|
taskQueryWrapper.eq("task_status", 0);
|
|
taskQueryWrapper.eq("account_id", accountId);
|
|
taskQueryWrapper.eq("account_id", accountId);
|
|
taskQueryWrapper.eq("stat_date", statDate);
|
|
taskQueryWrapper.eq("stat_date", statDate);
|
|
- // taskQueryWrapper.eq("view_type", 7);
|
|
|
|
taskQueryWrapper.orderByDesc("create_time");
|
|
taskQueryWrapper.orderByDesc("create_time");
|
|
List<KuaiShouDailyReportTask> dailyTaskList = this.list(taskQueryWrapper);
|
|
List<KuaiShouDailyReportTask> dailyTaskList = this.list(taskQueryWrapper);
|
|
if (!Check.isNull(dailyTaskList)) {
|
|
if (!Check.isNull(dailyTaskList)) {
|
|
@@ -127,38 +125,41 @@ public class KuaiShouDailyReportTaskServiceImpl extends ServiceImpl<KuaiShouDail
|
|
requestMap.put("task_id", task.getTaskId());
|
|
requestMap.put("task_id", task.getTaskId());
|
|
String localPath = LoadFileUtil.downloadByUrl(requestMap, downloadPath + task.getStatDate() + "//", url, token, fileName);
|
|
String localPath = LoadFileUtil.downloadByUrl(requestMap, downloadPath + task.getStatDate() + "//", url, token, fileName);
|
|
if (!Check.isNull(localPath)) {
|
|
if (!Check.isNull(localPath)) {
|
|
|
|
+ Map<String, Object> deleteMap = new HashMap<>();
|
|
|
|
+ deleteMap.put("account_id", task.getAccountId());
|
|
|
|
+ deleteMap.put("stat_date", task.getStatDate());
|
|
if (task.getViewType() == 2) {
|
|
if (task.getViewType() == 2) {
|
|
|
|
+ reportDailyCampaignMapper.deleteByMap(deleteMap);
|
|
reportDailyCampaignMapper.loadCampaignDailyReport(task.getAccountId(), localPath);
|
|
reportDailyCampaignMapper.loadCampaignDailyReport(task.getAccountId(), localPath);
|
|
} else if (task.getViewType() == 3) {
|
|
} else if (task.getViewType() == 3) {
|
|
|
|
+ reportDailyGroupMapper.deleteByMap(deleteMap);
|
|
reportDailyGroupMapper.loadGroupDailyReport(task.getAccountId(), localPath);
|
|
reportDailyGroupMapper.loadGroupDailyReport(task.getAccountId(), localPath);
|
|
-
|
|
|
|
} else if (task.getViewType() == 4) {
|
|
} else if (task.getViewType() == 4) {
|
|
|
|
+ reportDailyCreativeMapper.deleteByMap(deleteMap);
|
|
reportDailyCreativeMapper.loadCreativeDailyReport(task.getAccountId(), localPath);
|
|
reportDailyCreativeMapper.loadCreativeDailyReport(task.getAccountId(), localPath);
|
|
- /* Thread.sleep(1 * 1000);
|
|
|
|
- reportDailyCreativeMapper.formatCreativeDailyReportData(task.getAccountId(), task.getStatDate());*/
|
|
|
|
} else if (task.getViewType() == 10) {
|
|
} else if (task.getViewType() == 10) {
|
|
- XxlJobLogger.log("下载文件,accountId:{}", task.getAccountId());
|
|
|
|
|
|
+ reportDailyCreativeMapper.deleteByAccountIdAndStatDate(task.getAccountId(), task.getStatDate());
|
|
reportDailyCreativeMapper.loadProgramCreativeDailyReport(task.getAccountId(), localPath);
|
|
reportDailyCreativeMapper.loadProgramCreativeDailyReport(task.getAccountId(), localPath);
|
|
- XxlJobLogger.log("下载结束,accountId:{}", task.getAccountId());
|
|
|
|
} else if (task.getViewType() == 5) {
|
|
} else if (task.getViewType() == 5) {
|
|
|
|
+ kuaishouReportDailyMaterialMapper.deleteByMap(deleteMap);
|
|
kuaishouReportDailyMaterialMapper.loadMaterialDailyReport(task.getAccountId(), localPath);
|
|
kuaishouReportDailyMaterialMapper.loadMaterialDailyReport(task.getAccountId(), localPath);
|
|
Thread thread = new Thread() {
|
|
Thread thread = new Thread() {
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
try {
|
|
try {
|
|
- Thread.sleep(1 * 1000L);
|
|
|
|
|
|
+ Thread.sleep(1 * 500L);
|
|
kuaiShouHistoryReportTaskService.getMd5(task.getStatDate(), task.getAccountId());
|
|
kuaiShouHistoryReportTaskService.getMd5(task.getStatDate(), task.getAccountId());
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
};
|
|
};
|
|
thread.start();
|
|
thread.start();
|
|
- }else if(task.getViewType() == 7){
|
|
|
|
|
|
+ } else if (task.getViewType() == 7) {
|
|
//封面报表
|
|
//封面报表
|
|
- kuaishouReportDailyImageMapper.loadImageDailyReport(task.getAccountId(),localPath);
|
|
|
|
|
|
+ kuaishouReportDailyImageMapper.deleteByMap(deleteMap);
|
|
|
|
+ kuaishouReportDailyImageMapper.loadImageDailyReport(task.getAccountId(), localPath);
|
|
//清洗数据
|
|
//清洗数据
|
|
kuaishouReportDailyImageMapper.updateImageReportCode();
|
|
kuaishouReportDailyImageMapper.updateImageReportCode();
|
|
kuaishouReportDailyImageMapper.updateImageReportUserId();
|
|
kuaishouReportDailyImageMapper.updateImageReportUserId();
|