Browse Source

修改创建参数-计划

yangzian 3 years ago
parent
commit
2ac19b9bce

+ 1 - 1
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/dockapi/MarketingServiceImpl.java

@@ -344,7 +344,7 @@ public class MarketingServiceImpl implements MarketingService{
     @Override
     public  JSONObject creativeCreate(CtopOauthToken token, Long adId, JSONObject params) {
         return HttpUtils.bytedancePostRequest(token.getAccessToken(),
-                urlPath + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_create_v2"),
+                urlPath + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_creative_create_v2_123"),
                 params);
     }
 

+ 26 - 16
jeecg-boot-bytedance/src/main/java/org/jeecg/modules/bytedance/advertise/service/impl/AiBytedanceAdvertiserStrategyServiceImpl.java

@@ -276,22 +276,8 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         JSONObject params = new JSONObject();
         params.put("advertiser_id", strategy.getAccountId());
         params.put("ad_id", adId);
-        String inventoryType = strategy.getCreativeInventoryType();
-        if ("CREATIVE_IMAGE_MODE_UNION_SPLASH".equalsIgnoreCase(strategy.getCreativeImageMode())) {
-            params.put("inventory_type", new String[]{"INVENTORY_UNION_SPLASH_SLOT"});
-        } else {
-        if (null != inventoryType && !"".equals(inventoryType)) {
-            String[] inventoryTypeString = inventoryType.split(",");
-            if (inventoryTypeString.length > 0) {
-                params.put("inventory_type", inventoryTypeString);
-            }
-        }
-    }
 
-        Integer smartInventory = strategy.getCreativeSmartInventory();
-        if(null!=smartInventory&&smartInventory!=0){
-            params.put("smart_inventory",smartInventory);
-        }
+
 
         String sceneInventory = strategy.getCreativeSceneInventory();
         if(!Check.isNull(sceneInventory)){
@@ -589,10 +575,29 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         //投放范围
         if(null!=strategy.getAdDeliveryRange()&&!"".equals(strategy.getAdDeliveryRange().trim())){
             params.put("delivery_range",strategy.getAdDeliveryRange());
-            if(!"UNION".equals(strategy.getAdDeliveryRange())){
+           /* if(!"UNION".equals(strategy.getAdDeliveryRange())){
                 params.put("feed_delivery_search","DISABLED");
+            }*/
+        }
+
+        params.put("inventory_catalog","MANUAL");
+        Integer smartInventory = strategy.getCreativeSmartInventory();
+        if(null!=smartInventory&&smartInventory!=0){
+            params.put("smart_inventory","NORMAL");
+        }
+
+        String inventoryType = strategy.getCreativeInventoryType();
+        if ("CREATIVE_IMAGE_MODE_UNION_SPLASH".equalsIgnoreCase(strategy.getCreativeImageMode())) {
+            params.put("inventory_type", new String[]{"INVENTORY_UNION_SPLASH_SLOT"});
+        } else {
+            if (null != inventoryType && !"".equals(inventoryType)) {
+                String[] inventoryTypeString = inventoryType.split(",");
+                if (inventoryTypeString.length > 0) {
+                    params.put("inventory_type", inventoryTypeString);
+                }
             }
         }
+
         if(!Check.isNull(strategy.getAdUnionVideoType())){
             params.put("union_video_type",strategy.getAdUnionVideoType());
         }
@@ -1050,8 +1055,13 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
         if(null != strategy.getCampaignDeliveryRelatedNum()&&!"".equals(strategy.getCampaignDeliveryRelatedNum().trim())){
             campaignParam.put("delivery_related_num",strategy.getCampaignDeliveryRelatedNum());
         }
+
+        campaignParam.put("marketing_purpose","CONVERSION");
+
+        log.info("token获取失败=>accountId:{}", strategy.getAccountId());
         //创建组
         Result campaignData = marketingService.createCampaign(token, campaignParam);
+        log.info("===创建组==={}",campaignData);
         if(campaignData.getCode()!=0){
             AiBytedanceAutocreateLog iBytedanceAutocreateLog = new AiBytedanceAutocreateLog(
                     strategy.getAccountId(),