Browse Source

大数据去重逻辑修改

wangyunpeng 1 month ago
parent
commit
71b2e83792

+ 3 - 3
api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformDatastatJob.java

@@ -71,7 +71,7 @@ public class ContentPlatformDatastatJob {
                 "left join loghubods.out_channel_mid_split_total fission " +
                 "on first_level.channel_shortname = fission.channel_shortname and first_level.subchannel = fission.subchannel and first_level.dt = fission.dt " +
                 "and first_level.type = fission.type and first_level.tag = fission.tag " +
-                "WHERE   first_level.dt = %s and first_level.type = '公众号即时回复' and first_level.tag = '投放渠道内分客户分账号去重';", dt);
+                "WHERE   first_level.dt = %s and first_level.type = '公众号即时回复' and first_level.tag = '投放渠道客户分账号去重';", dt);
         List<Record> dataList = OdpsUtil.getOdpsData(sql);
         // 所有公众号
         List<ContentPlatformGzhAccount> accountList = getAllGzhAccount();
@@ -201,7 +201,7 @@ public class ContentPlatformDatastatJob {
                 "left join loghubods.out_channel_mid_split_total fission " +
                 "on first_level.subchannel = fission.subchannel and first_level.dt = fission.dt " +
                 "and first_level.type = fission.type and first_level.tag = fission.tag " +
-                "WHERE   first_level.dt = %s and first_level.type = '服务号代运营' and first_level.tag = '投放渠道内分客户分账号去重' ;", dt);
+                "WHERE   first_level.dt = %s and first_level.type = '服务号代运营' and first_level.tag = '投放渠道客户分账号去重' ;", dt);
         List<Record> dataList = OdpsUtil.getOdpsData(sql);
         // 所有公众号
         List<ContentPlatformGzhAccount> accountList = getAllGzhAccount();
@@ -571,7 +571,7 @@ public class ContentPlatformDatastatJob {
                 "left join loghubods.out_channel_mid_split_total fission " +
                 "on first_level.channel_shortname = fission.channel_shortname and first_level.subchannel = fission.subchannel and first_level.dt = fission.dt " +
                 "and first_level.type = fission.type and first_level.tag = fission.tag " +
-                "WHERE   first_level.dt = %s and first_level.type = '企微外部' and first_level.tag = '投放渠道内分客户分账号去重' ;", dt);
+                "WHERE   first_level.dt = %s and first_level.type = '企微外部' and first_level.tag = '投放渠道客户分账号去重' ;", dt);
         List<Record> outDataList = OdpsUtil.getOdpsData(outSql);
         List<ContentPlatformAccount> accountList = getAllAccount();
         Map<String, ContentPlatformAccount> accountMap = accountList.stream()

+ 4 - 31
api-module/src/test/java/com/tzld/piaoquan/api/ContentPlatformTest.java

@@ -1,56 +1,29 @@
 package com.tzld.piaoquan.api;
 
 import com.tzld.piaoquan.api.job.ContentPlatformDatastatJob;
-import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformCooperateAccountService;
-import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
 import com.tzld.piaoquan.growth.common.utils.DateUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 
-import java.util.Arrays;
 import java.util.List;
 
 @SpringBootTest(classes = GrowthServerApplication.class)
 @Slf4j
 public class ContentPlatformTest {
 
-    @Autowired
-    ContentPlatformCooperateAccountService cooperateAccountService;
-
-    @Autowired
-    ContentPlatformPlanService planService;
-
     @Autowired
     ContentPlatformDatastatJob datastatJob;
 
-    @Test
-    public void testImportGzhAccount() {
-        List<String> channels = Arrays.asList("ml","yy","zh","llf","wxm","hc","xs","wx","yqst","lq","bh","qd","bz","sw","pj","cy","xsy","ls","zqh");
-        cooperateAccountService.gzhImport(channels);
-    }
-
-    @Test
-    public void testImportGzhPlan() {
-        List<String> channels = Arrays.asList("ml","yy","zh","llf","wxm","hc","xs","wx","yqst","lq","bh","qd","bz","sw","pj","cy","xsy","ls","zqh");
-        planService.gzhPlanImport(channels);
-    }
-
-    @Test
-    public void testImportQwPlan() {
-        List<String> channels = Arrays.asList("ml2025", "mj", "nh", "qc", "tczy", "wb", "xj", "wxm", "xycsd", "shy");
-        planService.qwPlanImport(channels);
-    }
-
-
     @Test
     public void testSyncContentPlatformQwDatastatReplyTotalJob() {
-        List<String> dtList = DateUtil.getBeforeDays(14);
+        List<String> dtList = DateUtil.getBeforeDays(1);
         for (String dt : dtList) {
-            datastatJob.syncContentPlatformQwDatastatReplyTotalJob(dt);
+            datastatJob.syncContentPlatformGzhDatastatJob(dt);
+            datastatJob.syncContentPlatformFwhDatastatJob(dt);
+            datastatJob.syncContentPlatformQwDatastatSubChannelJob(dt);
         }
     }
 
-
 }