Переглянути джерело

Merge branch 'test' of http://git.tjyourong.com.cn/ctop/adsp-boot into test

syh 4 роки тому
батько
коміт
257d77a02a

+ 0 - 167
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/batch/controller/ByteDanceBatchController.java

@@ -1,167 +0,0 @@
-package cn.com.ctop.toutiao.modules.batch.controller;
-
-import cn.com.ctop.common.module.service.IFileInfoService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.toutiao.modules.batch.service.IBytedanceIndustryInfoService;
-import cn.com.ctop.toutiao.modules.material.entity.ByteDanceAdvertisePlan;
-import cn.com.ctop.toutiao.modules.material.entity.ByteDanceVideoInfo;
-import cn.com.ctop.toutiao.modules.material.entity.BytedanceImageInfo;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertisePlanService;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceCreativeService;
-import cn.com.ctop.toutiao.modules.material.service.IByteDanceVideoInfoService;
-import cn.com.ctop.toutiao.modules.material.service.IBytedanceImageInfoService;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.api.vo.Result;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-
-@Slf4j
-@RestController
-@RequestMapping("/bytedance/batch")
-public class ByteDanceBatchController {
-    @Autowired
-    IByteDanceAdvertisePlanService byteDanceAdvertisePlanService;
-    @Autowired
-    private IBytedanceIndustryInfoService bytedanceIndustryInfoService;
-    @Autowired
-    private IFileInfoService fileInfoService;
-    @Autowired
-    private IByteDanceCreativeService creativeService;
-    @Autowired
-    private IByteDanceVideoInfoService videoInfoService;
-
-    /**
-     * 获取动态词包信息
-     *
-     * @param accountId
-     * @return
-     */
-    @GetMapping("creative/words/get")
-    public Map<String, Object> getCreativeWords(Long accountId) {
-        return fileInfoService.getCreativeWords(accountId);
-    }
-
-    @GetMapping("action/text")
-    public Map<String,Object>getActionText(Long accountId,String landType){
-        return fileInfoService.getActionText(accountId,landType);
-    }
-
-    @GetMapping("industry/list")
-    public Map<String,Object>getIndustryList(){
-        return bytedanceIndustryInfoService.getIndustryList();
-    }
-    @GetMapping("load/industry")
-    public Map<String,Object>loadIndustryList(Long accountId,Integer level){
-        return bytedanceIndustryInfoService.getBytedanceIndustryList(accountId,level);
-    }
-
-    @GetMapping(value = "/getVideoList")
-    public Result<IPage<ByteDanceVideoInfo>> getBytedqanceVideoList(@RequestParam(name = "accountId") Long accountId, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                                    @RequestParam(name = "startDate", defaultValue = "") String startDate,
-                                                                    @RequestParam(name = "endDate", defaultValue = "") String endDate) {
-        Result<IPage<ByteDanceVideoInfo>> result = new Result<>();
-        try {
-            if (Check.isNull(accountId)) {
-                throw new Exception("账户id不能为空");
-            }
-
-            QueryWrapper<ByteDanceVideoInfo> queryWrapper = new QueryWrapper<>();
-            if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
-                queryWrapper.between("create_time", startDate+" 00:00:00", endDate+" 23:59:59");
-            }
-            queryWrapper.eq("account_id",accountId);
-            queryWrapper.orderByDesc("material_upload_time");
-            queryWrapper.groupBy("signature");
-            Page<ByteDanceVideoInfo> page = new Page<>(pageNo, pageSize);
-            IPage<ByteDanceVideoInfo> pageList = videoInfoService.page(page, queryWrapper);
-            result.setSuccess(true);
-            result.setResult(pageList);
-            return result;
-        } catch (Exception e) {
-            e.printStackTrace();
-            result.setSuccess(false);
-        }
-        return result;
-    }
-    @Autowired
-    private IBytedanceImageInfoService imageInfoService;
-
-    @GetMapping(value = "/getImageList")
-    public Result<IPage<BytedanceImageInfo>> getBytedqanceVideoList(@RequestParam(name = "accountId")Long accountId, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                                    @RequestParam(name = "startDate", defaultValue = "") String startDate,
-                                                                    @RequestParam(name = "endDate", defaultValue = "") String endDate, HttpServletRequest req) {
-        Result<IPage<BytedanceImageInfo>> result = new Result<>();
-        try {
-            if (Check.isNull(accountId)) {
-                throw new Exception("账户id不能为空");
-            }
-            QueryWrapper<BytedanceImageInfo> queryWrapper = new QueryWrapper<>();
-            if (!Check.isNull(startDate) && !Check.isNull(endDate)) {
-                queryWrapper.between("image_create_time", startDate+" 00:00:00", endDate+" 23:59:59");
-            }
-            queryWrapper.eq("account_id",accountId);
-            queryWrapper.orderByDesc("image_create_time");
-            queryWrapper.groupBy("signature");
-            Page<BytedanceImageInfo> page = new Page<>(pageNo, pageSize);
-            IPage<BytedanceImageInfo> pageList = imageInfoService.page(page, queryWrapper);
-            result.setSuccess(true);
-            result.setResult(pageList);
-            return result;
-        } catch (Exception e) {
-            e.printStackTrace();
-            result.setSuccess(false);
-        }
-        return result;
-    }
-
-    /**
-     *  批量创建计划
-     * @param byteDanceAdvertisePlan
-     * @param requestBody
-     * @return
-     */
-    @PostMapping(value = "/create/advertiserPlan")
-    public Result<List<ByteDanceAdvertisePlan>> add(@RequestBody ByteDanceAdvertisePlan byteDanceAdvertisePlan,
-                                                    @RequestBody JSONObject requestBody) {
-        Result<List<ByteDanceAdvertisePlan>> result = new Result<>();
-        List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList= new ArrayList<>();
-        if(requestBody.getJSONArray("accountIds").isEmpty()){
-            log.error("批量创建计划未选择账户");
-        }
-        requestBody.getJSONArray("accountIds").forEach(it->{
-            byteDanceAdvertisePlan.setAccountId(it.toString());
-            try {
-                //TODO 需要先存入头条后台
-                byteDanceAdvertisePlanService.save(byteDanceAdvertisePlan);
-                byteDanceAdvertisePlanList.add(byteDanceAdvertisePlan);
-                result.success("添加成功!");
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-                result.error500("操作失败");
-            }
-        });
-        result.setResult(byteDanceAdvertisePlanList);
-        return result;
-    }
-
-
-    /**
-     *  批量创建创意
-     */
-    @PostMapping("/create/creative")
-    public Map<String,Object>addCreative(@RequestBody JSONObject data){
-        return creativeService.batchCreate(data);
-    }
-}

