Переглянути джерело

Merge remote-tracking branch 'origin/master'

yumeng 4 роки тому
батько
коміт
230dc47b7c

+ 7 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceDailyMaterialReportJob.java

@@ -2,6 +2,7 @@ package cn.com.ctop.job.bytedance.handler;
 
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import com.xxl.job.core.context.XxlJobHelper;
@@ -10,6 +11,7 @@ import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
 import java.util.Date;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
@@ -24,7 +26,8 @@ public class BytedanceDailyMaterialReportJob {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IBytedanceReportService bytedanceReportService;
-
+    @Resource
+    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
     @XxlJob("bytedanceDailyMaterialReportJob")
     public void execute() throws Exception {
         Date getDate2 = DateUtils.addDay(new Date(), -2);
@@ -67,6 +70,9 @@ public class BytedanceDailyMaterialReportJob {
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
+        bytedanceReportMaterialDailyMapper.updateImageReportCode();
+        bytedanceReportMaterialDailyMapper.updateImageReportProjectId();
+        bytedanceReportMaterialDailyMapper.updateImageReportProjectName();
         Long end = System.currentTimeMillis();
         XxlJobHelper.log("头条素材数据获取耗时:{}毫秒", end - start);
 

+ 3 - 3
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouVideoRelateCreativesJob.java

@@ -82,16 +82,16 @@ public class KuaishouVideoRelateCreativesJob {
         if (!Check.isNull(KuaiShouVideoGets)) {
             JSONArray dateList = new JSONArray();
             JSONArray photoIds = new JSONArray();
-            Map<String, Object> statdateMap = new HashMap<>();
+            Map<String, KuaiShouVideoGet> statdateMap = new HashMap<>();
             int count = 0;
             for (KuaiShouVideoGet video : KuaiShouVideoGets) {
                 count++;
                 if (count < 20) {
                     photoIds.add(video.getPhotoId());
-                    statdateMap.put(video.getPhotoId(), video.getStatDate());
+                    statdateMap.put(video.getPhotoId(), video);
                 } else {
                     photoIds.add(video.getPhotoId());
-                    statdateMap.put(video.getPhotoId(), video.getStatDate());
+                    statdateMap.put(video.getPhotoId(), video);
                     dateList.add(photoIds);
                     photoIds = new JSONArray();
                     count = 0;

+ 3 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/entity/KuaishouVideoRelateCreatives.java

@@ -46,6 +46,9 @@ public class KuaishouVideoRelateCreatives {
     @Excel(name = "视频id", width = 15)
     @ApiModelProperty(value = "视频id")
     private Long photoId;
+
+    private Integer channelType;
+
     private Date statDate;
     /**
      * 与此视频id关联的创意总数

+ 4 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouVideoRelateCreativesMapper.xml

@@ -7,7 +7,8 @@
         account_id,
         photo_id,
         creative_count,
-        stat_date
+        stat_date,
+        channel_type
         )
         values
         <foreach collection="videolist" item="video" separator=",">
@@ -15,7 +16,8 @@
             #{video.accountId},
             #{video.photoId},
             #{video.creativeCount},
-            #{video.statDate}
+            #{video.statDate},
+            #{video.channelType}
             )
         </foreach>
     </insert>

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

@@ -1,5 +1,6 @@
 package cn.com.ctop.kuaishou.modules.batch.service;
 
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouVideoRelateCreatives;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -19,7 +20,7 @@ public interface IKuaishouVideoRelateCreativesService extends IService<KuaishouV
 
     Result pushVideo(JSONObject data);
 
-    void videoRelateCreatives(Long accountId, JSONArray photoIds, Map<String, Object> statdateMap);
+    void videoRelateCreatives(Long accountId, JSONArray photoIds, Map<String, KuaiShouVideoGet> statdateMap);
 
     List<JSONObject> getVideoListByMap(Map<String, Object> requestMap);
 

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

@@ -6,6 +6,7 @@ import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.HttpUtils;
 import cn.com.ctop.common.module.utils.KuaishouInterfaceConstant;
 import cn.com.ctop.common.module.utils.PropertiesUtils;
+import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouVideoRelateCreatives;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouVideoRelateCreativesMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouVideoRelateCreativesService;
@@ -102,7 +103,7 @@ public class KuaishouVideoRelateCreativesServiceImpl extends ServiceImpl<Kuaisho
      * @author ZHAOXA
      */
     @Override
-    public void videoRelateCreatives(Long accountId, JSONArray photoIds, Map<String, Object> statdateMap) {
+    public void videoRelateCreatives(Long accountId, JSONArray photoIds, Map<String, KuaiShouVideoGet> statdateMap) {
         try {
             CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
             for (int i = 0; i < photoIds.size(); i++) {
@@ -128,7 +129,9 @@ public class KuaishouVideoRelateCreativesServiceImpl extends ServiceImpl<Kuaisho
                                 k.setAccountId(accountId);
                                 k.setPhotoId(object.getLong("photo_id"));
                                 k.setCreativeCount(object.getInteger("creative_count"));
-                                k.setStatDate((Date) statdateMap.get(object.getString("photo_id")));
+                                KuaiShouVideoGet shouVideoGet = statdateMap.get(object.getString("photo_id"));
+                                k.setStatDate(shouVideoGet.getStatDate());
+                                k.setChannelType(shouVideoGet.getChannelType());
                                 videolist.add(k);
                             }
                             kuaishouVideoRelateCreativesMapper.insertBatch(videolist);

+ 0 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportServiceImpl.java

@@ -516,9 +516,6 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             retry.setType(1);
             bytedanceReportMaterialDailyMapper.replaceMaterialRetry(retry);
         }
-        bytedanceReportMaterialDailyMapper.updateImageReportCode();
-        bytedanceReportMaterialDailyMapper.updateImageReportProjectId();
-        bytedanceReportMaterialDailyMapper.updateImageReportProjectName();
         log.info("头条素材报表结束 当前accountId为:{}  {}~{}" , accountId, startDate,endDate);
         return code;
     }