Ver código fonte

自动投放账户重构——初版2

zhaoxian 4 anos atrás
pai
commit
9ced3c8ff0
26 arquivos alterados com 1506 adições e 1702 exclusões
  1. 8 161
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouAccountAutoDoController.java
  2. 21 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouAccountAutoTargetController.java
  3. 66 360
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAccountAutoStrategy.java
  4. 22 7
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAccountAutoVideo.java
  5. 13 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouUnitLevelOperationRecord.java
  6. 3 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouAccountAutoTargetMapper.java
  7. 5 5
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouAccountAutoVideoMapper.java
  8. 9 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouAccountAutoTargetMapper.xml
  9. 24 10
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouAccountAutoVideoMapper.xml
  10. 3 11
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouAccountAutoDoService.java
  11. 4 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouAccountAutoTargetService.java
  12. 3 3
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouAccountAutoVideoService.java
  13. 1296 1079
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoDoServiceImpl.java
  14. 5 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoTargetServiceImpl.java
  15. 11 12
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoVideoServiceImpl.java
  16. 2 16
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java
  17. 2 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouProjectCreateCreativeServiceImpl.java
  18. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouGroupController.java
  19. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouGroupMapper.java
  20. 1 0
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml
  21. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouGroupService.java
  22. 2 2
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java
  23. 2 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/xml/KuaishouChannelMapper.xml
  24. 1 1
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/xml/KuaishouChannelRelMapper.xml
  25. 0 5
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/IKuaishouChannelService.java
  26. 0 22
      jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelServiceImpl.java

+ 8 - 161
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouAccountAutoDoController.java

@@ -4,7 +4,6 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoStrategy;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAccountAutoDoService;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAccountAutoStrategyService;
-import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAdvertiserStrategyService;
 import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
@@ -13,12 +12,11 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.text.ParseException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
 @Slf4j
