Browse Source

渠道号。。。修改bug

zhaoxian 3 years ago
parent
commit
430ba419ce

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

@@ -323,6 +323,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                         }
                     } else {
                         log.error("通过账户(" + accountId + ")未获取到渠道号!!!");
+                        return videoCnt;
                     }
                 } catch (Exception e) {
                     e.printStackTrace();
@@ -359,12 +360,13 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                         if (code == 200) {
                             channel = (KuaishouChannel) result.getResult();
                             if (Check.isNull(channel)) {
-                                log.info("账户(组级):{},{}", accountId, result.getMessage());
+                                log.info("(组级)账户:{},{}", accountId, result.getMessage());
                             } else {
-                                log.info("获取到组级渠道号:{}", channel.getChannelCode());
+                                log.info("(组级)获取到渠道号:{}", channel.getChannelCode());
                             }
                         } else {
-                            log.error("通过账户(" + accountId + ")未获取到渠道号!!!");
+                            log.error("(组级)通过账户(" + accountId + ")未获取到渠道号!!!");
+                            continue;
                         }
                     } catch (Exception e) {
                         e.printStackTrace();
@@ -656,6 +658,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                         }
                     } else {
                         log.error("通过账户(" + accountId + ")未获取到渠道号!!!");
+                        return;
                     }
                 } catch (Exception e) {
                     e.printStackTrace();
@@ -687,12 +690,13 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                         if (code == 200) {
                             channel = (KuaishouChannel) result.getResult();
                             if (Check.isNull(channel)) {
-                                log.info("账户(组级):{},{}", accountId, result.getMessage());
+                                log.info("(组级)账户:{},{}", accountId, result.getMessage());
                             } else {
-                                log.info("获取到组级渠道号:{}", channel.getChannelCode());
+                                log.info("(组级)获取到渠道号:{}", channel.getChannelCode());
                             }
                         } else {
-                            log.error("通过账户(" + accountId + ")未获取到渠道号!!!");
+                            log.error("(组级)通过账户(" + accountId + ")未获取到渠道号!!!");
+                            continue;
                         }
                     } catch (Exception e) {
                         e.printStackTrace();

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

@@ -7,7 +7,7 @@
         SELECT *
         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 =#{channelCode}
+        WHERE t1.account_id =#{accountId}
           AND t2.app_name = #{appName}
           AND channel_code =  #{channelCode} limit 1
     </select>

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

@@ -568,6 +568,15 @@ public class KuaishouChannelServiceImpl extends ServiceImpl<KuaishouChannelMappe
 
         //渠道号
         String channelCode = strategy.getChannelCode().replace(NUMBER_STR, numberStr).trim();
+        channelCode = channelCode.replace("--", "-");
+        channelCode = channelCode.replace("--", "-");
+        if (channelCode.startsWith("-")) {
+            channelCode = channelCode.substring(1, channelCode.length());
+        }
+        if (channelCode.endsWith("-")) {
+            channelCode = channelCode.substring(0, channelCode.length() - 1);
+        }
+
         channelStrategy.setChannelCode(channelCode);
         String channelName = strategy.getChannelName();
         if (channelName.contains(CHANNEL_STR) || channelName.contains(NUMBER_STR)) {