|
@@ -1,14 +1,11 @@
|
|
package org.jeecg.modules.ctop.job;
|
|
package org.jeecg.modules.ctop.job;
|
|
|
|
|
|
-import cn.com.ctop.bytedance.entity.BytedancePlanHourlyReport;
|
|
|
|
import cn.com.ctop.bytedance.service.IBytedancePlanHourlyReportService;
|
|
import cn.com.ctop.bytedance.service.IBytedancePlanHourlyReportService;
|
|
import cn.com.ctop.bytedance.service.IReportService;
|
|
import cn.com.ctop.bytedance.service.IReportService;
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
-import cn.com.ctop.common.module.entity.UserAllocation;
|
|
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
import cn.com.ctop.common.module.service.ICtopOauthTokenService;
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.DateUtils;
|
|
import org.quartz.Job;
|
|
import org.quartz.Job;
|
|
@@ -73,39 +70,7 @@ public class BytedancePlanHourlyReportLoadJob implements Job {
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
- //清洗关于缘多多数据
|
|
|
|
- formatData(113,finalGetDate);
|
|
|
|
- //清洗关于交友数据
|
|
|
|
- formatData(112,finalGetDate);
|
|
|
|
- //清洗关于附近约会数据
|
|
|
|
- formatData(222,finalGetDate);
|
|
|
|
log.info("头条计划时报数据获取完成");
|
|
log.info("头条计划时报数据获取完成");
|
|
executorService.shutdown();
|
|
executorService.shutdown();
|
|
}
|
|
}
|
|
-
|
|
|
|
- private void formatData(Integer projectId, Date finalGetDate){
|
|
|
|
- QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
|
|
|
|
- queryWrapper.eq("project_id", projectId);
|
|
|
|
- List<UserAllocation> fjyhAllocations = userAllocationService.list(queryWrapper);
|
|
|
|
- if (null != fjyhAllocations && fjyhAllocations.size() > 0) {
|
|
|
|
- fjyhAllocations.forEach(allocation -> {
|
|
|
|
- //根据accountId和时间,查询相关的时报报表信息
|
|
|
|
- QueryWrapper<BytedancePlanHourlyReport> accountWrapper = new QueryWrapper<>();
|
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- String dateString = dateFormat.format(finalGetDate);
|
|
|
|
- accountWrapper.eq("advertiser_id", allocation.getAccountId())
|
|
|
|
- .eq("stat_datetime",dateString)
|
|
|
|
- ;
|
|
|
|
- List<BytedancePlanHourlyReport> bytedancePlanHourlyReports = planHourlyReportService.list(accountWrapper);
|
|
|
|
- if (null != bytedancePlanHourlyReports && bytedancePlanHourlyReports.size() > 0) {
|
|
|
|
- bytedancePlanHourlyReports.forEach(report -> {
|
|
|
|
- String adName = report.getAdName();
|
|
|
|
- String[] tags = adName.split("-");
|
|
|
|
- report.setChannelCode(tags[0]);
|
|
|
|
- planHourlyReportService.updateById(report);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|