Procházet zdrojové kódy

Merge branch 'V2.0.1' into test

zhaoxian před 2 roky
rodič
revize
0bc43585d3
21 změnil soubory, kde provedl 3872 přidání a 3 odebrání
  1. 14 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java
  2. 15 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCampaignLevelOperationRecord.java
  3. 15 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCreativeLevelOperationRecord.java
  4. 17 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouUnitLevelOperationRecord.java
  5. 119 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/controller/V3KuaishouAccountAutoDoController.java
  6. 284 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/controller/V3KuaishouAccountAutoStrategyController.java
  7. 181 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/controller/V3KuaishouAccountAutoTargetController.java
  8. 556 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/entity/V3KuaishouAccountAutoStrategy.java
  9. 271 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/entity/V3KuaishouAccountAutoTarget.java
  10. 21 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/mapper/V3KuaishouAccountAutoStrategyMapper.java
  11. 21 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/mapper/V3KuaishouAccountAutoTargetMapper.java
  12. 43 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/mapper/xml/V3KuaishouAccountAutoStrategyMapper.xml
  13. 25 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/mapper/xml/V3KuaishouAccountAutoTargetMapper.xml
  14. 23 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/V3KuaishouAccountAutoDoService.java
  15. 17 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/V3KuaishouAccountAutoStrategyService.java
  16. 27 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/V3KuaishouAccountAutoTargetService.java
  17. 13 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/V3KuaishouAccountDetailsService.java
  18. 1997 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/impl/V3KuaishouAccountAutoDoServiceImpl.java
  19. 24 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/impl/V3KuaishouAccountAutoStrategyServiceImpl.java
  20. 84 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/impl/V3KuaishouAccountAutoTargetServiceImpl.java
  21. 105 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/impl/V3KuaishouAccountDetailsServiceImpl.java

+ 14 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/utils/KuaishouInterfaceConstant.java

@@ -367,14 +367,26 @@ public class KuaishouInterfaceConstant {
      * 查询广告组的加速探索报表接口
      */
     public static final String QUERY_SPEED_EXPLORE_REPORT = "/rest/openapi/v1/report/speed_explore";
-  /**
+    /**
      * 辅助探索
      */
     public static final String AD_UNIT_EXPLORE_SUPPORT = "/rest/openapi/v1/ad_unit/explore/support";
 
-     /**
+    /**
      * 获取试玩列表
      */
     public static final String PLAYABLE_LIST = "/rest/openapi/gw/dsp/v1/playable/list";
 
+
+    /**
+     * 广告创建接口(包括广告计划、广告组、创意(自定义创意、程序化创意)的三层广告创编接口)
+     */
+    public static final String V3_CREATE_CASCADE_ALL = "/rest/openapi/gw/dsp/v3/ad/createCascadeAll";
+
+    /**
+     * 广告创建接口(广告组和广告创意)
+     */
+    public static final String V3_CREATE_UNIT_AND_CREATIVE = "/rest/openapi/gw/dsp/v3/ad/createUnitAndCreative";
+
+
 }

+ 15 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCampaignLevelOperationRecord.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.ai.entity;
 
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -106,6 +107,20 @@ public class AiKuaishouCampaignLevelOperationRecord {
         this.aiStrategyUuid = campaignUuid;
         this.createType = 3;
     }
+    public AiKuaishouCampaignLevelOperationRecord(V3KuaishouAccountAutoStrategy strategy, Long campaignId, Integer code, String message, String campaignName, String campaignUuid) {
+        this.accountId = strategy.getAccountId();
+        this.dayBudget = strategy.getCampaignDayBudget().longValue();
+        this.dayBudgetSchedule = strategy.getCampaignDayBudgetSchedule();
+        this.campaignType = strategy.getCampaignType();
+        this.campaignId = campaignId;
+        this.status = code;
+        this.message = message;
+        this.operationType = 1;
+        this.createTime = new Date();
+        this.campaignName = campaignName;
+        this.aiStrategyUuid = campaignUuid;
+        this.createType = 3;
+    }
 
     public AiKuaishouCampaignLevelOperationRecord(KuaishouProjectStrategy strategy, Long campaignId, Integer code, String message) {
         this.accountId = strategy.getAccountId();

+ 15 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouCreativeLevelOperationRecord.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.ai.entity;
 
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -162,7 +163,20 @@ public class AiKuaishouCreativeLevelOperationRecord {
 
     }
 
-    public AiKuaishouCreativeLevelOperationRecord(AiKuaishouAccountAutoStrategy strategy, Integer creativeCode, JSONObject creativeParams, String creativeMessage,Long newCampaignId, Long unitId, String uuid) {
+    public AiKuaishouCreativeLevelOperationRecord(AiKuaishouAccountAutoStrategy strategy, Integer creativeCode, JSONObject creativeParams, String creativeMessage, Long newCampaignId, Long unitId, String uuid) {
+        BeanUtils.copyProperties(strategy, this);
+        this.status = creativeCode;
+        this.description = creativeParams.getString("description");
+        this.photoId = creativeParams.getString("photo_id");
+        this.message = creativeMessage;
+        this.campaignId = newCampaignId;
+        this.unitId = unitId;
+        this.aiStrategyUuid = uuid;
+        this.createTime = new Date();
+        this.createType = 3;
+    }
+
+    public AiKuaishouCreativeLevelOperationRecord(V3KuaishouAccountAutoStrategy strategy, Integer creativeCode, JSONObject creativeParams, String creativeMessage, Long newCampaignId, Long unitId, String uuid) {
         BeanUtils.copyProperties(strategy, this);
         this.status = creativeCode;
         this.description = creativeParams.getString("description");

+ 17 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouUnitLevelOperationRecord.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.ai.entity;
 
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -349,4 +350,20 @@ public class AiKuaishouUnitLevelOperationRecord {
         this.channelId = channelId;
         this.autoTargetId = autoTargetId;
     }
+
+    public AiKuaishouUnitLevelOperationRecord(V3KuaishouAccountAutoStrategy strategy, JSONObject unitParams, Integer unitCode, String unitMessage, String strategyUuid, Long autoTargetId, Long channelId) {
+        BeanUtils.copyProperties(strategy, this);
+        this.groupName = unitParams.getString("unit_name");
+        this.campaignId = unitParams.getLong("campaign_id");
+        this.cpaBid = unitParams.getInteger("cpa_bid");
+        this.bid = unitParams.getInteger("bid");
+        this.deepConversionBid = unitParams.getInteger("deep_conversion_bid");
+        this.createTime = new Date();
+        this.status = unitCode;
+        this.message = unitMessage;
+        this.aiStrategyUuid = strategyUuid;
+        this.createType = 3;
+        this.channelId = channelId;
+        this.autoTargetId = autoTargetId;
+    }
 }

+ 119 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/controller/V3KuaishouAccountAutoDoController.java

@@ -0,0 +1,119 @@
+package cn.com.ctop.kuaishou.modules.v3.controller;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAccountAutoDoService;
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy;
+import cn.com.ctop.kuaishou.modules.v3.service.V3KuaishouAccountAutoDoService;
+import cn.com.ctop.kuaishou.modules.v3.service.V3KuaishouAccountAutoStrategyService;
+import com.alibaba.fastjson.JSONObject;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Slf4j
+@Api(tags = "快手-自动投放——重构")
+@RestController
+@RequestMapping("/auto/v3create")
+public class V3KuaishouAccountAutoDoController {
+    @Autowired
+    private V3KuaishouAccountAutoDoService autoDoService;
+    @Autowired
+    private V3KuaishouAccountAutoStrategyService strategyService;
+    static ExecutorService customService = Executors.newFixedThreadPool(8);
+    static ExecutorService programService = Executors.newFixedThreadPool(8);
+
+    /**
+     * 每日补充创建创意 、频率 每天22点05分钟执行1次
+     */
+    @GetMapping(value = "/supplementTodayCreatives")
+    public JSONObject supplementTodayCreatives(String id) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(id)) {
+                throw new Exception("主键id不能为空");
+            }
+            V3KuaishouAccountAutoStrategy strategy = strategyService.getById(id);
+            if (Check.isNull(strategy)) {
+                throw new Exception("根据id获取详细信息为空");
+            }
+            Boolean unitOverrun = autoDoService.getUnitOverrun(strategy.getAccountId());
+            if (unitOverrun) {
+                log.error("****** 广告组创建超限,accountId:{}", strategy.getAccountId());
+                throw new Exception("今日广告组创建已超限");
+            }
+            customService.submit(() -> autoDoService.supplementTodayCreatives(strategy));
+            returnJson.put("code", 0);
+            returnJson.put("message", "异步创建中");
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+    /**
+     * 创建自定义非上新广告创意 、频率 60分钟/次
+     */
+    @GetMapping(value = "/createCustomCreative")
+    public JSONObject createCustomCreative(String id) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(id)) {
+                throw new Exception("主键id不能为空");
+            }
+            V3KuaishouAccountAutoStrategy strategy = strategyService.getById(id);
+            if (Check.isNull(strategy)) {
+                throw new Exception("根据id获取详细信息为空");
+            }
+            Boolean unitOverrun = autoDoService.getUnitOverrun(strategy.getAccountId());
+            if (unitOverrun) {
+                log.error("****** 广告组创建超限,accountId:{}", strategy.getAccountId());
+                throw new Exception("今日广告组创建已超限");
+            }
+            customService.submit(() -> autoDoService.createCustomCreative(strategy));
+            returnJson.put("code", 0);
+            returnJson.put("message", "异步创建中");
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+
+    }
+
+    /**
+     * 创建程序化广告创意 频率 60分钟/次
+     */
+    @GetMapping(value = "/createProgramCreative")
+    public JSONObject createProgramCreative(String id) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(id)) {
+                throw new Exception("主键id不能为空");
+            }
+            V3KuaishouAccountAutoStrategy strategy = strategyService.getById(id);
+            if (Check.isNull(strategy)) {
+                throw new Exception("根据id获取详细信息为空");
+            }
+            Boolean unitOverrun = autoDoService.getUnitOverrun(strategy.getAccountId());
+            if (unitOverrun) {
+                log.error("组创建超限,accountId:{}", strategy.getAccountId());
+                throw new Exception("今日组创建已超限");
+            }
+            programService.submit(() -> autoDoService.createProgramCreative(strategy));
+            returnJson.put("code", 0);
+            returnJson.put("message", "异步创建中");
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+
+    }
+}

