yumeng 5 mesiacov pred
rodič
commit
c280c8caa8

+ 26 - 12
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/controller/KuaishouController.java

@@ -303,19 +303,33 @@ public class KuaishouController {
     private CompassBindAdvertisersService compassBindAdvertisersService;
 
     @GetMapping(value = "testD")
-    public void testD() throws Exception {/*
-        Long advertiserId = 4361966075L;
-        String token = tokenService.getOuthTokenAccountId(39526067L);
-        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId,token);*/
+    public void testD() throws Exception {
+        List<Long> list = compassBindAdvertisersService.getAccountList();
+
+        for (int i = 0; i < list.size(); i++) {
+            Long accountId = list.get(i);
+            CompassBindAdvertisers advertiser = compassBindAdvertisersService.getByAccountId(String.valueOf(accountId));
+            String corporationName = advertiser.getCorporationName();
+            String token;
+            if (!Check.isNull(corporationName) && corporationName.contains("骄阳")) {
+                //723 骄阳token
+                token = tokenService.getAgentTokenByAgentId(723L);
+            } else {
+                //汇创
+                token = tokenService.getAgentTokenByAgentId(14L);
+            }
+            dailyExecutorService.submit(
+                    new Runnable() {
+                        @Override
+                        public void run() {
+                            compassBindAdvertisersService.getCompassAdvertisersCampaignReportDaily(
+                                    Long.valueOf(accountId), token, "2025-01-14", "2025-01-15", 1);
+                        }
+                    });
+
+        }
+
 
-        String token = tokenService.getAgentTokenByAgentId(723L);
-        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-        String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1);
-//        List<CompassBindAdvertisers> list = compassBindAdvertisersService.list();
-//        for (CompassBindAdvertisers compassBindAdvertisers : list) {
-            compassBindAdvertisersService.getCompassAdvertisersUnitReportDaily(
-                    37310866L, token, yesterday, yesterday, 1);
-//        }
     }
 
 

+ 2 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/CompassBindAdvertisersMapper.java

@@ -26,4 +26,6 @@ public interface CompassBindAdvertisersMapper extends BaseMapper<CompassBindAdve
     void replaceBatchVideoList(@Param("videoGetList") List<KuaishouVideoList> videoGetList);
 
     CompassBindAdvertisers getByAccountId(@Param("accountId") String accountId);
+
+    List<Long> getAccountList();
 }

+ 4 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/mapper/xml/CompassBindAdvertisersMapper.xml

@@ -920,5 +920,9 @@
         from `media_api`.compass_bind_advertisers
         where advertiser_id = #{accountId}
     </select>
+    <select id="getAccountList" resultType="java.lang.Long">
+        select advertiser_id
+        from `media_api`.compass_bind_advertisers
+    </select>
 
 </mapper>

+ 4 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/CompassBindAdvertisersService.java

@@ -3,6 +3,8 @@ package cn.com.ctop.job.kuaishou.data.service;
 import cn.com.ctop.job.kuaishou.data.entity.CompassBindAdvertisers;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 public interface CompassBindAdvertisersService extends IService<CompassBindAdvertisers> {
 
     void openapiGwUcV1Advertisers(Long advertiserId, String token);
@@ -18,4 +20,6 @@ public interface CompassBindAdvertisersService extends IService<CompassBindAdver
     void getVideoList(Long valueOf, String token, String startDate, String endDate, int i);
 
     CompassBindAdvertisers getByAccountId(String accountId);
+
+    List<Long> getAccountList();
 }

+ 5 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/CompassBindAdvertisersServiceImpl.java

@@ -819,4 +819,9 @@ public class CompassBindAdvertisersServiceImpl extends ServiceImpl<CompassBindAd
     public CompassBindAdvertisers getByAccountId(String accountId) {
         return baseMapper.getByAccountId(accountId);
     }
+
+    @Override
+    public List<Long> getAccountList() {
+        return baseMapper.getAccountList();
+    }
 }

+ 48 - 0
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/CompassBindAdvertisersJob.java

@@ -115,6 +115,54 @@ public class CompassBindAdvertisersJob {
         log.info("------【获取罗盘绑定广告主列】执行完成");
 
 
+        Long advertiserId16 = 4583857834L;
+        String token16 = tokenService.getOuthTokenAccountId(55884757L);
+        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId16, token16);
+        log.info("------【获取罗盘绑定广告主列】执行完成");
+
+        Long advertiserId17 = 4583881875L;
+        String token17 = tokenService.getOuthTokenAccountId(55890192L);
+        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId17, token17);
+        log.info("------【获取罗盘绑定广告主列】执行完成");
+
+
+        Long advertiserId18 = 4583911135L;
+        String token18 = tokenService.getOuthTokenAccountId(55909821L);
+        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId18, token18);
+        log.info("------【获取罗盘绑定广告主列】执行完成");
+
+
+        Long advertiserId19 = 4583930765L;
+        String token19 = tokenService.getOuthTokenAccountId(55915385L);
+        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId19, token19);
+        log.info("------【获取罗盘绑定广告主列】执行完成");
+
+        Long advertiserId20 = 4583948298L;
+        String token20 = tokenService.getOuthTokenAccountId(55920227L);
+        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId20, token20);
+        log.info("------【获取罗盘绑定广告主列】执行完成");
+
+
+        Long advertiserId21 = 4584290787L;
+        String token21 = tokenService.getOuthTokenAccountId(56007657L);
+        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId21, token21);
+        log.info("------【获取罗盘绑定广告主列】执行完成");
+
+        Long advertiserId22 = 4584321933L;
+        String token22 = tokenService.getOuthTokenAccountId(56023739L);
+        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId22, token22);
+        log.info("------【获取罗盘绑定广告主列】执行完成");
+
+        Long advertiserId23 = 4584356474L;
+        String token23 = tokenService.getOuthTokenAccountId(56032555L);
+        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId23, token23);
+        log.info("------【获取罗盘绑定广告主列】执行完成");
+
+        Long advertiserId24 = 4584568971L;
+        String token24 = tokenService.getOuthTokenAccountId(56123878L);
+        compassBindAdvertisersService.openapiGwUcV1Advertisers(advertiserId24, token24);
+        log.info("------【获取罗盘绑定广告主列】执行完成");
+
 
     }