yumeng 4 anos atrás
pai
commit
18a282d49d

+ 7 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -80,12 +80,19 @@ public class TestController {
     private CrawlerDouyinMusicTaskService crawlerDouyinMusicTaskService;
     @Autowired
     private MusicInfoService musicInfoService;
+    @Autowired
+    private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
 
     static ExecutorService executorService = Executors.newFixedThreadPool(15);
     static ExecutorService videoService = Executors.newFixedThreadPool(5);
     static ExecutorService suzhaoService = Executors.newFixedThreadPool(10);
 
 
+    @GetMapping(value = "/getMd5")
+    public void getMd5() {
+        kuaiShouHistoryReportTaskService.getMd5();
+    }
+
     @GetMapping(value = "/getGroupReport")
     public void getGroupReport() throws ParseException {
         List<CtopOauthToken> tokens = oauthTokenService.selectKuaiShouToken();

+ 1 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouReportDailyMaterialMapper.xml

@@ -117,6 +117,7 @@
         <if test="statDate != null and statDate != '' ">
             and stat_date = #{statDate}
         </if>
+        group by photo_id
     </select>
 
     <select id="getVideoGetByPhotoId" resultType="cn.com.ctop.kuaishou.modules.report.entity.VideoGetvo">

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

@@ -15,4 +15,5 @@ public interface IKuaiShouHistoryReportTaskService extends IService<KuaiShouHist
 
     void getTaskList();
 
+    void getMd5();
 }

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

@@ -30,6 +30,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 /**
  * 快手历史数据任务记录
@@ -274,7 +276,7 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
         historyTypeList.add(2);
         historyTypeList.add(3);
         historyTypeList.add(4);
-      /*  historyTypeList.add(5);*/
+        /*  historyTypeList.add(5);*/
         historyTypeList.add(10);
     }
 
@@ -283,8 +285,53 @@ public class KuaiShouHistoryReportTaskServiceImpl extends ServiceImpl<KuaiShouHi
         dailyTypeList.add(2);
         dailyTypeList.add(3);
         dailyTypeList.add(4);
-       /* dailyTypeList.add(5);*/
+        /* dailyTypeList.add(5);*/
         dailyTypeList.add(10);
     }
 
+
+    static ExecutorService executorService = Executors.newFixedThreadPool(30);
+
+    @Autowired
+    private ICtopOauthTokenService oauthTokenService;
+
+
+    @Override
+    public void getMd5() {
+
+        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("media_id", 2);
+        List<CtopOauthToken> list = oauthTokenService.list(queryWrapper);
+        for (CtopOauthToken token : list) {
+            List<KuaiShouReportDailyMaterialVo> photoList = kuaishouReportDailyMaterialMapper.getPhotoList(token.getAccountId(), null);
+            if (!Check.isNull(photoList)) {
+                for (KuaiShouReportDailyMaterialVo materialVo : photoList) {
+                    executorService.submit(new Runnable() {
+                        @Override
+                        public void run() {
+                            //        Long id = materialVo.getId();
+                            Long photoId = materialVo.getPhotoId();
+                            VideoGetvo videoGetvo = kuaishouReportDailyMaterialMapper.getVideoGetByPhotoId(photoId);
+                            if (!Check.isNull(videoGetvo)) {
+                                QueryWrapper<KuaiShouReportDailyMaterial> updateQueryWrapper = new QueryWrapper<>();
+                                updateQueryWrapper.eq("photo_id", photoId);
+                                KuaiShouReportDailyMaterial material = new KuaiShouReportDailyMaterial();
+                                material.setSignature(videoGetvo.getSignature());
+                                material.setChannelType(videoGetvo.getChannelType());
+                                kuaishouReportDailyMaterialMapper.update(material, updateQueryWrapper);
+                                log.info("修改成功:photoId:{},accountId", photoId, token.getAccountId());
+                                // kuaishouReportDailyMaterialMapper.updateById(material);
+                            }
+                        }
+                    });
+                }
+
+            }
+
+
+        }
+
+
+    }
+
 }