|
@@ -13,24 +13,19 @@ import cn.com.ctop.common.module.utils.Check;
|
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
import cn.com.ctop.common.module.utils.ResultMapUtils;
|
|
|
import cn.com.ctop.common.module.utils.StatusCode;
|
|
|
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCampaignService;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskService;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
|
|
|
import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
|
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
|
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeMapper;
|
|
|
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyCreativeStatisticMapper;
|
|
|
import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.modules.ctop.service.ICleanMaterialService;
|
|
|
import org.jeecg.modules.ctop.service.ICreateInternalService;
|
|
|
-import org.jeecg.modules.ctop.service.IKuaiShouDefectMaterialService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -99,19 +94,13 @@ public class TestController {
|
|
|
String startDate = DateUtils.addMonth(endDateStr, -6);
|
|
|
QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
|
tokenQueryWrapper.eq("media_id", 2);
|
|
|
- System.err.println(startDate);
|
|
|
- System.err.println(endDateStr);
|
|
|
-
|
|
|
-
|
|
|
- //List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(tokenQueryWrapper);
|
|
|
- //if (!Check.isNull(ctopOauthTokens)) {
|
|
|
- //for (CtopOauthToken token : ctopOauthTokens) {
|
|
|
- //if ("3768019".equals(token.getAccountId())) {
|
|
|
- historyReportTaskService.createTask(3768019L, "0fb5f7dadd26b265979b1a8956950008", startDate, endDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
|
|
|
+ List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(tokenQueryWrapper);
|
|
|
+ if (!Check.isNull(ctopOauthTokens)) {
|
|
|
+ for (CtopOauthToken token : ctopOauthTokens) {
|
|
|
+ historyReportTaskService.createTask(token.getAccountId(), token.getAccessToken(), startDate, endDateStr, CtopAdConstant.KUAISHOU_LOAD_JOB_TYPE_HISTORY);
|
|
|
+ }
|
|
|
|
|
|
- //}
|
|
|
- //}
|
|
|
- //}
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
result.setSuccess(false);
|
|
@@ -128,13 +117,8 @@ public class TestController {
|
|
|
String startDate = DateUtils.addMonth(endDateStr, -6);
|
|
|
QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
|
tokenQueryWrapper.eq("media_id", 2);
|
|
|
- System.err.println(startDate);
|
|
|
- System.err.println(endDateStr);
|
|
|
-
|
|
|
-
|
|
|
historyReportTaskService.getTaskList();
|
|
|
|
|
|
-
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
result.setSuccess(false);
|
|
@@ -175,26 +159,7 @@ public class TestController {
|
|
|
return "Success";
|
|
|
}
|
|
|
|
|
|
- static ExecutorService executorService = Executors.newFixedThreadPool(5);
|
|
|
-
|
|
|
- @GetMapping(value = "/getVideoAndImage")
|
|
|
- public String getVideoAndImage() {
|
|
|
- QueryWrapper<CtopOauthToken> tokenQueryWrapper = new QueryWrapper<>();
|
|
|
- tokenQueryWrapper.eq("media_id", 2);
|
|
|
- List<CtopOauthToken> ctopOauthTokens = tokenMapper.selectList(tokenQueryWrapper);
|
|
|
- for (CtopOauthToken token : ctopOauthTokens) {
|
|
|
- executorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- kuaishouInterfaceService.getVideoList2(token, null, null, 1);
|
|
|
- //kuaishouInterfaceService.getImageList2(token, null, null, 1);
|
|
|
- // kuaishouInterfaceService.getCreativeList2(token, null, null, 1);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
- return "Success";
|
|
|
- }
|
|
|
+ static ExecutorService executorService = Executors.newFixedThreadPool(10);
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/gerCreative")
|
|
@@ -207,7 +172,6 @@ public class TestController {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
- System.err.println("获取创意,accountId:" + token.getAccountId());
|
|
|
kuaishouInterfaceService.getCreativeList(token, null, null);
|
|
|
// kuaishouInterfaceService.getVideoList2(token, null, null,1);
|
|
|
//3: 获取图片信息数据
|
|
@@ -247,118 +211,35 @@ public class TestController {
|
|
|
@Autowired
|
|
|
private IKuaiShouCampaignService campaignService;
|
|
|
|
|
|
- @GetMapping(value = "/getCreativeReportByAccount")
|
|
|
- public void gerCreativeReportByAccount(Long accountId, String startDateStr, String endDateStr) {
|
|
|
- Thread thread = new Thread() {
|
|
|
- @SneakyThrows
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date startDate = sim.parse(startDateStr);
|
|
|
- Date endDate = sim.parse(endDateStr);
|
|
|
- //1:查询当日数据
|
|
|
- //executorService = Executors.newFixedThreadPool(3);
|
|
|
- QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
|
- oauthTokenQueryWrapper.eq("media_id", 2);
|
|
|
- oauthTokenQueryWrapper.eq("account_id", accountId);
|
|
|
- CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
|
|
|
-
|
|
|
- System.err.println("创意报表accountId:" + ctopOauthToken.getAccountId());
|
|
|
- QueryWrapper<KuaiShouCampaign> campaignQueryWrapper = new QueryWrapper<>();
|
|
|
- campaignQueryWrapper.eq("account_id", accountId);
|
|
|
- List<KuaiShouCampaign> list = campaignService.list(campaignQueryWrapper);
|
|
|
- if (!Check.isNull(list)) {
|
|
|
- for (KuaiShouCampaign campaign : list) {
|
|
|
- kuaishouInterfaceService.getAdvertiserCreativeReportDailyV2(campaign.getCampaignId(), ctopOauthToken, startDate, endDate);
|
|
|
|
|
|
+ @GetMapping("loadBytedanceHistoryData")
|
|
|
+ public Map<String, Object> loadBytedanceHistoryData() {
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ //1:查询所有头条的token数据
|
|
|
+ List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
|
|
|
+ if (null != tokens && tokens.size() > 0) {
|
|
|
+ tokens.forEach(token -> {
|
|
|
+ //拉取往期数据
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ reportService.loadBytedanceHistoryData(token);
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- };
|
|
|
- thread.start();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
private IUserAllocationService userAllocationService;
|
|
|
- @Autowired
|
|
|
- private KuaishouReportDailyCreativeStatisticMapper reportDailyCreativeStatisticMapper;
|
|
|
-
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private KuaishouReportDailyCreativeMapper reportDailyCreativeMapper;
|
|
|
|
|
|
- @GetMapping(value = "/getCreativeReportByProjectId")
|
|
|
- public void getCreativeReportByProjectId(Long projectId) {
|
|
|
-
|
|
|
- try {
|
|
|
- Map<String, Object> deleteMap = new HashMap<>();
|
|
|
- String date = DateUtils.getDate("yyyy-MM-dd");
|
|
|
- String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", date, -1);
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date endDate = simpleDateFormat.parse(anotherDay);
|
|
|
- QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
|
|
|
- userAllocationQueryWrapper.eq("project_id", projectId);
|
|
|
- List<UserAllocation> list = userAllocationService.list(userAllocationQueryWrapper);
|
|
|
- if (!Check.isNull(list)) {
|
|
|
- for (UserAllocation allocation : list) {
|
|
|
- executorService.submit(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- if (!Check.isNull(allocation)) {
|
|
|
- log.info("账号id:{}", allocation.getAccountId());
|
|
|
-
|
|
|
- QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
|
- oauthTokenQueryWrapper.eq("media_id", 2);
|
|
|
- oauthTokenQueryWrapper.eq("account_id", allocation.getAccountId());
|
|
|
- CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
|
|
|
- if (!Check.isNull(ctopOauthToken)) {
|
|
|
- deleteMap.put("account_id", allocation.getAccountId());
|
|
|
- deleteMap.put("stat_date", anotherDay);
|
|
|
- // reportDailyCreativeStatisticMapper.deleteByMap(deleteMap);
|
|
|
- // reportDailyCreativeMapper.deleteByMap(deleteMap);
|
|
|
-
|
|
|
- // 1.计划数据
|
|
|
- log.info("获取计划,账号id:{}", allocation.getAccountId());
|
|
|
- kuaishouInterfaceService.getCampaignList(ctopOauthToken, null, null);
|
|
|
- // 2:广告组数据
|
|
|
- log.info("获取广告组,账号id:{}", allocation.getAccountId());
|
|
|
- kuaishouInterfaceService.getGroupList(ctopOauthToken, null, null);
|
|
|
- // 3:创意数据
|
|
|
- log.info("获取创意,账号id:{}", allocation.getAccountId());
|
|
|
- kuaishouInterfaceService.getCreativeList(ctopOauthToken, null, null);
|
|
|
-
|
|
|
- QueryWrapper<KuaiShouCampaign> campaignQueryWrapper = new QueryWrapper<>();
|
|
|
- campaignQueryWrapper.eq("account_id", ctopOauthToken.getAccountId());
|
|
|
- log.info("获取创意报表,账号id:{}", allocation.getAccountId());
|
|
|
- List<KuaiShouCampaign> campaigns = campaignService.list(campaignQueryWrapper);
|
|
|
- if (!Check.isNull(campaigns)) {
|
|
|
- for (KuaiShouCampaign campaign : campaigns) {
|
|
|
- kuaishouInterfaceService.getAdvertiserCreativeReportDailyV2(campaign.getCampaignId(), ctopOauthToken, endDate, endDate);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
public static void main(String[] args) throws ParseException {
|
|
|
String date = DateUtils.getDate("yyyy-MM-dd");
|
|
|
String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", date, -1);
|
|
|
- System.err.println(anotherDay);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -370,11 +251,9 @@ public class TestController {
|
|
|
oauthTokenQueryWrapper.last("limit 1");
|
|
|
CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
|
|
|
try {
|
|
|
- System.err.println("获取计划,广告组:" + accountId);
|
|
|
kuaishouInterfaceService.getCampaignList(token, null, null);
|
|
|
//1:获取全量广告组数据
|
|
|
kuaishouInterfaceService.getGroupList(token, null, null);
|
|
|
- System.err.println("获取计划,广告组:" + accountId);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -392,9 +271,7 @@ public class TestController {
|
|
|
CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
|
|
|
|
|
|
try {
|
|
|
- System.err.println("获取创意,accountId:" + token.getAccountId());
|
|
|
kuaishouInterfaceService.getCreativeList(token, null, null);
|
|
|
- System.err.println("获取创意结束,accountId:" + token.getAccountId());
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -403,60 +280,6 @@ public class TestController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @GetMapping(value = "/getVideo")
|
|
|
- public void getVideo(Long accountId) {
|
|
|
- QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
|
- oauthTokenQueryWrapper.eq("media_id", 2);
|
|
|
- oauthTokenQueryWrapper.eq("account_id", accountId);
|
|
|
- oauthTokenQueryWrapper.last("limit 1");
|
|
|
- CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
|
|
|
-
|
|
|
- try {
|
|
|
- System.err.println("获取视频,accountId:" + token.getAccountId());
|
|
|
- kuaishouInterfaceService.getVideoList(token, null, null);
|
|
|
- System.err.println("获取视频结束,accountId:" + token.getAccountId());
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @GetMapping(value = "/gerCreativeReportByAccount")
|
|
|
- public void gerCreativeReportByAccount(Long accountId, String startDateStr, String endDateStr, QueryWrapper<CtopOauthToken> account_id) {
|
|
|
- Thread thread = new Thread() {
|
|
|
- @SneakyThrows
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date startDate = sim.parse(startDateStr);
|
|
|
- Date endDate = sim.parse(endDateStr);
|
|
|
- //1:查询当日数据
|
|
|
- //executorService = Executors.newFixedThreadPool(3);
|
|
|
- QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
|
- oauthTokenQueryWrapper.eq("media_id", 2);
|
|
|
- oauthTokenQueryWrapper.eq("account_id", accountId);
|
|
|
- CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
|
|
|
- System.err.println("创意报表accountId:" + ctopOauthToken.getAccountId());
|
|
|
-
|
|
|
-
|
|
|
- QueryWrapper<KuaiShouCampaign> campaignQueryWrapper = new QueryWrapper<>();
|
|
|
- campaignQueryWrapper.eq("account_id", ctopOauthToken.getAccountId());
|
|
|
-
|
|
|
- List<KuaiShouCampaign> campaigns = campaignService.list(campaignQueryWrapper);
|
|
|
- if (!Check.isNull(campaigns)) {
|
|
|
- for (KuaiShouCampaign campaign : campaigns) {
|
|
|
- kuaishouInterfaceService.getAdvertiserCreativeReportDailyV2(campaign.getCampaignId(), ctopOauthToken, endDate, endDate);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- };
|
|
|
- thread.start();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
@Autowired
|
|
|
private IBytedancePlanDailyReportService planDailyReportService;
|
|
|
@Autowired
|
|
@@ -473,61 +296,60 @@ public class TestController {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
//1:查询当日数据
|
|
|
- List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
|
|
|
- if (null == tokens || tokens.size() <= 0) {
|
|
|
- log.info("定时获取头条数据异常:为获取到可用的token");
|
|
|
+ QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("project_id", 215);
|
|
|
+ List<UserAllocation> allocations = userAllocationService.list(queryWrapper);
|
|
|
+ if (null == allocations || allocations.size() <= 0) {
|
|
|
+ log.info("定时获取头条数据异常:获取用户信息失败");
|
|
|
}
|
|
|
Date finalGetDate = getDate;
|
|
|
- tokens.forEach(token -> {
|
|
|
+
|
|
|
+ allocations.forEach(allocation -> {
|
|
|
//3:获取广告计划信息数据
|
|
|
+ CtopOauthToken token = oauthTokenMapper.selectByAccountId(allocation.getAccountId());
|
|
|
reportService.getAdvertiserPlanReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
|
|
|
});
|
|
|
|
|
|
//清洗关于作业帮数据
|
|
|
//1:查询作业帮相关的用户数据
|
|
|
- QueryWrapper<UserAllocation> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("project_id", 215);
|
|
|
- List<UserAllocation> allocations = userAllocationService.list(wrapper);
|
|
|
- if (null != allocations && allocations.size() > 0) {
|
|
|
- allocations.forEach(allocation -> {
|
|
|
- //根据accountId和时间,查询相关的日报表信息
|
|
|
- QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- String dateString = dateFormat.format(finalGetDate) + " 00:00:00";
|
|
|
- queryWrapper.eq("advertiser_id", allocation.getAccountId())
|
|
|
- .eq("stat_datetime", dateString)
|
|
|
- ;
|
|
|
- List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
|
|
|
- if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
|
|
|
- bytedancePlanDailyReports.forEach(report -> {
|
|
|
- String adName = report.getAdName();
|
|
|
- String[] tags = adName.split("-");
|
|
|
- report.setAdsense(tags[1]);
|
|
|
- report.setPlanCode(tags[2]);
|
|
|
- String materialName = tags[3];
|
|
|
- report.setMaterialName(materialName);
|
|
|
- if (materialName.contains("其他")) {
|
|
|
- report.setMaterialType("其他");
|
|
|
- } else if (materialName.contains("图片轮播")) {
|
|
|
- report.setMaterialType("图片轮播");
|
|
|
- } else if (materialName.contains("大字报")) {
|
|
|
- report.setMaterialType("大字报");
|
|
|
- } else if (materialName.contains("文字动画")) {
|
|
|
- report.setMaterialType("文字动画");
|
|
|
- } else if (materialName.contains("采访形式")) {
|
|
|
- report.setMaterialType("采访形式");
|
|
|
- } else if (materialName.contains("剧情")) {
|
|
|
- report.setMaterialType("剧情");
|
|
|
- } else if (materialName.contains("口播")) {
|
|
|
- report.setMaterialType("口播");
|
|
|
- } else {
|
|
|
- report.setMaterialType("其他");
|
|
|
- }
|
|
|
- planDailyReportService.updateById(report);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ allocations.forEach(allocation -> {
|
|
|
+ //根据accountId和时间,查询相关的日报表信息
|
|
|
+ QueryWrapper<BytedancePlanDailyReport> reportQueryWrapper = new QueryWrapper<>();
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ String dateString = dateFormat.format(finalGetDate) + " 00:00:00";
|
|
|
+ queryWrapper.eq("advertiser_id", allocation.getAccountId())
|
|
|
+ .eq("stat_datetime", dateString)
|
|
|
+ ;
|
|
|
+ List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(reportQueryWrapper);
|
|
|
+ if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
|
|
|
+ bytedancePlanDailyReports.forEach(report -> {
|
|
|
+ String adName = report.getAdName();
|
|
|
+ String[] tags = adName.split("-");
|
|
|
+ report.setAdsense(tags[1]);
|
|
|
+ report.setPlanCode(tags[2]);
|
|
|
+ String materialName = tags[3];
|
|
|
+ report.setMaterialName(materialName);
|
|
|
+ if (materialName.contains("其他")) {
|
|
|
+ report.setMaterialType("其他");
|
|
|
+ } else if (materialName.contains("图片轮播")) {
|
|
|
+ report.setMaterialType("图片轮播");
|
|
|
+ } else if (materialName.contains("大字报")) {
|
|
|
+ report.setMaterialType("大字报");
|
|
|
+ } else if (materialName.contains("文字动画")) {
|
|
|
+ report.setMaterialType("文字动画");
|
|
|
+ } else if (materialName.contains("采访形式")) {
|
|
|
+ report.setMaterialType("采访形式");
|
|
|
+ } else if (materialName.contains("剧情")) {
|
|
|
+ report.setMaterialType("剧情");
|
|
|
+ } else if (materialName.contains("口播")) {
|
|
|
+ report.setMaterialType("口播");
|
|
|
+ } else {
|
|
|
+ report.setMaterialType("其他");
|
|
|
+ }
|
|
|
+ planDailyReportService.updateById(report);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
return result;
|
|
|
}
|
|
@@ -819,7 +641,6 @@ public class TestController {
|
|
|
executorService.submit(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- System.err.println(signature);
|
|
|
cleanMaterialService.calculationReport(signature);
|
|
|
}
|
|
|
});
|
|
@@ -848,7 +669,6 @@ public class TestController {
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- System.err.println("获取广告主报表,accountId:" + token.getAccountId());
|
|
|
kuaishouInterfaceService.getAdvertiserReportDaily(token, startDate, endDate);
|
|
|
|
|
|
Thread.sleep(1 * 200);
|
|
@@ -861,14 +681,62 @@ public class TestController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
- private IKuaiShouDefectMaterialService defectVideoService;
|
|
|
+ @GetMapping(value = "/getAllCreativeList")
|
|
|
+ public void getAllCreativeList() {
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+
|
|
|
+ QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
|
+ oauthTokenQueryWrapper.eq("media_id", 2);
|
|
|
+ List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(oauthTokenQueryWrapper);
|
|
|
+
|
|
|
+ if (!Check.isNull(ctopOauthTokens)) {
|
|
|
+ for (CtopOauthToken token : ctopOauthTokens) {
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ if (!Check.isNull(token)) {
|
|
|
+ log.info("获取创意,账号id:{}", token.getAccountId());
|
|
|
+ kuaishouInterfaceService.getCreativeList(token, null, null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping(value = "/getAllGroupList")
|
|
|
+ public void getAllGroupList() {
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
|
|
|
+ oauthTokenQueryWrapper.eq("media_id", 2);
|
|
|
+ List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(oauthTokenQueryWrapper);
|
|
|
+ if (!Check.isNull(ctopOauthTokens)) {
|
|
|
+ for (CtopOauthToken token : ctopOauthTokens) {
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ if (!Check.isNull(token)) {
|
|
|
+ log.info("获取组,账号id:{}", token.getAccountId());
|
|
|
+ kuaishouInterfaceService.getGroupList(token, null, null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
|
|
|
- @GetMapping(value = "/getDefectVideo")
|
|
|
- public void getDefectVideo(String startDate, String endDate) {
|
|
|
- log.info("开始获取缺失视频数据");
|
|
|
- defectVideoService.getDefectVideo(startDate, endDate);
|
|
|
- log.info("获取缺失视频数据结束");
|
|
|
}
|
|
|
|
|
|
|