Browse Source

视频库-更新视频关联创意数 变更查询条件2

zhaoxian 4 years ago
parent
commit
1e64d4e725

+ 2 - 2
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAudienceReportJob.java

@@ -44,8 +44,8 @@ public class KuaishouDailyAudienceReportJob {
             XxlJobHelper.handleFail();
             return;
         }
-        //查询有效策略的账户ID
-        List<Long> accountIds = kuaishouStrategyService.queryActiveAccount();
+        //查询手淘有效账户数据
+        List<Long> accountIds = kuaishouStrategyService.queryShouTaoAccounts();
         if (Check.isNull(accountIds) || accountIds.size() == 0) {
             XxlJobHelper.log("定时获取人群分析报表数据异常:未获取到有效策略账户信息");
             XxlJobHelper.handleFail();

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouStrategyMapper.java

@@ -18,4 +18,6 @@ public interface KuaishouStrategyMapper extends BaseMapper<KuaishouStrategy> {
     List<JSONObject> queryPlanIdsByStrategyId(Long id);
 
     List<Long> queryActiveAccount();
+
+    List<Long> queryShouTaoAccounts();
 }

+ 9 - 6
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouStrategyMapper.xml

@@ -12,12 +12,15 @@
     </select>
 
     <select id="queryActiveAccount" resultType="java.lang.Long">
-        select account_id from ctop_ai_kuaishou_advertiser_strategy where campaign_name like '%上下滑&信息流%' and status = 1 GROUP BY account_id
-    </select>
-
-
-     <!--  SELECT account_id FROM ctop_ai_kuaishou_advertiser_strategy
+        SELECT account_id FROM ctop_ai_kuaishou_advertiser_strategy
         WHERE timer_task_status = 1
-        GROUP BY account_id-->
+        GROUP BY account_id
+    </select>
 
+    <select id="queryShouTaoAccounts" resultType="java.lang.Long">
+        select t1.account_id from ctop_ai_kuaishou_advertiser_strategy t1
+        LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
+        where t2.project_id = 458
+        AND t1.status = 1
+    </select>
 </mapper>

+ 2 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouStrategyService.java

@@ -46,4 +46,6 @@ public interface IKuaishouStrategyService extends IService<KuaishouStrategy> {
      * @author ZHAOXA
      */
     List<Long> queryActiveAccount();
+
+    List<Long> queryShouTaoAccounts();
 }

+ 5 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouStrategyServiceImpl.java

@@ -152,6 +152,11 @@ public class KuaishouStrategyServiceImpl extends ServiceImpl<KuaishouStrategyMap
         return kuaishouStrategyMapper.queryActiveAccount();
     }
 
+    @Override
+    public List<Long> queryShouTaoAccounts() {
+        return kuaishouStrategyMapper.queryShouTaoAccounts();
+    }
+
     public JSONArray createGroupLevelStrategy(CtopOauthToken oauthToken, JSONObject data) {
         JSONArray resultArr = new JSONArray();
         JSONArray groupInfo = data.getJSONArray("groupInfo");