Bläddra i källkod

Merge remote-tracking branch 'origin/master'

syh 4 år sedan
förälder
incheckning
c93956102c

+ 4 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/controller/BatchController.java

@@ -918,7 +918,7 @@ public class BatchController {
                                 failArr.add(failJson);
                             } else {
                                 //更新数据状态
-                                shouGroupDailyReportService.updateStatus(accountId,unitId,putStatus);
+                                shouGroupDailyReportService.updateStatus(accountId, unitId, putStatus);
                             }
                         }
                     }
@@ -2266,12 +2266,12 @@ public class BatchController {
         Result<Boolean> result = new Result<>();
         try {
             String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-            String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -30);
+            String startDate = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -7);
             syncPullMaterialService.getSyncVideoList(accountId, startDate, nowDate);
-            Thread.sleep(5 * 1000L);
             result.setSuccess(true);
             result.setResult(true);
-        } catch (InterruptedException e) {
+        } catch (Exception e) {
+            result.setSuccess(false);
             e.printStackTrace();
         }
 

+ 3 - 22
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/SyncPullMaterialServiceImpl.java

@@ -2,15 +2,12 @@ package cn.com.ctop.kuaishou.modules.batch.service.impl;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.Check;
-import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouAdvertiserBaseInfo;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouAdvertiserBaseInfoService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.batch.service.ISyncPullMaterialService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -26,8 +23,7 @@ public class SyncPullMaterialServiceImpl implements ISyncPullMaterialService {
     private ICtopOauthTokenService oauthTokenService;
     @Autowired
     private IKuaishouInterfaceService iKuaishouInterfaceService;
-    static ExecutorService videoExecutorService = Executors.newFixedThreadPool(10);
-    static ExecutorService suZhaoExecutorService = Executors.newFixedThreadPool(10);
+
 
 
     /**
@@ -39,23 +35,8 @@ public class SyncPullMaterialServiceImpl implements ISyncPullMaterialService {
      */
     @Override
     public void getSyncVideoList(Long accountId, String startDate, String endDate) {
-        KuaiShouAdvertiserBaseInfo baseInfo = KuaiShouAdvertiserBaseInfoService.getBaseInfo(accountId);
-        if (!Check.isNull(baseInfo)) {
-            List<KuaiShouAdvertiserBaseInfo> baseInfoList = KuaiShouAdvertiserBaseInfoService.getAccountIdList(baseInfo.getUserId());
-            if (!Check.isNull(baseInfoList)) {
-                for (KuaiShouAdvertiserBaseInfo advertiserBaseInfo : baseInfoList) {
-                    CtopOauthToken token = oauthTokenService.getTokenByAccountId(advertiserBaseInfo.getAccountId());
-                    if (!Check.isNull(token)) {
-                        videoExecutorService.submit(new Runnable() {
-                            @Override
-                            public void run() {
-                                iKuaishouInterfaceService.getVideoList(token, startDate, endDate);
-                            }
-                        });
-                    }
-                }
-            }
-        }
+        CtopOauthToken token = oauthTokenService.getTokenByAccountId(accountId);
+        iKuaishouInterfaceService.getVideoList(token, startDate, endDate);
     }
 
 

+ 25 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/BytedanceAdvertiserDailyReport.java

@@ -363,6 +363,19 @@ public class BytedanceAdvertiserDailyReport {
     @Excel(name = "次留成本", width = 15)
     @ApiModelProperty(value = "次留成本")
     private BigDecimal nextDayOpenCost;
+    /**
+     * 应用下载广告数据-次留数
+     */
+    private Long attributionNextDayOpenCnt;
+    /**
+     * 应用下载广告数据-次留成本
+     */
+    private BigDecimal attributionNextDayOpenCost;
+    /**
+     * 应用下载广告数据-次留率
+     */
+    private BigDecimal attributionNextDayOpenRate;
+
     @Excel(name = "创建时间")
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
@@ -479,6 +492,18 @@ public class BytedanceAdvertiserDailyReport {
         if (null != nextDayOpenRate) {
             this.nextDayOpenRate = nextDayOpenRate;
         }
+        Long attributionNextDayOpenCnt = data.getLong("attribution_next_day_open_cnt");
+        if (null != attributionNextDayOpenCnt) {
+            this.attributionNextDayOpenCnt = attributionNextDayOpenCnt;
+        }
+        BigDecimal attributionNextDayOpenCost = data.getBigDecimal("attribution_next_day_open_cost");
+        if (null != attributionNextDayOpenCost) {
+            this.attributionNextDayOpenCost = attributionNextDayOpenCost;
+        }
+        BigDecimal attributionNextDayOpenRate = data.getBigDecimal("attribution_next_day_open_rate");
+        if (null != attributionNextDayOpenRate) {
+            this.attributionNextDayOpenRate = attributionNextDayOpenRate;
+        }
         Long mapSearch = data.getLong("map_search");
         if (null != mapSearch) {
             this.mapSearch = mapSearch;

+ 25 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/entity/BytedanceAdvertiserHourlyReport.java

@@ -356,6 +356,7 @@ public class BytedanceAdvertiserHourlyReport {
     @Excel(name = "次留数", width = 15)
     @ApiModelProperty(value = "次留数")
     private Long nextDayOpen;
+
     /**
      * 次留率
      */
@@ -369,6 +370,18 @@ public class BytedanceAdvertiserHourlyReport {
     @ApiModelProperty(value = "次留成本")
     private BigDecimal nextDayOpenCost;
     /**
+     * 应用下载广告数据-次留数
+     */
+    private Long attributionNextDayOpenCnt;
+    /**
+     * 应用下载广告数据-次留成本
+     */
+    private BigDecimal attributionNextDayOpenCost;
+    /**
+     * 应用下载广告数据-次留率
+     */
+    private BigDecimal attributionNextDayOpenRate;
+    /**
      * createTime
      */
     @ApiModelProperty(value = "createTime")
@@ -493,6 +506,18 @@ public class BytedanceAdvertiserHourlyReport {
         if (null != getNextDayOpenRate) {
             this.nextDayOpenRate = getNextDayOpenRate;
         }
+        Long attributionNextDayOpenCnt = data.getLong("attribution_next_day_open_cnt");
+        if (null != attributionNextDayOpenCnt) {
+            this.attributionNextDayOpenCnt = attributionNextDayOpenCnt;
+        }
+        BigDecimal attributionNextDayOpenCost = data.getBigDecimal("attribution_next_day_open_cost");
+        if (null != attributionNextDayOpenCost) {
+            this.attributionNextDayOpenCost = attributionNextDayOpenCost;
+        }
+        BigDecimal attributionNextDayOpenRate = data.getBigDecimal("attribution_next_day_open_rate");
+        if (null != attributionNextDayOpenRate) {
+            this.attributionNextDayOpenRate = attributionNextDayOpenRate;
+        }
         Long getMapSearch = data.getLong("map_search");
         if (null != getMapSearch) {
             this.mapSearch = getMapSearch;