|
@@ -13,10 +13,9 @@ import cn.com.ctop.crawler.modules.douyin.service.DouyinMusicService;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
|
|
import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAdvertiserStrategy;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreateCreativeService;
|
|
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouCreateCreativeService;
|
|
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaign;
|
|
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCreative;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouGroup;
|
|
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouTemplate;
|
|
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouProgramCreative;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
import cn.com.ctop.kuaishou.modules.batch.service.*;
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
|
|
import cn.com.ctop.kuaishou.modules.material.entity.KuaishouAccessToken;
|
|
import cn.com.ctop.kuaishou.modules.material.entity.KuaishouAccessToken;
|
|
@@ -25,7 +24,6 @@ import cn.com.ctop.kuaishou.modules.report.entity.KuaiShouProjectData;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouDailyAgentService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouDailyAgentService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouProjectDataService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaiShouProjectDataService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouAudienceReportDailyService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouAudienceReportDailyService;
|
|
-import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportHourlyGroupService;
|
|
|
|
import cn.com.ctop.manage.modules.material.service.IMaterialUploadService;
|
|
import cn.com.ctop.manage.modules.material.service.IMaterialUploadService;
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
import cn.com.ctop.toutiao.modules.link.service.IETLReportBytedanceVideoService;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
|
|
@@ -35,7 +33,6 @@ import cn.com.ctop.toutiao.modules.report.service.*;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
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.xxl.job.core.context.XxlJobHelper;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Param;
|
|
@@ -53,7 +50,6 @@ import java.math.BigDecimal;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
-import java.util.concurrent.CountDownLatch;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
|
@@ -103,7 +99,7 @@ public class TestController {
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
|
|
private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
|
|
|
|
|
|
- static ExecutorService executorService = Executors.newFixedThreadPool(5);
|
|
|
|
|
|
+ static ExecutorService executorService = Executors.newFixedThreadPool(10);
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
@Autowired
|
|
@Autowired
|
|
private IKuaiShouDailyAgentService dailyAgentService;
|
|
private IKuaiShouDailyAgentService dailyAgentService;
|
|
@@ -137,13 +133,342 @@ public class TestController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IBatchService batchService;
|
|
private IBatchService batchService;
|
|
- static ExecutorService videoService = Executors.newFixedThreadPool(3);
|
|
|
|
|
|
+ static ExecutorService videoService = Executors.newFixedThreadPool(8);
|
|
@Autowired
|
|
@Autowired
|
|
private IMaterialUploadService materialUploadService;
|
|
private IMaterialUploadService materialUploadService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IKuaishouProgramCreativeService kuaishouProgramCreativeService;
|
|
|
|
|
|
@Value("${xxl-job.requestUrl}")
|
|
@Value("${xxl-job.requestUrl}")
|
|
private String jobUrl;
|
|
private String jobUrl;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/getProgramCreative")
|
|
|
|
+ public void getProgramCreative() {
|
|
|
|
+ List<Long> list = new ArrayList();
|
|
|
|
+
|
|
|
|
+ list.add(10344460L);
|
|
|
|
+ list.add(10344415L);
|
|
|
|
+ list.add(10344390L);
|
|
|
|
+ list.add(10344030L);
|
|
|
|
+ list.add(10343624L);
|
|
|
|
+ list.add(10343590L);
|
|
|
|
+ list.add(10343529L);
|
|
|
|
+ list.add(10343451L);
|
|
|
|
+ list.add(10343394L);
|
|
|
|
+ list.add(10327332L);
|
|
|
|
+ list.add(10327322L);
|
|
|
|
+ list.add(10327303L);
|
|
|
|
+ list.add(10327276L);
|
|
|
|
+ list.add(10327257L);
|
|
|
|
+ list.add(10327214L);
|
|
|
|
+ list.add(10327078L);
|
|
|
|
+ list.add(10327042L);
|
|
|
|
+ list.add(10327022L);
|
|
|
|
+ list.add(10326908L);
|
|
|
|
+ list.add(10299258L);
|
|
|
|
+ list.add(10299241L);
|
|
|
|
+ list.add(10299221L);
|
|
|
|
+ list.add(10299210L);
|
|
|
|
+ list.add(10298910L);
|
|
|
|
+ list.add(10298871L);
|
|
|
|
+ list.add(10298859L);
|
|
|
|
+ list.add(10298840L);
|
|
|
|
+ list.add(10258924L);
|
|
|
|
+ list.add(10258921L);
|
|
|
|
+ list.add(10258286L);
|
|
|
|
+ list.add(10258278L);
|
|
|
|
+ list.add(10258257L);
|
|
|
|
+ list.add(10258249L);
|
|
|
|
+ list.add(10258216L);
|
|
|
|
+ list.add(10257909L);
|
|
|
|
+ list.add(10257825L);
|
|
|
|
+ list.add(10257792L);
|
|
|
|
+ list.add(10257253L);
|
|
|
|
+ list.add(10257209L);
|
|
|
|
+ list.add(10257193L);
|
|
|
|
+ list.add(10257189L);
|
|
|
|
+ list.add(10257172L);
|
|
|
|
+ list.add(10257141L);
|
|
|
|
+ list.add(10257048L);
|
|
|
|
+ list.add(10252339L);
|
|
|
|
+ list.add(10252321L);
|
|
|
|
+ list.add(10252233L);
|
|
|
|
+ list.add(10252231L);
|
|
|
|
+ list.add(10173389L);
|
|
|
|
+ list.add(10173385L);
|
|
|
|
+ list.add(10173375L);
|
|
|
|
+ list.add(10173366L);
|
|
|
|
+ list.add(10173200L);
|
|
|
|
+ list.add(10108671L);
|
|
|
|
+ list.add(10108435L);
|
|
|
|
+ list.add(10093939L);
|
|
|
|
+ list.add(10093926L);
|
|
|
|
+ list.add(10093914L);
|
|
|
|
+ list.add(10093909L);
|
|
|
|
+ list.add(10093479L);
|
|
|
|
+ list.add(9767717L);
|
|
|
|
+ list.add(9767697L);
|
|
|
|
+ list.add(9706671L);
|
|
|
|
+ list.add(9635821L);
|
|
|
|
+ list.add(9635234L);
|
|
|
|
+ list.add(9549313L);
|
|
|
|
+ list.add(9549277L);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ Long accountId = list.get(i);
|
|
|
|
+ CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
+ videoService.submit(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ try {
|
|
|
|
+ kuaishouProgramCreativeService.getProgramCreative(oauthToken.getAccountId(), null, oauthToken.getAccessToken(), null, null, 1);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/updateProgramCreative")
|
|
|
|
+ public void updateProgramCreative() {
|
|
|
|
+ List<Long> list = new ArrayList();
|
|
|
|
+ list.add(10173366L);
|
|
|
|
+ list.add(10173375L);
|
|
|
|
+ list.add(10298910L);
|
|
|
|
+ list.add(10299210L);
|
|
|
|
+ list.add(10299221L);
|
|
|
|
+ list.add(10299241L);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ Long accountId = list.get(i);
|
|
|
|
+ CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
+ QueryWrapper<KuaishouProgramCreative> creativeQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ creativeQueryWrapper.eq("account_id", accountId);
|
|
|
|
+ creativeQueryWrapper.lt("creative_create_time", "2021-07-11 00:00:00");
|
|
|
|
+ List<KuaishouProgramCreative> proList = kuaishouProgramCreativeService.list(creativeQueryWrapper);
|
|
|
|
+ if (Check.isNull(proList)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ for (KuaishouProgramCreative programCreative : proList) {
|
|
|
|
+ Long unitId = programCreative.getUnitId();
|
|
|
|
+ if (Check.isNull(unitId)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ try {
|
|
|
|
+ String updateUrl = "https://ad.e.kuaishou.com/rest/openapi/v2/creative/advanced/program/update";
|
|
|
|
+ Map<String, String> headers = new HashMap<>();
|
|
|
|
+ headers.put("Content-Type", "application/json");
|
|
|
|
+ headers.put("Access-Token", token.getAccessToken());
|
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
|
+ param.put("advertiser_id", token.getAccountId());
|
|
|
|
+ param.put("unit_id", unitId);
|
|
|
|
+
|
|
|
|
+ String replaceUrll = "https://uri6.com/tkio/Yj6773a?imei=__IMEI2__&androidid=__ANDROIDID2__&oaid=__OAID__&mac=__MAC__&ip=__IP__&ry_adcreative_id=__CID__&ry_adplan_id=__DID__&ry_adplan_name=__DNAME__&ry_adgroup_id=__AID__&callback=__CALLBACK__&csite=__CSITE__&accountid=__ACCOUNTID__&ua=__UA__&os=__OS__&noredirect=true";
|
|
|
|
+ param.put("click_url", replaceUrll);
|
|
|
|
+ String result = HttpUtils.httpPostRequest(updateUrl, param, headers);
|
|
|
|
+ JSONObject resultJson = JSONObject.parseObject(result);
|
|
|
|
+ Integer code = resultJson.getInteger("code");
|
|
|
|
+ if (code == 0) {
|
|
|
|
+ log.info("修改成功,accountId:{},unitId:{}", token.getAccountId(), unitId);
|
|
|
|
+ QueryWrapper<KuaishouProgramCreative> programCreativeQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ programCreativeQueryWrapper.eq("account_id", accountId);
|
|
|
|
+ programCreativeQueryWrapper.eq("unit_id", unitId);
|
|
|
|
+ kuaishouProgramCreativeService.remove(programCreativeQueryWrapper);
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ log.info("修改失败,accountId:{},unitId:{},原因:{}", token.getAccountId(), unitId, resultJson.getString("message"));
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/campaignList")
|
|
|
|
+ public void campaignList() {
|
|
|
|
+ List<Long> list = new ArrayList();
|
|
|
|
+ list.add(9549277L);
|
|
|
|
+ list.add(9635234L);
|
|
|
|
+ list.add(9767697L);
|
|
|
|
+ list.add(9767717L);
|
|
|
|
+ list.add(9549313L);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ Long accountId = list.get(i);
|
|
|
|
+ CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
+ // kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
|
|
|
|
+ videoService.submit(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ try {
|
|
|
|
+ // kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
|
|
|
|
+ kuaishouInterfaceService.getGroupList(oauthToken, null, null);
|
|
|
|
+ // kuaishouInterfaceService.getCreativeList(oauthToken, null, null);
|
|
|
|
+ Thread.sleep(1500);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/creativeList")
|
|
|
|
+ public void creativeList() {
|
|
|
|
+ List<Long> list = new ArrayList();
|
|
|
|
+ list.add(10108671L);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ Long accountId = list.get(i);
|
|
|
|
+ CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ suzhaoService.submit(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ kuaishouInterfaceService.getCreativeList(oauthToken, null, null);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ try {
|
|
|
|
+ Thread.sleep(400L);
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/updateUnit")
|
|
|
|
+ public void updateUnit() throws Exception {
|
|
|
|
+ List<Long> list = new ArrayList();
|
|
|
|
+ list.add(9556344L);
|
|
|
|
+ list.add(9743738L);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ Long accountId = list.get(i);
|
|
|
|
+ CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
+ QueryWrapper<KuaiShouGroup> groupQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ groupQueryWrapper.eq("account_id", accountId);
|
|
|
|
+ List<KuaiShouGroup> list1 = groupService.list(groupQueryWrapper);
|
|
|
|
+ for (KuaiShouGroup group : list1) {
|
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ try {
|
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
|
+ json.put("unitId", group.getUnitId());
|
|
|
|
+ json.put("cpaBid", 18 * 1000);
|
|
|
|
+ // json.put("gender", "2");
|
|
|
|
+ batchService.updateUnit(json, oauthToken);
|
|
|
|
+ Thread.sleep(1500);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IKuaiShouUpdateService kuaiShouUpdateService;
|
|
|
|
+
|
|
|
|
+ @GetMapping(value = "/updateCreative")
|
|
|
|
+ public void updateCreative() {
|
|
|
|
+ List<Long> list = new ArrayList();
|
|
|
|
+ list.add(10173366L);
|
|
|
|
+ list.add(10173375L);
|
|
|
|
+ list.add(10298910L);
|
|
|
|
+ list.add(10299210L);
|
|
|
|
+ list.add(10299221L);
|
|
|
|
+ list.add(10299241L);
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ Long accountId = list.get(i);
|
|
|
|
+ CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
+ QueryWrapper<KuaiShouCreative> creativeQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ creativeQueryWrapper.eq("account_id", accountId);
|
|
|
|
+ creativeQueryWrapper.eq("status", 52);
|
|
|
|
+ creativeQueryWrapper.lt("creative_create_time", "2021-07-11 00:00:00");
|
|
|
|
+ List<KuaiShouCreative> creativeList = creativeService.list(creativeQueryWrapper);
|
|
|
|
+ if (Check.isNull(creativeList)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ for (KuaiShouCreative creative : creativeList) {
|
|
|
|
+ QueryWrapper<KuaiShouGroup> groupQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ groupQueryWrapper.eq("unit_id", creative.getUnitId());
|
|
|
|
+ groupQueryWrapper.last("limit 1");
|
|
|
|
+ KuaiShouGroup one = groupService.getOne(groupQueryWrapper);
|
|
|
|
+ if (Check.isNull(one)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ try {
|
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
|
+ json.put("creativeId", creative.getCreativeId());
|
|
|
|
+ String url = "https://uri6.com/tkio/Yj6773a?imei=__IMEI2__&androidid=__ANDROIDID2__&oaid=__OAID__&mac=__MAC__&ip=__IP__&ry_adcreative_id=__CID__&ry_adplan_id=__DID__&ry_adplan_name=__DNAME__&ry_adgroup_id=__AID__&callback=__CALLBACK__&csite=__CSITE__&accountid=__ACCOUNTID__&ua=__UA__&os=__OS__&noredirect=true";
|
|
|
|
+
|
|
|
|
+ if (creative.getCreativeMaterialType() == 1) {
|
|
|
|
+ json.put("clickTrackUrl", url);
|
|
|
|
+ } else if (creative.getCreativeMaterialType() == 4) {
|
|
|
|
+ json.put("impressionUrl", url);
|
|
|
|
+ json.put("clickTrackUrl", url);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ JSONObject jsonObject = batchService.updateCreative(json, oauthToken);
|
|
|
|
+ log.info("修改创意返回信息accountId:{},creative:{},结果:{}", creative.getAccountId(), creative.getCreativeId(), jsonObject);
|
|
|
|
+ Thread.sleep(1000L);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
@GetMapping("/testSend")
|
|
@GetMapping("/testSend")
|
|
public void testSend(String userId) {
|
|
public void testSend(String userId) {
|
|
|
|
|
|
@@ -1262,29 +1587,29 @@ public class TestController {
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping("checkCostData")
|
|
@GetMapping("checkCostData")
|
|
- public void checkCostData(String date){
|
|
|
|
- //1:初始化
|
|
|
|
- checkReportTaskInfoService.initTask(date);
|
|
|
|
- //2: checkCost
|
|
|
|
- List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,date,0);
|
|
|
|
- if(null!=taskInfos&&!taskInfos.isEmpty()){
|
|
|
|
- for (BytedanceCheckReportTaskInfo task:taskInfos) {
|
|
|
|
- checkReportTaskInfoService.checkCost(task);
|
|
|
|
- }
|
|
|
|
- log.info("{}:数据获取完成",date);
|
|
|
|
|
|
+ public void checkCostData(String date) {
|
|
|
|
+ //1:初始化
|
|
|
|
+ checkReportTaskInfoService.initTask(date);
|
|
|
|
+ //2: checkCost
|
|
|
|
+ List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, date, 0);
|
|
|
|
+ if (null != taskInfos && !taskInfos.isEmpty()) {
|
|
|
|
+ for (BytedanceCheckReportTaskInfo task : taskInfos) {
|
|
|
|
+ checkReportTaskInfoService.checkCost(task);
|
|
}
|
|
}
|
|
|
|
+ log.info("{}:数据获取完成", date);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping("refreshReportData")
|
|
@GetMapping("refreshReportData")
|
|
- public void refreshReportData()throws Exception{
|
|
|
|
|
|
+ public void refreshReportData() throws Exception {
|
|
//1:查询异常任务数据
|
|
//1:查询异常任务数据
|
|
- List<BytedanceCheckReportTaskInfo>taskInfos = checkReportTaskInfoService.getListByParams(null,null,50001);
|
|
|
|
- if(null!=taskInfos&&!taskInfos.isEmpty()){
|
|
|
|
|
|
+ List<BytedanceCheckReportTaskInfo> taskInfos = checkReportTaskInfoService.getListByParams(null, null, 50001);
|
|
|
|
+ if (null != taskInfos && !taskInfos.isEmpty()) {
|
|
taskInfos.forEach(taskInfo -> {
|
|
taskInfos.forEach(taskInfo -> {
|
|
try {
|
|
try {
|
|
checkReportTaskInfoService.reloadData(taskInfo);
|
|
checkReportTaskInfoService.reloadData(taskInfo);
|
|
checkReportTaskInfoService.checkCost(taskInfo);
|
|
checkReportTaskInfoService.checkCost(taskInfo);
|
|
- }catch (Exception e) {
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
log.info("数据更新完成");
|
|
log.info("数据更新完成");
|