Przeglądaj źródła

头条批量合代码

jiequan.bi 4 lat temu
rodzic
commit
b3cec00642

+ 26 - 0
jeecg-boot-module-system/pom.xml

@@ -151,6 +151,32 @@
             <artifactId>pagehelper</artifactId>
             <version>5.1.11</version>
         </dependency>
+        <!--drools规则引擎-->
+        <dependency>
+            <groupId>org.drools</groupId>
+            <artifactId>drools-core</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.drools</groupId>
+            <artifactId>drools-compiler</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.drools</groupId>
+            <artifactId>drools-templates</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.kie</groupId>
+            <artifactId>kie-api</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.kie</groupId>
+            <artifactId>kie-spring</artifactId>
+            <version>7.6.0.Final</version>
+        </dependency>
     </dependencies>
 
     <dependencyManagement>

+ 1 - 1
jeecg-boot-module-system/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: @activatedProperties@
+    active: test
   application:
     name: system-web
 #分页pageHelper

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

@@ -1,9 +1,11 @@
 package cn.com.ctop.toutiao.modules.material.controller;
 
+import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.utils.StringUtils;
 import cn.com.ctop.toutiao.modules.material.entity.ByteDanceAdvertisePlan;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertisePlanService;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -43,18 +45,22 @@ public class ByteDanceAdvertisePlanController {
                                                                @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                                HttpServletRequest req) {
         Result<IPage<ByteDanceAdvertisePlan>> result = new Result<>();
-        if(!accountId.isEmpty()){
+        if (!accountId.isEmpty()) {
             byteDanceAdvertisePlan.setAccountId(accountId);
         }
+        if(byteDanceAdvertisePlan.getToutiaoStatus()!=null){
+            String toutiaoStatus="AD_STATUS"+byteDanceAdvertisePlan.getToutiaoStatus();
+            byteDanceAdvertisePlan.setToutiaoStatus(toutiaoStatus);
+        }
         QueryWrapper<ByteDanceAdvertisePlan> queryWrapper = QueryGenerator.initQueryWrapper(byteDanceAdvertisePlan, req.getParameterMap());
         Page<ByteDanceAdvertisePlan> page = new Page<>(pageNo, pageSize);
         IPage<ByteDanceAdvertisePlan> pageList = byteDanceAdvertisePlanService.page(page, queryWrapper);
         //处理计划投放状态
-        if(!pageList.getRecords().isEmpty()){
-            pageList.getRecords().forEach(it->{
-                if(it.getToutiaoStatus().equals("AD_STATUS_DELIVERY_OK")){
+        if (!pageList.getRecords().isEmpty()) {
+            pageList.getRecords().forEach(it -> {
+                if (it.getToutiaoStatus().equals("AD_STATUS_DELIVERY_OK")) {
                     it.setStatus(true);
-                }else{
+                } else {
                     it.setStatus(false);
                 }
             });
@@ -68,25 +74,25 @@ public class ByteDanceAdvertisePlanController {
      * 添加
      */
     @PostMapping(value = "/add")
-        public Result<List<ByteDanceAdvertisePlan>> add(@RequestBody ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
+    public Result<List<ByteDanceAdvertisePlan>> add(@RequestBody ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
 
         Result<List<ByteDanceAdvertisePlan>> result = new Result<>();
-        List<String> names= (List) byteDanceAdvertisePlan.getNames();
+        List<String> names = (List) byteDanceAdvertisePlan.getNames();
         String landingType = byteDanceAdvertisePlan.getLandingType();
-        List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList=new ArrayList<>();
+        List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList = new ArrayList<>();
         try {
-            names.forEach(name->{
+            for (String name : names) {
                 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 {
+                if (advertiserPlan.get("code").equals(0)) {
+                    byteDanceAdvertisePlan.setId(((ByteDanceAdvertisePlan)advertiserPlan.get("data")).getId());
+                    byteDanceAdvertisePlanService.save((ByteDanceAdvertisePlan)advertiserPlan.get("data"));
+                    byteDanceAdvertisePlanList.add(byteDanceAdvertisePlanService.getById(((ByteDanceAdvertisePlan) advertiserPlan.get("data")).getId()));
+                } else {
                     result.setCode(-200);
                     result.setMessage(advertiserPlan.get("message").toString());
                 }
-            });
+            }
         } catch (Exception e) {
             log.error(e.getMessage(), e);
             result.error500("操作失败");
@@ -101,36 +107,77 @@ public class ByteDanceAdvertisePlanController {
     @PostMapping(value = "/edit")
     public Result<ByteDanceAdvertisePlan> edit(@RequestBody ByteDanceAdvertisePlan byteDanceAdvertisePlan) {
         Result<ByteDanceAdvertisePlan> result = new Result<>();
-        ByteDanceAdvertisePlan byteDanceAdvertisePlanEntity = byteDanceAdvertisePlanService.getById(byteDanceAdvertisePlan.getId());
-        if (byteDanceAdvertisePlanEntity == null) {
-            result.error500("未找到数据");
-        } else {
+        String landingType = byteDanceAdvertisePlan.getLandingType();
+        Map<String, Object> map = byteDanceAdvertisePlanService.updateAdvertiserPlan(ctopOauthTokenService.getTokenByAccountId(Long.valueOf(byteDanceAdvertisePlan.getAccountId())), landingType, byteDanceAdvertisePlan);
+        if(!map.get("code").equals(0)){
+            result.error500(map.get("message").toString());
+        }else {
             boolean ok = byteDanceAdvertisePlanService.updateById(byteDanceAdvertisePlan);
             if (ok) {
                 result.success("修改成功!");
-            }else {
+            } else {
                 result.error500("未知错误");
             }
         }
-
         return result;
     }
 
-    @PostMapping(value = "/batchEdit")
-    public Result<List<ByteDanceAdvertisePlan>> edit(@RequestBody List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList) {
+    @PostMapping(value = "/batchEdit/{operate}")
+    public Result<List<ByteDanceAdvertisePlan>> edit(@RequestBody List<ByteDanceAdvertisePlan> byteDanceAdvertisePlanList,
+                                                     @PathVariable String operate) {
         Result<List<ByteDanceAdvertisePlan>> result = new Result<>();
-        byteDanceAdvertisePlanList.forEach(it->{
-            ByteDanceAdvertisePlan byteDanceAdvertisePlanEntity = byteDanceAdvertisePlanService.getById(it.getId());
-            if (byteDanceAdvertisePlanEntity == null) {
-                result.error500("未找到数据");
-            } else {
-                boolean ok = byteDanceAdvertisePlanService.updateById(it);
-                if (ok) {
-                    result.success("修改成功!");
-                }else {
-                    result.error500("未知错误");
+        if (byteDanceAdvertisePlanList.isEmpty()) {
+            log.error("未选择数据");
+            result.error500("请选择数据");
+        }
+        CtopOauthToken token = ctopOauthTokenService.getTokenByAccountId(Long.valueOf(byteDanceAdvertisePlanList.get(0).getAccountId()));
+        try {
+            if ("status".equals(operate)) {
+                JSONArray adIds = new JSONArray();
+                String optStatus = byteDanceAdvertisePlanList.get(0).getOptStatus();
+                byteDanceAdvertisePlanList.forEach(it -> {
+                    adIds.add(it.getId());
+                });
+                Map<String, Object> map = byteDanceAdvertisePlanService.updateAdvertiserPlanStatus(token, adIds, optStatus);
+                if (!map.get("code").equals(0)) {
+                    result.error500(map.get("message").toString());
+                    return result;
+                }
+            } else if ("bid".equals(operate)) {
+                JSONArray adIds = new JSONArray();
+                JSONArray bids = new JSONArray();
+                byteDanceAdvertisePlanList.forEach(it -> {
+                    adIds.add(it.getId());
+                    bids.add(it.getBid());
+                });
+                Map<String, Object> map = byteDanceAdvertisePlanService.updateAdvertiserPlanBid(token, adIds, bids);
+                if (!map.get("code").equals(0)) {
+                    result.error500(map.get("message").toString());
+                    return result;
+                }
+            } else if ("budget".equals(operate)) {
+                JSONArray adIds = new JSONArray();
+                JSONArray budgets = new JSONArray();
+                byteDanceAdvertisePlanList.forEach(it -> {
+                    adIds.add(it.getId());
+                    budgets.add(it.getBudget());
+                });
+                Map<String, Object> map = byteDanceAdvertisePlanService.updateAdvertiserPlanBudget(token, adIds, budgets);
+                if (!map.get("code").equals(0)) {
+                    result.error500(map.get("message").toString());
+                    return result;
                 }
             }
+        } catch (Exception e) {
+            log.error("头条批量更新接口错误");
+        }
+        byteDanceAdvertisePlanList.forEach(it -> {
+            boolean ok = byteDanceAdvertisePlanService.updateById(it);
+            if (ok) {
+                result.success("修改成功!");
+            } else {
+                result.error500("未知错误");
+            }
         });
         result.setResult(byteDanceAdvertisePlanList);
         return result;

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

@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -61,7 +62,9 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         params.put("start_time", byteDanceAdvertisePlan.getStartTime());
         params.put("end_time", byteDanceAdvertisePlan.getEndTime());
         //广告投放时段
-        //params.put("schedule_time",byteDanceAdvertisePlan.getString("scheduleTime"));
+        if(!byteDanceAdvertisePlan.getScheduleTime().equals("")){
+            params.put("schedule_time",byteDanceAdvertisePlan.getScheduleTime());
+        }
         params.put("pricing", byteDanceAdvertisePlan.getPricing());
         params.put("bid", byteDanceAdvertisePlan.getBid());
         params.put("cpa_bid", byteDanceAdvertisePlan.getCpaBid());
@@ -71,7 +74,9 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
                 //查询必填参数convert_id
                 params.put("convert_id", byteDanceAdvertisePlan.getConvertId());
             }else{
-                params.put("convert_id",getConvertIdByExternalAction(byteDanceAdvertisePlan.getExternalAction()));
+                int convertId=getConvertIdByExternalAction(byteDanceAdvertisePlan.getExternalAction());
+                params.put("convert_id",convertId);
+                byteDanceAdvertisePlan.setConvertId((long) convertId);
             }
         }
         params.put("deep_bid_type", byteDanceAdvertisePlan.getDeepBidType());
@@ -130,7 +135,8 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         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"));
+            byteDanceAdvertisePlan.setId(jsonObject.getJSONObject("data").getLong("ad_id"));
+            resultMap.put("data",byteDanceAdvertisePlan);
         } else {
             log.error("广告计划创建失败==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
             resultMap.put("code",-200);
@@ -144,53 +150,70 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
 
         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("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")) {
+        //查询记录,获取修改时间等字段
+        List adId=new ArrayList();
+        adId.add(byteDanceAdvertisePlan.getId());
+        Map<String, Object> map = queryAdByAdId(token, Long.valueOf(byteDanceAdvertisePlan.getAccountId()), adId);
+        if(!map.get("code").equals(0)){
+            log.error("获取修改时间接口错误");
+        }else {
+            Object modifyTime = ((Map) ((JSONObject) map.get("data")).getJSONArray("list").get(0)).get("modify_time");
+            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", modifyTime);
+            params.put("budget", byteDanceAdvertisePlan.getBudget());
+            params.put("schedule_type", byteDanceAdvertisePlan.getScheduleType());
+            params.put("start_time", byteDanceAdvertisePlan.getStartTime());
+            params.put("end_time", byteDanceAdvertisePlan.getEndTime());
+            //广告投放时段
+            if(!byteDanceAdvertisePlan.getScheduleTime().equals("")){
+                params.put("schedule_time",byteDanceAdvertisePlan.getScheduleTime());
+            }
+            params.put("bid", byteDanceAdvertisePlan.getBid());
+            params.put("cpa_bid", byteDanceAdvertisePlan.getCpaBid());
+            params.put("flow_control_mode", byteDanceAdvertisePlan.getFlowControlMode());
             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("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());
-        //判断推广目的
-        if (landingType.equals("Link")) {
+            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("adjust_cpa", 0);
+            //暂时不需要定向包id
+            //params.put("audience_package_id",byteDanceAdvertisePlan.getLong("audiencePackageId"));
+        /*if(byteDanceAdvertisePlan.getUseOpenUrl().equals("YES")){
+            params.put("open_url", byteDanceAdvertisePlan.getOpenUrl());
+        }*/
+            //判断推广目的
+        /*if (landingType.equals("LINK")) {
             params.put("external_url", 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));
-        if (jsonObject.getInteger("code") != 0) {
-            log.error("广告计划创建失败==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
-            resultMap.put("code", -1);
-            resultMap.put("message", jsonObject.getString("message"));
-            return resultMap;
+            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_update"), params, headers));
+            if (jsonObject.getInteger("code") != 0) {
+                log.error("广告计划修改失败==》accountId:{},message:{}", token.getAccountId(), jsonObject.getString("message"));
+                resultMap.put("code", -1);
+                resultMap.put("message", jsonObject.getString("message"));
+                return resultMap;
+            }
+            resultMap.put("code", 0);
+            resultMap.put("message", "广告组状态修改成功");
         }
-        resultMap.put("code", 0);
-        resultMap.put("message", "广告组状态修改成功");
+
         return resultMap;
     }
 
@@ -200,7 +223,17 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", "application/json");
         headers.put("Access-Token", token.getAccessToken());
-
+        switch (optStatus) {
+            case "AD_STATUS_DISABLE":
+                optStatus = "disable";
+                break;
+            case "AD_STATUS_ENABLE":
+                optStatus = "enable";
+                break;
+            case "AD_STATUS_DELETE":
+                optStatus = "delete";
+                break;
+        }
         JSONObject params = new JSONObject();
         params.put("advertiser_id", token.getAccountId());
         params.put("ad_ids", adIds.toJSONString());
@@ -225,8 +258,8 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         if (adIds.size() > 0) {
             for (int i = 0; i < adIds.size(); i++) {
                 JSONObject object = new JSONObject();
-                Long adId = (Long)adIds.get(i);
-                Long budget = (Long)budgets.get(i);
+                Long adId = Long.valueOf(adIds.get(i).toString());
+                Long budget = Long.valueOf(budgets.get(i).toString());
                 object.put("ad_id", adId);
                 object.put("budget", budget);
                 data.add(object);
@@ -260,8 +293,8 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         if (adIds.size() > 0) {
             for (int i = 0; i < adIds.size(); i++) {
                 JSONObject object = new JSONObject();
-                Long adId = (Long)adIds.get(i);
-                Long bid = (Long)bids.get(i);
+                Long adId = Long.valueOf(adIds.get(i).toString());
+                Long bid = Long.valueOf(bids.get(i).toString());
                 object.put("ad_id", adId);
                 object.put("bid", bid);
                 data.add(object);
@@ -380,6 +413,30 @@ public class ByteDanceAdvertisePlanServiceImpl extends ServiceImpl<ByteDanceAdve
         return byteDanceAdvertisePlanMapper.selectWarningCpaBid(accountId, maxCapBid);
     }
 
+    private Map<String, Object> queryAdByAdId(CtopOauthToken token, Long accountId, List adId){
+
+        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", accountId);
+        Map<String, Object> filtering = new HashMap<>();
+        filtering.put("ids",adId);
+        params.put("filtering", filtering);
+        JSONObject jsonObject = JSONObject.parseObject(HttpUtils.httpGetRequest(PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_get"), headers, params));
+        Map<String, Object> resultMap = new HashMap<>();
+        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",-200);
+            resultMap.put("message", jsonObject.getString("message"));
+        }
+        return resultMap;
+    }
+
     private int getConvertIdByExternalAction(String externalAction){
         int result=0;
         switch (externalAction) {

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceAccountReportServiceImpl.java

@@ -4,7 +4,7 @@ import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.toutiao.modules.report.DTO.ByteDanceReportAccountDailyDTO;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceAccountReportMapper;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceAccountReportService;
-import cn.com.ctop.toutiao.modules.utils.LinkUtils;
+import cn.com.ctop.toutiao.modules.report.utils.LinkUtils;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceHomepageReportServiceImpl.java

@@ -2,7 +2,7 @@ package cn.com.ctop.toutiao.modules.report.service.impl;
 
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceHomepageMapper;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceHomepageReportService;
-import cn.com.ctop.toutiao.modules.utils.LinkUtils;
+import cn.com.ctop.toutiao.modules.report.utils.LinkUtils;
 import com.alibaba.fastjson.JSONObject;
 import org.jeecg.common.constant.SystemDateConstant;
 import org.jeecg.common.util.DateUtils;

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/utils/LinkUtils.java

@@ -1,4 +1,4 @@
-package cn.com.ctop.toutiao.modules.utils;
+package cn.com.ctop.toutiao.modules.report.utils;
 
 import com.alibaba.fastjson.JSONObject;
 

+ 1 - 1
module-toutiao/src/main/resources/bytedance_config.properties

@@ -16,7 +16,7 @@ bytedance_v2_advertiser_info=/2/advertiser/public_info/
 bytedance_v2_ad_get=/2/ad/get/
 bytedance_v2_advertiser_fund_daily_stat=/2/advertiser/fund/daily_stat/
 bytedance_v2_ad_create=/2/ad/create/
-bytedance_v2_ad_update=2/ad/update/
+bytedance_v2_ad_update=/2/ad/update/
 bytedance_v2_ad_update_status=/2/ad/update/status/
 bytedance_v2_ad_update_bid=/2/ad/update/bid/
 bytedance_v2_ad_update_budget=/2/ad/update/budget/