yumeng %!s(int64=4) %!d(string=hai) anos
pai
achega
bfceffbd14

+ 39 - 36
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -87,8 +87,8 @@ public class TestController {
     @GetMapping(value = "/campaignList")
     public void campaignList() {
         List<Long> list = new ArrayList();
-        list.add(7087890L);
-        list.add(7087866L);
+        list.add(7607727L);
+       /* list.add(7087866L);
         list.add(7025567L);
         list.add(7607830L);
         list.add(6791568L);
@@ -100,7 +100,7 @@ public class TestController {
         list.add(7421671L);
         list.add(7421646L);
         list.add(7421646L);
-        list.add(7607849L);
+        list.add(7607849L);*/
         for (int i = 0; i < list.size(); i++) {
             Long accountId = list.get(i);
             CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
@@ -114,8 +114,8 @@ public class TestController {
     @GetMapping(value = "/creativeList")
     public void creativeList() {
         List<Long> list = new ArrayList();
-        list.add(7087890L);
-        list.add(7087866L);
+        list.add(7607727L);
+      /*  list.add(7087866L);
         list.add(7025567L);
         list.add(7607830L);
         list.add(6791568L);
@@ -126,7 +126,7 @@ public class TestController {
         list.add(7607727L);
         list.add(7421671L);
         list.add(7421646L);
-        list.add(7607849L);
+        list.add(7607849L);*/
         for (int i = 0; i < list.size(); i++) {
             Long accountId = list.get(i);
             CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
@@ -270,8 +270,8 @@ public class TestController {
     @GetMapping(value = "/updateCreative")
     public void updateCreative() {
         List<Long> list = new ArrayList();
-        list.add(7087890L);
-        list.add(7087866L);
+        list.add(7607727L);
+    /*    list.add(7087866L);
         list.add(7025567L);
         list.add(7607830L);
         list.add(6791568L);
@@ -283,7 +283,7 @@ public class TestController {
         list.add(7421671L);
         list.add(7421646L);
         list.add(7421646L);
-        list.add(7607849L);
+        list.add(7607849L);*/
         for (int i = 0; i < list.size(); i++) {
             Long accountId = list.get(i);
             CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
@@ -296,12 +296,12 @@ public class TestController {
                     QueryWrapper<KuaiShouCreative> creativeQueryWrapper = new QueryWrapper<>();
                     creativeQueryWrapper.eq("account_id", accountId);
                     creativeQueryWrapper.eq("campaign_id", campaign.getCampaignId());
-                    creativeQueryWrapper.like("click_track_url", "&csite=__CSITE__&csite=__CSITE__");
+             //       creativeQueryWrapper.like("click_track_url", "&csite=__CSITE__&csite=__CSITE__");
                     List<KuaiShouCreative> creativeList = creativeService.list(creativeQueryWrapper);
                     for (KuaiShouCreative creative : creativeList) {
-                        executorService.submit(new Runnable() {
+                       /* executorService.submit(new Runnable() {
                             @Override
-                            public void run() {
+                            public void run() {*/
                                 try {
                                     JSONObject json = new JSONObject();
                                     json.put("creativeId", creative.getCreativeId());
@@ -310,34 +310,37 @@ public class TestController {
 
 
                                     String clickTrackUrl = creative.getClickTrackUrl();
-                          /*  if (!Check.isNull(clickTrackUrl)) {
-                                b = clickTrackUrl;
-                            } else {
-                                b = creative.getImpressionUrl();
-                            }
-                            if (b.contains("&pass_through")) {
-                                String[] split = b.split("&pass_through");
-                                a = split[0] + "&csite=__CSITE__" + "&pass_through" + split[1];
-
-                            } else {
-                                a = b + "&csite=__CSITE__";
-                            }*/
-                                    a = clickTrackUrl.replace("&csite=__CSITE__&csite=__CSITE__", "&csite=__CSITE__");
-
-                                    if (creative.getCreativeMaterialType() == 1) {
-                                        json.put("clickTrackUrl", a);
-                                    } else if (creative.getCreativeMaterialType() == 4) {
-                                        json.put("impressionUrl", a);
-                                        json.put("clickTrackUrl", a);
-                                    }
 
-                                    batchService.updateCreative(json, oauthToken);
-                                    Thread.sleep(1000);
+                                    if (!clickTrackUrl.contains("&csite=__CSITE__")) {
+                                        if (!Check.isNull(clickTrackUrl)) {
+                                            b = clickTrackUrl;
+                                        } else {
+                                            b = creative.getImpressionUrl();
+                                        }
+                                        if (b.contains("&pass_through")) {
+                                            String[] split = b.split("&pass_through");
+                                            a = split[0] + "&csite=__CSITE__" + "&pass_through" + split[1];
+
+                                        } else {
+                                            a = b + "&csite=__CSITE__";
+                                        }
+                                        //   a = clickTrackUrl.replace("&csite=__CSITE__&csite=__CSITE__", "&csite=__CSITE__");
+
+                                        if (creative.getCreativeMaterialType() == 1) {
+                                            json.put("clickTrackUrl", a);
+                                        } else if (creative.getCreativeMaterialType() == 4) {
+                                            json.put("impressionUrl", a);
+                                            json.put("clickTrackUrl", a);
+                                        }
+
+                                        batchService.updateCreative(json, oauthToken);
+                                        Thread.sleep(1000);
+                                    }
                                 } catch (Exception e) {
                                     e.printStackTrace();
                                 }
-                            }
-                        });
+                      /*      }
+                        });*/
                     }
                 }
             }