-@Api(tags = "快手-自动投放")
+@Api(tags = "快手-自动投放——重构")
 @RestController
 @RequestMapping("/auto/create")
 public class AiKuaishouAccountAutoDoController {
@@ -26,21 +24,8 @@ public class AiKuaishouAccountAutoDoController {
     private IAiKuaishouAccountAutoDoService autoDoService;
     @Autowired
     private IAiKuaishouAccountAutoStrategyService strategyService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(5);
-    static ExecutorService kuaishouCustomCreativeSupplementExecutorService = Executors.newFixedThreadPool(3);
-    static ExecutorService kuaishouProgramCreativeAutoService = Executors.newFixedThreadPool(3);
-    static ExecutorService kuaishouProgramTopCreativeAutoService = Executors.newFixedThreadPool(3);
-
-
-    /**
-     * 临时测试
-     */
-    @GetMapping(value = "/testMethod")
-    public JSONObject testMethod(int type, int count) {
-        JSONObject returnJson = new JSONObject();
-        autoDoService.testMethod(type, count);
-        return returnJson;
-    }
+    static ExecutorService customService = Executors.newFixedThreadPool(8);
+    static ExecutorService programService = Executors.newFixedThreadPool(8);
 
     /**
      * 创建自定义广告创意
@@ -61,90 +46,7 @@ public class AiKuaishouAccountAutoDoController {
                 log.error("****** 广告组创建超限,accountId:{}", strategy.getAccountId());
                 throw new Exception("今日广告组创建已超限");
             }
-            executorService.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;
-
-    }
-
-    /**
-     * 自动上新
-     *
-     * @param id
-     * @return
-     */
-    @GetMapping(value = "/customCreativeLimit")
-    public JSONObject customCreativeLimit(String id) {
-        JSONObject returnJson = new JSONObject();
-        try {
-            if (Check.isNull(id)) {
-                throw new Exception("主键id不能为空");
-            }
-            AiKuaishouAccountAutoStrategy 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("今日组创建已超限");
-            }
-
-            executorService.submit(() ->
-                    autoDoService.customCreativeLimit(strategy)
-            );
-            returnJson.put("code", 0);
-            returnJson.put("message", "异步创建中");
-        } catch (Exception e) {
-            returnJson.put("code", -1);
-            returnJson.put("message", e.getMessage());
-        }
-        return returnJson;
-
-    }
-
-    /**
-     * 自定义创意补充
-     *
-     * @param id
-     * @param hour
-     * @return
-     */
-    @GetMapping(value = "/kuaishouCustomCreativeSupplement")
-    public JSONObject kuaishouCustomCreativeSupplement(String id, Integer hour) {
-        JSONObject returnJson = new JSONObject();
-        try {
-            if (Check.isNull(id)) {
-                throw new Exception("主键id不能为空");
-            }
-            AiKuaishouAccountAutoStrategy 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("今日组创建已超限");
-            }
-            if (Check.isNull(hour)) {
-                throw new Exception("小时数据为空");
-            }
-            if (strategy.getHistoryTop() == 0) {
-                kuaishouCustomCreativeSupplementExecutorService.submit(() -> {
-                    try {
-                        autoDoService.customCreativeSupplement(strategy, hour);
-                    } catch (ParseException e) {
-                        e.printStackTrace();
-                    }
-                });
-            } else {
-                log.info("高质量暂停搭建,accountId:{}", strategy.getAccountId());
-            }
+            customService.submit(() -> autoDoService.createCustomCreative(strategy));
             returnJson.put("code", 0);
             returnJson.put("message", "异步创建中");
         } catch (Exception e) {
@@ -156,14 +58,10 @@ public class AiKuaishouAccountAutoDoController {
     }
 
     /**
-     * 程序化上新素材
-     *
-     * @param id
-     * @param videoCnt
-     * @return
+     * 创建程序化广告创意
      */
-    @GetMapping(value = "/kuaishouProgramCreativeAuto")
-    public JSONObject kuaishouProgramCreativeAuto(String id, Integer videoCnt) {
+    @GetMapping(value = "/createProgramCreative")
+    public JSONObject createProgramCreative(String id) {
         JSONObject returnJson = new JSONObject();
         try {
             if (Check.isNull(id)) {
@@ -178,13 +76,7 @@ public class AiKuaishouAccountAutoDoController {
                 log.error("组创建超限,accountId:{}", strategy.getAccountId());
                 throw new Exception("今日组创建已超限");
             }
-            if (Check.isNull(videoCnt)) {
-                throw new Exception("视频数量不能为空");
-            }
-            kuaishouProgramCreativeAutoService.submit(() -> {
-                autoDoService.autoCreateProgramCreative(strategy, 1, videoCnt);
-
-            });
+            programService.submit(() -> autoDoService.createProgramCreative(strategy));
             returnJson.put("code", 0);
             returnJson.put("message", "异步创建中");
         } catch (Exception e) {
@@ -194,49 +86,4 @@ public class AiKuaishouAccountAutoDoController {
         return returnJson;
 
     }
-
-    /**
-     * 程序化历史高质量
-     *
-     * @param id
-     * @param videoCnt
-     * @return
-     */
-    @GetMapping(value = "/autoCreateProgramHistoryTopCreative")
-    public JSONObject autoCreateProgramHistoryTopCreative(String id, Integer videoCnt) {
-        JSONObject returnJson = new JSONObject();
-        try {
-            if (Check.isNull(id)) {
-                throw new Exception("主键id不能为空");
-            }
-            AiKuaishouAccountAutoStrategy 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("今日组创建已超限");
-            }
-            if (Check.isNull(videoCnt)) {
-                throw new Exception("视频数量不能为空");
-            }
-            if (strategy.getHistoryTop() == 0) {
-                kuaishouProgramTopCreativeAutoService.submit(() -> {
-                    autoDoService.autoCreateProgramCreative(strategy, 2, videoCnt);
-                });
-            } else {
-                log.info("历史高质量暂停搭建,accountId:{}", strategy.getAccountId());
-            }
-            returnJson.put("code", 0);
-            returnJson.put("message", "异步创建中");
-        } catch (Exception e) {
-            returnJson.put("code", -1);
-            returnJson.put("message", e.getMessage());
-        }
-        return returnJson;
-
-    }
-
-
 }

+ 21 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouAccountAutoTargetController.java

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoTarget;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAccountAutoTargetService;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import io.swagger.annotations.Api;
@@ -189,6 +190,26 @@ public class AiKuaishouAccountAutoTargetController {
         }
     }
 
+
+    @PostMapping(value = "/getAutoTargetByIds")
+    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<AiKuaishouAccountAutoTarget> targets = aiKuaishouAccountAutoTargetService.getAutoTargetByIds(list);
+            return Result.ok(targets);
+        } catch (Exception e) {
+            log.error("查询异常,", e);
+            return Result.error("查询失败," + e.getMessage());
+        }
+    }
+
     /**
      * 导出excel
      *

+ 66 - 360
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAccountAutoStrategy.java

@@ -111,7 +111,7 @@ public class AiKuaishouAccountAutoStrategy {
      */
     @Excel(name = "出价", width = 15)
     @ApiModelProperty(value = "出价")
-    private BigDecimal cpaBid;
+    private String cpaBid;
     /**
      * 优先低成本出价
      */
@@ -184,495 +184,201 @@ public class AiKuaishouAccountAutoStrategy {
     @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
-     */
+    /**应用ID*/
     @Excel(name = "应用ID", width = 15)
     @ApiModelProperty(value = "应用ID")
     private Long appId;
-    /**
-     * 创意展现方式 1-轮播  2-优选
-     */
+    /**创意展现方式 1-轮播  2-优选*/
     @Excel(name = "创意展现方式 1-轮播  2-优选", width = 15)
     @ApiModelProperty(value = "创意展现方式 1-轮播  2-优选")
     private Integer showMode;
-    /**
-     * 投放方式 1-加速投放  2-平滑投放 3-优先低成本
-     */
+    /**投放方式 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;
-    /**
-     * 智能定向
-     */
+    /**智能定向*/
     @Excel(name = "智能定向", width = 15)
     @ApiModelProperty(value = "智能定向")
     private Integer autoTarget;
-    /**
-     * 是否开启自动生成视频
-     */
+    /**是否开启自动生成视频*/
     @Excel(name = "是否开启自动生成视频", width = 15)
     @ApiModelProperty(value = "是否开启自动生成视频")
     private Integer autoCreatePhoto;
-    /**
-     * 地域
-     */
-    @Excel(name = "地域", width = 15)
-    @ApiModelProperty(value = "地域")
-    private String region;
-    /**
-     * 商圈定向
-     */
-    @Excel(name = "商圈定向", width = 15)
-    @ApiModelProperty(value = "商圈定向")
-    private String districtIds;
-    /**
-     * 用户类型
-     */
-    @Excel(name = "用户类型", width = 15)
-    @ApiModelProperty(value = "用户类型")
-    private Integer userType;
-    /**
-     * 最大年龄
-     */
-    @Excel(name = "最大年龄", width = 15)
-    @ApiModelProperty(value = "最大年龄")
-    private Integer ageMin;
-    /**
-     * 最小年龄
-     */
-    @Excel(name = "最小年龄", width = 15)
-    @ApiModelProperty(value = "最小年龄")
-    private Integer ageMax;
-    /**
-     * 固定年龄段
-     */
-    @Excel(name = "固定年龄段", width = 15)
-    @ApiModelProperty(value = "固定年龄段")
-    private String agesRange;
-    /**
-     * 性别
-     */
-    @Excel(name = "性别", width = 15)
-    @ApiModelProperty(value = "性别")
-    private Integer gender;
-    /**
-     * 操作系统
-     */
-    @Excel(name = "操作系统", width = 15)
-    @ApiModelProperty(value = "操作系统")
-    private Integer platformOs;
-    /**
-     * Android版本
-     */
-    @Excel(name = "Android版本", width = 15)
-    @ApiModelProperty(value = "Android版本")
-    private Integer androidOsv;
-    /**
-     * iOS版本
-     */
-    @Excel(name = "iOS版本", width = 15)
-    @ApiModelProperty(value = "iOS版本")
-    private Integer iosOsv;
-    /**
-     * 网络环境
-     */
-    @Excel(name = "网络环境", width = 15)
-    @ApiModelProperty(value = "网络环境")
-    private Integer network;
-    /**
-     * 设备品牌
-     */
-    @Excel(name = "设备品牌", width = 15)
-    @ApiModelProperty(value = "设备品牌")
-    private String deviceBrand;
-    /**
-     * 设备价格
-     */
-    @Excel(name = "设备价格", width = 15)
-    @ApiModelProperty(value = "设备价格")
-    private String devicePrice;
-    /**
-     * 商业兴趣类型
-     */
-    @Excel(name = "商业兴趣类型", width = 15)
-    @ApiModelProperty(value = "商业兴趣类型")
-    private Integer businessInterestType;
-    /**
-     * 商业兴趣
-     */
-    @Excel(name = "商业兴趣", width = 15)
-    @ApiModelProperty(value = "商业兴趣")
-    private String businessInterest;
-    /**
-     * 网红粉丝
-     */
-    @Excel(name = "网红粉丝", width = 15)
-    @ApiModelProperty(value = "网红粉丝")
-    private String fansStar;
-    /**
-     * 兴趣视频用户
-     */
-    @Excel(name = "兴趣视频用户", width = 15)
-    @ApiModelProperty(value = "兴趣视频用户")
-    private String interestVideo;
-    /**
-     * APP行为-按分类
-     */
-    @Excel(name = "APP行为-按分类", width = 15)
-    @ApiModelProperty(value = "APP行为-按分类")
-    private String appInterest;
-    /**
-     * APP行为-按APP名称
-     */
-    @Excel(name = "APP行为-按APP名称", width = 15)
-    @ApiModelProperty(value = "APP行为-按APP名称")
-    private String appIds;
-    /**
-     * 过滤已转化人群纬度
-     */
-    @Excel(name = "过滤已转化人群纬度", width = 15)
-    @ApiModelProperty(value = "过滤已转化人群纬度")
-    private Integer filterConvertedLevel;
-    /**
-     * 人群包定向
-     */
-    @Excel(name = "人群包定向", width = 15)
-    @ApiModelProperty(value = "人群包定向")
-    private String population;
-    /**
-     * 人群包排除
-     */
-    @Excel(name = "人群包排除", width = 15)
-    @ApiModelProperty(value = "人群包排除")
-    private String excludePopulation;
-    /**
-     * 付费人群包id
-     */
-    @Excel(name = "付费人群包id", width = 15)
-    @ApiModelProperty(value = "付费人群包id")
-    private String paidAudience;
-    /**
-     * 开启智能扩量
-     */
-    @Excel(name = "开启智能扩量", width = 15)
-    @ApiModelProperty(value = "开启智能扩量")
-    private Integer isOpen;
-    /**
-     * 不可突破年龄
-     */
-    @Excel(name = "不可突破年龄", width = 15)
-    @ApiModelProperty(value = "不可突破年龄")
-    private Integer noAgeBreak;
-    /**
-     * 不可突破性别
-     */
-    @Excel(name = "不可突破性别", width = 15)
-    @ApiModelProperty(value = "不可突破性别")
-    private Integer noGenderBreak;
-    /**
-     * 不可突破地域
-     */
-    @Excel(name = "不可突破地域", width = 15)
-    @ApiModelProperty(value = "不可突破地域")
-    private Integer noAreaBreak;
-    /**
-     * 行为兴趣定向
-     */
-    @Excel(name = "行为兴趣定向", width = 15)
-    @ApiModelProperty(value = "行为兴趣定向")
-    private String behaviorInterest;
-    /**
-     * 创意名称
-     */
+    /**创意名称*/
     @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期
-     */
+    /**广告标签2期*/
     @Excel(name = "广告标签2期", width = 15)
     @ApiModelProperty(value = "广告标签2期")
     private String newExposeTag;
-    /**
-     * 安卓下载中间页ID
-     */
+    /**安卓下载中间页ID*/
     @Excel(name = "安卓下载中间页ID", width = 15)
     @ApiModelProperty(value = "安卓下载中间页ID")
     private String siteId;
-    /**
-     * 第三方点击检测链接
-     */
+    /**第三方点击检测链接*/
     @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;
-    /**
-     * 物料关联的封面个数
-     */
+    /**物料关联的封面个数*/
     @Excel(name = "物料关联的封面个数", width = 15)
     @ApiModelProperty(value = "物料关联的封面个数")
     private Integer imageCnt;
-    /**
-     * 创建时间
-     */
-    @ApiModelProperty(value = "创建时间")
-    private Date createTime;
-    /**
-     * 生效时间
-     */
-    @ApiModelProperty(value = "生效时间")
-    private Date effectiveTime;
-    /**
-     * 失效时间
-     */
-    @ApiModelProperty(value = "失效时间")
-    private Date expiryTime;
-    /**
-     * timerTaskStatus
-     */
-    @Excel(name = "timerTaskStatus", width = 15)
-    @ApiModelProperty(value = "timerTaskStatus")
-    private Integer timerTaskStatus;
-    /**
-     * 程序化创意2.0-是否开启智能抽帧
-     */
+    /**程序化创意2.0-是否开启智能抽帧*/
     @Excel(name = "程序化创意2.0-是否开启智能抽帧", width = 15)
     @ApiModelProperty(value = "程序化创意2.0-是否开启智能抽帧")
     private Integer smartCover;
-    /**
-     * 程序化创意2.0-是否开启素材挖掘
-     */
+    /**程序化创意2.0-是否开启素材挖掘*/
     @Excel(name = "程序化创意2.0-是否开启素材挖掘", width = 15)
     @ApiModelProperty(value = "程序化创意2.0-是否开启素材挖掘")
     private Integer assetMining;
-    /**
-     * 是否单一应用 0 是 1 否
-     */
+    /**单/多应用,1单应用,2多应用*/
     @Excel(name = "单/多应用,1单应用,2多应用", width = 15)
     @ApiModelProperty(value = "单/多应用,1单应用,2多应用")
     private Integer singleAppid;
-    /**
-     * 应用ID列表
-     */
+    /**应用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 BigDecimal deepConversionBid;
-    /**
-     * 是否创建程序化创意
-     */
+    /**是否创建程序化创意*/
     @Excel(name = "是否创建程序化创意", width = 15)
     @ApiModelProperty(value = "是否创建程序化创意")
     private Integer openProgramCreate;
-    /**
-     * userId
-     */
-    @Excel(name = "userId", width = 15)
-    @ApiModelProperty(value = "userId")
+    /**操作人*/
+    @Excel(name = "操作人", width = 15)
+    @ApiModelProperty(value = "操作人")
     private String userId;
-    /**
-     * 素材来源
-     */
+    /**素材来源*/
     @Excel(name = "素材来源", width = 15)
     @ApiModelProperty(value = "素材来源")
     private Integer channelType;
-    /**
-     * 计划日预算
-     */
+    /**计划日预算*/
     @Excel(name = "计划日预算", width = 15)
     @ApiModelProperty(value = "计划日预算")
     private BigDecimal campaignDayBudget;
-    /**
-     * 组日预算
-     */
+    /**组日预算*/
     @Excel(name = "组日预算", width = 15)
     @ApiModelProperty(value = "组日预算")
     private BigDecimal unitDayBudget;
-    /**
-     * campaignDayBudgetSchedule
-     */
-    @Excel(name = "campaignDayBudgetSchedule", width = 15)
-    @ApiModelProperty(value = "campaignDayBudgetSchedule")
+    /**分日预算*/
+    @Excel(name = "分日预算", width = 15)
+    @ApiModelProperty(value = "分日预算")
     private String campaignDayBudgetSchedule;
-    /**
-     * unitDayBudgetSchedule
-     */
-    @Excel(name = "unitDayBudgetSchedule", width = 15)
-    @ApiModelProperty(value = "unitDayBudgetSchedule")
-    private String unitDayBudgetSchedule;
-    /**
-     * 自定义组数量
-     */
+    /**自定义组数量*/
     @Excel(name = "自定义组数量", width = 15)
     @ApiModelProperty(value = "自定义组数量")
     private Integer customUnitCnt;
-    /**
-     * 程序化数量
-     */
+    /**程序化数量*/
     @Excel(name = "程序化数量", width = 15)
     @ApiModelProperty(value = "程序化数量")
     private Integer programUnitCnt;
-    /**
-     * 0:搭建 1:不搭建
-     */
-    @Excel(name = "0:搭建 1:不搭建", width = 15)
-    @ApiModelProperty(value = "0:搭建 1:不搭建")
-    private Integer historyTop;
-    /**
-     * 素材名称关键字
-     */
+    /**素材名称关键字*/
     @Excel(name = "素材名称关键字", width = 15)
     @ApiModelProperty(value = "素材名称关键字")
     private String materialKeyword;
-    /**
-     * 是否多应用多出价 0 否 1 是
-     */
+    /**是否多应用多出价 0 否 1 是*/
     @Excel(name = "是否多应用多出价 0 否 1 是", width = 15)
     @ApiModelProperty(value = "是否多应用多出价 0 否 1 是")
     private Integer multipleBids;
-    /**
-     * 层级
-     */
-    @Excel(name = "层级", width = 15)
-    @ApiModelProperty(value = "层级")
+    /**渠道号使用层级*/
+    @Excel(name = "渠道号使用层级", width = 15)
+    @ApiModelProperty(value = "渠道号使用层级")
     private String usageLevel;
-    /**
-     * 是否使用渠道号0不使用,1使用
-     */
+    /**是否使用渠道号0不使用,1使用*/
     @Excel(name = "是否使用渠道号0不使用,1使用", width = 15)
     @ApiModelProperty(value = "是否使用渠道号0不使用,1使用")
     private Integer useChannel;
-    /**
-     * 1 定向匹配。2素材匹配
-     */
+    /**1 定向匹配。2素材匹配*/
+    @Excel(name = "1 定向匹配。2素材匹配", width = 15)
+    @ApiModelProperty(value = "1 定向匹配。2素材匹配")
     private Integer matchType;
-    /**
-     * 本地定向集
-     */
+    /**本地定向集*/
+    @Excel(name = "本地定向集", width = 15)
+    @ApiModelProperty(value = "本地定向集")
     private String autoTargetArray;
-    /**
-     * 是否开启系统优选 0 否 1 是
-     */
-    @Excel(name = "是否开启系统优选 0 否 1 是", width = 15)
-    @ApiModelProperty(value = "是否开启系统优选 0 否 1 是")
-    private Integer systemOptimization;
-    /**
-     * updateTime
-     */
+    /**素材来源 1-上新素材,2-高质量素材,3-遗漏素材,4-历史打捞*/
+    @Excel(name = "素材来源 1-上新素材,2-高质量素材,3-遗漏素材,4-历史打捞", width = 15)
+    @ApiModelProperty(value = "素材来源 1-上新素材,2-高质量素材,3-遗漏素材,4-历史打捞")
+    private String sourceMaterial;
+    /**创建时间*/
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+    /**updateTime*/
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
-
-    /**
-     * 素材来源 1-上新素材,2-高质量素材,3-遗漏素材,4-历史打捞
-     */
-    private String sourceMaterial;
+    
     @TableField(exist = false)
     private String authName;
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 22 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAccountAutoVideo.java


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

@@ -315,6 +315,16 @@ public class AiKuaishouUnitLevelOperationRecord {
      */
     private Integer assetMining;
     /**
+     * 本地定向ID
+     */
+    private Long autoTargetId;
+
+    /**
+     * 渠道号Id
+     */
+    private Long channelId;
+
+    /**
      * 深度转化目标出价
      */
     private Integer deepConversionBid;
@@ -324,7 +334,7 @@ public class AiKuaishouUnitLevelOperationRecord {
 
     }
 
-    public AiKuaishouUnitLevelOperationRecord(AiKuaishouAccountAutoStrategy strategy, JSONObject unitParams, Integer unitCode, String unitMessage, String strategyUuid) {
+    public AiKuaishouUnitLevelOperationRecord(AiKuaishouAccountAutoStrategy 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");
@@ -336,5 +346,7 @@ public class AiKuaishouUnitLevelOperationRecord {
         this.message = unitMessage;
         this.aiStrategyUuid = strategyUuid;
         this.createType = 3;
+        this.channelId = channelId;
+        this.autoTargetId = autoTargetId;
     }
 }

+ 3 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouAccountAutoTargetMapper.java

@@ -15,5 +15,7 @@ import java.util.List;
  */
 public interface AiKuaishouAccountAutoTargetMapper extends BaseMapper<AiKuaishouAccountAutoTarget> {
 
-    List<AiKuaishouAccountAutoTarget> queryPageList(@Param("accountId") Long accountId,@Param("targetName") String targetName);
+    List<AiKuaishouAccountAutoTarget> queryPageList(@Param("accountId") Long accountId, @Param("targetName") String targetName);
+
+    List<AiKuaishouAccountAutoTarget> getAutoTargetByIds(@Param("ids") List<String> list);
 }

+ 5 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/AiKuaishouAccountAutoVideoMapper.java

@@ -17,17 +17,17 @@ public interface AiKuaishouAccountAutoVideoMapper extends BaseMapper<AiKuaishouA
 
     void insertBatch(@Param("videoGetList") List<AiKuaishouAccountAutoVideo> videoGetList);
 
-    List<AiKuaishouAccountAutoVideo> getUpNewVideos(@Param("accountId") Long accountId, @Param("channelType") Integer channelType, @Param("keyword") String keyword, @Param("videoCnt") Integer videoCnt, @Param("statDate") String statDate);
+    List<AiKuaishouAccountAutoVideo> getUpNewVideos(@Param("accountId") Long accountId, @Param("channelType") Integer channelType, @Param("keyword") String keyword, @Param("videoCnt") Integer videoCnt, @Param("statDate") String statDate, @Param("createType") String createType);
 
-    List<AiKuaishouAccountAutoVideo> getHistoryTopVideos(@Param("accountId") Long accountId, @Param("channelType") Integer channelType, @Param("keyword") String keyword, @Param("videoCnt") Integer videoCnt);
+    List<AiKuaishouAccountAutoVideo> getHistoryTopVideos(@Param("accountId") Long accountId, @Param("channelType") Integer channelType, @Param("keyword") String keyword, @Param("videoCnt") Integer videoCnt, @Param("createType") String createType);
 
     List<AiKuaishouAccountAutoVideo> getHistoryCatchVideos(@Param("accountId") Long accountId, @Param("channelType") Integer channelType, @Param("keyword") String keyword, @Param("videoCnt") Integer videoCnt);
 
     List<AiKuaishouAccountAutoVideo> getZeroVideoByParams(Long accountId, Integer channelType, String keyword, Integer videoCnt);
 
-    Integer getAutoVideoUsed(@Param("accountId") Long accountId, @Param("signature") String signature, @Param("createType") Integer createType);
+    Integer getAutoVideoUsed(@Param("accountId") Long accountId, @Param("signature") String signature, @Param("videoType") Integer videoType, @Param("createType") String createType);
 
-    void addAutoVideoUsed(@Param("accountId") Long accountId, @Param("signature") String signature, @Param("createType") Integer createType, @Param("usageTimes") Integer usageTimes, @Param("date") String date);
+    void addAutoVideoUsed(@Param("accountId") Long accountId, @Param("signature") String signature, @Param("videoType") Integer videoType, @Param("createType") String createType, @Param("usageTimes") Integer usageTimes, @Param("date") String date);
 
-    void updateAutoVideoUsed(@Param("accountId") Long accountId, @Param("signature") String signature, @Param("createType") Integer createType, @Param("usageTimes") Integer usageTimes);
+    void updateAutoVideoUsed(@Param("accountId") Long accountId, @Param("signature") String signature, @Param("videoType") Integer videoType, @Param("createType") String createType, @Param("usageTimes") Integer usageTimes, @Param("date") String date);
 }

+ 9 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouAccountAutoTargetMapper.xml

@@ -13,4 +13,13 @@
         order by create_time desc
     </select>
 
+    <select id="getAutoTargetByIds" resultType="cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoTarget">
+        SELECT *
+        FROM ctop_ai_kuaishou_account_auto_target
+        WHERE id in
+        <foreach collection="ids" item="ids" separator="," open="(" close=")">
+            #{ids}
+        </foreach>
+    </select>
+
 </mapper>

+ 24 - 10
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/AiKuaishouAccountAutoVideoMapper.xml

@@ -31,8 +31,13 @@
 
     <select id="getUpNewVideos" resultType="cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoVideo">
         SELECT * FROM ctop_ai_kuaishou_account_auto_video
-        WHERE status = 1
-        AND account_id = #{accountId}
+        WHERE account_id = #{accountId}
+        <if test="createType ==custom">
+            AND custom_status = 1
+        </if>
+        <if test="createType ==program">
+            AND program_status = 1
+        </if>
         <if test="channelType!=null">
             AND channel_type = #{channelType}
         </if>
@@ -47,7 +52,7 @@
 
     <select id="getZeroVideoByParams" resultType="cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoVideo">
         SELECT * FROM ctop_ai_kuaishou_account_auto_video
-        WHERE status = 1
+        WHERE custom_status = 1
         AND account_id = #{accountId}
         <if test="channelType!=null">
             AND channel_type = #{channelType}
@@ -76,8 +81,11 @@
         (
         SELECT signature FROM ctop_ai_kuaishou_account_auto_video_used
         WHERE account_id =#{accountId}
-        AND type = 3
+        AND video_type = 2
         AND usage_times &lt;= 5
+        <if test="createType !=null">
+            AND create_type = #{createType}
+        </if>
         AND stat_date &gt;= DATE_SUB(#{statDate},INTERVAL 7 day)
         group by signature
         )
@@ -106,7 +114,8 @@
         (
         SELECT signature FROM ctop_ai_kuaishou_account_auto_video_used
         WHERE account_id =#{accountId}
-        AND type = 4
+        AND video_type = 4
+        AND create_type = 'custom'
         AND usage_times &lt;= 2
         AND stat_date &gt;= DATE_SUB(#{statDate},INTERVAL 60 day)
         group by signature
@@ -128,7 +137,8 @@
         FROM ctop_ai_kuaishou_account_auto_video_used
         WHERE signature = #{signature}
           AND account_id = #{accountId}
-          AND type = #{createType} limit 1
+          AND video_type = #{videoType}
+          AND create_type = #{createType} limit 1
     </select>
 
 
@@ -138,14 +148,16 @@
         (
         account_id,
         signature,
-        type,
+        video_type,
+        create_type,
         stat_date,
         usage_times)
         values
         (
         #{accountId},
         #{signature},
-        #{type},
+        #{videoType},
+        #{createType},
         #{date},
         #{usageTimes}
         )
@@ -153,9 +165,11 @@
 
     <update id="updateAutoVideoUsed">
         UPDATE ctop_ai_kuaishou_account_auto_video_used
-        SET usage_times = #{usageTimes}
+        SET usage_times = #{usageTimes},
+            stat_date   = #{date}
         WHERE signature = #{signature}
           AND account_id = #{accountId}
-          AND type = #{createType}
+          AND video_type = #{videoType}
+          AND create_type = #{createType}
     </update>
 </mapper>

+ 3 - 11
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouAccountAutoDoService.java

@@ -9,18 +9,10 @@ public interface IAiKuaishouAccountAutoDoService {
     //创建自定义广告创意
     void createCustomCreative(AiKuaishouAccountAutoStrategy strategy);
 
+    //创建程序化广告创意
+    void createProgramCreative(AiKuaishouAccountAutoStrategy strategy);
+
     // 组创建是否超限
     Boolean getUnitOverrun(Long accountId);
 
-
-    Integer autoCreateCreative(AiKuaishouAccountAutoStrategy strategy, Integer createType, Integer videoCnt);
-
-    void autoCreateProgramCreative(AiKuaishouAccountAutoStrategy strategy, Integer createType, Integer videoCnt);
-
-    void customCreativeSupplement(AiKuaishouAccountAutoStrategy strategy, Integer hour) throws ParseException;
-
-    void customCreativeLimit(AiKuaishouAccountAutoStrategy strategy);
-
-
-    void testMethod(int type, int count);
 }

+ 4 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouAccountAutoTargetService.java

@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.common.api.vo.Result;
 
+import java.util.List;
+
 /**
  * 自动投放重构-本地定向表
  *
@@ -19,4 +21,6 @@ public interface IAiKuaishouAccountAutoTargetService extends IService<AiKuaishou
     Result<Object> addLocalTarget(JSONObject requestJson);
 
     Result<Object> updateLocalTarget(JSONObject requestJson);
+
+    List<AiKuaishouAccountAutoTarget> getAutoTargetByIds(List<String> list);
 }

+ 3 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/IAiKuaishouAccountAutoVideoService.java

@@ -15,10 +15,10 @@ import java.util.List;
 public interface IAiKuaishouAccountAutoVideoService extends IService<AiKuaishouAccountAutoVideo> {
 
     // 获取上新素材(自动投放账户级重构)
-    List<AiKuaishouAccountAutoVideo> getUpNewVideos(Long accountId, Integer channelType, String keyword, Integer videoCnt, String statDate);
+    List<AiKuaishouAccountAutoVideo> getUpNewVideos(Long accountId, Integer channelType, String keyword, Integer videoCnt, String statDate, String createType);
 
     //获取7天高质量 (自动投放账户级重构)
-    List<AiKuaishouAccountAutoVideo> getHistoryTopVideos(Long accountId, Integer channelType, String keyword, Integer videoCnt, String statDate);
+    List<AiKuaishouAccountAutoVideo> getHistoryTopVideos(Long accountId, Integer channelType, String keyword, Integer videoCnt, String statDate, String createType);
 
     //获取遗漏素材:7天内未被创建过的素材(自动投放账户级重构)
     List<AiKuaishouAccountAutoVideo> getMissVideoByParams(Long accountId, Integer channelType, String keyword, Integer videoCnt, String statDate);
@@ -29,5 +29,5 @@ public interface IAiKuaishouAccountAutoVideoService extends IService<AiKuaishouA
     void insertAutoVideo(Long accountId);
 
     //自动投放重构——记录(高质量,历史打捞)使用次数
-    void saveOrUpdateAutoVideoUsedCount(Long accountId, String signature, Integer createType);
+    void saveOrUpdateAutoVideoUsedCount(Long accountId, String signature, Integer videoType, String createType);
 }

Diferenças do arquivo suprimidas por serem muito extensas
+ 1296 - 1079
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoDoServiceImpl.java


+ 5 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoTargetServiceImpl.java

@@ -75,4 +75,9 @@ public class AiKuaishouAccountAutoTargetServiceImpl extends ServiceImpl<AiKuaish
         return Result.ok("修改失败");
     }
 
+    @Override
+    public List<AiKuaishouAccountAutoTarget> getAutoTargetByIds(List<String> list) {
+        return accountAutoTargetMapper.getAutoTargetByIds(list);
+    }
+
 }

+ 11 - 12
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoVideoServiceImpl.java

@@ -10,7 +10,6 @@ import cn.com.ctop.common.module.utils.PropertiesUtils;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoVideo;
 import cn.com.ctop.kuaishou.modules.ai.mapper.AiKuaishouAccountAutoVideoMapper;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouAccountAutoVideoService;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -44,13 +43,13 @@ public class AiKuaishouAccountAutoVideoServiceImpl extends ServiceImpl<AiKuaisho
     private ICtopOauthTokenService tokenService;
 
     @Override
-    public List<AiKuaishouAccountAutoVideo> getUpNewVideos(Long accountId, Integer channelType, String keyword, Integer videoCnt, String statDate) {
-        return autoVideoMapper.getUpNewVideos(accountId, channelType, keyword, videoCnt, statDate);
+    public List<AiKuaishouAccountAutoVideo> getUpNewVideos(Long accountId, Integer channelType, String keyword, Integer videoCnt, String statDate, String createType) {
+        return autoVideoMapper.getUpNewVideos(accountId, channelType, keyword, videoCnt, statDate, createType);
     }
 
     @Override
-    public List<AiKuaishouAccountAutoVideo> getHistoryTopVideos(Long accountId, Integer channelType, String keyword, Integer videoCnt, String statDate) {
-        return autoVideoMapper.getHistoryTopVideos(accountId, channelType, keyword, videoCnt);
+    public List<AiKuaishouAccountAutoVideo> getHistoryTopVideos(Long accountId, Integer channelType, String keyword, Integer videoCnt, String statDate, String createType) {
+        return autoVideoMapper.getHistoryTopVideos(accountId, channelType, keyword, videoCnt, createType);
     }
 
     @Override
@@ -65,16 +64,15 @@ public class AiKuaishouAccountAutoVideoServiceImpl extends ServiceImpl<AiKuaisho
 
 
     @Override
-    public void saveOrUpdateAutoVideoUsedCount(Long accountId, String signature, Integer createType) {
-        Integer usageTimes = autoVideoMapper.getAutoVideoUsed(accountId, signature, createType);
-
+    public void saveOrUpdateAutoVideoUsedCount(Long accountId, String signature, Integer videoType, String createType) {
+        Integer usageTimes = autoVideoMapper.getAutoVideoUsed(accountId, signature, videoType, createType);
+        String date = DateUtils.formatDate(new Date());
         if (Check.isNull(usageTimes)) {
-            String date = DateUtils.formatDate(new Date());
             usageTimes = 1;
-            autoVideoMapper.addAutoVideoUsed(accountId, signature, createType,usageTimes,date);
+            autoVideoMapper.addAutoVideoUsed(accountId, signature, videoType, createType, usageTimes, date);
         } else {
             usageTimes += 1;
-            autoVideoMapper.updateAutoVideoUsed(accountId, signature, createType,usageTimes);
+            autoVideoMapper.updateAutoVideoUsed(accountId, signature, videoType, createType, usageTimes, date);
         }
     }
 
@@ -150,7 +148,8 @@ public class AiKuaishouAccountAutoVideoServiceImpl extends ServiceImpl<AiKuaisho
                 Integer newStatus = detailJson.getInteger("new_status");
                 if (newStatus == 1) {
                     //状态1是可用,其他状态不录存
-                    videoGet.setStatus(1);
+                    videoGet.setCustomStatus(1);
+                    videoGet.setProgramStatus(1);
                 } else {
                     continue;
                 }

+ 2 - 16
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java

@@ -801,7 +801,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         Long unitNum = customUnitCnt * hour / 20;
         log.info("{}当前时间内需要创建组总数:{}", strategy.getAccountId(), unitNum);
         //查询当前账户创建自定义类型组数量
-        int unitCreateCnt = groupService.queryToDayBuiltCount(strategy.getAccountId());
+        int unitCreateCnt = groupService.queryToDayBuiltCount(strategy.getAccountId(),4);
         log.info("{}截止目前创建组总数:{}", strategy.getAccountId(), unitCreateCnt);
         long remindCnt = unitNum - unitCreateCnt;
         if (remindCnt >= 1) {
@@ -834,7 +834,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         }
         log.info("{}当天可创建组总数:{}", strategy.getAccountId(), unitNum);
         //查询当前账户创建自定义类型组数量
-        int unitCreateCnt = groupService.queryToDayBuiltCount(strategy.getAccountId());
+        int unitCreateCnt = groupService.queryToDayBuiltCount(strategy.getAccountId(),4);
         log.info("{}截止目前创建组总数:{}", strategy.getAccountId(), unitCreateCnt);
         long remindCnt = unitNum - unitCreateCnt;
         if (remindCnt >= 1) {
@@ -1438,20 +1438,6 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         return Long.valueOf(bidString);
     }
 
-    private JSONArray cleanPramgramErrorScence(JSONArray scenceArray) {
-        JSONArray result = new JSONArray();
-        if (null == scenceArray || scenceArray.isEmpty()) {
-            return result;
-        }
-        for (int i = 0; i < scenceArray.size(); i++) {
-            Integer senceId = scenceArray.getInteger(i);
-            if (senceId != 5 && senceId != 3) {
-                result.add(senceId);
-            }
-        }
-        return result;
-    }
-
     /**
      * 获取定向包
      *

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouProjectCreateCreativeServiceImpl.java

@@ -145,7 +145,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
         int unitNum = customUnitCnt * hour / 20;
         log.info("{}当前时间内需要创建组总数:{}", strategy.getAccountId(), unitNum);
         //查询当前账户创建自定义类型组数量
-        int unitCreateCnt = groupService.queryToDayBuiltCount(strategy.getAccountId());
+        int unitCreateCnt = groupService.queryToDayBuiltCount(strategy.getAccountId(), 4);
         log.info("{}截止目前创建组总数:{}", strategy.getAccountId(), unitCreateCnt);
         int remindCnt = unitNum - unitCreateCnt;
         int concat = strategy.getSourceMaterial().contains("3") ? 3 : 0;
@@ -185,7 +185,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
             }
             log.info("{}可创建组总数:{}", strategy.getAccountId(), customUnitCnt);
             //查询当前账户创建自定义类型组数量
-            int unitCreateCnt = groupService.queryToDayBuiltCount(strategy.getAccountId());
+            int unitCreateCnt = groupService.queryToDayBuiltCount(strategy.getAccountId(), 4);
             log.info("{}截止目前创建组总数:{}", strategy.getAccountId(), unitCreateCnt);
             int remindCnt = customUnitCnt - unitCreateCnt;
             if (remindCnt >= 1) {

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/KuaiShouGroupController.java

@@ -184,7 +184,7 @@ public class KuaiShouGroupController {
     @GetMapping(value = "/queryToDayBuiltCount")
     public Result<Object> queryToDayBuiltCount(Long accountId) {
         try {
-            int count = kuaiShouGroupService.queryToDayBuiltCount(accountId);
+            int count = kuaiShouGroupService.queryToDayBuiltCount(accountId, 4);
             return Result.ok(600 - count);
         } catch (Exception e) {
             e.printStackTrace();

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaiShouGroupMapper.java

@@ -30,7 +30,7 @@ public interface KuaiShouGroupMapper extends BaseMapper<KuaiShouGroup> {
 
     List<KuaiShouGroup> queryUnitInfoByCampaignId(@Param("accountId") Long accountId, @Param("campaignId") Long campaignId);
 
-    Integer queryToDayBuiltCount(@Param("accountId") Long accountId, @Param("date") String date);
+    Integer queryToDayBuiltCount(@Param("accountId") Long accountId, @Param("date") String date,@Param("unitType") Integer unitType);
 
     void deleteByAccountId(@Param("accountId") Long accountId);
 

+ 1 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouGroupMapper.xml

@@ -140,6 +140,7 @@
         WHERE account_id = #{accountId}
           AND create_channel =1
           AND group_create_time like concat(#{date},'%')
+          AND unit_type = #{unitType}
     </select>
     <select id="getNewDataByAccountIdAndDate" resultType="java.lang.Integer">
      select

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaiShouGroupService.java

@@ -39,7 +39,7 @@ public interface IKuaiShouGroupService extends IService<KuaiShouGroup> {
 
     KuaiShouGroup selectGroupByUnitId(Long accountId, Long unitId);
 
-    Integer queryToDayBuiltCount(Long accountId);
+    Integer queryToDayBuiltCount(Long accountId,Integer unitType);
 
     void deleteByAccountId(Long accountId);
 

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaiShouGroupServiceImpl.java

@@ -132,9 +132,9 @@ public class KuaiShouGroupServiceImpl extends ServiceImpl<KuaiShouGroupMapper, K
     }
 
     @Override
-    public Integer queryToDayBuiltCount(Long accountId) {
+    public Integer queryToDayBuiltCount(Long accountId,Integer unitType) {
         String date = DateUtil.formatDate(new Date());
-        return groupMapper.queryToDayBuiltCount(accountId, date);
+        return groupMapper.queryToDayBuiltCount(accountId, date,unitType);
     }
 
     @Override

+ 2 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/xml/KuaishouChannelMapper.xml

@@ -223,7 +223,8 @@
         channel_name,
         click_track_url,
         actionbar_click_url,
-        schema_uri
+        schema_uri,
+        have_cycle_times
         FROM `ctop_kuaishou_channel`
         WHERE strategy_id IN
         <foreach collection="strategys" item="item" separator=","

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/mapper/xml/KuaishouChannelRelMapper.xml

@@ -4,7 +4,7 @@
 
     <select id="queryByAccountChannelCode"
             resultType="cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannelRel">
-        SELECT *
+        SELECT t1.*
         FROM ctop_kuaishou_channel_rel t1
                  LEFT JOIN ctop_kuaishou_channel_app_info t2 ON t1.app_id = t2.app_id
         WHERE t1.account_id =#{accountId}

+ 0 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/IKuaishouChannelService.java

@@ -1,7 +1,5 @@
 package cn.com.ctop.kuaishou.modules.channel.service;
 
-import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoVideo;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -9,8 +7,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.common.api.vo.Result;
 import org.springframework.web.multipart.MultipartFile;
 
-import java.util.List;
-
 /**
  * 渠道号信息表
  *
@@ -44,5 +40,4 @@ public interface IKuaishouChannelService extends IService<KuaishouChannel> {
 
     Result<Object> queryChannelList(Long accountId, String appName);
 
-    List<JSONObject> queryGroupChannel(Long accountId, String appName, List<AiKuaishouAccountAutoVideo> newVideos);
 }

+ 0 - 22
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/channel/service/impl/KuaishouChannelServiceImpl.java

@@ -14,7 +14,6 @@ import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouAccountAutoVideo;
 import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaiShouAppInfoService;
 import cn.com.ctop.kuaishou.modules.ai.service.IKuaishouAppPackageService;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAppList;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAppListService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCreativeService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouMaterialUploadService;
@@ -1116,27 +1115,6 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
         return Result.ok(pageInfo);
     }
 
-    //TODO
-    @Override
-    public List<JSONObject> queryGroupChannel(Long accountId, String appName, List<AiKuaishouAccountAutoVideo> newVideos) {
-        //查询账户策略
-        List<KuaishouChannelCreateStrategy> strategys = channelCreateStrategyService.queryChannelStrategyByAccountId(accountId);
-        if (Check.isNull(strategys) || strategys.isEmpty()) {
-            //查询账户所在项目策略
-            strategys = channelCreateStrategyService.queryChannelStrategyByProjectId(accountId);
-            if (Check.isNull(strategys) || strategys.isEmpty()) {
-                log.error("****** 渠道号获取失败,该账户没有创建过渠道号");
-                return null;
-            }
-        }
-        //所有策略下的 使用范围,使用层级,是否循环等字段 保持一致
-        KuaishouChannelCreateStrategy createStrategy = strategys.get(0);
-        Integer usageRange = createStrategy.getUsageRange();
-        String usageLevel = createStrategy.getUsageLevel();
-//        doGroupLevel(accountId, strategys, appName, 0, photoName);
-        return null;
-    }
-
     private Result<Object> doAccountRangeAccountLevel(Long accountId, List<KuaishouChannelCreateStrategy> strategys, String appName) throws Exception {
         List<KuaishouChannel> channelList = channelMapper.queryByAccountIdLevel(accountId, "account");
         if (!Check.isNull(channelList)) {