Browse Source

渠道号——修改

zhaoxian 3 years ago
parent
commit
968f624287

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

@@ -1792,6 +1792,8 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
             //判断是否扔可创建计划
             if (planCnt > datas.size()) {
                 return createCampaign(strategy, token, videoType, uuid, channel);
+            }else{
+                log.info("当日创建量已达标");
             }
         } else {
             return createCampaign(strategy, token, videoType, uuid, channel);

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

@@ -234,10 +234,10 @@
             t1.account_id = #{accountId}
           AND t1.state = 1
           AND t1.channel_state = 1
-          AND app_id is not null
+          AND t1.app_id is not null
           and t1.usage_level = 'account'
         <if test="appName != null">
-            AND app_id in (
+            AND t1.app_id in (
             SELECT DISTINCT app_id FROM ctop_kuaishou_channel_app_info where app_name = #{appName}  and app_id is not null
             )
         </if>
@@ -264,11 +264,11 @@
           AND t1.channel_state = 1
           AND app_id is not null
           AND t1.channel_code not in (
-            SELECT channel_code FROM ctop_kuaishou_channel_rel WHERE account_id = #{accountId}
+            SELECT channel_code FROM ctop_kuaishou_channel_rel WHERE account_id = #{accountId}  AND unit_id is not null
         )
         <if test="appName != null">
-            AND app_id in (
-            SELECT DISTINCT app_id FROM ctop_kuaishou_channel_app_info where app_name = #{appName}  and app_id is not null
+            AND t1.app_id in (
+            SELECT DISTINCT app_id FROM ctop_kuaishou_channel_app_info WHERE app_name = #{appName}  AND app_id is not null
             )
         </if>
         ORDER BY t1.create_time,t1.channel_number
@@ -292,7 +292,7 @@
           AND t1.channel_state = 1
           AND app_id is not null
         <if test="appName != null">
-            AND app_id in (
+            AND t1.app_id in (
             SELECT DISTINCT app_id FROM ctop_kuaishou_channel_app_info where app_name = #{appName}  and app_id is not null
             )
         </if>

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

@@ -169,15 +169,8 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
      */
     private boolean checkChannelCode(KuaishouChannelCreateStrategy strategy) {
         String numberValue = strategy.getNumberValue().trim();
-        Integer min = null;
-        Integer max = null;
-        if (numberValue.contains("-")) {
-            String[] split = numberValue.split("-");
-            min = Integer.valueOf(split[0]);
-            max = Integer.valueOf(split[1]);
-            strategy.setNumberMin(min);
-            strategy.setNumberMax(max);
-        }
+        Integer min = strategy.getNumberMin();
+        Integer max = strategy.getNumberMax();
 
         QueryWrapper<KuaishouChannelCreateStrategy> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("product_id", strategy.getProductId());
@@ -243,6 +236,15 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
             queryWrapper.eq("account_id", strategy.getAccountId());
         }
         queryWrapper.eq("project_id", strategy.getProjectId());
+        Integer numberMin = 0;
+        Integer numberMax = 0;
+        if (strategy.getNumberValue().contains("-")) {
+            String[] split = strategy.getNumberValue().split("-");
+            numberMin = Integer.valueOf(split[0]);
+            numberMax = Integer.valueOf(split[1]);
+            strategy.setNumberMin(numberMin);
+            strategy.setNumberMax(numberMax);
+        }
         //查询是否已经创建过策略,若已创建则某些字段必须一致,比如是否循环、使用层级
         KuaishouChannelCreateStrategy one = channelCreateStrategyService.getOne(queryWrapper.last("limit 1"));
         if (!Check.isNull(one)) {
@@ -279,8 +281,6 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
             if (!strategy.getNumberValue().contains("-")) {
                 return customizedCreate(strategy);
             }
-            Integer numberMin = strategy.getNumberMin();
-            Integer numberMax = strategy.getNumberMax();
             Integer usageRange = strategy.getUsageRange();
             if (usageRange == 2) {
                 /*==========================范围是 项目==========================*/
@@ -918,6 +918,14 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
                 }
                 strategy.setCreateType(createType);
 
+                if (strategy.getNumberValue().contains("-")) {
+                    String[] split = strategy.getNumberValue().split("-");
+                    Integer numberMin = Integer.valueOf(split[0]);
+                    Integer numberMax = Integer.valueOf(split[1]);
+                    strategy.setNumberMin(numberMin);
+                    strategy.setNumberMax(numberMax);
+                }
+
                 QueryWrapper<KuaishouChannelCreateStrategy> queryWrapper = new QueryWrapper<>();
                 queryWrapper.eq("product_id", strategy.getProductId());
                 if (!Check.isNull(strategy.getAccountId())) {