|
@@ -16,7 +16,6 @@ import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportServi
|
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanHourlyReportService;
|
|
|
import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
|
|
|
import cn.com.ctop.toutiao.modules.report.service.IReportService;
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -80,7 +79,7 @@ public class TestController {
|
|
|
|
|
|
@Autowired
|
|
|
private IBatchService batchService;
|
|
|
- static ExecutorService executorService = Executors.newFixedThreadPool(8);
|
|
|
+ static ExecutorService executorService = Executors.newFixedThreadPool(15);
|
|
|
static ExecutorService videoService = Executors.newFixedThreadPool(5);
|
|
|
static ExecutorService suzhaoService = Executors.newFixedThreadPool(5);
|
|
|
|
|
@@ -110,14 +109,19 @@ public class TestController {
|
|
|
list.add(7882996L);
|
|
|
list.add(7883032L);
|
|
|
list.add(7922257L);*/
|
|
|
- list.add(8206288L);
|
|
|
- // list.add(8159827L);
|
|
|
+ list.add(9643754L);
|
|
|
+ list.add(9538300L);
|
|
|
+ list.add(9643726L);
|
|
|
+ list.add(9538319L);
|
|
|
+ list.add(9643738L);
|
|
|
+
|
|
|
+ // list.add(8159827L);
|
|
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Long accountId = list.get(i);
|
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
- // kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
|
|
|
- kuaishouInterfaceService.getGroupList(oauthToken, null, null);
|
|
|
+ kuaishouInterfaceService.getCampaignList(oauthToken, null, null);
|
|
|
+ // kuaishouInterfaceService.getGroupList(oauthToken, null, null);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -126,33 +130,11 @@ public class TestController {
|
|
|
@GetMapping(value = "/creativeList")
|
|
|
public void creativeList() {
|
|
|
List<Long> list = new ArrayList();
|
|
|
- /*list.add(6409841L);
|
|
|
- list.add(6433033L);
|
|
|
- list.add(6433053L);
|
|
|
- list.add(6789970L);
|
|
|
- list.add(6791568L);
|
|
|
- list.add(7025551L);
|
|
|
- list.add(7025567L);
|
|
|
- list.add(7087866L);
|
|
|
- list.add(7087890L);
|
|
|
- list.add(7421646L);*/
|
|
|
-
|
|
|
- /* list.add(7421660L);
|
|
|
- list.add(7421671L);
|
|
|
- list.add(7607727L);
|
|
|
- list.add(7607803L);
|
|
|
- list.add(7607818L);
|
|
|
- list.add(7607830L);
|
|
|
- list.add(7607849L);
|
|
|
- list.add(7783907L);
|
|
|
- list.add(7882964L);
|
|
|
- list.add(7882996L);
|
|
|
- list.add(7883032L);
|
|
|
- list.add(7922257L);*/
|
|
|
-
|
|
|
- // list.add(8166349L);
|
|
|
- list.add(8206288L);
|
|
|
-
|
|
|
+ /* list.add(9643754L);
|
|
|
+ list.add(9538300L);
|
|
|
+ list.add(9643726L);*/
|
|
|
+ list.add(9538319L);
|
|
|
+ list.add(9643738L);
|
|
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Long accountId = list.get(i);
|
|
@@ -162,11 +144,14 @@ public class TestController {
|
|
|
|
|
|
List<KuaiShouCampaign> list1 = campaignService.list(campaignQueryWrapper);
|
|
|
for (KuaiShouCampaign campaign : list1) {
|
|
|
-
|
|
|
- kuaishouInterfaceService.getAsyncCreativeListV2(oauthToken.getAccountId(), oauthToken.getAccessToken(), campaign.getCampaignId(), 1);
|
|
|
-
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ kuaishouInterfaceService.getAsyncCreativeListV2(oauthToken.getAccountId(), oauthToken.getAccessToken(), campaign.getCampaignId(), 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
try {
|
|
|
- Thread.sleep(1000L);
|
|
|
+ Thread.sleep(500L);
|
|
|
} catch (InterruptedException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -187,7 +172,7 @@ public class TestController {
|
|
|
CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
QueryWrapper<KuaiShouGroup> groupQueryWrapper = new QueryWrapper<>();
|
|
|
groupQueryWrapper.eq("account_id", accountId);
|
|
|
- // groupQueryWrapper.eq("use_app_market", 1);
|
|
|
+ // groupQueryWrapper.eq("use_app_market", 1);
|
|
|
|
|
|
|
|
|
List<KuaiShouGroup> list1 = groupService.list(groupQueryWrapper);
|
|
@@ -205,16 +190,16 @@ public class TestController {
|
|
|
/* executorService.submit(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {*/
|
|
|
- try {
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("unitId", group.getUnitId());
|
|
|
- json.put("cpaBid", 8500);
|
|
|
- json.put("deepConversionBid", 21270);
|
|
|
- batchService.updateUnit(json, oauthToken);
|
|
|
- Thread.sleep(1000);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ try {
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("unitId", group.getUnitId());
|
|
|
+ json.put("cpaBid", 8500);
|
|
|
+ json.put("deepConversionBid", 21270);
|
|
|
+ batchService.updateUnit(json, oauthToken);
|
|
|
+ Thread.sleep(1000);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
/*}
|
|
|
});*/
|
|
|
|
|
@@ -231,8 +216,11 @@ public class TestController {
|
|
|
@GetMapping(value = "/updateCreative")
|
|
|
public void updateCreative() {
|
|
|
List<Long> list = new ArrayList();
|
|
|
- list.add(8166349L);
|
|
|
- list.add(8159827L);
|
|
|
+ list.add(9643754L);
|
|
|
+ list.add(9538300L);
|
|
|
+ list.add(9643726L);
|
|
|
+ /* list.add(9538319L);
|
|
|
+ list.add(9643738L);*/
|
|
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Long accountId = list.get(i);
|
|
@@ -246,73 +234,43 @@ public class TestController {
|
|
|
QueryWrapper<KuaiShouCreative> creativeQueryWrapper = new QueryWrapper<>();
|
|
|
creativeQueryWrapper.eq("account_id", accountId);
|
|
|
creativeQueryWrapper.eq("campaign_id", campaign.getCampaignId());
|
|
|
- // creativeQueryWrapper.notLike("click_track_url", "&ad_name=__DNAME__");
|
|
|
List<KuaiShouCreative> creativeList = creativeService.list(creativeQueryWrapper);
|
|
|
for (KuaiShouCreative creative : creativeList) {
|
|
|
- /* executorService.submit(new Runnable() {
|
|
|
+ executorService.submit(new Runnable() {
|
|
|
@Override
|
|
|
- public void run() {*/
|
|
|
- try {
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("creativeId", creative.getCreativeId());
|
|
|
- /*String url = "";
|
|
|
- if (!Check.isNull(creative.getClickTrackUrl())) {
|
|
|
- url = creative.getClickTrackUrl().replace("&idfa_md5=__IDFA__", "").replace("&idfa_md5=__IDFA2__", "");
|
|
|
- } else {
|
|
|
- url = creative.getImpressionUrl().replace("&idfa_md5=__IDFA__", "").replace("&idfa_md5=__IDFA2__", "");
|
|
|
- }*/
|
|
|
- String url = "";
|
|
|
- if (accountId == 8166349L) {
|
|
|
- url = "https://market.wsskj520.cn/kuaishou/android.php?appid=602102&pkg=msailiao.weiling&aid=__AID__&cid=__CID__&did=__DID__&dname=__DNAME__&callback=__CALLBACK__&imei=__IMEI2__&oaid=__OAID__&ip=__IP__&ts=__TS__";
|
|
|
-
|
|
|
- } else if (accountId == 8159827L) {
|
|
|
- url = "https://market.wsskj520.cn/kuaishou/android.php?appid=602100&pkg=msailiao.weiling&aid=__AID__&cid=__CID__&did=__DID__&dname=__DNAME__&callback=__CALLBACK__&imei=__IMEI2__&oaid=__OAID__&ip=__IP__&ts=__TS__";
|
|
|
- }
|
|
|
-
|
|
|
- /*if (!Check.isNull(url)) {
|
|
|
- String[] split1 = url.split("&imei_md5=");
|
|
|
- String replaceUrll = split1[0];
|
|
|
- replaceUrll += "&imei_md5=__IMEI2__&ip=__IP__×tamp=__TS__&campaign_id=__AID__&creative_id=__CID__&ad_id=__DID__&androidid_md5=__ANDROIDID2__&callback=__CALLBACK__&ua=__UA__&oaid=__OAID__&csite=__CSITE__&advertiser_id=__ACCOUNTID__&ad_name=__DNAME__";
|
|
|
-
|
|
|
-
|
|
|
- // String replaceUrll = "https://open.snssdk.com/ug/ad/display/clicks?ad_platform=kuaishou&app_platform=android&surl_token=Y1tF&imei_md5=__IMEI2__&ip=__IP__×tamp=__TS__&campaign_id=__AID__&creative_id=__CID__&ad_id=__DID__&androidid_md5=__ANDROIDID2__&callback=__CALLBACK__&ua=__UA__&oaid=__OAID__&csite=__CSITE__&advertiser_id=__ACCOUNTID__&ad_name=__DNAME__";
|
|
|
- if (!url.contains("&ad_name=__DNAME__")) {
|
|
|
- if (url.contains("&pass_through=")) {
|
|
|
- String[] split = url.split("&pass_through=");
|
|
|
- replaceUrll += "&pass_through=" + split[1];
|
|
|
- }
|
|
|
-
|
|
|
- if (replaceUrll.contains("&app_platform=ios")) {
|
|
|
- replaceUrll = replaceUrll.replace("&oaid=__OAID__", "").replace("&androidid_md5=__ANDROIDID2__", "");
|
|
|
- }
|
|
|
-
|
|
|
- if (creative.getCreativeMaterialType() == 1) {
|
|
|
- json.put("clickTrackUrl", replaceUrll);
|
|
|
- } else if (creative.getCreativeMaterialType() == 4) {
|
|
|
- json.put("impressionUrl", replaceUrll);
|
|
|
- json.put("clickTrackUrl", replaceUrll);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- batchService.updateCreative(json, oauthToken);
|
|
|
- Thread.sleep(1000);
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("creativeId", creative.getCreativeId());
|
|
|
+
|
|
|
+ String url = "";
|
|
|
+ if (accountId == 9643754L) {
|
|
|
+ url = "https://youku-dsp.youku.com/ksrta/track?evt=clk&biz=RTAKS_NU&oaid=__OAID__&imei=__IMEI2__&idfa=__IDFA2__&mac=__MAC2__&os=__OS__&callback=__CALLBACK__&pid=c91817d982fee2c5&ip=__IP__";
|
|
|
+ } else if (accountId == 9538300L) {
|
|
|
+ url = "https://youku-dsp.youku.com/ksrta/track?evt=clk&biz=RTAKS_NU&oaid=__OAID__&imei=__IMEI2__&idfa=__IDFA2__&mac=__MAC2__&os=__OS__&callback=__CALLBACK__&pid=1711d4f52f5cac73&ip=__IP__";
|
|
|
+ } else if (accountId == 9643726L) {
|
|
|
+ url = "https://youku-dsp.youku.com/ksrta/track?evt=clk&biz=RTAKS_NU&oaid=__OAID__&imei=__IMEI2__&idfa=__IDFA2__&mac=__MAC2__&os=__OS__&callback=__CALLBACK__&pid=073067367598206b&ip=__IP__";
|
|
|
+ }
|
|
|
+ /*if (accountId == 9538319L) {
|
|
|
+ url = "https://lstat.youku.com/yt/tpc.idfa.initail?company=kuaishou&adid=__AID__&cid=__CID__&did=__DID__&idfamd5=__IDFA2__&callbackurl=__CALLBACK__&pid=ef6cb68e4b8b9129&channel_id=1579246922799&test=test";
|
|
|
+ } else if (accountId == 9643738L) {
|
|
|
+ url = "https://lstat.youku.com/yt/tpc.idfa.initail?company=kuaishou&adid=__AID__&cid=__CID__&did=__DID__&idfamd5=__IDFA2__&callbackurl=__CALLBACK__&pid=3a93c9641c42514e&channel_id=1579246919546&test=test";
|
|
|
}*/
|
|
|
+ if (creative.getCreativeMaterialType() == 1) {
|
|
|
+ json.put("clickTrackUrl", url);
|
|
|
+ } else if (creative.getCreativeMaterialType() == 4) {
|
|
|
+ json.put("impressionUrl", url);
|
|
|
+ json.put("clickTrackUrl", url);
|
|
|
|
|
|
- if (creative.getCreativeMaterialType() == 1) {
|
|
|
- json.put("clickTrackUrl", url);
|
|
|
- } else if (creative.getCreativeMaterialType() == 4) {
|
|
|
- json.put("impressionUrl", url);
|
|
|
- json.put("clickTrackUrl", url);
|
|
|
+ }
|
|
|
|
|
|
+ batchService.updateCreative(json, oauthToken);
|
|
|
+ Thread.sleep(500L);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- batchService.updateCreative(json, oauthToken);
|
|
|
-
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- /* }
|
|
|
- });*/
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|