瀏覽代碼

Merge branch 'master' into test

yumeng 3 年之前
父節點
當前提交
d62db67614

+ 12 - 7
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -130,6 +130,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
     private IKuaishouAppPackageService appPackageService;
     @Autowired
     private UserAllocationMapper allocationMapper;
+    private static ExecutorService cutExecutorService = Executors.newFixedThreadPool(10);
 
     @Override
     public void getAdvertiserReportHourly(CtopOauthToken token, Date startDate, Date endDate) {
@@ -264,13 +265,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
                     videoGet.setMaterialType(type);
                 }
                 videoGetList.add(videoGet);
-                Thread thread = new Thread() {
-                    @Override
-                    public void run() {
-                        videoGetService.getKeyFrame(token.getAccessToken(), token.getAccountId(), signature, photo_id);
-                    }
-                };
-                thread.start();
+                getCut(token.getAccessToken(), token.getAccountId(), signature, photo_id);
             }
             if (!Check.isNull(videoGetList)) {
                 videoGetService.replaceBatch(videoGetList);
@@ -285,6 +280,16 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
 
     }
 
+    private void getCut(String token, Long accountId, String signature, String photo_id) {
+        cutExecutorService.submit(new Runnable() {
+            @Override
+            public void run() {
+                videoGetService.getKeyFrame(token, accountId, signature, photo_id);
+            }
+        });
+
+    }
+
     @Override
     public void getAdvertiserReportDaily(CtopOauthToken token, Date startDate, Date endDate, String reportDims) {
         try {

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialUploadServiceImpl.java

@@ -215,9 +215,9 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
                                     if (resultJson.getInteger("code") == 0) {
                                         JSONObject dataJson = resultJson.getJSONObject("data");
                                         if (!Check.isNull(dataJson)) {
-                                            String signature = dataJson.getString("signature");
+                                          /*  String signature = dataJson.getString("signature");
                                             //同步 视频关联的封面
-                                            materialUploadImageService.uploadImage(signature, accountId, ctopOauthToken.getAccessToken());
+                                            materialUploadImageService.uploadImage(signature, accountId, ctopOauthToken.getAccessToken());*/
                                             // 发送推送成功通知
                                             UserAllocation allocation = userAllocationService.getByAccountId(accountId);
                                             Project project = projectService.getById(allocation.getProjectId());