Browse Source

直播投流

zhaoxian 3 năm trước cách đây
mục cha
commit
42678d83f9

+ 9 - 7
ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchCampaignAutoStrategyServiceImpl.java

@@ -103,13 +103,15 @@ public class KuaishouLaunchCampaignAutoStrategyServiceImpl implements IKuaishouL
         JSONObject strategyJson = (JSONObject) JSONObject.toJSON(strategy);
         JSONObject strategyJson = (JSONObject) JSONObject.toJSON(strategy);
         //1、创建计划&获取计划ID
         //1、创建计划&获取计划ID
         Long campaignId = createCampaign(strategyJson, token);
         Long campaignId = createCampaign(strategyJson, token);
-        strategyJson.put("campaignId", campaignId);
-        //2、创建广告组
-        try {
-            Long unitId = createGroup(strategyJson, token);
-        } catch (InterruptedException e) {
-            log.error("---创建广告组异常---");
-            e.printStackTrace();
+        if (campaignId > 0) {
+            strategyJson.put("campaignId", campaignId);
+            //2、创建广告组
+            try {
+                Long unitId = createGroup(strategyJson, token);
+            } catch (InterruptedException e) {
+                log.error("---创建广告组异常---");
+                e.printStackTrace();
+            }
         }
         }
         return ResultResponse.success();
         return ResultResponse.success();
     }
     }

+ 2 - 2
ruixuan-launch/src/main/java/com/ruixuan/launch/service/impl/KuaishouLaunchGroupServiceImpl.java

@@ -190,8 +190,8 @@ public class KuaishouLaunchGroupServiceImpl implements IKuaishouLaunchGroupServi
         }
         }
 
 
         //购物意图
         //购物意图
-        if (Check.isNotNull(requestJson.getInteger("purchaseIntention"))) {
-            targetJson.put("purchase_intention", requestJson.getJSONArray("purchaseIntention"));
+        if (Check.isNotNull(requestJson.getJSONObject("purchaseIntention"))) {
+            targetJson.put("purchase_intention", requestJson.getJSONObject("purchaseIntention"));
         }
         }
         return targetJson;
         return targetJson;
     }
     }