+ 23 - 11
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/controller/ByteDanceAdvertisePlanController.java

@@ -14,9 +14,11 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * 今日头条广告计划信息
@@ -67,21 +69,30 @@ public class ByteDanceAdvertisePlanController {
      * 添加
      */
     @PostMapping(value = "/add")
-    public Result<ByteDanceAdvertisePlan> add(@RequestBody ByteDanceAdvertisePlan byteDanceAdvertisePlan,
-                                              @RequestParam String landingType) {
-        Result<ByteDanceAdvertisePlan> result = new Result<>();
+        public Result<List<ByteDanceAdvertisePlan>> add(@RequestBody ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
+
+        Result<List<ByteDanceAdvertisePlan>> result = new Result<>();
+        List<String> names= (List) byteDanceAdvertisePlan.getNames();
+        String landingType = byteDanceAdvertisePlan.getLandingType();
+        List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList=new ArrayList<>();
         try {
-            Map<String, Object> advertiserPlan = byteDanceAdvertisePlanService.createAdvertiserPlan(ctopOauthTokenService.getTokenByAccountId(Long.valueOf(byteDanceAdvertisePlan.getAccountId())), landingType, byteDanceAdvertisePlan);
-            if(advertiserPlan.get("code").equals(0)){
-                byteDanceAdvertisePlanService.save(byteDanceAdvertisePlan);
-                result.success("添加成功!");
-            }else {
-                result.error500(advertiserPlan.get("message").toString());
-            }
+            names.forEach(name->{
+                byteDanceAdvertisePlan.setName(name);
+                Map<String, Object> advertiserPlan = byteDanceAdvertisePlanService.createAdvertiserPlan(ctopOauthTokenService.getTokenByAccountId(Long.valueOf(byteDanceAdvertisePlan.getAccountId())), landingType, byteDanceAdvertisePlan);
+                if(advertiserPlan.get("code").equals(0)){
+                    byteDanceAdvertisePlan.setId(Long.valueOf(((Map)advertiserPlan.get("data")).get("ad_id").toString()));
+                    byteDanceAdvertisePlanService.save(byteDanceAdvertisePlan);
+                    byteDanceAdvertisePlanList.add(byteDanceAdvertisePlan);
+                }else {
+                    result.setCode(-200);
+                    result.setMessage(advertiserPlan.get("message").toString());
+                }
+            });
         } catch (Exception e) {
             log.error(e.getMessage(), e);
             result.error500("操作失败");
         }
+        result.setResult(byteDanceAdvertisePlanList);
         return result;
     }
 
@@ -107,7 +118,8 @@ public class ByteDanceAdvertisePlanController {
     }
 
     @PostMapping(value = "/batchEdit")
-    public Result<List<ByteDanceAdvertisePlan>> edit(@RequestBody List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList) {
+    public Result<List<ByteDanceAdvertisePlan>> edit(@RequestBody List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList
+    ) {
         Result<List<ByteDanceAdvertisePlan>> result = new Result<>();
         byteDanceAdvertisePlanList.forEach(it->{
             ByteDanceAdvertisePlan byteDanceAdvertisePlanEntity = byteDanceAdvertisePlanService.getById(it.getId());

+ 73 - 8
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAdvertisePlan.java

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.annotation.Dict;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
@@ -44,6 +45,12 @@ public class ByteDanceAdvertisePlan {
     // 计划名称
     private String name;
 
+    @TableField(exist=false)
+    private Object names;
+
+    @TableField(exist=false)
+    private String landingType;
+
     // 广告组id
     @Dict(dicCode = "id",dictTable="ctop_bytedance_campaign",dicText="name")
     private Long campaignId;
@@ -76,7 +83,6 @@ public class ByteDanceAdvertisePlan {
     //true:投放中 false:暂停
     private Boolean status;
 
-
     // 广告计划操作状态
     private String optStatus;
 
@@ -107,6 +113,9 @@ public class ByteDanceAdvertisePlan {
     // 应用下载方式
     private String downloadType;
 
+    // 应用下载方式
+    private String downloadUrl;
+
     // 广告落地页链接
     private String externalUrl;
 
@@ -121,6 +130,7 @@ public class ByteDanceAdvertisePlan {
 
     // ocpc广告转化出价
     private BigDecimal cpaBid;
+
     private BigDecimal deepCpaBid;  // 深度优化出价
 
     private String deepBidType;
@@ -141,18 +151,73 @@ public class ByteDanceAdvertisePlan {
     // audience
     private String audience;
 
-
     private String modifyTime;
 
-    // 受众性别
-    private String gender;
-
-    // 受众平台
-    private String platform;
-
     private Date createTime;
 
     private Date updateTime;
+    /**
+     *  受众公共参数
+     */
+    // 受众性别
+    private String gender;
+    // 受众平台
+    @TableField(exist=false)
+    private Object platform;
+    @TableField(exist=false)
+    private Object retargetingTags;
+    @TableField(exist=false)
+    private Object retargetingTagsExclude;
+    @TableField(exist=false)
+    private Object age;
+    @TableField(exist=false)
+    private Object carrier;
+    @TableField(exist=false)
+    private Object ac;
+    @TableField(exist=false)
+    private Object deviceBrand;
+    @TableField(exist=false)
+    private Object articleCategory;
+    @TableField(exist=false)
+    private Object activateType;
+    @TableField(exist=false)
+    private Object city;
+    @TableField(exist=false)
+    private Object businessIds;
+    @TableField(exist=false)
+    private String locationType;
+    @TableField(exist=false)
+    private Object superiorPopularityType;
+    @TableField(exist=false)
+    private Object flowPackage;
+    @TableField(exist=false)
+    private Object excludeFlowPackage;
+    @TableField(exist=false)
+    private Object deviceType;
+    @TableField(exist=false)
+    private Object autoExtendEnabled;
+    @TableField(exist=false)
+    private Object launchPrice;
+    @TableField(exist=false)
+    private Object interestActionMode;
+    @TableField(exist=false)
+    private Object actionScene;
+    @TableField(exist=false)
+    private Object actionDays;
+    @TableField(exist=false)
+    private Object actionCategories;
+    @TableField(exist=false)
+    private Object actionWords;
+    @TableField(exist=false)
+    private Object interestCategories;
+    @TableField(exist=false)
+    private Object interestWords;
+    @TableField(exist=false)
+    private Object geolocation;
+    @TableField(exist=false)
+    private String externalAction;
+    @TableField(exist=false)
+    private String useOpenUrl;
 
     public ByteDanceAdvertisePlan(JSONObject dataObject, String accountId) {
         this.id = dataObject.getLong("id");

+ 3 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAudiencePackage.java

@@ -28,6 +28,7 @@ public class ByteDanceAudiencePackage {
 	/**账户Id*/
 	private String userId;
 
+
 	/**定向包名称*/
 	private String name;
 
@@ -124,6 +125,8 @@ public class ByteDanceAudiencePackage {
 	/**需要传json对象!地图位置,district为BUSINESS_DISTRICT才有效*/
 	private Object geolocation;
 
+	private String filterConvertedUsers;
+
 	/**(抖音推广特有)账号粉丝相似人群(添加抖音账号,会将广告投放给对应账号的相似人群粉丝)	*/
 	private Object awemeFansNumbers;
 

+ 4 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceAdvertisePlanService.java

@@ -2,6 +2,7 @@ package cn.com.ctop.toutiao.modules.material.service;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.toutiao.modules.material.entity.ByteDanceAdvertisePlan;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import jdk.nashorn.internal.scripts.JS;
@@ -28,13 +29,13 @@ public interface IByteDanceAdvertisePlanService extends IService<ByteDanceAdvert
     Map<String, Object> updateAdvertiserPlan(CtopOauthToken token,String landingType, ByteDanceAdvertisePlan byteDanceAdvertisePlan);
 
     //更新计划状态  https://ad.oceanengine.com/open_api/2/ad/update/status/
-    Map<String, Object> updateAdvertiserPlanStatus(CtopOauthToken token, String adIds,String optStatus);
+    Map<String, Object> updateAdvertiserPlanStatus(CtopOauthToken token, JSONArray adIds, String optStatus);
 
     //更新计划预算  https://ad.oceanengine.com/open_api/2/ad/update/budget/
-    Map<String, Object> updateAdvertiserPlanBudget(CtopOauthToken token, String adIds, String budgets);
+    Map<String, Object> updateAdvertiserPlanBudget(CtopOauthToken token, JSONArray adIds, JSONArray budgets);
 
     //更新计划出价  https://ad.oceanengine.com/open_api/2/ad/update/bid/
-    Map<String, Object> updateAdvertiserPlanBid(CtopOauthToken token, String adIds,String bids);
+    Map<String, Object> updateAdvertiserPlanBid(CtopOauthToken token, JSONArray adIds,JSONArray bids);
 
     //获取计划审核建议  https://ad.oceanengine.com/open_api/2/ad/reject_reason/
     Map<String, Object> getAdvertiserPlanRejectReason(CtopOauthToken token, Long advertiserId, List<Long> adIds);

+ 148 - 138
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceAdvertisePlanServiceImpl.java

@@ -7,6 +7,7 @@ import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.toutiao.modules.material.entity.ByteDanceAdvertisePlan;
 import cn.com.ctop.toutiao.modules.material.mapper.ByteDanceAdvertisePlanMapper;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertisePlanService;
+import cn.com.ctop.toutiao.modules.tool.service.IByteDanceConvertToolService;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -26,6 +27,9 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
     @Autowired
     private ByteDanceAdvertisePlanMapper byteDanceAdvertisePlanMapper;
 
+    @Autowired
+    private IByteDanceConvertToolService byteDanceConvertToolService;
+
     @Override
     public Map<String, Object> getAdvertiserPlan(CtopOauthToken token, String ids, String date, String updateDate) {
         getAd(token, 1, ids, date, updateDate);
@@ -36,7 +40,7 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
     }
 
     @Override
-    public Map<String, Object> createAdvertiserPlan(CtopOauthToken token,String landingType, ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
+    public Map<String, Object> createAdvertiserPlan(CtopOauthToken token, String landingType, ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
 
         Map<String, Object> resultMap = new HashMap<>();
         //拼接访问参数
@@ -45,103 +49,140 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         headers.put("Access-Token", token.getAccessToken());
 
         JSONObject params = new JSONObject();
-        params.put("advertiser_id",byteDanceAdvertisePlan.getAccountId());
-        params.put("campaign_id",byteDanceAdvertisePlan.getCampaignId());
-        params.put("name",byteDanceAdvertisePlan.getName());
-        params.put("operation",byteDanceAdvertisePlan.getOperation()==null?"enable":byteDanceAdvertisePlan.getOperation());
-        params.put("delivery_range",byteDanceAdvertisePlan.getDeliveryRange()==null?"DEFAULT":byteDanceAdvertisePlan.getDeliveryRange());
-        params.put("union_video_type",byteDanceAdvertisePlan.getUnionVideoType()==null?"ORIGINAL_VIDEO":byteDanceAdvertisePlan.getUnionVideoType());
-        params.put("budget_mode",byteDanceAdvertisePlan.getBudgetMode());
-        params.put("budget",byteDanceAdvertisePlan.getBudget());
-        params.put("schedule_type",byteDanceAdvertisePlan.getScheduleType());
-        params.put("start_time",byteDanceAdvertisePlan.getStartTime());
-        params.put("end_time",byteDanceAdvertisePlan.getEndTime());
+        params.put("advertiser_id", byteDanceAdvertisePlan.getAccountId());
+        params.put("campaign_id", byteDanceAdvertisePlan.getCampaignId());
+        params.put("name", byteDanceAdvertisePlan.getName());
+        params.put("operation", byteDanceAdvertisePlan.getOperation() == null ? "enable" : byteDanceAdvertisePlan.getOperation());
+        params.put("delivery_range", byteDanceAdvertisePlan.getDeliveryRange() == null ? "DEFAULT" : byteDanceAdvertisePlan.getDeliveryRange());
+        params.put("union_video_type", byteDanceAdvertisePlan.getUnionVideoType() == null ? "ORIGINAL_VIDEO" : byteDanceAdvertisePlan.getUnionVideoType());
+        params.put("budget_mode", byteDanceAdvertisePlan.getBudgetMode());
+        params.put("budget", byteDanceAdvertisePlan.getBudget());
+        params.put("schedule_type", byteDanceAdvertisePlan.getScheduleType());
+        params.put("start_time", byteDanceAdvertisePlan.getStartTime());
+        params.put("end_time", byteDanceAdvertisePlan.getEndTime());
         //广告投放时段
         //params.put("schedule_time",byteDanceAdvertisePlan.getString("scheduleTime"));
-        params.put("pricing",byteDanceAdvertisePlan.getPricing());
-        params.put("bid",byteDanceAdvertisePlan.getBid()==null?0:byteDanceAdvertisePlan.getBid());
-        params.put("cpa_bid",byteDanceAdvertisePlan.getCpaBid()==null?0.1:byteDanceAdvertisePlan.getCpaBid());
-        params.put("flow_control_mode",byteDanceAdvertisePlan.getFlowControlMode());
-        if(byteDanceAdvertisePlan.getPricing().equals("OCPM")){
-            params.put("convert_id",byteDanceAdvertisePlan.getConvertId());
+        params.put("pricing", byteDanceAdvertisePlan.getPricing());
+        params.put("bid", byteDanceAdvertisePlan.getBid());
+        params.put("cpa_bid", byteDanceAdvertisePlan.getCpaBid());
+        params.put("flow_control_mode", byteDanceAdvertisePlan.getFlowControlMode());
+        if (byteDanceAdvertisePlan.getPricing().equals("PRICING_OCPM")) {
+            if(byteDanceAdvertisePlan.getConvertId()!=null){
+                //查询必填参数convert_id
+                params.put("convert_id", byteDanceAdvertisePlan.getConvertId());
+            }else{
+                params.put("convert_id",getConvertIdByExternalAction(byteDanceAdvertisePlan.getExternalAction()));
+            }
         }
-        params.put("deep_bid_type",byteDanceAdvertisePlan.getDeepBidType());
-        params.put("deep_cpabid",byteDanceAdvertisePlan.getDeepCpaBid());
-        params.put("hide_if_converted",byteDanceAdvertisePlan.getHideIfConverted());
-        params.put("hide_if_exists",byteDanceAdvertisePlan.getHideIfExists() == null ? 0 : byteDanceAdvertisePlan.getHideIfExists());
-        params.put("converted_time_duration",byteDanceAdvertisePlan.getConvertedTimeDuration());
+        params.put("deep_bid_type", byteDanceAdvertisePlan.getDeepBidType());
+        params.put("deep_cpabid", byteDanceAdvertisePlan.getDeepCpaBid());
+        params.put("hide_if_converted", byteDanceAdvertisePlan.getHideIfConverted());
+        params.put("hide_if_exists", byteDanceAdvertisePlan.getHideIfExists() == null ? 0 : byteDanceAdvertisePlan.getHideIfExists());
+        params.put("converted_time_duration", byteDanceAdvertisePlan.getConvertedTimeDuration());
         //params.put("luban_roi_goal",byteDanceAdvertisePlan.getLubanRoiGoal()==null?0.00:byteDanceAdvertisePlan.getFloat("lubanRoiGoal"));
         //params.put("roi_goal",byteDanceAdvertisePlan.getFroiGoal")==null?0.00:byteDanceAdvertisePlan.getFloat("roiGoal"));
         //params.put("unique_fk",byteDanceAdvertisePlan.getUniqueFk")==null?"":byteDanceAdvertisePlan.getString("uniqueFk"));
         //params.put("smart_bid_type",byteDanceAdvertisePlan.getSmartBidType")==null?"":byteDanceAdvertisePlan.getString("smartBidType"));
-        params.put("adjust_cpa",0);
+        params.put("adjust_cpa", 0);
+        //暂时不需要定向包id
         //params.put("audience_package_id",byteDanceAdvertisePlan.getLong("audiencePackageId"));
-        params.put("open_url",byteDanceAdvertisePlan.getOpenUrl());
+        if(byteDanceAdvertisePlan.getUseOpenUrl().equals("YES")){
+            params.put("open_url", byteDanceAdvertisePlan.getOpenUrl());
+        }
         //判断推广目的
-        if(landingType.equals("Link")){
-            params.put("external_url",byteDanceAdvertisePlan.getExternalUrl());
+        if (landingType.equals("LINK")) {
+            params.put("external_url", byteDanceAdvertisePlan.getExternalUrl());
         }
-        if(landingType.equals("APP")){
-            params.put("download_type",byteDanceAdvertisePlan.getExternalUrl());
-
+        if (landingType.equals("APP")) {
+            params.put("download_type", byteDanceAdvertisePlan.getDownloadType());
+            params.put("download_url", byteDanceAdvertisePlan.getDownloadUrl());
+            params.put("package", byteDanceAdvertisePlan.getToutiaoPackage());
+            params.put("app_type",byteDanceAdvertisePlan.getAppType());
         }
-        JSONObject jsonObject = JSONObject.parseObject( HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_create"), params, headers));
-        if (jsonObject.getInteger("code") != 0) {
+
+        //公共参数--受众相关
+        params.put("retargeting_tags_include", byteDanceAdvertisePlan.getRetargetingTags());
+        params.put("retargeting_tags_exclude", byteDanceAdvertisePlan.getRetargetingTagsExclude());
+        params.put("gender", byteDanceAdvertisePlan.getGender());
+        params.put("age", byteDanceAdvertisePlan.getAge());
+        params.put("carrier", byteDanceAdvertisePlan.getCarrier());
+        params.put("ac", byteDanceAdvertisePlan.getAc());
+        params.put("device_brand", byteDanceAdvertisePlan.getDeviceBrand());
+        params.put("article_category", byteDanceAdvertisePlan.getArticleCategory());
+        params.put("activate_type", byteDanceAdvertisePlan.getActivateType());
+        params.put("city", byteDanceAdvertisePlan.getCity());
+        params.put("business_ids", byteDanceAdvertisePlan.getBusinessIds());
+        params.put("location_type", byteDanceAdvertisePlan.getLocationType());
+        params.put("superior_popularity_type", byteDanceAdvertisePlan.getSuperiorPopularityType());
+        params.put("flow_package", byteDanceAdvertisePlan.getFlowPackage());
+        params.put("exclude_flow_package", byteDanceAdvertisePlan.getExcludeFlowPackage());
+        params.put("device_type", byteDanceAdvertisePlan.getDeviceType());
+        params.put("auto_extend_enabled", byteDanceAdvertisePlan.getAutoExtendEnabled());
+        params.put("launch_price", byteDanceAdvertisePlan.getLaunchPrice());
+        params.put("interest_action_mode", byteDanceAdvertisePlan.getInterestActionMode());
+        params.put("action_scene", byteDanceAdvertisePlan.getActionScene());
+        params.put("action_days", byteDanceAdvertisePlan.getActionDays());
+        params.put("action_categories", byteDanceAdvertisePlan.getActionCategories());
+        params.put("action_words", byteDanceAdvertisePlan.getActionWords());
+        params.put("interest_categories", byteDanceAdvertisePlan.getInterestWords());
+        params.put("interest_words", byteDanceAdvertisePlan.getGeolocation());
+
+        JSONObject jsonObject = JSONObject.parseObject(HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_create"), params, headers));
+        if (jsonObject.getInteger("code") == 0) {
+            resultMap.put("code", 0);
+            resultMap.put("data",jsonObject.getJSONObject("data"));
+        } else {
             log.error("广告计划创建失败==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
-            resultMap.put("code", -1);
+            resultMap.put("code",-200);
             resultMap.put("message", jsonObject.getString("message"));
-            return resultMap;
         }
-        resultMap.put("code", 0);
-        resultMap.put("message", "广告组状态修改成功");
         return resultMap;
     }
 
     @Override
-    public Map<String, Object> updateAdvertiserPlan(CtopOauthToken token,String landingType, ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
+    public Map<String, Object> updateAdvertiserPlan(CtopOauthToken token, String landingType, ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
 
         Map<String, Object> resultMap = new HashMap<>();
 
-        //拼接访问参数
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
 
         JSONObject params = new JSONObject();
-        params.put("advertiser_id",byteDanceAdvertisePlan.getAccountId());
-        params.put("ad_id",byteDanceAdvertisePlan.getId());
-        params.put("name",byteDanceAdvertisePlan.getName());
-        params.put("modify_time",byteDanceAdvertisePlan.getModifyTime());
-        params.put("budget",byteDanceAdvertisePlan.getBudget());
-        params.put("schedule_type",byteDanceAdvertisePlan.getScheduleType());
-        params.put("start_time",byteDanceAdvertisePlan.getStartTime());
-        params.put("end_time",byteDanceAdvertisePlan.getEndTime());
+        params.put("advertiser_id", byteDanceAdvertisePlan.getAccountId());
+        params.put("ad_id", byteDanceAdvertisePlan.getId());
+        params.put("name", byteDanceAdvertisePlan.getName());
+        params.put("modify_time", byteDanceAdvertisePlan.getModifyTime());
+        params.put("budget", byteDanceAdvertisePlan.getBudget());
+        params.put("schedule_type", byteDanceAdvertisePlan.getScheduleType());
+        params.put("start_time", byteDanceAdvertisePlan.getStartTime());
+        params.put("end_time", byteDanceAdvertisePlan.getEndTime());
         //广告投放时段
-        //params.put("schedule_time",byteDanceAdvertisePlan.getString("scheduleTime"));
-        params.put("bid",byteDanceAdvertisePlan.getBid()==null?0:byteDanceAdvertisePlan.getBid());
-        params.put("cpa_bid",byteDanceAdvertisePlan.getCpaBid()==null?0.1:byteDanceAdvertisePlan.getCpaBid());
-        params.put("flow_control_mode",byteDanceAdvertisePlan.getFlowControlMode());
-        if(byteDanceAdvertisePlan.getPricing().equals("OCPM")){
-            params.put("convert_id",byteDanceAdvertisePlan.getConvertId());
+        params.put("schedule_time",byteDanceAdvertisePlan.getScheduleTime());
+        params.put("bid", byteDanceAdvertisePlan.getBid());
+        params.put("cpa_bid", byteDanceAdvertisePlan.getCpaBid());
+        params.put("flow_control_mode", byteDanceAdvertisePlan.getFlowControlMode());
+        if (byteDanceAdvertisePlan.getPricing().equals("OCPM")) {
+            params.put("convert_id", byteDanceAdvertisePlan.getConvertId());
         }
-        params.put("deep_bid_type",byteDanceAdvertisePlan.getDeepBidType());
-        params.put("deep_cpabid",byteDanceAdvertisePlan.getDeepCpaBid());
-        params.put("hide_if_converted",byteDanceAdvertisePlan.getHideIfConverted());
-        params.put("hide_if_exists",byteDanceAdvertisePlan.getHideIfExists() == null ? 0 : byteDanceAdvertisePlan.getHideIfExists());
-        params.put("converted_time_duration",byteDanceAdvertisePlan.getConvertedTimeDuration());
+        params.put("deep_bid_type", byteDanceAdvertisePlan.getDeepBidType());
+        params.put("deep_cpabid", byteDanceAdvertisePlan.getDeepCpaBid());
+        params.put("hide_if_converted", byteDanceAdvertisePlan.getHideIfConverted());
+        params.put("hide_if_exists", byteDanceAdvertisePlan.getHideIfExists() == null ? 0 : byteDanceAdvertisePlan.getHideIfExists());
+        params.put("converted_time_duration", byteDanceAdvertisePlan.getConvertedTimeDuration());
         //params.put("luban_roi_goal",byteDanceAdvertisePlan.getLubanRoiGoal()==null?0.00:byteDanceAdvertisePlan.getFloat("lubanRoiGoal"));
         //params.put("roi_goal",byteDanceAdvertisePlan.getFroiGoal")==null?0.00:byteDanceAdvertisePlan.getFloat("roiGoal"));
         //params.put("audience_package_id",byteDanceAdvertisePlan.getLong("audiencePackageId"));
-        params.put("open_url",byteDanceAdvertisePlan.getOpenUrl());
+        params.put("open_url", byteDanceAdvertisePlan.getOpenUrl());
         //判断推广目的
-        if(landingType.equals("Link")){
-            params.put("external_url",byteDanceAdvertisePlan.getExternalUrl());
+        if (landingType.equals("Link")) {
+            params.put("external_url", byteDanceAdvertisePlan.getExternalUrl());
         }
-        if(landingType.equals("APP")){
-            params.put("download_type",byteDanceAdvertisePlan.getExternalUrl());
+        if (landingType.equals("APP")) {
+            params.put("download_type", byteDanceAdvertisePlan.getExternalUrl());
 
         }
-        JSONObject jsonObject = JSONObject.parseObject( HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update"), params, headers));
+        JSONObject jsonObject = JSONObject.parseObject(HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update"), params, headers));
         if (jsonObject.getInteger("code") != 0) {
             log.error("广告计划创建失败==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             resultMap.put("code", -1);
@@ -154,67 +195,43 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
     }
 
     @Override
-    public Map<String, Object> updateAdvertiserPlanStatus(CtopOauthToken token, String adIds, String optStatus) {
-        JSONArray ids = new JSONArray();
-        String[] getIds = adIds.split(StringUtils.COMMA);
-        if (getIds.length > 0) {
-            for (String getId : getIds) {
-                ids.add(Long.parseLong(getId));
-            }
-        }
-        //2: 根据token以及用户id获取用户信息数据
-        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_status");
+    public Map<String, Object> updateAdvertiserPlanStatus(CtopOauthToken token, JSONArray adIds, String optStatus) {
+
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
 
         JSONObject params = new JSONObject();
         params.put("advertiser_id", token.getAccountId());
-        params.put("ad_ids", ids.toJSONString());
+        params.put("ad_ids", adIds.toJSONString());
         params.put("opt_status", optStatus);
-        String result = HttpUtils.httpPostRequest(url, params, headers);
+        String result = HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_status"), params, headers);
         JSONObject jsonObject = JSONObject.parseObject(result);
         int code = jsonObject.getInteger("code");
         Map<String, Object> resultMap = new HashMap<>();
         if (code != 0) {
             log.error("广告计划更新状态接口异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             resultMap.put("code", -1);
-            resultMap.put("message", "广告计划更新状态接口异常");
-            return resultMap;
-        }
-        JSONObject data = jsonObject.getJSONObject("data");
-        if (null == data) {
-            log.info("广告计划更新状态异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
-            resultMap.put("code", -1);
             resultMap.put("message", jsonObject.getString("message"));
             return resultMap;
         }
-        JSONArray getAdIds = data.getJSONArray("ad_ids");
-        if (null != getAdIds && !getAdIds.isEmpty()) {
-            //获取广告计划信息
-            getAdvertiserPlan(token, adIds, null, null);
-        }
         resultMap.put("code", 0);
         resultMap.put("message", "广告组状态修改成功");
         return resultMap;
     }
 
-    public Map<String, Object> updateAdvertiserPlanBudget(CtopOauthToken token, String adIds, String budgets) {
+    public Map<String, Object> updateAdvertiserPlanBudget(CtopOauthToken token, JSONArray adIds, JSONArray budgets) {
         JSONArray data = new JSONArray();
-        String[] getadIds = adIds.split(StringUtils.COMMA);
-        String[] getBudgets = budgets.split(StringUtils.COMMA);
-        if (getadIds.length > 0) {
-            for (int i = 0; i < getadIds.length; i++) {
+        if (adIds.size() > 0) {
+            for (int i = 0; i < adIds.size(); i++) {
                 JSONObject object = new JSONObject();
-                Long adId = Long.parseLong(getadIds[i]);
-                Long budget = Long.parseLong(getBudgets[i]);
+                Long adId = (Long)adIds.get(i);
+                Long budget = (Long)budgets.get(i);
                 object.put("ad_id", adId);
                 object.put("budget", budget);
                 data.add(object);
             }
         }
-        //2: 根据token以及用户id获取用户信息数据
-        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_budget");
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
@@ -222,50 +239,35 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         JSONObject params = new JSONObject();
         params.put("advertiser_id", token.getAccountId());
         params.put("data", data.toJSONString());
-        String result = HttpUtils.httpPostRequest(url, params, headers);
+        String result = HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_budget"), params, headers);
         JSONObject jsonObject = JSONObject.parseObject(result);
         Map<String, Object> resultMap = new HashMap<>();
-        Integer code = jsonObject.getInteger("code");
-        if (null == code || !code.equals(0)) {
+        int code = jsonObject.getInteger("code");
+        if (code!=0) {
             log.info("修改计划预算接口异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             resultMap.put("code", -1);
             resultMap.put("message", jsonObject.getString("message"));
             return resultMap;
         }
-        JSONObject getData = jsonObject.getJSONObject("data");
-        if (null == getData) {
-            log.info("修改计划预算异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
-            resultMap.put("code", -1);
-            resultMap.put("message", jsonObject.getString("message"));
-            return resultMap;
-        }
-        JSONArray getAdIds = getData.getJSONArray("ad_ids");
-        if (null != getAdIds && !getAdIds.isEmpty()) {
-            //获取广告计划信息
-            getAdvertiserPlan(token, adIds, null, null);
-        }
         resultMap.put("code", 0);
         resultMap.put("message", "修改计划预算成功");
         return resultMap;
     }
 
     @Override
-    public Map<String, Object> updateAdvertiserPlanBid(CtopOauthToken token, String adIds, String bids) {
-        String[] getadIds = adIds.split(StringUtils.COMMA);
-        String[] getBids = bids.split(StringUtils.COMMA);
+    public Map<String, Object> updateAdvertiserPlanBid(CtopOauthToken token, JSONArray adIds, JSONArray bids) {
         JSONArray data = new JSONArray();
-        if (getadIds.length > 0) {
-            for (int i = 0; i < getadIds.length; i++) {
+        if (adIds.size() > 0) {
+            for (int i = 0; i < adIds.size(); i++) {
                 JSONObject object = new JSONObject();
-                Long adId = Long.parseLong(getadIds[i]);
-                Long bid = Long.parseLong(getBids[i]);
+                Long adId = (Long)adIds.get(i);
+                Long bid = (Long)bids.get(i);
                 object.put("ad_id", adId);
                 object.put("bid", bid);
                 data.add(object);
             }
         }
         //2: 根据token以及用户id获取用户信息数据
-        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_bid");
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
@@ -273,8 +275,7 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         JSONObject params = new JSONObject();
         params.put("advertiser_id", token.getAccountId());
         params.put("data", data.toJSONString());
-        String result = HttpUtils.httpPostRequest(url, params, headers);
-        JSONObject jsonObject = JSONObject.parseObject(result);
+        JSONObject jsonObject = JSONObject.parseObject(HttpUtils.httpPostRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_update_bid"), params, headers));
         int code = jsonObject.getInteger("code");
         Map<String, Object> resultMap = new HashMap<>();
         if (code != 0) {
@@ -283,18 +284,6 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
             resultMap.put("message", jsonObject.getString("message"));
             return resultMap;
         }
-        JSONObject getData = jsonObject.getJSONObject("data");
-        if (null == getData) {
-            log.info("修改计划出价异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
-            resultMap.put("code", -1);
-            resultMap.put("message", jsonObject.getString("message"));
-            return resultMap;
-        }
-        JSONArray getAdIds = getData.getJSONArray("ad_ids");
-        if (null != getAdIds && !getAdIds.isEmpty()) {
-            //获取广告计划信息
-            getAdvertiserPlan(token, adIds, null, null);
-        }
         resultMap.put("code", 0);
         resultMap.put("message", "修改计划出价成功");
         return resultMap;
@@ -310,16 +299,16 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
 
-        JSONObject params=new JSONObject();
-        params.put("advertiser_id",advertiserId);
-        params.put("ad_ids",adIds);
+        JSONObject params = new JSONObject();
+        params.put("advertiser_id", advertiserId);
+        params.put("ad_ids", adIds);
         String result = HttpUtils.httpPostRequest(url, params, headers);
         JSONObject jsonObject = JSONObject.parseObject(result);
         int code = jsonObject.getInteger("code");
-        if(code!=0){
+        if (code != 0) {
             log.info("获取计划审核建议接口异常==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             resultMap.put("code", -1);
-            resultMap.put("message",jsonObject.getString("message"));
+            resultMap.put("message", jsonObject.getString("message"));
             return resultMap;
         }
         resultMap.put("code", 0);
@@ -391,5 +380,26 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         return byteDanceAdvertisePlanMapper.selectWarningCpaBid(accountId, maxCapBid);
     }
 
+    private int getConvertIdByExternalAction(String externalAction){
+        int result=0;
+        switch (externalAction) {
+            case "AD_CONVERT_TYPE_DOWNLOAD_FINISH":
+                result = 4;
+                break;
+            case "AD_CONVERT_TYPE_BUTTON":
+                result = 5;
+                break;
+            case "AD_CONVERT_TYPE_DOWNLOAD_START":
+                result = 9;
+                break;
+            case "AD_CONVERT_TYPE_INSTALL_FINISH":
+                result = 15;
+                break;
+            case "AD_CONVERT_TYPE_REDIRECT":
+                result = 95;
+                break;
+        }
+        return result;
+    }
 
 }

+ 2 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/tool/constants/QueryToolUrlConstant.java

@@ -35,4 +35,6 @@ public class QueryToolUrlConstant {
     //查询门店活动
     public static final String ADVERTISER_STORE_PACK="https://ad.oceanengine.com/open_api/2/tools/advertiser_store/search_pack/";
 
+    //【新】查询计划可用转化id
+    public static final String AD_CONVERT_QUERY="https://ad.oceanengine.com/open_api/2/tools/ad_convert/query/";
 }

+ 33 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/tool/controller/ByteDanceQueryToolController.java

@@ -1,12 +1,44 @@
 package cn.com.ctop.toutiao.modules.tool.controller;
 
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.tool.service.IByteDanceConvertToolService;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Map;
+
 @Slf4j
 @RestController
-@RequestMapping("/ctop/audiencePackage")
+@RequestMapping("/ctop/queryTool")
 public class ByteDanceQueryToolController {
 
+    @Autowired
+    private IByteDanceConvertToolService byteDanceConvertToolService;
+
+    @Autowired
+    ICtopOauthTokenService ctopOauthTokenService;
+
+    /**
+     *  查询转化目标接口
+     */
+    @PostMapping(value="/queryConvert")
+    public Result<Map<String,Object>> queryConvertResult(Long accountId, String landingType, String appType,
+                                                                String downloadType,String externalUrl,String toutiaoPackage,
+                                                                String downloadUrl){
+
+        Result<Map<String,Object>> result=new Result<>();
+        Map<String, Object> convertQueryMap = byteDanceConvertToolService.queryAdConvert(ctopOauthTokenService.getTokenByAccountId(accountId), accountId,
+                landingType, appType, downloadType, externalUrl, toutiaoPackage, downloadUrl);
+        if(!convertQueryMap.get("code").equals(0)){
+            result.error500("查询转化目标结果失败");
+            return result;
+        }
+        result.setSuccess(true);
+        result.setResult(convertQueryMap);
+        return result;
+    }
 }