+ 284 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/controller/V3KuaishouAccountAutoStrategyController.java

@@ -0,0 +1,284 @@
+package cn.com.ctop.kuaishou.modules.v3.controller;
+
+import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
+import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouVideoRelateCreativesService;
+import cn.com.ctop.kuaishou.modules.document.service.DocumentLibraryService;
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy;
+import cn.com.ctop.kuaishou.modules.v3.service.V3KuaishouAccountAutoStrategyService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.common.util.RedisUtil;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.system.service.ISysRoleService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 自动投放v3-账户策略表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-10-24
+ */
+@Slf4j
+@Api(tags = "自动投放v3-账户策略表")
+@RestController
+@RequestMapping("/auto/v3KuaishouAccountAutoStrategy")
+public class V3KuaishouAccountAutoStrategyController {
+    @Autowired
+    private V3KuaishouAccountAutoStrategyService v3KuaishouAccountAutoStrategyService;
+
+    @Autowired
+    private ISysRoleService sysRoleService;
+
+    @Autowired
+    private IUserAllocationService allocationService;
+
+    @Autowired
+    private IKuaishouVideoRelateCreativesService kuaishouVideoRelateCreativesService;
+
+    @Autowired
+    private DocumentLibraryService documentLibraryService;
+
+    @Autowired
+    private IAiKuaishouAdvertiserStrategyService aiKuaishouAdvertiserStrategyService;
+
+    @Autowired
+    private RedisUtil redisUtil;
+
+    /**
+     * 分页列表查询
+     *
+     * @param V3KuaishouAccountAutoStrategy
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @GetMapping(value = "/list")
+    public Result<PageInfo<V3KuaishouAccountAutoStrategy>> queryPageList(V3KuaishouAccountAutoStrategy strategy,
+                                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                                         HttpServletRequest req) {
+        Result<PageInfo<V3KuaishouAccountAutoStrategy>> result = new Result<>();
+        if (Check.isNull(strategy.getUserId())) {
+            result.setSuccess(false);
+            result.setMessage("请选择用户");
+            return result;
+        }
+        String userId = strategy.getUserId();
+        String roleCode = sysRoleService.getRoleCodeByUserId(userId);
+        List<String> userIds = new ArrayList<>();
+        if ("CompanyManager".equals(roleCode)) {
+            userIds = sysRoleService.getCompanyUsers(roleCode, userId);
+            strategy.setUserIds(userIds);
+        } else if ("bytedanceDirector".equals(roleCode)) {
+            userIds = sysRoleService.getCompanyUsers(roleCode, userId);
+            strategy.setUserIds(userIds);
+        } else if ("kuaishouDirector".equals(roleCode)) {
+            userIds = sysRoleService.getCompanyUsers(roleCode, userId);
+            strategy.setUserIds(userIds);
+        } else if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)) {
+            strategy.setUserIds(null);
+        } else {
+            userIds.add(userId);
+            strategy.setUserIds(userIds);
+        }
+        PageHelper.startPage(pageNo, pageSize);
+        PageInfo<V3KuaishouAccountAutoStrategy> pageInfo = v3KuaishouAccountAutoStrategyService.queryList(strategy);
+        List<V3KuaishouAccountAutoStrategy> list = pageInfo.getList();
+        List<V3KuaishouAccountAutoStrategy> setData = new ArrayList<>();
+        String date = DateUtils.formatDate(new Date());
+        if (null != list && !list.isEmpty()) {
+            list.forEach(record -> {
+                Long accountId = record.getAccountId();
+                UserAllocation allocation = allocationService.getByAccountId(accountId);
+                if (null != allocation) {
+                    record.setAuthName(allocation.getAuthName());
+                }
+                String customkey = date + "_v3_custom_cnt_" + accountId;
+                Integer customUnitCnt = (Integer) redisUtil.get(customkey);
+                customUnitCnt = Check.isNull(customUnitCnt) ? 0 : customUnitCnt;
+                record.setCustomCreatedUnitCnt(customUnitCnt);
+                String programkey = date + "_v3_program_cnt_" + accountId;
+                Integer programUnitCnt = (Integer) redisUtil.get(programkey);
+                programUnitCnt = Check.isNull(programUnitCnt) ? 0 : programUnitCnt;
+                record.setProgramCreatedUnitCnt(programUnitCnt);
+            });
+        }
+        pageInfo.setList(list);
+        result.setSuccess(true);
+        result.setResult(pageInfo);
+        return result;
+    }
+
+    /**
+     * 添加
+     *
+     * @param V3KuaishouAccountAutoStrategy
+     * @return
+     */
+    @ApiOperation(value = "自动投放重构-账户策略表-添加", notes = "自动投放重构-账户策略表-添加")
+    @PostMapping(value = "/add")
+    public Result<V3KuaishouAccountAutoStrategy> add(@RequestBody V3KuaishouAccountAutoStrategy autoStrategy) {
+        Result<V3KuaishouAccountAutoStrategy> result = new Result<>();
+        try {
+            Long accountId = autoStrategy.getAccountId();
+            QueryWrapper<V3KuaishouAccountAutoStrategy> queryWrapper = new QueryWrapper();
+            queryWrapper.eq("account_id", accountId).last("limit 1");
+            V3KuaishouAccountAutoStrategy one = v3KuaishouAccountAutoStrategyService.getOne(queryWrapper);
+            if (null != one) {
+                result.error500("该账户配置信息已经被创建");
+                return result;
+            }
+            UserAllocation allocation = allocationService.getByAccountId(accountId);
+            if (null != allocation) {
+                autoStrategy.setUserId(allocation.getUserId());
+            }
+            Integer singleAppId = autoStrategy.getSingleAppid();
+            if (null != singleAppId && singleAppId == 1) {
+                if (autoStrategy.getCampaignType() == 2 || autoStrategy.getCampaignType() == 7) {
+                    Long appId = Long.valueOf(JSONArray.parseArray(autoStrategy.getAppIdArray()).getString(0));
+                    autoStrategy.setAppId(appId);
+                }
+            }
+            v3KuaishouAccountAutoStrategyService.save(autoStrategy);
+            //添加广告语到文案库
+            documentLibraryService.insertBatch(autoStrategy.getDescription(), accountId);
+            Thread thread = new Thread() {
+                @Override
+                public void run() {
+                    kuaishouVideoRelateCreativesService.videoRelateCreatives(autoStrategy.getAccountId());
+                }
+            };
+            thread.start();
+            result.success("添加成功!");
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            result.error500("操作失败");
+        }
+        return result;
+    }
+
+
+    /**
+     * 编辑
+     *
+     * @param v3KuaishouAccountAutoStrategy
+     * @return
+     */
+    @ApiOperation(value = "自动投放v3-账户策略表-编辑", notes = "自动投放v3-账户策略表-编辑")
+    @PostMapping(value = "/edit")
+    public Result<V3KuaishouAccountAutoStrategy> edit(@RequestBody V3KuaishouAccountAutoStrategy v3KuaishouAccountAutoStrategy) {
+        Result<V3KuaishouAccountAutoStrategy> result = new Result<V3KuaishouAccountAutoStrategy>();
+        V3KuaishouAccountAutoStrategy v3KuaishouAccountAutoStrategyEntity = v3KuaishouAccountAutoStrategyService.getById(v3KuaishouAccountAutoStrategy.getId());
+        if (v3KuaishouAccountAutoStrategyEntity == null) {
+            result.error500("未找到对应实体");
+        } else {
+            boolean ok = v3KuaishouAccountAutoStrategyService.updateById(v3KuaishouAccountAutoStrategy);
+            if (ok) {
+                result.success("修改成功!");
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "自动投放v3-账户策略表-通过id删除", notes = "自动投放v3-账户策略表-通过id删除")
+    @GetMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id") String id) {
+        try {
+            v3KuaishouAccountAutoStrategyService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @ApiOperation(value = "自动投放v3-账户策略表-批量删除", notes = "自动投放v3-账户策略表-批量删除")
+    @GetMapping(value = "/deleteBatch")
+    public Result<V3KuaishouAccountAutoStrategy> deleteBatch(@RequestParam(name = "ids") String ids) {
+        Result<V3KuaishouAccountAutoStrategy> result = new Result<>();
+        if (ids == null || "".equals(ids.trim())) {
+            result.error500("参数不识别!");
+        } else {
+            this.v3KuaishouAccountAutoStrategyService.removeByIds(Arrays.asList(ids.split(",")));
+            result.success("删除成功!");
+        }
+        return result;
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "自动投放v3-账户策略表-通过id查询", notes = "自动投放v3-账户策略表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<V3KuaishouAccountAutoStrategy> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<V3KuaishouAccountAutoStrategy> result = new Result<>();
+        V3KuaishouAccountAutoStrategy v3KuaishouAccountAutoStrategy = v3KuaishouAccountAutoStrategyService.getById(id);
+        if (v3KuaishouAccountAutoStrategy == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(v3KuaishouAccountAutoStrategy);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+
+}

+ 181 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/controller/V3KuaishouAccountAutoTargetController.java

@@ -0,0 +1,181 @@
+package cn.com.ctop.kuaishou.modules.v3.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoTarget;
+import cn.com.ctop.kuaishou.modules.v3.service.V3KuaishouAccountAutoTargetService;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 自动投放-v3-本地定向表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-10-31
+ */
+@Slf4j
+@Api(tags = "自动投放-v3-本地定向表")
+@RestController
+@RequestMapping("/auto/v3KuaishouAccountAutoTarget")
+public class V3KuaishouAccountAutoTargetController {
+    @Autowired
+    private V3KuaishouAccountAutoTargetService v3KuaishouAccountAutoTargetService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param v3KuaishouAccountAutoTarget
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    @ApiOperation(value = "自动投放-v3-本地定向表-分页列表查询", notes = "自动投放-v3-本地定向表-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<Object> queryPageList(Long accountId, String targetName,Integer platform, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+																	@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
+		try {
+			if (Check.isNull(accountId)||Check.isNull(platform)) {
+				return Result.error("缺少参数");
+			}
+			return v3KuaishouAccountAutoTargetService.queryPageList(accountId, targetName,platform, pageNo, pageSize);
+		} catch (Exception e) {
+			log.error("查询异常,", e.getMessage());
+			e.printStackTrace();
+		}
+		return Result.error("查询失败");
+    }
+	/**
+	 * 创建定向包
+	 *
+	 * @param
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<Object> add(@RequestBody JSONObject requestJson) {
+		try {
+			if (Check.isNull(requestJson.getString("targetName"))) {
+				return Result.error("定向包名称为必传项");
+			}
+			Long accountId = requestJson.getLong("accountId");
+			if (Check.isNull(accountId)) {
+				return Result.error("请选择账户id");
+			}
+			return v3KuaishouAccountAutoTargetService.addV3LocalTarget(requestJson);
+		} catch (Exception e) {
+			log.error("创建定向包失败", e);
+			return Result.error("创建失败" + e.getMessage());
+		}
+	}
+
+	/**
+	 * 修改定向包
+	 *
+	 * @param
+	 * @return
+	 */
+	@PostMapping(value = "/edit")
+	public Result<Object> edit(@RequestBody JSONObject requestJson) {
+		try {
+			if (Check.isNull(requestJson.getString("id"))) {
+				return Result.error("请选择定向包");
+			}
+			V3KuaishouAccountAutoTarget target = v3KuaishouAccountAutoTargetService.getById(requestJson.getString("id"));
+			if (target == null) {
+				return Result.ok("修改失败,未查到对应定向包");
+			}
+			return v3KuaishouAccountAutoTargetService.updateV3LocalTarget(requestJson);
+		} catch (Exception e) {
+			return Result.error("修改异常");
+		}
+	}
+
+	@PostMapping(value = "/getV3AutoTargetByIds")
+	public Result<Object> getAutoTargetByIds(@RequestBody JSONObject data) {
+		try {
+			JSONArray ids = data.getJSONArray("ids");
+			if (Check.isNull(ids)) {
+				return Result.error("缺少参数");
+			}
+			List<String> list = JSONObject.parseObject(JSONObject.toJSONString(ids), List.class);
+			if (Check.isNull(list)) {
+				return Result.error("缺少参数");
+			}
+			List<V3KuaishouAccountAutoTarget> targets = v3KuaishouAccountAutoTargetService.getAutoTargetByIds(list);
+			return Result.ok(targets);
+		} catch (Exception e) {
+			log.error("查询异常,", e);
+			return Result.error("查询失败," + e.getMessage());
+		}
+	}
+
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "自动投放-v3-本地定向表-通过id删除", notes = "自动投放-v3-本地定向表-通过id删除")
+    @GetMapping(value = "/delete")
+    public Result<?> delete(@RequestParam(name = "id") String id) {
+        try {
+            v3KuaishouAccountAutoTargetService.removeById(id);
+        } catch (Exception e) {
+            log.error("删除失败", e.getMessage());
+            return Result.error("删除失败!");
+        }
+        return Result.ok("删除成功!");
+    }
+
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "自动投放-v3-本地定向表-通过id查询", notes = "自动投放-v3-本地定向表-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<V3KuaishouAccountAutoTarget> queryById(@RequestParam(name = "id", required = true) String id) {
+        Result<V3KuaishouAccountAutoTarget> result = new Result<>();
+        V3KuaishouAccountAutoTarget v3KuaishouAccountAutoTarget = v3KuaishouAccountAutoTargetService.getById(id);
+        if (v3KuaishouAccountAutoTarget == null) {
+            result.error500("未找到对应实体");
+        } else {
+            result.setResult(v3KuaishouAccountAutoTarget);
+            result.setSuccess(true);
+        }
+        return result;
+    }
+}

+ 556 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/entity/V3KuaishouAccountAutoStrategy.java

@@ -0,0 +1,556 @@
+package cn.com.ctop.kuaishou.modules.v3.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 自动投放v3-账户策略表
+ *
+ * @author jeecg-boot
+ * @version V1.0
+ * @date 2022-10-24
+ */
+@Data
+@TableName("ctop_v3_kuaishou_account_auto_strategy")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "ctop_v3_kuaishou_account_auto_strategy对象", description = "自动投放v3-账户策略表")
+public class V3KuaishouAccountAutoStrategy {
+
+    /**
+     * 客户策略ID
+     */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "客户策略ID")
+    private Long id;
+    /**
+     * 账户ID
+     */
+    @Excel(name = "账户ID", width = 15)
+    @ApiModelProperty(value = "账户ID")
+    private Long accountId;
+    /**
+     * 策略状态 1-使用 0-停用
+     */
+    @Excel(name = "策略状态 1-使用 0-停用", width = 15)
+    @ApiModelProperty(value = "策略状态 1-使用 0-停用")
+    private Integer status;
+    /**
+     * 客户要求的计划名称规范
+     */
+    @Excel(name = "客户要求的计划名称规范", width = 15)
+    @ApiModelProperty(value = "客户要求的计划名称规范")
+    private String campaignName;
+    /**
+     * 计划状态: 1:投放 2:暂停
+     */
+    @Excel(name = "计划状态: 1:投放 2:暂停 ", width = 15)
+    @ApiModelProperty(value = "计划状态: 1:投放 2:暂停 ")
+    private Integer campaignStatus;
+    /**
+     * 计划类型2-应用下载;3-获取电商下单;4-推广品牌活动;5-收集营销线索;7-应用拉活;16-粉丝直播推广
+     */
+    @Excel(name = "计划类型2-应用下载;3-获取电商下单;4-推广品牌活动;5-收集营销线索;7-应用拉活;16-粉丝直播推广", width = 15)
+    @ApiModelProperty(value = "计划类型2-应用下载;3-获取电商下单;4-推广品牌活动;5-收集营销线索;7-应用拉活;16-粉丝直播推广")
+    private Integer campaignType;
+    /**
+     * 客户要求的广告组名称规范
+     */
+    @Excel(name = "客户要求的广告组名称规范", width = 15)
+    @ApiModelProperty(value = "客户要求的广告组名称规范")
+    private String groupName;
+
+    /**
+     * 定向模板id
+     */
+    @Excel(name = "定向模板id", width = 15)
+    @ApiModelProperty(value = "定向模板id")
+    private String templateId;
+    /**
+     * 广告类型		0:信息流广告;1:搜索广告
+     */
+    @Excel(name = "广告类型	0:信息流广告;1:搜索广告", width = 15)
+    @ApiModelProperty(value = "广告类型	0:信息流广告;1:搜索广告")
+    private Integer adType;
+    /**
+     * 投放策略 0:投放策略(默认);1:最大转化
+     */
+    @Excel(name = "投放策略 0:投放策略(默认);1:最大转化", width = 15)
+    @ApiModelProperty(value = "投放策略 0:投放策略(默认);1:最大转化")
+    private Integer campaignBidType;
+    /**
+     * 出价类型 2:CPC;10:OCPM;12:最大转化
+     */
+    @Excel(name = "出价类型 2:CPC;10:OCPM;12:最大转化", width = 15)
+    @ApiModelProperty(value = "出价类型 2:CPC;10:OCPM;12:最大转化")
+    private Integer unitBidType;
+    /**
+     * 优先从系统应用商店下载
+     */
+    @Excel(name = "优先从系统应用商店下载", width = 15)
+    @ApiModelProperty(value = "优先从系统应用商店下载")
+    private Integer useAppMarket;
+    /**
+     * 应用商店列表
+     */
+    @Excel(name = "应用商店列表", width = 15)
+    @ApiModelProperty(value = "应用商店列表")
+    private String appStore;
+    /**
+     * 出价
+     */
+    @Excel(name = "出价", width = 15)
+    @ApiModelProperty(value = "出价")
+    private String bid;
+    /**
+     * cpaBid出价
+     */
+    @Excel(name = "cpaBid出价", width = 15)
+    @ApiModelProperty(value = "cpaBid出价")
+    private String cpaBid;
+    /**
+     * 优化目标
+     */
+    @Excel(name = "优化目标", width = 15)
+    @ApiModelProperty(value = "优化目标")
+    private Integer ocpxActionType;
+    /**
+     * 深度转化目标
+     */
+    @Excel(name = "深度转化目标", width = 15)
+    @ApiModelProperty(value = "深度转化目标")
+    private Integer deepConversionType;
+    /**
+     * 付费ROI系数
+     */
+    @Excel(name = "付费ROI系数", width = 15)
+    @ApiModelProperty(value = "付费ROI系数")
+    private Float roiRatio;
+    /**
+     * 资源位置
+     */
+    @Excel(name = "资源位置", width = 15)
+    @ApiModelProperty(value = "资源位置")
+    private String sceneIds;
+    /**
+     * 创意制作方式 4-自定义 5-程序化创意 7-程序化创意2.0
+     */
+    @Excel(name = " 创意制作方式 4-自定义 5-程序化创意 7-程序化创意2.0", width = 15)
+    @ApiModelProperty(value = " 创意制作方式 4-自定义 5-程序化创意 7-程序化创意2.0")
+    private Integer unitType;
+    /**
+     * 投放开始时间
+     */
+    @Excel(name = "投放开始时间", width = 15)
+    @ApiModelProperty(value = "投放开始时间")
+    private String beginTime;
+    /**
+     * 投放结束时间
+     */
+    @Excel(name = "投放结束时间", width = 15)
+    @ApiModelProperty(value = "投放结束时间")
+    private String endTime;
+    /**
+     * 投放排期
+     * [[0,2],[],[5, 9],[],[],[],[]]
+     * 表示只在周一的0点和2点,周三的5点和9点进行投放。 注意如果传参为[],[],[],[],[],[],[]会被当成[]处理
+     */
+    @Excel(name = "投放时间段", width = 15)
+    @ApiModelProperty(value = "投放时间段")
+    private String scheduleTime;
+    /**
+     * 转化目标ID
+     */
+    @Excel(name = "转化目标ID", width = 15)
+    @ApiModelProperty(value = "转化目标ID")
+    private Integer convertId;
+    /**
+     * url类型
+     */
+    @Excel(name = "url类型", width = 15)
+    @ApiModelProperty(value = "url类型")
+    private Integer urlType;
+    /**
+     * url类型
+     */
+    @Excel(name = "url类型", width = 15)
+    @ApiModelProperty(value = "url类型")
+    private Integer webUriType;
+    /**
+     * 投放链接
+     */
+    @Excel(name = "投放链接", width = 15)
+    @ApiModelProperty(value = "投放链接")
+    private String url;
+    /**
+     * 调起链接
+     */
+    @Excel(name = "调起链接", width = 15)
+    @ApiModelProperty(value = "调起链接")
+    private String schemaUri;
+    /**
+     * 应用ID
+     */
+    @Excel(name = "应用ID", width = 15)
+    @ApiModelProperty(value = "应用ID")
+    private Long appId;
+    /**
+     * 创意展现方式 1-轮播  2-优选
+     */
+    @Excel(name = "创意展现方式 1-轮播  2-优选", width = 15)
+    @ApiModelProperty(value = "创意展现方式 1-轮播  2-优选")
+    private Integer showMode;
+    /**
+     * 投放方式 1-加速投放  2-平滑投放 3-优先低成本
+     */
+    @Excel(name = "投放方式 1-加速投放  2-平滑投放 3-优先低成本", width = 15)
+    @ApiModelProperty(value = "投放方式 1-加速投放  2-平滑投放 3-优先低成本")
+    private Integer speed;
+    /**
+     * 预约广告
+     */
+    @Excel(name = "预约广告", width = 15)
+    @ApiModelProperty(value = "预约广告")
+    private Integer siteType;
+    /**
+     * 游戏礼包码
+     */
+    @Excel(name = "游戏礼包码", width = 15)
+    @ApiModelProperty(value = "游戏礼包码")
+    private String giftData;
+    /**
+     * 是否使用落地页前置功能
+     */
+    @Excel(name = "是否使用落地页前置功能", width = 15)
+    @ApiModelProperty(value = "是否使用落地页前置功能")
+    private Integer videoLandingPage;
+    /**
+     * 定向类型 0:不限;1:智能定向
+     */
+    @Excel(name = "定向类型 0:不限;1:智能定向", width = 15)
+    @ApiModelProperty(value = "定向类型 0:不限;1:智能定向")
+    private Integer targetType;
+    /**
+     * 是否开启自动生成视频
+     */
+    @Excel(name = "是否开启自动生成视频", width = 15)
+    @ApiModelProperty(value = "是否开启自动生成视频")
+    private Integer autoCreatePhoto;
+    /**
+     * 创意名称
+     */
+    @Excel(name = "创意名称", width = 15)
+    @ApiModelProperty(value = "创意名称")
+    private String creativeName;
+    /**
+     * 行动号召按钮文案
+     */
+    @Excel(name = "行动号召按钮文案", width = 15)
+    @ApiModelProperty(value = "行动号召按钮文案")
+    private String actionBarText;
+    /**
+     * 广告语
+     */
+    @Excel(name = "广告语", width = 15)
+    @ApiModelProperty(value = "广告语")
+    private String description;
+    /**
+     * 便利贴创意短广告语
+     */
+    @Excel(name = "便利贴创意短广告语", width = 15)
+    @ApiModelProperty(value = "便利贴创意短广告语")
+    private String shortSlogan;
+    /**
+     * 封面广告语标题
+     */
+    @Excel(name = "封面广告语标题", width = 15)
+    @ApiModelProperty(value = "封面广告语标题")
+    private String stickerTitle;
+    /**
+     * 贴纸样式类型
+     */
+    @Excel(name = "贴纸样式类型", width = 15)
+    @ApiModelProperty(value = "贴纸样式类型")
+    private String overlayType;
+    /**
+     * 广告标签
+     */
+    @Excel(name = "广告标签", width = 15)
+    @ApiModelProperty(value = "广告标签")
+    private String exposeTag;
+    /**
+     * 广告标签2期
+     */
+    @Excel(name = "广告标签2期", width = 15)
+    @ApiModelProperty(value = "广告标签2期")
+    private String newExposeTag;
+    /**
+     * 安卓下载中间页ID
+     */
+    @Excel(name = "安卓下载中间页ID", width = 15)
+    @ApiModelProperty(value = "安卓下载中间页ID")
+    private String siteId;
+    /**
+     * 程序化落地页
+     */
+    @Excel(name = "程序化落地页", width = 15)
+    @ApiModelProperty(value = "程序化落地页")
+    private String groupId;
+    /**
+     * 第三方点击检测链接
+     */
+    @Excel(name = "第三方点击检测链接", width = 15)
+    @ApiModelProperty(value = "第三方点击检测链接")
+    private String clickTrackUrl;
+    /**
+     * 第三方开始播放监测链接
+     */
+    @Excel(name = "第三方开始播放监测链接", width = 15)
+    @ApiModelProperty(value = "第三方开始播放监测链接")
+    private String impressionUrl;
+    /**
+     * 第三方有效播放监测链接
+     */
+    @Excel(name = "第三方有效播放监测链接", width = 15)
+    @ApiModelProperty(value = "第三方有效播放监测链接")
+    private String adPhotoPlayedT3sUrl;
+    /**
+     * 第三方点击按钮监测链接
+     */
+    @Excel(name = "第三方点击按钮监测链接", width = 15)
+    @ApiModelProperty(value = "第三方点击按钮监测链接")
+    private String actionbarClickUrl;
+    /**
+     * 创意分类
+     */
+    @Excel(name = "创意分类", width = 15)
+    @ApiModelProperty(value = "创意分类")
+    private Integer creativeCategory;
+    /**
+     * 创意标签
+     */
+    @Excel(name = "创意标签", width = 15)
+    @ApiModelProperty(value = "创意标签")
+    private String creativeTag;
+    /**
+     * 物料关联的封面个数
+     */
+    private Integer imageCnt;
+    /**
+     * 组素材数
+     */
+    @Excel(name = "组素材数", width = 15)
+    @ApiModelProperty(value = "组素材数")
+    private Integer customCreativeCnt;
+    /**
+     * 程序化创意2.0-是否开启智能抽帧
+     */
+    @Excel(name = "程序化创意2.0-是否开启智能抽帧", width = 15)
+    @ApiModelProperty(value = "程序化创意2.0-是否开启智能抽帧")
+    private Integer smartCover;
+    /**
+     * 程序化创意2.0-是否开启素材挖掘
+     */
+    @Excel(name = "程序化创意2.0-是否开启素材挖掘", width = 15)
+    @ApiModelProperty(value = "程序化创意2.0-是否开启素材挖掘")
+    private Integer assetMining;
+    /**
+     * 单/多应用,1单应用,2多应用
+     */
+    @Excel(name = "单/多应用,1单应用,2多应用", width = 15)
+    @ApiModelProperty(value = "单/多应用,1单应用,2多应用")
+    private Integer singleAppid;
+    /**
+     * 应用ID列表
+     */
+    @Excel(name = "应用ID列表", width = 15)
+    @ApiModelProperty(value = "应用ID列表")
+    private String appIdArray;
+    /**
+     * 是否通用监测链接
+     */
+    @Excel(name = "是否通用监测链接", width = 15)
+    @ApiModelProperty(value = "是否通用监测链接")
+    private Integer generalTrack;
+    /**
+     * 深度转化出价
+     */
+    @Excel(name = "深度转化出价", width = 15)
+    @ApiModelProperty(value = "深度转化出价")
+    private String deepConversionBid;
+    /**
+     * 是否创建程序化创意
+     */
+    @Excel(name = "是否创建程序化创意", width = 15)
+    @ApiModelProperty(value = "是否创建程序化创意")
+    private Integer openProgramCreate;
+    /**
+     * 行为意向-系统优选,0关闭,1开启
+     */
+    @Excel(name = "行为意向-系统优选,0关闭,1开启", width = 15)
+    @ApiModelProperty(value = "行为意向-系统优选,0关闭,1开启")
+    private Integer intentionTarget;
+    /**
+     * 操作人
+     */
+    @Excel(name = "操作人", width = 15)
+    @ApiModelProperty(value = "操作人")
+    private String userId;
+    /**
+     * 素材来源 0:自产 1:素造
+     */
+    @Excel(name = "素材来源 0:自产 1:素造", width = 15)
+    @ApiModelProperty(value = "素材来源 0:自产 1:素造")
+    private Integer channelType;
+    /**
+     * 计划日预算
+     */
+    @Excel(name = "计划日预算", width = 15)
+    @ApiModelProperty(value = "计划日预算")
+    private Long campaignDayBudget;
+    /**
+     * 组日预算
+     */
+    @Excel(name = "组日预算", width = 15)
+    @ApiModelProperty(value = "组日预算")
+    private Long unitDayBudget;
+    /**
+     * 分日预算
+     */
+    @Excel(name = "分日预算", width = 15)
+    @ApiModelProperty(value = "分日预算")
+    private String campaignDayBudgetSchedule;
+    /**
+     * 自定义计划数量
+     */
+    @Excel(name = "自定义计划数量", width = 15)
+    @ApiModelProperty(value = "自定义计划数量")
+    private Integer customPlanCnt;
+    /**
+     * 自定义组数量
+     */
+    @Excel(name = "自定义组数量", width = 15)
+    @ApiModelProperty(value = "自定义组数量")
+    private Integer customUnitCnt;
+    /**
+     * 程序化计划数量
+     */
+    @Excel(name = "程序化计划数量", width = 15)
+    @ApiModelProperty(value = "程序化计划数量")
+    private Integer programPlanCnt;
+    /**
+     * 程序化组数量
+     */
+    @Excel(name = "程序化组数量", width = 15)
+    @ApiModelProperty(value = "程序化组数量")
+    private Integer programUnitCnt;
+    /**
+     * 素材名称关键字
+     */
+    @Excel(name = "素材名称关键字", width = 15)
+    @ApiModelProperty(value = "素材名称关键字")
+    private String materialKeyword;
+    /**
+     * 是否多应用多出价 0 否 1 是
+     */
+    @Excel(name = "是否多应用多出价 0 否 1 是", width = 15)
+    @ApiModelProperty(value = "是否多应用多出价 0 否 1 是")
+    private Integer multipleBids;
+    /**
+     * 渠道号使用层级
+     */
+    @Excel(name = "渠道号使用层级", width = 15)
+    @ApiModelProperty(value = "渠道号使用层级")
+    private String usageLevel;
+    /**
+     * 是否使用渠道号0不使用,1使用
+     */
+    @Excel(name = "是否使用渠道号0不使用,1使用", width = 15)
+    @ApiModelProperty(value = "是否使用渠道号0不使用,1使用")
+    private Integer useChannel;
+    /**
+     * 1 定向匹配。2素材匹配
+     */
+    @Excel(name = "1 定向匹配。2素材匹配", width = 15)
+    @ApiModelProperty(value = "1 定向匹配。2素材匹配")
+    private Integer matchType;
+    /**
+     * 本地定向集
+     */
+    @Excel(name = "本地定向集", width = 15)
+    @ApiModelProperty(value = "本地定向集")
+    private String autoTargetArray;
+    /**
+     * 素材来源 1-上新素材,2-高质量素材,3-遗漏素材,4-历史打捞
+     */
+    @Excel(name = "素材来源 1-上新素材,2-高质量素材,3-遗漏素材,4-历史打捞", width = 15)
+    @ApiModelProperty(value = "素材来源 1-上新素材,2-高质量素材,3-遗漏素材,4-历史打捞")
+    private String sourceMaterial;
+    /**
+     * 是否使用优质定向  0 否 1 是
+     */
+    @Excel(name = "是否使用优质定向  0 否 1 是 ", width = 15)
+    @ApiModelProperty(value = "是否使用优质定向  0 否 1 是 ")
+    private Integer systemOptimization;
+    /**
+     * 应用中间页的类型 0=不使用;1=建站落地页
+     */
+    @Excel(name = "应用中间页的类型 0=不使用;1=建站落地页", width = 15)
+    @ApiModelProperty(value = "应用中间页的类型 0=不使用;1=建站落地页")
+    private Integer downloadPageType;
+    /**
+     * 应用中间页链接
+     */
+    @Excel(name = "应用中间页链接", width = 15)
+    @ApiModelProperty(value = "应用中间页链接")
+    private String downloadPageUrl;
+    /**
+     * 试玩 ID集
+     */
+    @Excel(name = "试玩 ID集", width = 15)
+    @ApiModelProperty(value = "试玩 ID集")
+    private String playableIds;
+    /**
+     * 1:立即试玩;2:试玩一下;3:立即体验;4:免装试玩;5:免装体验。启用试玩时:默认“立即试玩”
+     */
+    @Excel(name = "1:立即试玩;2:试玩一下;3:立即体验;4:免装试玩;5:免装体验。启用试玩时:默认“立即试玩”", width = 15)
+    @ApiModelProperty(value = "1:立即试玩;2:试玩一下;3:立即体验;4:免装试玩;5:免装体验。启用试玩时:默认“立即试玩”")
+    private String playButton;
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**
+     * updateTime
+     */
+    @ApiModelProperty(value = "updateTime")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private List<String> userIds;
+
+    @TableField(exist = false)
+    private String authName;
+
+    @TableField(exist = false)
+    private int customCreatedUnitCnt;
+
+    @TableField(exist = false)
+    private int programCreatedUnitCnt;
+    //待建广告组数
+    @TableField(exist = false)
+    private int toBeBuiltCnt;
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 271 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/entity/V3KuaishouAccountAutoTarget.java


+ 21 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/mapper/V3KuaishouAccountAutoStrategyMapper.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.kuaishou.modules.v3.mapper;
+
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * 自动投放v3-账户策略表
+ *
+ * @author jeecg-boot
+ * 2022-10-24
+ * @version V1.0
+ */
+public interface V3KuaishouAccountAutoStrategyMapper extends BaseMapper<V3KuaishouAccountAutoStrategy> {
+
+    List<V3KuaishouAccountAutoStrategy> queryList(V3KuaishouAccountAutoStrategy strategy);
+
+    void createRecord(JSONObject record);
+}

+ 21 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/mapper/V3KuaishouAccountAutoTargetMapper.java

@@ -0,0 +1,21 @@
+package cn.com.ctop.kuaishou.modules.v3.mapper;
+
+import java.util.List;
+
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoTarget;
+import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 自动投放-v3-本地定向表
+ *
+ * @author jeecg-boot
+ * 2022-10-31
+ * @version V1.0
+ */
+public interface V3KuaishouAccountAutoTargetMapper extends BaseMapper<V3KuaishouAccountAutoTarget> {
+
+    List<V3KuaishouAccountAutoTarget> queryPageList(@Param("accountId") Long accountId, @Param("targetName") String targetName, @Param("platform") Integer platform);
+
+    List<V3KuaishouAccountAutoTarget> getAutoTargetByIds(@Param("ids")List<String> list);
+}

+ 43 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/mapper/xml/V3KuaishouAccountAutoStrategyMapper.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.v3.mapper.V3KuaishouAccountAutoStrategyMapper">
+
+    <select id="queryList" resultType="cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy">
+        SELECT
+        id,
+        account_id,
+        status,
+        create_time,
+        convert_id,
+        ocpx_action_type,
+        cpa_bid,
+        bid,
+        unit_bid_type,
+        campaign_bid_type
+        FROM ctop_v3_kuaishou_account_auto_strategy
+        <where>
+            <if test="accountId != null">
+                and account_id = #{accountId}
+            </if>
+            <if test="userIds != null and userIds.size() > 0">
+                and user_id in
+                <foreach item="id" index="index" collection="userIds"
+                         open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+        </where>
+        order by create_time desc
+    </select>
+
+    <insert id="createRecord">
+        insert into ctop_v3_kuaishou_account_create_record
+            (account_id, params, message)
+        values (#{accountId}, #{params}, #{message})
+    </insert>
+
+
+</mapper>

+ 25 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/mapper/xml/V3KuaishouAccountAutoTargetMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.kuaishou.modules.v3.mapper.V3KuaishouAccountAutoTargetMapper">
+
+    <select id="queryPageList" resultType="cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoTarget">
+        SELECT
+        *
+        FROM ctop_v3_kuaishou_account_auto_target
+        where account_id = #{accountId}
+        <if test="targetName != null">
+            and target_name LIKE CONCAT(CONCAT('%', #{targetName}), '%')
+        </if>
+        AND (platform =0 or platform = #{platform})
+        order by create_time desc
+    </select>
+
+    <select id="getAutoTargetByIds" resultType="cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoTarget">
+        SELECT *
+        FROM ctop_v3_kuaishou_account_auto_target
+        WHERE id in
+        <foreach collection="ids" item="ids" separator="," open="(" close=")">
+            #{ids}
+        </foreach>
+    </select>
+</mapper>

+ 23 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/V3KuaishouAccountAutoDoService.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.kuaishou.modules.v3.service;
+
+
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy;
+
+import java.text.ParseException;
+
+public interface V3KuaishouAccountAutoDoService {
+
+
+    //创建自定义广告创意
+    void createCustomCreative(V3KuaishouAccountAutoStrategy strategy) ;
+
+    //创建程序化广告创意
+    void createProgramCreative(V3KuaishouAccountAutoStrategy strategy);
+
+    // 组创建是否超限
+    Boolean getUnitOverrun(Long accountId);
+
+    //每日补齐创建
+    void supplementTodayCreatives(V3KuaishouAccountAutoStrategy strategy);
+
+}

+ 17 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/V3KuaishouAccountAutoStrategyService.java

@@ -0,0 +1,17 @@
+package cn.com.ctop.kuaishou.modules.v3.service;
+
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.pagehelper.PageInfo;
+
+/**
+ * 自动投放v3-账户策略表
+ *
+ * @author jeecg-boot
+ * 2022-10-24
+ * @version V1.0
+ */
+public interface V3KuaishouAccountAutoStrategyService extends IService<V3KuaishouAccountAutoStrategy> {
+
+    PageInfo<V3KuaishouAccountAutoStrategy> queryList(V3KuaishouAccountAutoStrategy strategy);
+}

+ 27 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/V3KuaishouAccountAutoTargetService.java

@@ -0,0 +1,27 @@
+package cn.com.ctop.kuaishou.modules.v3.service;
+
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoTarget;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
+
+import java.util.List;
+
+/**
+ * 自动投放-v3-本地定向表
+ *
+ * @author jeecg-boot
+ * 2022-10-31
+ * @version V1.0
+ */
+public interface V3KuaishouAccountAutoTargetService extends IService<V3KuaishouAccountAutoTarget> {
+
+    Result<Object> queryPageList(Long accountId, String targetName, Integer platform, Integer pageNo, Integer pageSize);
+
+    Result<Object> addV3LocalTarget(JSONObject requestJson);
+
+    Result<Object> updateV3LocalTarget(JSONObject requestJson);
+
+    List<V3KuaishouAccountAutoTarget> getAutoTargetByIds(List<String> list);
+
+}

+ 13 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/V3KuaishouAccountDetailsService.java

@@ -0,0 +1,13 @@
+package cn.com.ctop.kuaishou.modules.v3.service;
+
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy;
+import com.alibaba.fastjson.JSONObject;
+
+public interface V3KuaishouAccountDetailsService {
+
+    JSONObject createCascadeAll(CtopOauthToken token, JSONObject newAdParams);
+
+    JSONObject createUnitAndCreative(CtopOauthToken token, JSONObject hadAdParams);
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1997 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/impl/V3KuaishouAccountAutoDoServiceImpl.java


+ 24 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/impl/V3KuaishouAccountAutoStrategyServiceImpl.java

@@ -0,0 +1,24 @@
+package cn.com.ctop.kuaishou.modules.v3.service.impl;
+
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoStrategy;
+import cn.com.ctop.kuaishou.modules.v3.mapper.V3KuaishouAccountAutoStrategyMapper;
+import cn.com.ctop.kuaishou.modules.v3.service.V3KuaishouAccountAutoStrategyService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageInfo;
+import org.springframework.stereotype.Service;
+
+/**
+ * 自动投放v3-账户策略表
+ *
+ * @author jeecg-boot
+ * 2022-10-24
+ * @version V1.0
+ */
+@Service
+public class V3KuaishouAccountAutoStrategyServiceImpl extends ServiceImpl<V3KuaishouAccountAutoStrategyMapper, V3KuaishouAccountAutoStrategy> implements V3KuaishouAccountAutoStrategyService {
+
+    @Override
+    public PageInfo<V3KuaishouAccountAutoStrategy> queryList(V3KuaishouAccountAutoStrategy strategy) {
+        return new PageInfo<>(baseMapper.queryList(strategy));
+    }
+}

+ 84 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/impl/V3KuaishouAccountAutoTargetServiceImpl.java

@@ -0,0 +1,84 @@
+package cn.com.ctop.kuaishou.modules.v3.service.impl;
+
+import cn.com.ctop.common.module.utils.Check;
+import cn.com.ctop.kuaishou.modules.v3.entity.V3KuaishouAccountAutoTarget;
+import cn.com.ctop.kuaishou.modules.v3.mapper.V3KuaishouAccountAutoTargetMapper;
+import cn.com.ctop.kuaishou.modules.v3.service.V3KuaishouAccountAutoTargetService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.jeecg.common.api.vo.Result;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 自动投放-v3-本地定向表
+ *
+ * @author jeecg-boot
+ * 2022-10-31
+ * @version V1.0
+ */
+@Service
+public class V3KuaishouAccountAutoTargetServiceImpl extends ServiceImpl<V3KuaishouAccountAutoTargetMapper, V3KuaishouAccountAutoTarget> implements V3KuaishouAccountAutoTargetService {
+
+    @Override
+    public Result<Object> queryPageList(Long accountId, String targetName, Integer platform, Integer pageNo, Integer pageSize) {
+        PageHelper.startPage(pageNo, pageSize);
+        List<V3KuaishouAccountAutoTarget> list = baseMapper.queryPageList(accountId, targetName, platform);
+        return Result.ok(new PageInfo<>(list));
+    }
+
+    @Override
+    public Result<Object> addV3LocalTarget(JSONObject requestJson) {
+        QueryWrapper<V3KuaishouAccountAutoTarget> wrapper = new QueryWrapper<>();
+        wrapper.eq("account_id", requestJson.getLong("accountId"));
+        wrapper.eq("target_name", requestJson.getString("targetName")).last("limit 1");
+        V3KuaishouAccountAutoTarget one = this.getOne(wrapper);
+        if (!Check.isNull(one)) {
+            return Result.error("该账户下定向包名已存在");
+        }
+        V3KuaishouAccountAutoTarget target = JSONObject.toJavaObject(requestJson, V3KuaishouAccountAutoTarget.class);
+        if (!Check.isNull(requestJson.getJSONArray("keyword"))) {
+            target.setKeyword(JSONObject.toJSONString(requestJson.getJSONArray("keyword")));
+        }
+        boolean save = this.save(target);
+        if (save) {
+            return Result.ok("创建成功");
+        }
+        return Result.error("创建失败,定向包新增失败");
+    }
+
+    @Override
+    public Result<Object> updateV3LocalTarget(JSONObject requestJson) {
+        QueryWrapper<V3KuaishouAccountAutoTarget> wrapper = new QueryWrapper<>();
+        wrapper.eq("account_id", requestJson.getLong("accountId"));
+        wrapper.eq("target_name", requestJson.getString("targetName")).last("limit 1");
+        V3KuaishouAccountAutoTarget one = this.getOne(wrapper);
+        if (!Check.isNull(one) && one.getId() - requestJson.getLong("id") != 0) {
+            return Result.error("账户下定向包名重复");
+        }
+        V3KuaishouAccountAutoTarget target = JSONObject.toJavaObject(requestJson, V3KuaishouAccountAutoTarget.class);
+        if (!Check.isNull(requestJson.getJSONArray("keyword"))) {
+            target.setKeyword(JSONObject.toJSONString(requestJson.getJSONArray("keyword")));
+        }
+        if (!Check.isNull(target.getMax()) && target.getMax() == -1) {
+            target.setMax(null);
+        }
+        if (!Check.isNull(target.getMin()) && target.getMin() == -1) {
+            target.setMin(null);
+        }
+        boolean update = this.saveOrUpdate(target);
+        if (update) {
+            return Result.ok("修改成功");
+        }
+        return Result.ok("修改失败");
+    }
+
+    @Override
+    public List<V3KuaishouAccountAutoTarget> getAutoTargetByIds(List<String> list) {
+        return baseMapper.getAutoTargetByIds(list);
+    }
+}

+ 105 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/v3/service/impl/V3KuaishouAccountDetailsServiceImpl.java

@@ -0,0 +1,105 @@
+package cn.com.ctop.kuaishou.modules.v3.service.impl;
+
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.utils.HttpUtils;
+import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
+import cn.com.ctop.common.module.utils.PropertiesUtils;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouGroupService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.v3.service.V3KuaishouAccountDetailsService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+@Service
+public class V3KuaishouAccountDetailsServiceImpl implements V3KuaishouAccountDetailsService {
+
+    @Autowired
+    private IKuaishouInterfaceService kuaishouInterfaceService;
+    @Autowired
+    private IKuaiShouGroupService getKuaiShouGroupService;
+
+
+    @Override
+    public JSONObject createCascadeAll(CtopOauthToken token, JSONObject requestJson) {
+        Long accountId = requestJson.getLong("advertiser_id");
+        String accessToken = token.getAccessToken();
+        JSONObject resultJson = null;
+        try {
+            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.V3_CREATE_CASCADE_ALL;
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Access-Token", accessToken);
+            headers.put("Content-Type", " application/json");
+            String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
+            resultJson = JSONObject.parseObject(result);
+            Integer code = resultJson.getInteger("code");
+            if (code == 0) {
+                JSONObject dataJson = resultJson.getJSONObject("data");
+                Long campaignId = dataJson.getLong("campaign_id");
+                Long unitId = dataJson.getLong("unit_id");
+                JSONArray creativeIds = dataJson.getJSONArray("creative_ids");
+                // 创建成功 拉取广告组信息
+                Thread.sleep(300);
+                Thread thread = new Thread() {
+                    @Override
+                    public void run() {
+                        kuaishouInterfaceService.getCampaign(accessToken, accountId, campaignId);
+                        getKuaiShouGroupService.getGroupByUnitId(accessToken, accountId, unitId);
+                        kuaishouInterfaceService.getCreativeByCreativeIds(accessToken, accountId, creativeIds);
+                    }
+                };
+            } else {
+                log.error("创建V3广告失败,advertiser_id:{},返回信息:{}", accountId, resultJson);
+            }
+        } catch (Exception e) {
+            log.error("创建V3广告失败,advertiser_id:{}", accountId);
+            e.printStackTrace();
+        }
+        return resultJson;
+    }
+
+    @Override
+    public JSONObject createUnitAndCreative(CtopOauthToken token, JSONObject requestJson) {
+        Long accountId = requestJson.getLong("advertiser_id");
+        String accessToken = token.getAccessToken();
+        JSONObject resultJson = null;
+        try {
+            String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.V3_CREATE_UNIT_AND_CREATIVE;
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Access-Token", accessToken);
+            headers.put("Content-Type", " application/json");
+            String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
+             resultJson = JSONObject.parseObject(result);
+            Integer code = resultJson.getInteger("code");
+            if (code == 0) {
+                JSONObject dataJson = resultJson.getJSONObject("data");
+                Long campaignId = dataJson.getLong("campaign_id");
+                Long unitId = dataJson.getLong("unit_id");
+                JSONArray creativeIds = dataJson.getJSONArray("creative_ids");
+                // 创建成功 拉取广告组信息
+                Thread.sleep(300);
+                Thread thread = new Thread() {
+                    @Override
+                    public void run() {
+                        kuaishouInterfaceService.getCampaign(accessToken, accountId, campaignId);
+                        getKuaiShouGroupService.getGroupByUnitId(accessToken, accountId, unitId);
+                        kuaishouInterfaceService.getCreativeByCreativeIds(accessToken, accountId, creativeIds);
+                    }
+                };
+            } else {
+                log.error("创建V3广告失败,advertiser_id:{},返回信息:{}", accountId, resultJson);
+            }
+        } catch (Exception e) {
+            log.error("创建V3广告失败,advertiser_id:{}", accountId);
+            e.printStackTrace();
+        }
+        return resultJson;
+    }
+}