Browse Source

Merge remote-tracking branch 'origin/master'

yumeng 4 years ago
parent
commit
19c0ce6449

+ 15 - 11
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -12,7 +12,6 @@ import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouDailyReportTaskServic
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
-import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouCostGroupService;
 import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAgentService;
 import cn.com.ctop.oa.modules.service.IWechatCheckinDataService;
@@ -22,7 +21,6 @@ import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataServ
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceFundDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.junit.Test;
@@ -56,11 +54,8 @@ public class SampleTest {
     private IByteDanceAdvertiserDataService advertiserDataService;
     @Autowired
     private IKuaiShouHistoryReportTaskService kuaiShouHistoryReportTaskService;
-
     @Autowired
     private ICtopOauthTokenService tokenService;
-    @Autowired
-    private KuaishouReportDailyAccountMapper reportDailyAccountMapper;
 
     @Test
     public void loadBytedanceCreativeData() {
@@ -79,10 +74,7 @@ public class SampleTest {
 
     @Test
     public void loadKuaishouCookie() {
-        reportDailyAccountMapper.loadAccountDailyReport(23212L, "D://report2//8206288_1.csv");
-
-
-       /* List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1);
+        List<BindAccountLogin> list = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1);
         if (list != null && !list.isEmpty()) {
             int i = 0;
             for (BindAccountLogin login : list) {
@@ -91,11 +83,10 @@ public class SampleTest {
                     i++;
                 }
             }
-        }*/
+        }
     }
 
     static ExecutorService executorService = null;
-    //线程计数器/bytedance/bytedanceMaterialReport
     static CountDownLatch countDownLatch = null;
 
     @Test
@@ -254,6 +245,19 @@ public class SampleTest {
         }
     }
 
+    @Test
+    public void loadKuaishouHourlyReportData(){
+        Date getDate = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
+        String hour = simpleDateFormat.format(getDate);
+        if ("00".equals(hour)) {
+            getDate = DateUtils.addDay(getDate, -1);
+        }
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
+        Date finalGetDate = getDate;
+        tokens.forEach(token -> kuaishouInterfaceService.getAdvertiserReportHourly(token, finalGetDate, finalGetDate));
+    }
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
 

+ 0 - 6
module-job-bytedance/pom.xml

@@ -231,11 +231,5 @@
                 <activatedProperties>prod</activatedProperties>
             </properties>
         </profile>
-        <profile>
-            <id>jiaoyang</id>
-            <properties>
-                <activatedProperties>jiaoyang</activatedProperties>
-            </properties>
-        </profile>
     </profiles>
 </project>

+ 50 - 0
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/DeleteKuaishouCommentJob.java

@@ -0,0 +1,50 @@
+package cn.com.ctop.job.kuaishou.handler;
+
+import cn.com.ctop.common.module.entity.BindAccountLogin;
+import cn.com.ctop.common.module.service.IBindAccountLoginService;
+import cn.com.ctop.common.module.utils.CtopAdConstant;
+import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class DeleteKuaishouCommentJob {
+    @Autowired
+    private IBindAccountLoginService bindAccountLoginService;
+    @Autowired
+    private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
+    static ExecutorService executorService = Executors.newFixedThreadPool(5);
+    static CountDownLatch countDownLatch = null;
+    @XxlJob("deleteKuaishouComment")
+    public void deleteKuaishouComment(){
+        Long start = System.currentTimeMillis();
+        List<BindAccountLogin> loginList = bindAccountLoginService.getListByParams(CtopAdConstant.PLATFORM_TYPE_KUAISHOU_PY, 1);
+        if (loginList != null && !loginList.isEmpty()) {
+            countDownLatch = new CountDownLatch(loginList.size());
+            loginList.forEach(login -> executorService.submit(() -> {
+                try {
+                    kuaishouWebInterfaceService.deleteAllComment(new HashMap<>(), login);
+                } catch (Exception e) {
+                    XxlJobHelper.log(e.getMessage(), e);
+                } finally {
+                    countDownLatch.countDown();
+                }
+            }));
+            try {
+                countDownLatch.await();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+            Long end = System.currentTimeMillis();
+            XxlJobHelper.log("快手删评论所用时长:{}毫秒", end - start);
+        }
+    }
+}

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

@@ -184,8 +184,6 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             kuaishouReportHourlyAccount.setUpdateTime(new Date());
             hourlyAccountService.saveOrUpdate(kuaishouReportHourlyAccount);
         }
-
-
     }
 
 

+ 0 - 1
module-oa/src/main/java/cn/com/ctop/oa/modules/controller/WechatNoListController.java

@@ -265,7 +265,6 @@ public class WechatNoListController {
     /**
      * 考勤异常记录 导出数据
      *
-     * @param requestBody
      * @param response
      */
     @GetMapping("/excel")