Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/test' into test

yumeng 5 gadi atpakaļ
vecāks
revīzija
d343c69e22
38 mainītis faili ar 799 papildinājumiem un 1806 dzēšanām
  1. 90 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  2. 5 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/Advertiser.java
  3. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyReportLoadJob.java
  4. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceHourlyReportLoadJob.java
  5. 0 51
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyPlanReportLoadJob.java
  6. 4 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceMaterialsLoadJob.java
  7. 12 54
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java
  8. 88 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanHourlyReportLoadJob.java
  9. 0 57
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanLoadJob.java
  10. 4 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceNowDatePlanLoadJob.java
  11. 366 366
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/OceanengineJob.java
  12. 79 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/PerformanceController2.java
  13. 11 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/IPerformanceService2.java
  14. 88 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/PerformanceServiceImpl2.java
  15. 0 118
      log-server/.mvn/wrapper/MavenWrapperDownloader.java
  16. BIN
      log-server/.mvn/wrapper/maven-wrapper.jar
  17. 0 2
      log-server/.mvn/wrapper/maven-wrapper.properties
  18. 0 376
      log-server/pom.xml
  19. 0 13
      log-server/src/main/java/cn/com/ctop/logserver/LogServerApplication.java
  20. 0 17
      log-server/src/main/java/cn/com/ctop/logserver/controller/LogController.java
  21. 0 160
      log-server/src/main/resources/application-dev.yml
  22. 0 159
      log-server/src/main/resources/application-prod.yml
  23. 0 161
      log-server/src/main/resources/application-test.yml
  24. 0 15
      log-server/src/main/resources/application.yml
  25. 0 14
      log-server/src/main/resources/banner.txt
  26. 0 4
      log-server/src/main/resources/log4j.properties
  27. 0 57
      log-server/src/main/resources/logback-dev.xml
  28. 0 57
      log-server/src/main/resources/logback-prod.xml
  29. 0 57
      log-server/src/main/resources/logback-test.xml
  30. 0 6
      log-server/src/main/resources/quartz.properties
  31. 0 13
      log-server/src/test/java/cn/com/ctop/logserver/LogServerApplicationTests.java
  32. 12 1
      module-report/src/main/java/cn/com/ctop/bytedance/entity/BytedancePlanHourlyReport.java
  33. 4 4
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/ReportServiceImpl.java
  34. 2 5
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/ByteDanceAdvertisePlan.java
  35. 4 4
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/ByteDanceVideoInfo.java
  36. 14 7
      module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertiserDataServiceImpl.java
  37. 1 0
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/UserDto2.java
  38. 11 11
      performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/xml/UserEfficientVideoMapMapper.xml

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

@@ -13,6 +13,7 @@ import cn.com.ctop.common.module.utils.ResultMapUtils;
 import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
+import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.SneakyThrows;
@@ -23,6 +24,7 @@ import org.jeecg.modules.ctop.service.ICreateInternalService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.ExecutorService;
@@ -193,11 +195,6 @@ public class TestController {
         thread.start();
     }
 
-
-
-
-
-
     @GetMapping(value = "/gerCreativeByAccount")
     public void gerCreative(Long accountId) {
         QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
@@ -259,6 +256,94 @@ public class TestController {
     @Autowired
     private ICtopOauthTokenService tokenService;
 
+    @GetMapping("loadBytedanceData")
+    public Map<String, Object> formatZybData(String date) {
+        Map<String,Object>result = new HashMap<>();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date getDate = null;
+        try {
+            getDate = simpleDateFormat.parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取头条数据异常:为获取到可用的token");
+        }
+        Date finalGetDate = getDate;
+        tokens.forEach(token -> {
+            //3:获取广告计划信息数据
+            reportService.getAdvertiserPlanReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        });
+
+        //清洗关于作业帮数据
+        //1:查询作业帮相关的用户数据
+        QueryWrapper<UserAllocation> wrapper = new QueryWrapper<>();
+        wrapper.eq("project_id",215);
+        List<UserAllocation> allocations = userAllocationService.list(wrapper);
+        if(null!=allocations&&allocations.size()>0){
+            allocations.forEach(allocation->{
+                //根据accountId和时间,查询相关的日报表信息
+                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                String dateString = dateFormat.format(finalGetDate)+" 00:00:00";
+                queryWrapper.eq("advertiser_id",allocation.getAccountId())
+                        .eq("stat_datetime",dateString)
+                ;
+                List<BytedancePlanDailyReport>bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
+                if(null!=bytedancePlanDailyReports&&bytedancePlanDailyReports.size()>0){
+                    bytedancePlanDailyReports.forEach(report->{
+                        String adName = report.getAdName();
+                        String[] tags = adName.split("-");
+                        report.setAdsense(tags[1]);
+                        report.setPlanCode(tags[2]);
+                        String materialName = tags[3];
+                        report.setMaterialName(materialName);
+                        if (materialName.contains("其他")) {
+                            report.setMaterialType("其他");
+                        } else if (materialName.contains("图片轮播")) {
+                            report.setMaterialType("图片轮播");
+                        } else if (materialName.contains("大字报")) {
+                            report.setMaterialType("大字报");
+                        } else if (materialName.contains("文字动画")) {
+                            report.setMaterialType("文字动画");
+                        } else if (materialName.contains("采访形式")) {
+                            report.setMaterialType("采访形式");
+                        } else if (materialName.contains("剧情")) {
+                            report.setMaterialType("剧情");
+                        } else if (materialName.contains("口播")) {
+                            report.setMaterialType("口播");
+                        }else{
+                            report.setMaterialType("其他");
+                        }
+                        planDailyReportService.updateById(report);
+                    });
+                }
+            });
+        }
+        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
+    @Autowired
+    private IByteDanceAdvertiserDataService advertiserDataService;
+    @GetMapping("getBytedanceData")
+    public Map<String, Object> getBytedanceData() {
+        Map<String,Object>result = new HashMap<>();
+        //1:查询当日数据
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取头条数据异常:为获取到可用的token");
+        }
+        tokens.forEach(token -> {
+            //3:获取广告计划信息数据
+            advertiserDataService.getMaterialList(token);
+        });
+        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        return result;
+    }
+
     @GetMapping("formatZybData")
     public Map<String, Object> formatZybData() {
         //清洗关于作业帮数据

+ 5 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/Advertiser.java

@@ -60,6 +60,11 @@ public class Advertiser {
     private Integer advertiserType;
 
     /**
+     * 代理商Id
+     */
+    private Long agentId;
+
+    /**
      * 联系人姓名
      */
     @Excel(name = "联系人姓名", width = 15)
@@ -105,9 +110,6 @@ public class Advertiser {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "修改时间")
     private Date updateTime;
-
-
-
     private String userId;
 
     private String companyId;

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyReportLoadJob.java

@@ -18,10 +18,11 @@ import java.util.concurrent.Executors;
 
 /**
  * @author syh
+ * 头条广告主日报数据获取任务
  * 第二天凌晨跑前一天的数据
  */
 @Slf4j
-public class BytedanceDailyReportLoadJob implements Job {
+public class BytedanceAdvertiserDailyReportLoadJob implements Job {
     @Autowired
     private ICtopOauthTokenService tokenService;
     @Autowired

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceHourlyReportLoadJob.java

@@ -19,9 +19,10 @@ import java.util.concurrent.Executors;
 
 /**
  * @author syh
+ * 头条广告主时报获取任务
  */
 @Slf4j
-public class BytedanceHourlyReportLoadJob implements Job {
+public class BytedanceAdvertiserHourlyReportLoadJob implements Job {
     @Autowired
     private ICtopOauthTokenService tokenService;
     @Autowired

+ 0 - 51
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyPlanReportLoadJob.java

@@ -1,51 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.bytedance.service.IReportService;
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import lombok.extern.slf4j.Slf4j;
-import org.jeecg.common.util.DateUtils;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 头条计划层级数据
- */
-@Slf4j
-public class BytedanceDailyPlanReportLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    @Autowired
-    private IReportService reportService;
-
-    static ExecutorService executorService = null;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        Date getDate = DateUtils.addDay(new Date(), -1);
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条数据异常:为获取到可用的token");
-            return;
-        }
-        executorService = Executors.newFixedThreadPool(5);
-        tokens.forEach(token -> {
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    //获取广告计划信息数据
-                    reportService.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-                }
-            });
-        });
-    }
-}

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceMaterialsLoadJob.java

@@ -34,7 +34,7 @@ public class BytedanceMaterialsLoadJob implements Job {
         String dateString = dateFormat.format(getDate);
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-        executorService = Executors.newFixedThreadPool(10);
+        executorService = Executors.newFixedThreadPool(4);
         tokens.forEach(token -> {
             executorService.submit(new Runnable() {
                 @Override
@@ -42,11 +42,11 @@ public class BytedanceMaterialsLoadJob implements Job {
                     try {
                         //1:获取当日广告组数据
                         advertiserDataService.getAdvertiserCampaign(token.getAccountId() + "", "", dateString);
-                        //1:获取当日广告计划数据
+                        //2:获取当日广告计划数据
                         advertiserDataService.getAdvertiserPlan(token, "", dateString, null);
-                        //1:获取全量创意数据
+                        //3:获取当日创意数据
                         creativeService.getAdvertiserCreative(token.getAccountId() + "", "", dateString);
-                        //2:获取全量素材数据
+                        //4:获取全量素材数据
                         advertiserDataService.getMaterialList(token);
                     } catch (Exception e) {
                         e.printStackTrace();

+ 12 - 54
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java

@@ -20,6 +20,9 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 
+/**
+ * 头条计划日报数据任务
+ */
 @Slf4j
 public class BytedancePlanDailyReportLoadJob implements Job {
     @Autowired
@@ -87,69 +90,24 @@ public class BytedancePlanDailyReportLoadJob implements Job {
                 }
             });
         }
+        formatData(113,getDate);
+        formatData(112,getDate);
+        formatData(222,getDate);
+    }
 
+    private void formatData(Integer projectId,Date getDate){
         //清洗关于缘多多数据
-        //1:查询缘多多相关的用户数据
-        QueryWrapper<UserAllocation> yddWrapper = new QueryWrapper<>();
-        wrapper.eq("project_id",113);
-        List<UserAllocation> yddallocations = userAllocationService.list(wrapper);
-        if(null!=yddallocations&&yddallocations.size()>0){
-            yddallocations.forEach(allocation->{
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                String dateString = dateFormat.format(getDate)+" 00:00:00";
-                queryWrapper.eq("advertiser_id",allocation.getAccountId())
-                        .eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport>bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if(null!=bytedancePlanDailyReports&&bytedancePlanDailyReports.size()>0){
-                    bytedancePlanDailyReports.forEach(report->{
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setChannelCode(tags[1]);
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-
-        //清洗关于缘多多数据
-        //1:查询缘多多相关的用户数据
         QueryWrapper<UserAllocation> dsjyWrapper = new QueryWrapper<>();
-        yddWrapper.eq("project_id", 112);
+        dsjyWrapper.eq("project_id", projectId);
         List<UserAllocation> dsjyAllocations = userAllocationService.list(dsjyWrapper);
         if (null != dsjyAllocations && dsjyAllocations.size() > 0) {
             dsjyAllocations.forEach(allocation -> {
                 //根据accountId和时间,查询相关的日报表信息
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                String dateString = dateFormat.format(getDate)+" 00:00:00";
                 QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
                 queryWrapper.eq("advertiser_id", allocation.getAccountId())
-                //.eq("stat_datetime",dateString)
-                ;
-                List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
-                if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
-                    bytedancePlanDailyReports.forEach(report -> {
-                        String adName = report.getAdName();
-                        String[] tags = adName.split("-");
-                        report.setChannelCode(tags[0]);
-                        planDailyReportService.updateById(report);
-                    });
-                }
-            });
-        }
-
-        //清洗关于附近约会数据
-        //1:查询附近约会相关的用户数据
-        QueryWrapper<UserAllocation> fjyhWrapper = new QueryWrapper<>();
-        yddWrapper.eq("project_id", 222);
-        List<UserAllocation> fjyhAllocations = userAllocationService.list(fjyhWrapper);
-        if (null != fjyhAllocations && fjyhAllocations.size() > 0) {
-            fjyhAllocations.forEach(allocation -> {
-                //根据accountId和时间,查询相关的日报表信息
-                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("advertiser_id", allocation.getAccountId())
-                //.eq("stat_datetime",dateString)
-                ;
+                        .eq("stat_datetime",dateString);
                 List<BytedancePlanDailyReport> bytedancePlanDailyReports = planDailyReportService.list(queryWrapper);
                 if (null != bytedancePlanDailyReports && bytedancePlanDailyReports.size() > 0) {
                     bytedancePlanDailyReports.forEach(report -> {

+ 88 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanHourlyReportLoadJob.java

@@ -0,0 +1,88 @@
+package org.jeecg.modules.ctop.job;
+
+import cn.com.ctop.bytedance.entity.BytedancePlanHourlyReport;
+import cn.com.ctop.bytedance.service.IBytedancePlanHourlyReportService;
+import cn.com.ctop.bytedance.service.IReportService;
+import cn.com.ctop.common.module.entity.CtopOauthToken;
+import cn.com.ctop.common.module.entity.UserAllocation;
+import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.IUserAllocationService;
+import cn.com.ctop.common.module.utils.CtopAdConstant;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.util.DateUtils;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 头条计划时报数据任务
+ */
+@Slf4j
+public class BytedancePlanHourlyReportLoadJob implements Job {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IBytedancePlanHourlyReportService planHourlyReportService;
+    @Autowired
+    private IUserAllocationService userAllocationService;
+    @Autowired
+    private IReportService reportService;
+
+    @Override
+    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        log.info("头条时报数据获取开始");
+        Date getDate = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
+        String hour = simpleDateFormat.format(getDate);
+        if (null != hour && "00".equals(hour)) {
+            getDate = DateUtils.addDay(getDate, -1);
+        }
+        //1:查询当日计划时报数据
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+        Date finalGetDate = getDate;
+        tokens.forEach(token -> {
+            //1:获取当日广告计划数据
+            reportService.getAdvertiserPlanReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
+        });
+        //清洗关于缘多多数据
+        formatData(113,finalGetDate);
+        //清洗关于交友数据
+        formatData(112,finalGetDate);
+        //清洗关于附近约会数据
+        formatData(222,finalGetDate);
+
+        log.info("头条计划时报数据获取完成");
+    }
+
+    private void formatData(Integer projectId, Date finalGetDate){
+        QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("project_id", projectId);
+        List<UserAllocation> fjyhAllocations = userAllocationService.list(queryWrapper);
+        if (null != fjyhAllocations && fjyhAllocations.size() > 0) {
+            fjyhAllocations.forEach(allocation -> {
+                //根据accountId和时间,查询相关的时报报表信息
+                QueryWrapper<BytedancePlanHourlyReport> accountWrapper = new QueryWrapper<>();
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                String dateString = dateFormat.format(finalGetDate);
+                accountWrapper.eq("advertiser_id", allocation.getAccountId())
+                        .eq("stat_datetime",dateString)
+                ;
+                List<BytedancePlanHourlyReport> bytedancePlanHourlyReports = planHourlyReportService.list(accountWrapper);
+                if (null != bytedancePlanHourlyReports && bytedancePlanHourlyReports.size() > 0) {
+                    bytedancePlanHourlyReports.forEach(report -> {
+                        String adName = report.getAdName();
+                        String[] tags = adName.split("-");
+                        report.setChannelCode(tags[0]);
+                        planHourlyReportService.updateById(report);
+                    });
+                }
+            });
+        }
+    }
+}

+ 0 - 57
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanLoadJob.java

@@ -1,57 +0,0 @@
-package org.jeecg.modules.ctop.job;
-
-import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.service.ICtopOauthTokenService;
-import cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
-import cn.com.ctop.toutiao.service.IByteDanceCreativeService;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-@Slf4j
-public class BytedancePlanLoadJob implements Job {
-    @Autowired
-    private ICtopOauthTokenService tokenService;
-    static ExecutorService executorService = null;
-    @Autowired
-    private IByteDanceAdvertiserDataService advertiserDataService;
-    @Autowired
-    private IByteDanceCreativeService creativeService;
-
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-
-        Thread thread = new Thread() {
-            @Override
-            public void run() {
-                //1:查询当日数据
-                List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
-                executorService = Executors.newFixedThreadPool(4);
-                tokens.forEach(token -> {
-                    executorService.submit(new Runnable() {
-                        @Override
-                        public void run() {
-                            try {
-                                //1:获取当日广告计划数据
-                                advertiserDataService.getAdvertiserPlan(token, "", null, null);
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            } finally {
-                            }
-                        }
-                    });
-                });
-                log.info("头条全量计划数据获取完成");
-            }
-
-        };
-        thread.start();
-    }
-}

+ 4 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceNowDatePlanLoadJob.java

@@ -15,8 +15,11 @@ import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
+/**
+ * 头条当日计划素材获取任务
+ */
 @Slf4j
-public class BytedanceNowDatePlanLoadJob implements Job {
+public class BytedancePlanRealTimeLoadJob implements Job {
     @Autowired
     private ICtopOauthTokenService tokenService;
     static ExecutorService executorService = null;

+ 366 - 366
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/OceanengineJob.java

@@ -1,366 +1,366 @@
-//package org.jeecg.modules.ctop.job;
-//
-//import cn.com.ctop.common.module.utils.Base64Utils;
-//import cn.com.ctop.common.module.utils.HttpUtils2;
-//import cn.com.ctop.crawler.modules.core.util.FateadmHttpUtil;
-//import cn.com.ctop.crawler.modules.core.util.FateadmUtil;
-//import cn.com.ctop.crawler.modules.oceanengine.entity.DouyinHot;
-//import cn.com.ctop.crawler.modules.oceanengine.entity.EffectCase;
-//import cn.com.ctop.crawler.modules.oceanengine.entity.HotMaterial;
-//import cn.com.ctop.crawler.modules.oceanengine.service.IDouyinHotService;
-//import cn.com.ctop.crawler.modules.oceanengine.service.IEffectCaseService;
-//import cn.com.ctop.crawler.modules.oceanengine.service.IHotMaterialService;
-//import com.fasterxml.jackson.core.type.TypeReference;
-//import com.fasterxml.jackson.databind.DeserializationFeature;
-//import com.fasterxml.jackson.databind.JsonNode;
-//import com.fasterxml.jackson.databind.ObjectMapper;
-//import org.apache.http.impl.cookie.BasicClientCookie;
-//import org.bytedeco.javacpp.opencv_core;
-//import org.bytedeco.javacv.FFmpegFrameGrabber;
-//import org.bytedeco.javacv.Frame;
-//import org.bytedeco.javacv.Java2DFrameConverter;
-//import org.openqa.selenium.Cookie;
-//import org.openqa.selenium.WebDriver;
-//import org.openqa.selenium.chrome.ChromeDriver;
-//import org.openqa.selenium.chrome.ChromeOptions;
-//import org.quartz.Job;
-//import org.quartz.JobExecutionContext;
-//import org.quartz.JobExecutionException;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.beans.factory.annotation.Value;
-//
-//import javax.imageio.ImageIO;
-//import java.awt.*;
-//import java.awt.image.BufferedImage;
-//import java.io.ByteArrayOutputStream;
-//import java.net.HttpURLConnection;
-//import java.net.URL;
-//import java.util.List;
-//import java.util.*;
-//
-//public class OceanengineJob implements Job {
-//    @Value("${jeecg.path.chrome-driver}")
-//    private String chromeDriver;
-//    @Autowired
-//    private IDouyinHotService douyinHotService;
-//    @Autowired
-//    private IEffectCaseService effectCaseService;
-//    @Autowired
-//    private IHotMaterialService hotMaterialService;
-//    public static void main(String[] args){
-//        System.out.println(getRealVideoUrl(""));
-//    }
-//
-//    public static String getVideoUrlByVid(String vid) {
-//        String url = "https://aweme.snssdk.com/aweme/v1/playwm/?video_id=" + vid + "&line=0";
-//        return getRealVideoUrl(url);
-//    }
-//
-//    public static String getRealVideoUrl(String url) {
-//        try {
-//            URL serverUrl = new URL(url);
-//            HttpURLConnection conn = (HttpURLConnection) serverUrl
-//                    .openConnection();
-//            conn.setRequestMethod("GET");
-//            // 必须设置false,否则会自动redirect到Location的地址
-//            conn.setInstanceFollowRedirects(false);
-//            conn.addRequestProperty("User-Agent",
-//                    "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.8) Firefox/3.6.8");
-//            conn.connect();
-//            String location = conn.getHeaderField("Location");
-//            return location;
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//        return null;
-//    }
-//    private void hotMaterialHandler(int page,int appCode,String appName){
-//        String result = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/hot_material/list?material_type=3&order_by=convert_show_rate&period_type=3&aggr_app_code="+appCode+"&page="+page+"&limit=20");
-//        ObjectMapper mapper = new ObjectMapper();
-//        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-//        try {
-//            JsonNode node = mapper.readTree(result);
-//            int code = node.get("code").asInt();
-//            if (code == 0) {
-//                if (node.get("data") != null&&node.get("data").get("materials")!=null) {
-//                    String dataJson = node.get("data").get("materials").toString();
-//                    List<HotMaterial> list = mapper.readValue(dataJson,new TypeReference<List<HotMaterial>>() {});
-//                    if(list != null && list.size() > 0){
-//                        for (HotMaterial material : list){
-//                            material.setAppCode(appCode);
-//                            material.setAppName(appName);
-//                            material.setVideoUrl(getRealVideoUrl("https://aweme.snssdk.com/aweme/v1/playwm/?video_id="+material.getVid()+"&line=0"));
-//                            if(material.getVideoUrl() == null){
-//                                material.setVideoUrl(getVideoUrl(material.getVid()));
-//                            }
-////                            material.setVideoUrl(getVideoUrl(material.getVid()));
-//                            material.setCoverImage(getVideoFirstImage(material.getVideoUrl()));
-//                            if(material.getCoverImage() == null){
-//                                Thread.sleep(1000);
-//                                material.setCoverImage(getVideoFirstImage(material.getVideoUrl()));
-//                            }
-//                            hotMaterialService.saveOrUpdate(material);
-//                        }
-//                        hotMaterialHandler(page+1,appCode,appName);
-//                    }
-//                }
-//            }
-//        }catch (Exception e){
-//            e.printStackTrace();
-//        }
-//    }
-//
-//    public static String getVideoUrl(String vid) throws Exception {
-//        String url = "http://i.snssdk.com/video/urls/1/toutiao/mp4/"+vid;
-//        String result = HttpUtils2.httpGetRequest(url);
-//        ObjectMapper mapper = new ObjectMapper();
-//        if(result != null){
-//            JsonNode node = mapper.readTree(result);
-//            String mainUrl = node.get("data").get("video_list").get("video_1").get("main_url").asText();
-//            return Base64Utils.decode(mainUrl);
-//        }
-//        return null;
-//    }
-//    private void effectCaseHandler(int page){
-//        String result = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/case/effect_case_list?industry=0&style=0&mode=0&page="+page+"&limit=20");
-//        ObjectMapper mapper = new ObjectMapper();
-//        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-//        try {
-//            JsonNode node = mapper.readTree(result);
-//            int code = node.get("code").asInt();
-//            if(code == 0) {
-//                if (node.get("data") != null) {
-//                    String dataJson = node.get("data").get("effect_cases").toString();
-//                    List<EffectCase> list = mapper.readValue(dataJson,new TypeReference<List<EffectCase>>() {});
-//                    if (list != null && list.size() > 0) {
-//                        for (EffectCase effectCase:list){
-//                            String resultDetail = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/case/effect_case/"+effectCase.getId());
-//                            JsonNode detailNode = mapper.readTree(resultDetail);
-//                            int detailCode = detailNode.get("code").asInt();
-//                            if(detailCode == 0){
-//                                if(detailNode.get("data") != null){
-////                                    String detailJson = node.get("data").get("effect_cases").toString();
-////                                    EffectCase effectCase1 = mapper.readValue(detailJson,EffectCase.class);
-//                                    effectCase.setAuthor(detailNode.get("data").get("effect_case").get("author").asText());
-//                                    effectCase.setCreateDate(detailNode.get("data").get("effect_case").get("create_date").asText());
-//                                    effectCase.setCreativeId(detailNode.get("data").get("effect_case").get("creative_id").asLong());
-//                                    effectCase.setCreativeScore(detailNode.get("data").get("effect_case").get("creative_score").asText());
-//                                    effectCase.setEffect(detailNode.get("data").get("effect_case").get("effect").toString());
-//                                    effectCase.setMethods(detailNode.get("data").get("effect_case").get("methods").toString());
-//                                    effectCase.setVideoUrl(getRealVideoUrl("https://aweme.snssdk.com/aweme/v1/playwm/?video_id="+effectCase.getVid()+"&line=0"));
-//                                    if (effectCase.getVideoUrl() == null){
-//                                        effectCase.setVideoUrl(getVideoUrl(effectCase.getVid()));
-//                                    }
-////                                    effectCase.setVideoUrl(getVideoUrl(effectCase.getVid()));
-//                                    effectCase.setCoverImage(getVideoFirstImage(effectCase.getVideoUrl()));
-//                                    if (effectCase.getCoverImage() == null){
-//                                        Thread.sleep(1000);
-//                                        effectCase.setCoverImage(getVideoFirstImage(effectCase.getVideoUrl()));
-//                                    }
-//                                    effectCase.setCreativeLabel(detailNode.get("data").get("effect_case").get("creative_label").toString());
-//                                }
-//                            }
-//                            effectCaseService.saveOrUpdate(effectCase);
-//                        }
-//                        effectCaseHandler(page+1);
-//                    }
-//                }
-//            }
-//        }catch (Exception e){
-//            e.printStackTrace();
-//        }
-//    }
-//
-//    private String getVideoFirstImage(String url){
-//        try {
-//            FFmpegFrameGrabber ff = new FFmpegFrameGrabber(url);
-//            ff.start();
-//            int lenght = ff.getLengthInFrames();
-//            int i = 0;
-//            Frame f = null;
-//            while (i < lenght) {
-//// 过滤前5帧,避免出现全黑的图片,依自己情况而定
-//                f = ff.grabFrame();
-//                if ((i > 5) && (f.image != null)) {
-//                    break;
-//                }
-//                i++;
-//            }
-////            opencv_core.IplImage img = f.image;
-//            int owidth = f.imageWidth;
-//            int oheight = f.imageHeight;
-//            Java2DFrameConverter converter =new Java2DFrameConverter();
-//            BufferedImage fecthedImage =converter.getBufferedImage(f);
-//// 对截取的帧进行等比例缩放
-//            int width = 800;
-//            int height = (int) (((double) width / owidth) * oheight);
-//            BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
-//            bi.getGraphics().drawImage(fecthedImage.getScaledInstance(width, height, Image.SCALE_SMOOTH),
-//                    0, 0, null);
-//            ByteArrayOutputStream baos = new ByteArrayOutputStream();//io流
-//            ImageIO.write(bi, "jpg", baos);
-//            byte[] bytes = baos.toByteArray();//转换成字节
-//            String png_base64 = Base64.getEncoder().encodeToString(bytes).trim();//转换成base64串
-//            png_base64 = png_base64.replaceAll("\n", "").replaceAll("\r", "");//删除 \r\n
-//            //        ImageIO.write(bufferedImage, "png", new File("D:/qrcode1.png"));
-//            baos.close();
-//            ff.close();
-//            return "data:image/jpg;base64,"+png_base64;
-//        }catch (Exception e){
-//            e.printStackTrace();
-//            return null;
-//        }
-//
-//    }
-//    private void douyinHotHandler(int page,int listType){
-//        String result = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/hot_video/user_side/list?page="+page+"&limit=20&list_type="+listType+"&aggr_duration_type=-1");
-//        ObjectMapper mapper = new ObjectMapper();
-//        try {
-//            JsonNode node = mapper.readTree(result);
-//            int code = node.get("code").asInt();
-//            if(code == 0){
-//                if(node.get("data")!= null){
-//                    String dataJson = node.get("data").get("items").toString();
-//                    List<DouyinHot> list = mapper.readValue(dataJson,new TypeReference<List<DouyinHot>>() {});
-//                    if (list != null && list.size() > 0){
-//                        for (DouyinHot douyinHot : list){
-//                            douyinHot.setUrl(getRealVideoUrl("https://aweme.snssdk.com/aweme/v1/playwm/?video_id="+douyinHot.getVideoId()+"&line=0"));
-//                            if(douyinHot.getUrl() == null){
-//                                douyinHot.setUrl(getVideoUrl(douyinHot.getVideoId()));
-//                            }
-////                            douyinHot.setUrl(getVideoUrl(douyinHot.getVideoId()));
-//                            douyinHot.setCoverImage(getVideoFirstImage(douyinHot.getUrl()));
-//                            if(douyinHot.getCoverImage() == null){
-//                                Thread.sleep(1000);
-//                                douyinHot.setCoverImage(getVideoFirstImage(douyinHot.getUrl()));
-//                            }
-//                            douyinHotService.saveOrUpdate(douyinHot);
-//                        }
-//                        douyinHotHandler(page+1,listType);
-//                    }else {
-//                        if(listType < 4){
-//                            douyinHotHandler(1,listType+1);
-//                        }
-//                    }
-//                }
-//            }
-//        }catch (Exception e){
-//            e.printStackTrace();
-//        }
-//
-//    }
-//    @Override
-//    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-//        String account="3248395570@qq.com";
-//        String password = "Ydxq-704127411";
-//        login(account,password);
-//        douyinHotHandler(1,1);
-//        effectCaseHandler(1);
-//        hotMaterialHandler(1,1,"西瓜");
-//        hotMaterialHandler(1,3,"火山");
-//        hotMaterialHandler(1,4,"抖音");
-//        hotMaterialHandler(1,8,"头条");
-//        hotMaterialHandler(1,9,"穿山甲");
-//        System.out.println("巨量创意抓取完成");
-//    }
-//
-//    private void login(String account,String password){
-//        String url = "https://cc.oceanengine.com/login";
-//        System.getProperties().setProperty("webdriver.chrome.driver", chromeDriver);
-//        ChromeOptions chromeOptions = new ChromeOptions();
-//        chromeOptions.addArguments("--headless");
-//        chromeOptions.addArguments("--no-sandbox");
-//        chromeOptions.addArguments("--window-size=1920,1080");
-//        chromeOptions.addArguments("--user-agent=" + HttpUtils2.USER_AGENT);
-//        chromeOptions.setAcceptInsecureCerts(true);
-//        WebDriver webDriver = new ChromeDriver(chromeOptions);
-//        //清除所有的缓存
-//        webDriver.manage().deleteAllCookies();
-//        try {
-//            //获取登录页面
-//            webDriver.get(url);
-//            for (Cookie cookie : webDriver.manage().getCookies()) {
-//                BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
-//                ck.setDomain("oceanengine.com");
-//                ck.setExpiryDate(cookie.getExpiry());
-//                ck.setPath(cookie.getPath());
-//                HttpUtils2.cookieStore.addCookie(ck);
-//            }
-//            Map<String, String> header = new HashMap<>();
-//            header.put("Accept", "*/*");
-//            header.put("Connection", "keep-alive");
-//            header.put("Host", "sso.toutiao.com");
-//            header.put("Content-Type", "application/x-www-form-urlencoded");
-//            header.put("Origin", "https://cc.oceanengine.com");
-//            header.put("Referer", "https://cc.oceanengine.com/login");
-//            Map<String, Object> param = new HashMap<>();
-//            param.put("mobile", "");
-//            param.put("code", "");
-//            param.put("account", account);
-//            param.put("password", password);
-//            param.put("captcha", "hqde");
-//            param.put("is_30_days_no_login", "true");
-//            param.put("service", "https://cc.oceanengine.com");
-//            String res = HttpUtils2.httpPostParamRequest("https://sso.toutiao.com/account_login/", param, header);
-//            System.out.println(res);
-//            ObjectMapper mapper = new ObjectMapper();
-//            mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-//            JsonNode jsonNode = mapper.readTree(res);
-//            //errorcode == 1102 验证码错误,请重新输入验证码
-//            //errorcode == 1101 验证码为空
-//
-//            Integer errorCode = jsonNode.get("error_code").asInt();
-//            String orderId = null;
-//            while (errorCode != 0) {
-//                //用户名或者密码错误
-//                if (null != errorCode && errorCode == 1009) {
-//                    return;
-//                }
-//                FateadmUtil fateadmUtil = new FateadmUtil();
-//                fateadmUtil.init();
-//                if (orderId != null) {
-//                    fateadmUtil.Justice(orderId);
-//                }
-//                String captcha = jsonNode.get("captcha").asText();
-//                Base64.Decoder decoder = Base64.getDecoder();
-//                FateadmHttpUtil.HttpResp resp = fateadmUtil.Predict("30400", decoder.decode(captcha));
-//                param.put("captcha", resp.pred_resl);
-//                orderId = resp.req_id;
-//                res = HttpUtils2.httpPostParamRequest("https://sso.toutiao.com/account_login/", param, header);
-//                System.out.println(res);
-//                jsonNode = mapper.readTree(res);
-//                errorCode = jsonNode.get("error_code").asInt();
-//            }
-//            if (errorCode == 0) {
-//                //表示登录成功
-//
-//                List<org.apache.http.cookie.Cookie> cookies = HttpUtils2.cookieStore.getCookies();
-//                for (org.apache.http.cookie.Cookie ck : cookies) {
-//                    Cookie cookie = new Cookie(ck.getName(), ck.getValue(), "." + ck.getDomain(), ck.getPath(), ck.getExpiryDate());
-//                    webDriver.manage().addCookie(cookie);
-//                }
-//                String redirectUrl = jsonNode.get("redirect_url").asText();
-//                webDriver.get(redirectUrl);
-//                //登录成功 进入推广页面
-//                webDriver.get("https://cc.oceanengine.com/inspiration/douyin-rank-list");
-//                Thread.sleep(3000);
-//                for (Cookie cookie : webDriver.manage().getCookies()) {
-//                    BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
-//                    ck.setDomain("cc.oceanengine.com");
-//                    ck.setExpiryDate(cookie.getExpiry());
-//                    ck.setPath(cookie.getPath());
-//                    HttpUtils2.cookieStore.addCookie(ck);
-//                }
-//
-//            }
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        } finally {
-//            //获得cookie
-//            Set<Cookie> coo = webDriver.manage().getCookies();
-//            //清除所有的缓存
-//            webDriver.manage().deleteAllCookies();
-//            webDriver.quit();
-//        }
-//    }
-//}
+package org.jeecg.modules.ctop.job;
+
+import cn.com.ctop.common.module.utils.Base64Utils;
+import cn.com.ctop.common.module.utils.HttpUtils2;
+import cn.com.ctop.crawler.modules.core.util.FateadmHttpUtil;
+import cn.com.ctop.crawler.modules.core.util.FateadmUtil;
+import cn.com.ctop.crawler.modules.oceanengine.entity.DouyinHot;
+import cn.com.ctop.crawler.modules.oceanengine.entity.EffectCase;
+import cn.com.ctop.crawler.modules.oceanengine.entity.HotMaterial;
+import cn.com.ctop.crawler.modules.oceanengine.service.IDouyinHotService;
+import cn.com.ctop.crawler.modules.oceanengine.service.IEffectCaseService;
+import cn.com.ctop.crawler.modules.oceanengine.service.IHotMaterialService;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.impl.cookie.BasicClientCookie;
+import org.bytedeco.javacpp.opencv_core;
+import org.bytedeco.javacv.FFmpegFrameGrabber;
+import org.bytedeco.javacv.Frame;
+import org.bytedeco.javacv.Java2DFrameConverter;
+import org.openqa.selenium.Cookie;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.*;
+
+public class OceanengineJob implements Job {
+    @Value("${jeecg.path.chrome-driver}")
+    private String chromeDriver;
+    @Autowired
+    private IDouyinHotService douyinHotService;
+    @Autowired
+    private IEffectCaseService effectCaseService;
+    @Autowired
+    private IHotMaterialService hotMaterialService;
+    public static void main(String[] args){
+        System.out.println(getRealVideoUrl(""));
+    }
+
+    public static String getVideoUrlByVid(String vid) {
+        String url = "https://aweme.snssdk.com/aweme/v1/playwm/?video_id=" + vid + "&line=0";
+        return getRealVideoUrl(url);
+    }
+
+    public static String getRealVideoUrl(String url) {
+        try {
+            URL serverUrl = new URL(url);
+            HttpURLConnection conn = (HttpURLConnection) serverUrl
+                    .openConnection();
+            conn.setRequestMethod("GET");
+            // 必须设置false,否则会自动redirect到Location的地址
+            conn.setInstanceFollowRedirects(false);
+            conn.addRequestProperty("User-Agent",
+                    "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.8) Firefox/3.6.8");
+            conn.connect();
+            String location = conn.getHeaderField("Location");
+            return location;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+    private void hotMaterialHandler(int page,int appCode,String appName){
+        String result = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/hot_material/list?material_type=3&order_by=convert_show_rate&period_type=3&aggr_app_code="+appCode+"&page="+page+"&limit=20");
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        try {
+            JsonNode node = mapper.readTree(result);
+            int code = node.get("code").asInt();
+            if (code == 0) {
+                if (node.get("data") != null&&node.get("data").get("materials")!=null) {
+                    String dataJson = node.get("data").get("materials").toString();
+                    List<HotMaterial> list = mapper.readValue(dataJson,new TypeReference<List<HotMaterial>>() {});
+                    if(list != null && list.size() > 0){
+                        for (HotMaterial material : list){
+                            material.setAppCode(appCode);
+                            material.setAppName(appName);
+                            material.setVideoUrl(getRealVideoUrl("https://aweme.snssdk.com/aweme/v1/playwm/?video_id="+material.getVid()+"&line=0"));
+                            if(material.getVideoUrl() == null){
+                                material.setVideoUrl(getVideoUrl(material.getVid()));
+                            }
+//                            material.setVideoUrl(getVideoUrl(material.getVid()));
+                            material.setCoverImage(getVideoFirstImage(material.getVideoUrl()));
+                            if(material.getCoverImage() == null){
+                                Thread.sleep(1000);
+                                material.setCoverImage(getVideoFirstImage(material.getVideoUrl()));
+                            }
+                            hotMaterialService.saveOrUpdate(material);
+                        }
+                        hotMaterialHandler(page+1,appCode,appName);
+                    }
+                }
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
+
+    public static String getVideoUrl(String vid) throws Exception {
+        String url = "http://i.snssdk.com/video/urls/1/toutiao/mp4/"+vid;
+        String result = HttpUtils2.httpGetRequest(url);
+        ObjectMapper mapper = new ObjectMapper();
+        if(result != null){
+            JsonNode node = mapper.readTree(result);
+            String mainUrl = node.get("data").get("video_list").get("video_1").get("main_url").asText();
+            return Base64Utils.decode(mainUrl);
+        }
+        return null;
+    }
+    private void effectCaseHandler(int page){
+        String result = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/case/effect_case_list?industry=0&style=0&mode=0&page="+page+"&limit=20");
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        try {
+            JsonNode node = mapper.readTree(result);
+            int code = node.get("code").asInt();
+            if(code == 0) {
+                if (node.get("data") != null) {
+                    String dataJson = node.get("data").get("effect_cases").toString();
+                    List<EffectCase> list = mapper.readValue(dataJson,new TypeReference<List<EffectCase>>() {});
+                    if (list != null && list.size() > 0) {
+                        for (EffectCase effectCase:list){
+                            String resultDetail = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/case/effect_case/"+effectCase.getId());
+                            JsonNode detailNode = mapper.readTree(resultDetail);
+                            int detailCode = detailNode.get("code").asInt();
+                            if(detailCode == 0){
+                                if(detailNode.get("data") != null){
+//                                    String detailJson = node.get("data").get("effect_cases").toString();
+//                                    EffectCase effectCase1 = mapper.readValue(detailJson,EffectCase.class);
+                                    effectCase.setAuthor(detailNode.get("data").get("effect_case").get("author").asText());
+                                    effectCase.setCreateDate(detailNode.get("data").get("effect_case").get("create_date").asText());
+                                    effectCase.setCreativeId(detailNode.get("data").get("effect_case").get("creative_id").asLong());
+                                    effectCase.setCreativeScore(detailNode.get("data").get("effect_case").get("creative_score").asText());
+                                    effectCase.setEffect(detailNode.get("data").get("effect_case").get("effect").toString());
+                                    effectCase.setMethods(detailNode.get("data").get("effect_case").get("methods").toString());
+                                    effectCase.setVideoUrl(getRealVideoUrl("https://aweme.snssdk.com/aweme/v1/playwm/?video_id="+effectCase.getVid()+"&line=0"));
+                                    if (effectCase.getVideoUrl() == null){
+                                        effectCase.setVideoUrl(getVideoUrl(effectCase.getVid()));
+                                    }
+//                                    effectCase.setVideoUrl(getVideoUrl(effectCase.getVid()));
+                                    effectCase.setCoverImage(getVideoFirstImage(effectCase.getVideoUrl()));
+                                    if (effectCase.getCoverImage() == null){
+                                        Thread.sleep(1000);
+                                        effectCase.setCoverImage(getVideoFirstImage(effectCase.getVideoUrl()));
+                                    }
+                                    effectCase.setCreativeLabel(detailNode.get("data").get("effect_case").get("creative_label").toString());
+                                }
+                            }
+                            effectCaseService.saveOrUpdate(effectCase);
+                        }
+                        effectCaseHandler(page+1);
+                    }
+                }
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+    }
+
+    private String getVideoFirstImage(String url){
+        try {
+            FFmpegFrameGrabber ff = new FFmpegFrameGrabber(url);
+            ff.start();
+            int lenght = ff.getLengthInFrames();
+            int i = 0;
+            Frame f = null;
+            while (i < lenght) {
+// 过滤前5帧,避免出现全黑的图片,依自己情况而定
+                f = ff.grabFrame();
+                if ((i > 5) && (f.image != null)) {
+                    break;
+                }
+                i++;
+            }
+//            opencv_core.IplImage img = f.image;
+            int owidth = f.imageWidth;
+            int oheight = f.imageHeight;
+            Java2DFrameConverter converter =new Java2DFrameConverter();
+            BufferedImage fecthedImage =converter.getBufferedImage(f);
+// 对截取的帧进行等比例缩放
+            int width = 800;
+            int height = (int) (((double) width / owidth) * oheight);
+            BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
+            bi.getGraphics().drawImage(fecthedImage.getScaledInstance(width, height, Image.SCALE_SMOOTH),
+                    0, 0, null);
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();//io流
+            ImageIO.write(bi, "jpg", baos);
+            byte[] bytes = baos.toByteArray();//转换成字节
+            String png_base64 = Base64.getEncoder().encodeToString(bytes).trim();//转换成base64串
+            png_base64 = png_base64.replaceAll("\n", "").replaceAll("\r", "");//删除 \r\n
+            //        ImageIO.write(bufferedImage, "png", new File("D:/qrcode1.png"));
+            baos.close();
+            ff.close();
+            return "data:image/jpg;base64,"+png_base64;
+        }catch (Exception e){
+            e.printStackTrace();
+            return null;
+        }
+
+    }
+    private void douyinHotHandler(int page,int listType){
+        String result = HttpUtils2.httpGetRequest("https://cc.oceanengine.com/creative_center_server/api/hot_video/user_side/list?page="+page+"&limit=20&list_type="+listType+"&aggr_duration_type=-1");
+        ObjectMapper mapper = new ObjectMapper();
+        try {
+            JsonNode node = mapper.readTree(result);
+            int code = node.get("code").asInt();
+            if(code == 0){
+                if(node.get("data")!= null){
+                    String dataJson = node.get("data").get("items").toString();
+                    List<DouyinHot> list = mapper.readValue(dataJson,new TypeReference<List<DouyinHot>>() {});
+                    if (list != null && list.size() > 0){
+                        for (DouyinHot douyinHot : list){
+                            douyinHot.setUrl(getRealVideoUrl("https://aweme.snssdk.com/aweme/v1/playwm/?video_id="+douyinHot.getVideoId()+"&line=0"));
+                            if(douyinHot.getUrl() == null){
+                                douyinHot.setUrl(getVideoUrl(douyinHot.getVideoId()));
+                            }
+//                            douyinHot.setUrl(getVideoUrl(douyinHot.getVideoId()));
+                            douyinHot.setCoverImage(getVideoFirstImage(douyinHot.getUrl()));
+                            if(douyinHot.getCoverImage() == null){
+                                Thread.sleep(1000);
+                                douyinHot.setCoverImage(getVideoFirstImage(douyinHot.getUrl()));
+                            }
+                            douyinHotService.saveOrUpdate(douyinHot);
+                        }
+                        douyinHotHandler(page+1,listType);
+                    }else {
+                        if(listType < 4){
+                            douyinHotHandler(1,listType+1);
+                        }
+                    }
+                }
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+
+    }
+    @Override
+    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
+        String account="3248395570@qq.com";
+        String password = "Ydxq-704127411";
+        login(account,password);
+        douyinHotHandler(1,1);
+        effectCaseHandler(1);
+        hotMaterialHandler(1,1,"西瓜");
+        hotMaterialHandler(1,3,"火山");
+        hotMaterialHandler(1,4,"抖音");
+        hotMaterialHandler(1,8,"头条");
+        hotMaterialHandler(1,9,"穿山甲");
+        System.out.println("巨量创意抓取完成");
+    }
+
+    private void login(String account,String password){
+        String url = "https://cc.oceanengine.com/login";
+        System.getProperties().setProperty("webdriver.chrome.driver", chromeDriver);
+        ChromeOptions chromeOptions = new ChromeOptions();
+        chromeOptions.addArguments("--headless");
+        chromeOptions.addArguments("--no-sandbox");
+        chromeOptions.addArguments("--window-size=1920,1080");
+        chromeOptions.addArguments("--user-agent=" + HttpUtils2.USER_AGENT);
+        chromeOptions.setAcceptInsecureCerts(true);
+        WebDriver webDriver = new ChromeDriver(chromeOptions);
+        //清除所有的缓存
+        webDriver.manage().deleteAllCookies();
+        try {
+            //获取登录页面
+            webDriver.get(url);
+            for (Cookie cookie : webDriver.manage().getCookies()) {
+                BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
+                ck.setDomain("oceanengine.com");
+                ck.setExpiryDate(cookie.getExpiry());
+                ck.setPath(cookie.getPath());
+                HttpUtils2.cookieStore.addCookie(ck);
+            }
+            Map<String, String> header = new HashMap<>();
+            header.put("Accept", "*/*");
+            header.put("Connection", "keep-alive");
+            header.put("Host", "sso.toutiao.com");
+            header.put("Content-Type", "application/x-www-form-urlencoded");
+            header.put("Origin", "https://cc.oceanengine.com");
+            header.put("Referer", "https://cc.oceanengine.com/login");
+            Map<String, Object> param = new HashMap<>();
+            param.put("mobile", "");
+            param.put("code", "");
+            param.put("account", account);
+            param.put("password", password);
+            param.put("captcha", "hqde");
+            param.put("is_30_days_no_login", "true");
+            param.put("service", "https://cc.oceanengine.com");
+            String res = HttpUtils2.httpPostParamRequest("https://sso.toutiao.com/account_login/", param, header);
+            System.out.println(res);
+            ObjectMapper mapper = new ObjectMapper();
+            mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+            JsonNode jsonNode = mapper.readTree(res);
+            //errorcode == 1102 验证码错误,请重新输入验证码
+            //errorcode == 1101 验证码为空
+
+            Integer errorCode = jsonNode.get("error_code").asInt();
+            String orderId = null;
+            while (errorCode != 0) {
+                //用户名或者密码错误
+                if (null != errorCode && errorCode == 1009) {
+                    return;
+                }
+                FateadmUtil fateadmUtil = new FateadmUtil();
+                fateadmUtil.init();
+                if (orderId != null) {
+                    fateadmUtil.Justice(orderId);
+                }
+                String captcha = jsonNode.get("captcha").asText();
+                Base64.Decoder decoder = Base64.getDecoder();
+                FateadmHttpUtil.HttpResp resp = fateadmUtil.Predict("30400", decoder.decode(captcha));
+                param.put("captcha", resp.pred_resl);
+                orderId = resp.req_id;
+                res = HttpUtils2.httpPostParamRequest("https://sso.toutiao.com/account_login/", param, header);
+                System.out.println(res);
+                jsonNode = mapper.readTree(res);
+                errorCode = jsonNode.get("error_code").asInt();
+            }
+            if (errorCode == 0) {
+                //表示登录成功
+
+                List<org.apache.http.cookie.Cookie> cookies = HttpUtils2.cookieStore.getCookies();
+                for (org.apache.http.cookie.Cookie ck : cookies) {
+                    Cookie cookie = new Cookie(ck.getName(), ck.getValue(), "." + ck.getDomain(), ck.getPath(), ck.getExpiryDate());
+                    webDriver.manage().addCookie(cookie);
+                }
+                String redirectUrl = jsonNode.get("redirect_url").asText();
+                webDriver.get(redirectUrl);
+                //登录成功 进入推广页面
+                webDriver.get("https://cc.oceanengine.com/inspiration/douyin-rank-list");
+                Thread.sleep(3000);
+                for (Cookie cookie : webDriver.manage().getCookies()) {
+                    BasicClientCookie ck = new BasicClientCookie(cookie.getName(), cookie.getValue());
+                    ck.setDomain("cc.oceanengine.com");
+                    ck.setExpiryDate(cookie.getExpiry());
+                    ck.setPath(cookie.getPath());
+                    HttpUtils2.cookieStore.addCookie(ck);
+                }
+
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            //获得cookie
+            Set<Cookie> coo = webDriver.manage().getCookies();
+            //清除所有的缓存
+            webDriver.manage().deleteAllCookies();
+            webDriver.quit();
+        }
+    }
+}

+ 79 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/PerformanceController2.java

@@ -439,6 +439,46 @@ public class PerformanceController2 {
         return result;
     }
 
+    //快手优化师周报
+    @AutoLog(value = "获取快手优化师绩效周报表")
+    @ApiOperation(value = "获取快手优化师绩效周报表", notes = "获取快手优化师绩效周报表")
+    @PostMapping(value = "/kuaishouYouhuaWeekReport")
+    public Result<List<UserDto2>> kuaishouYouhuaWeekReport(@RequestBody PerformanceTimeDTO dto,
+                                                     HttpServletRequest req) {
+        Result<List<UserDto2>> result = new Result<List<UserDto2>>();
+        String startDate = dto.getStartDate();
+        String endDate = dto.getEndDate();
+        if(StringUtils.isBlank(startDate) || StringUtils.isBlank(endDate)){
+            result.setSuccess(false);
+            result.setMessage("时间不能为空");
+            return result;
+        }
+        List<UserDto2> userDto2List = performanceService.kuaishouYouhuaWeekReport(startDate, endDate);
+        result.setSuccess(true);
+        result.setResult(userDto2List);
+        return result;
+    }
+
+    //头条优化师周报
+    @AutoLog(value = "获取头条优化师绩效周报表")
+    @ApiOperation(value = "获取头条优化师绩效周报表", notes = "获取头条绩效周报表")
+    @PostMapping(value = "/toutiaoYouhuaWeekReport")
+    public Result<List<UserDto2>> toutiaoYouhuaWeekReport(@RequestBody PerformanceTimeDTO dto,
+                                                    HttpServletRequest req) {
+        Result<List<UserDto2>> result = new Result<List<UserDto2>>();
+        String startDate = dto.getStartDate();
+        String endDate = dto.getEndDate();
+        if(StringUtils.isBlank(startDate) || StringUtils.isBlank(endDate)){
+            result.setSuccess(false);
+            result.setMessage("时间不能为空");
+            return result;
+        }
+        List<UserDto2> userDto2List = performanceService.toutiaoYouhuaWeekReport(startDate, endDate);
+        result.setSuccess(true);
+        result.setResult(userDto2List);
+        return result;
+    }
+
     @AutoLog(value = "获取快手季度绩效报表")
     @ApiOperation(value = "获取快手季度绩效报表", notes = "获取快手季度绩效报表")
     @PostMapping(value = "/kuaishouQuarterReport")
@@ -495,4 +535,43 @@ public class PerformanceController2 {
         return result;
     }
 
+    //快手优化季度绩效报表
+    //List<UserDto2> kuaishouYouhuaQuarterReport(Integer year, Integer quarter);
+    @AutoLog(value = "快手优化季度绩效报表")
+    @ApiOperation(value = "快手优化季度绩效报表", notes = "快手优化季度绩效报表")
+    @PostMapping(value = "/kuaishouYouhuaQuarterReport")
+    public Result<List<UserDto2>> kuaishouYouhuaQuarterReport(@RequestBody PerformanceTimeDTO dto,
+                                                             HttpServletRequest req) {
+        Result<List<UserDto2>> result = new Result<List<UserDto2>>();
+        Integer year = dto.getYear();
+        Integer quarter = dto.getQuarter();
+        if(year==null || quarter == null){
+            result.setSuccess(false);
+            result.setMessage("时间不能为空");
+        }
+        List<UserDto2> userDto2List = performanceService.kuaishouYouhuaQuarterReport(year, quarter);
+        result.setSuccess(true);
+        result.setResult(userDto2List);
+        return result;
+    }
+
+    //头条优化季度绩效报表
+    @AutoLog(value = "头条优化季度绩效报表")
+    @ApiOperation(value = "头条优化季度绩效报表", notes = "头条优化季度绩效报表")
+    @PostMapping(value = "/toutiaoYouhuaQuarterReport")
+    public Result<List<UserDto2>> toutiaoYouhuaQuarterReport(@RequestBody PerformanceTimeDTO dto,
+                                                       HttpServletRequest req) {
+        Result<List<UserDto2>> result = new Result<List<UserDto2>>();
+        Integer year = dto.getYear();
+        Integer quarter = dto.getQuarter();
+        if(year==null || quarter == null){
+            result.setSuccess(false);
+            result.setMessage("时间不能为空");
+        }
+        List<UserDto2> userDto2List = performanceService.toutiaoYouhuaQuarterReport(year, quarter);
+        result.setSuccess(true);
+        result.setResult(userDto2List);
+        return result;
+    }
+
 }

+ 11 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/IPerformanceService2.java

@@ -102,4 +102,15 @@ public interface IPerformanceService2 extends IService<Performance> {
     //获取头条优化师所属账号信息
     List<AccountDTO> getToutiaoYouhuaAccountsList(String userId, Integer appType, Integer year , Integer quarter);
 
+    //快手优化师周报
+    List<UserDto2> kuaishouYouhuaWeekReport(String startDate, String endDate);
+
+    //头条优化师周报
+    List<UserDto2> toutiaoYouhuaWeekReport(String startDate, String endDate);
+
+    //快手优化季度绩效报表
+    List<UserDto2> kuaishouYouhuaQuarterReport(Integer year, Integer quarter);
+
+    //头条优化季度绩效报表
+    List<UserDto2> toutiaoYouhuaQuarterReport(Integer year, Integer quarter);
 }

+ 88 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/PerformanceServiceImpl2.java

@@ -1666,6 +1666,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
             userDto.setCost(cost);
             userDto.setVideoCount(videoCount);
             userDto.setEffiVideoCount(effiVideoCount);
+            userDto.setAppType(2);
         }
         return userDto2List;
     }
@@ -1693,6 +1694,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
                 cost = BigDecimal.ZERO;
             }
             userDto.setCost(cost);
+            userDto.setAppType(2);
         }
         return userDto2List;
     }
@@ -1720,6 +1722,43 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
                 cost = BigDecimal.ZERO;
             }
             userDto.setCost(cost);
+            userDto.setAppType(1);
+        }
+        return userDto2List;
+    }
+
+    //获取快手优化师绩效周报
+    @Override
+    public List<UserDto2> kuaishouYouhuaWeekReport(String startDate, String endDate) {
+        //1 获取快手下所有人
+        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getKuaishouYunyingDepartUserInfo();
+        //2 循环所有人,并查询出每个优化师的总消耗
+        for (UserDto2 userDto : userDto2List) {
+            BigDecimal cost = null;
+            cost = userEfficientVideoMapMapper.getKuaishouYunyingTotalCost(userDto.getUserId(),2,startDate, endDate);
+            if(cost == null){
+                cost = BigDecimal.ZERO;
+            }
+            userDto.setCost(cost);
+            userDto.setAppType(2);
+        }
+        return userDto2List;
+    }
+
+    //获取头条优化师绩效周报
+    @Override
+    public List<UserDto2> toutiaoYouhuaWeekReport(String startDate, String endDate) {
+        //1 获取快手下所有人
+        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getToutiaoYunyingDepartUserInfo();
+        //2 循环所有人,并查询出每个人的有效视频数、总视频数、总消耗
+        for (UserDto2 userDto : userDto2List) {
+            BigDecimal cost = null;
+            cost = userEfficientVideoMapMapper.getToutiaoYunyingTotalCost(userDto.getUserId(),1,startDate, endDate);
+            if(cost == null){
+                cost = BigDecimal.ZERO;
+            }
+            userDto.setCost(cost);
+            userDto.setAppType(1);
         }
         return userDto2List;
     }
@@ -1785,11 +1824,12 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
             userDto.setCost(cost);
             userDto.setVideoCount(videoCount);
             userDto.setEffiVideoCount(effiVideoCount);
+            userDto.setAppType(1);
         }
         return userDto2List;
     }
 
-    //快手绩效周报数据接口
+    //快手绩效周报
     @Override
     public List<UserDto2> kuaishouWeekReport(String startDate, String endDate) {
         //1 获取快手下所有人
@@ -1821,7 +1861,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         return userDto2List;
     }
 
-    //头条绩效实时数据
+    //头条绩效周报
     public List<UserDto2> toutiaoWeekReport(String startDate, String endDate) {
         //1 获取头条所有人
         List<UserDto2> userDto2List = userEfficientVideoMapMapper.getToutiaoDepartUserInfo();
@@ -1929,5 +1969,51 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         return materialInfoList;
     }
 
+    //快手优化季度绩效报表
+    //@Override
+    public List<UserDto2> kuaishouYouhuaQuarterReport(Integer year, Integer quarter) {
+        //1 获取快手下所有人
+        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getKuaishouYunyingDepartUserInfo();
+        //2 循环所有人,并查询出每个人的有效视频数、总视频数、总消耗
+        for (UserDto2 userDto : userDto2List) {
+            //总消耗
+            BigDecimal cost = userEfficientVideoMapMapper.getQuarterCost(userDto.getUserId(), year, quarter, 2);
+            if (cost == null) {
+                cost = BigDecimal.ZERO;
+            }
+            //当季度绩效
+            BigDecimal performance = userEfficientVideoMapMapper.getQuarterPerformance(userDto.getUserId(), year, quarter, 2);
+            userDto.setEffiRate(performance);
+            userDto.setCost(cost);
+            userDto.setYear(year);
+            userDto.setQuarter(quarter);
+            userDto.setAppType(2);
+        }
+        return userDto2List;
+    }
+
+    //头条优化季度绩效报表
+    //@Override
+    public List<UserDto2> toutiaoYouhuaQuarterReport(Integer year, Integer quarter) {
+        //1 获取快手下所有人
+        List<UserDto2> userDto2List = userEfficientVideoMapMapper.getToutiaoYunyingDepartUserInfo();
+        //2 循环所有人,并查询出每个人的有效视频数、总视频数、总消耗
+        for (UserDto2 userDto : userDto2List) {
+            //总消耗
+            BigDecimal cost = userEfficientVideoMapMapper.getQuarterCost(userDto.getUserId(), year, quarter, 1);
+            if (cost == null) {
+                cost = BigDecimal.ZERO;
+            }
+            //当季度绩效
+            BigDecimal performance = userEfficientVideoMapMapper.getQuarterPerformance(userDto.getUserId(), year, quarter, 1);
+            userDto.setEffiRate(performance);
+            userDto.setCost(cost);
+            userDto.setYear(year);
+            userDto.setQuarter(quarter);
+            userDto.setAppType(1);
+        }
+        return userDto2List;
+    }
+
 }
 

+ 0 - 118
log-server/.mvn/wrapper/MavenWrapperDownloader.java

@@ -1,118 +0,0 @@
-/*
- * Copyright 2007-present the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.net.*;
-import java.io.*;
-import java.nio.channels.*;
-import java.util.Properties;
-
-public class MavenWrapperDownloader {
-
-    private static final String WRAPPER_VERSION = "0.5.6";
-    /**
-     * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
-     */
-    private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
-            + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
-
-    /**
-     * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
-     * use instead of the default one.
-     */
-    private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
-            ".mvn/wrapper/maven-wrapper.properties";
-
-    /**
-     * Path where the maven-wrapper.jar will be saved to.
-     */
-    private static final String MAVEN_WRAPPER_JAR_PATH =
-            ".mvn/wrapper/maven-wrapper.jar";
-
-    /**
-     * Name of the property which should be used to override the default download url for the wrapper.
-     */
-    private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
-
-    public static void main(String args[]) {
-        System.out.println("- Downloader started");
-        File baseDirectory = new File(args[0]);
-        System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
-
-        // If the maven-wrapper.properties exists, read it and check if it contains a custom
-        // wrapperUrl parameter.
-        File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
-        String url = DEFAULT_DOWNLOAD_URL;
-        if (mavenWrapperPropertyFile.exists()) {
-            FileInputStream mavenWrapperPropertyFileInputStream = null;
-            try {
-                mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
-                Properties mavenWrapperProperties = new Properties();
-                mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
-                url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
-            } catch (IOException e) {
-                System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
-            } finally {
-                try {
-                    if (mavenWrapperPropertyFileInputStream != null) {
-                        mavenWrapperPropertyFileInputStream.close();
-                    }
-                } catch (IOException e) {
-                    // Ignore ...
-                }
-            }
-        }
-        System.out.println("- Downloading from: " + url);
-
-        File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
-        if (!outputFile.getParentFile().exists()) {
-            if (!outputFile.getParentFile().mkdirs()) {
-                System.out.println(
-                        "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
-            }
-        }
-        System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
-        try {
-            downloadFileFromURL(url, outputFile);
-            System.out.println("Done");
-            System.exit(0);
-        } catch (Throwable e) {
-            System.out.println("- Error downloading");
-            e.printStackTrace();
-            System.exit(1);
-        }
-    }
-
-    private static void downloadFileFromURL(String urlString, File destination) throws Exception {
-        if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
-            String username = System.getenv("MVNW_USERNAME");
-            char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
-            Authenticator.setDefault(new Authenticator() {
-                @Override
-                protected PasswordAuthentication getPasswordAuthentication() {
-                    return new PasswordAuthentication(username, password);
-                }
-            });
-        }
-        URL website = new URL(urlString);
-        ReadableByteChannel rbc;
-        rbc = Channels.newChannel(website.openStream());
-        FileOutputStream fos = new FileOutputStream(destination);
-        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
-        fos.close();
-        rbc.close();
-    }
-
-}

BIN
log-server/.mvn/wrapper/maven-wrapper.jar


+ 0 - 2
log-server/.mvn/wrapper/maven-wrapper.properties

@@ -1,2 +0,0 @@
-distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
-wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

+ 0 - 376
log-server/pom.xml

@@ -1,376 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.springframework.boot</groupId>
-        <artifactId>spring-boot-starter-parent</artifactId>
-        <version>2.2.2.RELEASE</version>
-        <relativePath/>
-    </parent>
-    <groupId>cn.com.ctop</groupId>
-    <artifactId>log-server</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-    <name>log-server</name>
-    <description>Demo project for Spring Boot</description>
-
-    <properties>
-        <java.version>1.8</java.version>
-        <spring-cloud.version>Hoxton.SR1</spring-cloud.version>
-        <jeecgboot.common.version>2.0.2</jeecgboot.common.version>
-        <java.version>1.8</java.version>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <mybatis-plus.version>3.0.6</mybatis-plus.version>
-        <druid.version>1.1.10</druid.version>
-        <commons.version>2.6</commons.version>
-        <aliyun-java-sdk-core.version>3.5.0</aliyun-java-sdk-core.version>
-        <aliyun-java-sdk-dysmsapi.version>1.0.0</aliyun-java-sdk-dysmsapi.version>
-    </properties>
-
-    <dependencies>
-
-        <!--集成springmvc框架并实现自动配置 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>ch.qos.logback</groupId>
-                    <artifactId>logback-classic</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-mail</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-aop</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-actuator</artifactId>
-        </dependency>
-        <!-- <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-devtools</artifactId>
-            <optional>true</optional>
-        </dependency> -->
-
-        <!-- commons -->
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>${commons.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
-            <version>${commons.version}</version>
-        </dependency>
-
-        <!-- freemarker -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-freemarker</artifactId>
-        </dependency>
-
-        <!-- Lombok -->
-        <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-        </dependency>
-
-        <!-- mybatis-plus -->
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-boot-starter</artifactId>
-            <version>${mybatis-plus.version}</version>
-        </dependency>
-
-        <!-- druid -->
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
-            <version>${druid.version}</version>
-        </dependency>
-
-        <!-- 动态数据源 -->
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
-            <version>2.5.4</version>
-        </dependency>
-
-        <!-- json -->
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-            <version>1.2.56</version>
-        </dependency>
-
-        <!--mysql-->
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>5.1.47</version>
-            <scope>runtime</scope>
-        </dependency>
-        <!--sqlserver-->
-        <dependency>
-            <groupId>net.sourceforge.jtds</groupId>
-            <artifactId>jtds</artifactId>
-            <version>1.3.1</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.microsoft.sqlserver</groupId>
-            <artifactId>mssql-jdbc</artifactId>
-            <version>7.2.1.jre8</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <!-- Quartz定时任务 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-quartz</artifactId>
-        </dependency>
-
-        <!--JWT-->
-        <dependency>
-            <groupId>com.auth0</groupId>
-            <artifactId>java-jwt</artifactId>
-            <version>3.7.0</version>
-        </dependency>
-
-        <!--shiro-->
-        <dependency>
-            <groupId>org.apache.shiro</groupId>
-            <artifactId>shiro-spring-boot-starter</artifactId>
-            <version>1.4.0</version>
-        </dependency>
-
-        <!-- Swagger API文档 -->
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger2</artifactId>
-            <version>2.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger-ui</artifactId>
-            <version>2.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>com.github.xiaoymin</groupId>
-            <artifactId>swagger-bootstrap-ui</artifactId>
-            <version>1.9.3</version>
-        </dependency>
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-bean-validators</artifactId>
-            <version>2.9.2</version>
-        </dependency>
-
-
-        <!-- Redis -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-redis</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-pool2</artifactId>
-        </dependency>
-
-        <!-- 代码生成器 -->
-
-        <!-- AutoPoi Excel工具类-->
-        <dependency>
-            <groupId>org.jeecgframework</groupId>
-            <artifactId>autopoi-web</artifactId>
-            <version>1.0.3</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>commons-codec</groupId>
-                    <artifactId>commons-codec</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpclient</artifactId>
-            <version>4.5.9</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpcore</artifactId>
-            <version>4.4</version>
-        </dependency>
-        <dependency>
-            <groupId>com.squareup.retrofit2</groupId>
-            <artifactId>retrofit</artifactId>
-            <version>2.6.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.pdfbox</groupId>
-            <artifactId>fontbox</artifactId>
-            <version>2.0.15</version>
-        </dependency>
-        <dependency>
-            <groupId>org.seleniumhq.selenium</groupId>
-            <artifactId>selenium-java</artifactId>
-            <version>3.141.59</version>
-        </dependency>
-        <dependency>
-            <groupId>org.seleniumhq.selenium</groupId>
-            <artifactId>selenium-firefox-driver</artifactId>
-            <version>3.141.59</version>
-        </dependency>
-        <dependency>
-            <groupId>org.json</groupId>
-            <artifactId>json</artifactId>
-            <version>LATEST</version>
-        </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <version>25.0-jre</version>
-        </dependency>
-        <dependency>
-            <groupId>com.github.binarywang</groupId>
-            <artifactId>weixin-java-cp</artifactId>
-            <version>3.6.0</version>
-        </dependency>
-        <dependency>
-            <groupId>us.codecraft</groupId>
-            <artifactId>webmagic-core</artifactId>
-            <version>0.7.3</version>
-        </dependency>
-        <dependency>
-            <groupId>us.codecraft</groupId>
-            <artifactId>webmagic-extension</artifactId>
-            <version>0.7.3</version>
-        </dependency>
-        <dependency>
-            <groupId>net.sourceforge.htmlunit</groupId>
-            <artifactId>htmlunit</artifactId>
-            <version>2.36.0</version>
-        </dependency>
-        <dependency>
-            <groupId>io.appium</groupId>
-            <artifactId>java-client</artifactId>
-            <version>7.2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-            <version>1.11</version>
-        </dependency>
-
-        <dependency>
-            <groupId>cn.hutool</groupId>
-            <artifactId>hutool-all</artifactId>
-            <version>4.5.11</version>
-        </dependency>
-
-        <!-- 阿里云短信 -->
-        <dependency>
-            <groupId>com.aliyun</groupId>
-            <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
-            <version>${aliyun-java-sdk-dysmsapi.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.aliyun</groupId>
-            <artifactId>aliyun-java-sdk-core</artifactId>
-            <version>${aliyun-java-sdk-core.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.aliyun.oss</groupId>
-            <artifactId>aliyun-sdk-oss</artifactId>
-            <version>2.8.3</version>
-        </dependency>
-        <dependency>
-            <groupId>com.aliyun</groupId>
-            <artifactId>aliyun-java-sdk-mts</artifactId>
-            <version>2.5.2</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.junit.vintage</groupId>
-                    <artifactId>junit-vintage-engine</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    </dependencies>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.jeecgframework.boot</groupId>
-                <artifactId>jeecg-boot-base-common</artifactId>
-                <version>${jeecgboot.common.version}</version>
-            </dependency>
-
-            <dependency>
-                <groupId>org.springframework.cloud</groupId>
-                <artifactId>spring-cloud-dependencies</artifactId>
-                <version>${spring-cloud.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-
-    <profiles>
-        <profile>
-            <id>dev</id>
-            <properties>
-                <!-- 环境标识,需要与配置文件的名称相对应 -->
-                <activatedProperties>dev</activatedProperties>
-            </properties>
-            <activation>
-                <!-- 默认环境 -->
-                <activeByDefault>true</activeByDefault>
-            </activation>
-        </profile>
-        <profile>
-            <id>test</id>
-            <properties>
-                <activatedProperties>test</activatedProperties>
-            </properties>
-        </profile>
-        <profile>
-            <id>prod</id>
-            <properties>
-                <activatedProperties>prod</activatedProperties>
-            </properties>
-        </profile>
-    </profiles>
-</project>

+ 0 - 13
log-server/src/main/java/cn/com/ctop/logserver/LogServerApplication.java

@@ -1,13 +0,0 @@
-package cn.com.ctop.logserver;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
-
-@SpringBootApplication
-@EnableEurekaClient
-public class LogServerApplication {
-    public static void main(String[] args) {
-        SpringApplication.run(LogServerApplication.class, args);
-    }
-}

+ 0 - 17
log-server/src/main/java/cn/com/ctop/logserver/controller/LogController.java

@@ -1,17 +0,0 @@
-package cn.com.ctop.logserver.controller;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-public class LogController {
-    @Value("${server.port}")
-    String port;
-
-    @GetMapping("hi")
-    public String home(@RequestParam(value = "name", defaultValue = "forezp") String name) {
-        return "hi " + name + " ,i am from port:" + port;
-    }
-}

+ 0 - 160
log-server/src/main/resources/application-dev.yml

@@ -1,160 +0,0 @@
-server:
-  port: 8080
-  servlet:
-    context-path: /jeecg-boot
-    compression:
-      enabled: true
-      mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: metrics,httptrace
-
-spring:
-  rabbitmq:
-    host: 39.106.184.70
-    port: 5672
-    username: guest
-    password: guest
-  servlet:
-    multipart:
-      max-file-size: -1
-      max-request-size: -1
-  mail:
-    host: smtp.163.com
-    username: jeecgos@163.com
-    password: ??
-    properties:
-      mail:
-        smtp:
-          auth: true
-          starttls:
-            enable: true
-            required: true
-  ## quartz定时任务,采用数据库方式
-  quartz:
-    job-store-type: jdbc
-  #json 时间戳统一转换
-  jackson:
-    date-format:   yyyy-MM-dd HH:mm:ss
-    time-zone:   GMT+8
-  aop:
-    proxy-target-class: true
-  #配置freemarker
-  freemarker:
-    # 设置模板后缀名
-    suffix: .ftl
-    # 设置文档类型
-    content-type: text/html
-    # 设置页面编码格式
-    charset: UTF-8
-    # 设置页面缓存
-    cache: false
-    prefer-file-system-access: false
-    # 设置ftl文件路径
-    template-loader-path:
-      - classpath:/templates
-  # 设置静态文件路径,js,css等
-  mvc:
-    static-path-pattern: /**
-  resource:
-    static-locations: classpath:/static/,classpath:/public/
-  autoconfigure:
-    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
-  datasource:
-    druid:
-      stat-view-servlet:
-        enabled: true
-        loginUsername: admin
-        loginPassword: 123456
-      web-stat-filter:
-        enabled: true
-    dynamic:
-      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
-        # 连接池的配置信息
-        # 初始化大小,最小,最大
-        connection-init-sql: set names utf8mb4
-
-        initial-size: 5
-        min-idle: 5
-        maxActive: 20
-        # 配置获取连接等待超时的时间
-        maxWait: 60000
-        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-        timeBetweenEvictionRunsMillis: 60000
-        # 配置一个连接在池中最小生存的时间,单位是毫秒
-        minEvictableIdleTimeMillis: 300000
-        validationQuery: SELECT 1 FROM DUAL
-        testWhileIdle: true
-        testOnBorrow: false
-        testOnReturn: false
-        # 打开PSCache,并且指定每个连接上PSCache的大小
-        poolPreparedStatements: true
-        maxPoolPreparedStatementPerConnectionSize: 20
-        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        filters: stat,wall,slf4j
-        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
-        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
-      datasource:
-        master:
-          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: root
-          password: hcst2019
-          driver-class-name: com.mysql.jdbc.Driver
-          # 多数据源配置
-          #multi-datasource1:
-          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
-          #username: root
-          #password: root
-          #driver-class-name: com.mysql.jdbc.Driver
-  #redis 配置
-  redis:
-    database: 0
-    host: 127.0.0.1
-    lettuce:
-      pool:
-        max-active: 8   #最大连接数据库连接数,设 0 为没有限制
-        max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
-        max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
-        min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
-      shutdown-timeout: 100ms
-    password: ''
-    port: 6379
-#mybatis plus 设置
-mybatis-plus:
-  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
-  global-config:
-    # 关闭MP3.0自带的banner
-    banner: false
-    db-config:
-      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
-      id-type: 4
-      # 默认数据库表下划线命名
-      table-underline: true
-    configuration:
-      # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
-      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-#jeecg专用配置
-jeecg:
-  path:
-    #文件上传根目录 设置
-    upload: D://upFiles
-    #webapp文件路径
-    webapp: D://webapp
-    video-upload: D://upFiles//video//
-    image-upload: D://upFiles//image//
-    chrome-driver: D://chromedriver.exe
-    csv-upload: D://upFiles//csv//
-kuaishou:
-  group-control:
-    path: http://39.106.184.70
-    port: 4723
-logging:
-  level:
-    root: info
-  config: classpath:logback-dev.xml
-chrome:
-  script:
-    clean: sh /mnt/webapp/cleanProcess.sh

+ 0 - 159
log-server/src/main/resources/application-prod.yml

@@ -1,159 +0,0 @@
-server:
-  port: 8080
-  servlet:
-    context-path: /jeecg-boot
-    compression:
-      enabled: true
-      mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: metrics,httptrace
-
-
-spring:
-  rabbitmq:
-    host: 39.106.184.70
-    port: 5672
-    username: guest
-    password: guest
-  servlet:
-    multipart:
-      max-file-size: -1
-      max-request-size: -1
-  mail:
-    host: smtp.163.com
-    username: jeecgos@163.com
-    password: ??
-    properties:
-      mail:
-        smtp:
-          auth: true
-          starttls:
-            enable: true
-            required: true
-  ## quartz定时任务,采用数据库方式
-  quartz:
-    job-store-type: jdbc
-  #json 时间戳统一转换
-  jackson:
-    date-format:   yyyy-MM-dd HH:mm:ss
-    time-zone:   GMT+8
-  aop:
-    proxy-target-class: true
-  #配置freemarker
-  freemarker:
-    # 设置模板后缀名
-    suffix: .ftl
-    # 设置文档类型
-    content-type: text/html
-    # 设置页面编码格式
-    charset: UTF-8
-    # 设置页面缓存
-    cache: false
-    prefer-file-system-access: false
-    # 设置ftl文件路径
-    template-loader-path:
-      - classpath:/templates
-  # 设置静态文件路径,js,css等
-  mvc:
-    static-path-pattern: /**
-  resource:
-    static-locations: classpath:/static/,classpath:/public/
-  autoconfigure:
-    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
-  datasource:
-    druid:
-      stat-view-servlet:
-        loginUsername: admin
-        loginPassword: hcst2016
-        enabled: true
-      web-stat-filter:
-        enabled: true
-    #      remove-abandoned: false
-    dynamic:
-      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
-        # 连接池的配置信息
-        # 初始化大小,最小,最大
-        connection-init-sql: set names utf8mb4
-        initial-size: 5
-        min-idle: 5
-        maxActive: 20
-        # 配置获取连接等待超时的时间
-        maxWait: 60000
-        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-        timeBetweenEvictionRunsMillis: 60000
-        # 配置一个连接在池中最小生存的时间,单位是毫秒
-        minEvictableIdleTimeMillis: 300000
-        validationQuery: SELECT 1 FROM DUAL
-        testWhileIdle: true
-        testOnBorrow: false
-        testOnReturn: false
-        # 打开PSCache,并且指定每个连接上PSCache的大小
-        poolPreparedStatements: true
-        maxPoolPreparedStatementPerConnectionSize: 20
-        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        filters: stat,wall,slf4j
-        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
-        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
-      datasource:
-        master:
-          url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: hcst
-          password: test@20190531
-          driver-class-name: com.mysql.jdbc.Driver
-          # 多数据源配置
-          #multi-datasource1:
-          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
-          #username: root
-          #password: root
-          #driver-class-name: com.mysql.jdbc.Driver
-  #redis 配置
-  redis:
-    database: 0
-    host: 127.0.0.1
-    lettuce:
-      pool:
-        max-active: 8   #最大连接数据库连接数,设 0 为没有限制
-        max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
-        max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
-        min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
-      shutdown-timeout: 100ms
-    password: ''
-    port: 6379
-#mybatis plus 设置
-mybatis-plus:
-  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
-  global-config:
-    # 关闭MP3.0自带的banner
-    banner: false
-    db-config:
-      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
-      id-type: 4
-      # 默认数据库表下划线命名
-      table-underline: true
-#jeecg专用配置
-jeecg:
-  path:
-    #文件上传根目录 设置
-    upload: /mnt/upload
-    #webapp文件路径
-    webapp: /mnt/webapp
-    video-upload: /mnt/upload/video/
-    image-upload: /mnt/upload/image/
-    chrome-driver: /usr/bin/chromedriver
-    csv-upload: /mnt/upload/csv/
-kuaishou:
-  group-control:
-    path: http://39.106.184.70
-    port: 4723
-logging:
-  level:
-    root: info
-  config: classpath:logback-prod.xml
-chrome:
-  script:
-    clean: sh /mnt/webapp/cleanProcess.sh
-

+ 0 - 161
log-server/src/main/resources/application-test.yml

@@ -1,161 +0,0 @@
-server:
-  port: 8080
-  servlet:
-    context-path: /jeecg-boot
-    compression:
-      enabled: true
-      mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: metrics,httptrace
-
-spring:
-  rabbitmq:
-    host: 127.0.0.1
-    port: 5672
-    username: guest
-    password: guest
-  servlet:
-    multipart:
-      max-file-size: -1
-      max-request-size: -1
-  mail:
-    host: smtp.163.com
-    username: jeecgos@163.com
-    password: ??
-    properties:
-      mail:
-        smtp:
-          auth: true
-          starttls:
-            enable: true
-            required: true
-  ## quartz定时任务,采用数据库方式
-  quartz:
-    job-store-type: jdbc
-  #json 时间戳统一转换
-  jackson:
-    date-format:   yyyy-MM-dd HH:mm:ss
-    time-zone:   GMT+8
-  aop:
-    proxy-target-class: true
-  #配置freemarker
-  freemarker:
-    # 设置模板后缀名
-    suffix: .ftl
-    # 设置文档类型
-    content-type: text/html
-    # 设置页面编码格式
-    charset: UTF-8
-    # 设置页面缓存
-    cache: false
-    prefer-file-system-access: false
-    # 设置ftl文件路径
-    template-loader-path:
-      - classpath:/templates
-  # 设置静态文件路径,js,css等
-  mvc:
-    static-path-pattern: /**
-  resource:
-    static-locations: classpath:/static/,classpath:/public/
-  autoconfigure:
-    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
-  datasource:
-    druid:
-      stat-view-servlet:
-        enabled: true
-        loginUsername: admin
-        loginPassword: 123456
-      web-stat-filter:
-        enabled: true
-    dynamic:
-      druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
-        # 连接池的配置信息
-        # 初始化大小,最小,最大
-        connection-init-sql: set names utf8mb4
-
-        initial-size: 5
-        min-idle: 5
-        maxActive: 20
-        # 配置获取连接等待超时的时间
-        maxWait: 60000
-        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-        timeBetweenEvictionRunsMillis: 60000
-        # 配置一个连接在池中最小生存的时间,单位是毫秒
-        minEvictableIdleTimeMillis: 300000
-        validationQuery: SELECT 1 FROM DUAL
-        testWhileIdle: true
-        testOnBorrow: false
-        testOnReturn: false
-        # 打开PSCache,并且指定每个连接上PSCache的大小
-        poolPreparedStatements: true
-        maxPoolPreparedStatementPerConnectionSize: 20
-        # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
-        filters: stat,wall,slf4j
-        # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
-        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
-      datasource:
-        master:
-          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
-          username: root
-          password: hcst2019
-          driver-class-name: com.mysql.jdbc.Driver
-          # 多数据源配置
-          #multi-datasource1:
-          #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true
-          #username: root
-          #password: root
-          #driver-class-name: com.mysql.jdbc.Driver
-  #redis 配置
-  redis:
-    database: 0
-    host: 127.0.0.1
-    lettuce:
-      pool:
-        max-active: 8   #最大连接数据库连接数,设 0 为没有限制
-        max-idle: 8     #最大等待连接中的数量,设 0 为没有限制
-        max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
-        min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
-      shutdown-timeout: 100ms
-    password: ''
-    port: 6379
-#mybatis plus 设置
-mybatis-plus:
-  mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:cn/com/ctop/**/xml/*Mapper.xml
-  global-config:
-    # 关闭MP3.0自带的banner
-    banner: false
-    db-config:
-      #主键类型  0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
-      id-type: 4
-      # 默认数据库表下划线命名
-      table-underline: true
-    configuration:
-      # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
-      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-#jeecg专用配置
-jeecg:
-  path:
-    #文件上传根目录 设置
-    #文件上传根目录 设置
-    upload: /data/upload
-    #webapp文件路径
-    webapp: /data/webapp
-    video-upload: /data/upload/video/
-    image-upload: /data/upload/image/
-    chrome-driver: /usr/bin/chromedriver
-    csv-upload: /data/upload/csv/
-kuaishou:
-  group-control:
-    path: http://127.0.0.1
-    port: 4723
-logging:
-  level:
-    root: info
-  config: classpath:logback-test.xml
-chrome:
-  script:
-    clean: sh /mnt/webapp/cleanProcess.sh

+ 0 - 15
log-server/src/main/resources/application.yml

@@ -1,15 +0,0 @@
-spring:
-  profiles:
-    active: @activatedProperties@
-  application:
-    name: system-web
-eureka:
-  client:
-    serviceUrl:
-      defaultZone: http://localhost:8761/eureka/
-swagger:
-  production: false
-  basic:
-    enable: true
-    username: jeecg
-    password: jeecg1314

+ 0 - 14
log-server/src/main/resources/banner.txt

@@ -1,14 +0,0 @@
-
-${AnsiColor.BRIGHT_BLUE}
-   (_)                          | |               | |
-    _  ___  ___  ___ __ _ ______| |__   ___   ___ | |_ 
-   | |/ _ \/ _ \/ __/ _` |______| '_ \ / _ \ / _ \| __|
-   | |  __/  __/ (_| (_| |      | |_) | (_) | (_) | |_ 
-   | |\___|\___|\___\__, |      |_.__/ \___/ \___/ \__|
-  _/ |               __/ |                             
- |__/               |___/
-
-${AnsiColor.BRIGHT_GREEN}
-Jeecg  Boot Version: 2.0.2
-Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
-${AnsiColor.BLACK}

+ 0 - 4
log-server/src/main/resources/log4j.properties

@@ -1,4 +0,0 @@
-log4j.rootLogger=INFO,stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS}-[%p] [%t] %-5l - %m%n

+ 0 - 57
log-server/src/main/resources/logback-dev.xml

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="10 seconds">
-
-    <contextName>logback</contextName>
-
-
-    <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
-    <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
-
-    <!-- 定义日志存储的路径,不要配置相对路径 -->
-    <property name="FILE_PATH" value="D:/Desktop/log/spring-log.%d{yyyy-MM-dd}.%i.log"/>
-
-    <!-- 控制台输出日志 -->
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <!-- 日志级别过滤INFO以下 -->
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>INFO</level>
-        </filter>
-        <encoder>
-            <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
-            <pattern>${LOG_PATTERN}</pattern>
-        </encoder>
-    </appender>
-
-    <!--每天生成一个日志文件,保存30天的日志文件。rollingFile用来切分文件的 -->
-    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
-
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-
-            <fileNamePattern>${FILE_PATH}</fileNamePattern>
-
-            <!-- keep 15 days' worth of history -->
-            <maxHistory>30</maxHistory>
-
-            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <!-- 日志文件的最大大小 -->
-                <maxFileSize>2MB</maxFileSize>
-            </timeBasedFileNamingAndTriggeringPolicy>
-
-            <!-- 超出删除老文件 -->
-            <totalSizeCap>1GB</totalSizeCap>
-        </rollingPolicy>
-
-        <encoder>
-            <pattern>${LOG_PATTERN}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- project default level -->
-    <logger name="net.sh.rgface.serive" level="ERROR"/>
-
-    <!-- 日志输出级别 -->
-    <root level="INFO">
-        <appender-ref ref="console"/>
-        <appender-ref ref="rollingFile"/>
-    </root>
-</configuration>

+ 0 - 57
log-server/src/main/resources/logback-prod.xml

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="10 seconds">
-
-    <contextName>logback</contextName>
-
-
-    <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
-    <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
-
-    <!-- 定义日志存储的路径,不要配置相对路径 -->
-    <property name="FILE_PATH" value="/mnt/webapps/logs/spring-log.%d{yyyy-MM-dd}.%i.log"/>
-
-    <!-- 控制台输出日志 -->
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <!-- 日志级别过滤INFO以下 -->
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>INFO</level>
-        </filter>
-        <encoder>
-            <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
-            <pattern>${LOG_PATTERN}</pattern>
-        </encoder>
-    </appender>
-
-    <!--每天生成一个日志文件,保存30天的日志文件。rollingFile用来切分文件的 -->
-    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
-
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-
-            <fileNamePattern>${FILE_PATH}</fileNamePattern>
-
-            <!-- keep 15 days' worth of history -->
-            <maxHistory>30</maxHistory>
-
-            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <!-- 日志文件的最大大小 -->
-                <maxFileSize>2MB</maxFileSize>
-            </timeBasedFileNamingAndTriggeringPolicy>
-
-            <!-- 超出删除老文件 -->
-            <totalSizeCap>1GB</totalSizeCap>
-        </rollingPolicy>
-
-        <encoder>
-            <pattern>${LOG_PATTERN}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- project default level -->
-    <logger name="net.sh.rgface.serive" level="ERROR"/>
-
-    <!-- 日志输出级别 -->
-    <root level="INFO">
-        <appender-ref ref="console"/>
-        <appender-ref ref="rollingFile"/>
-    </root>
-</configuration>

+ 0 - 57
log-server/src/main/resources/logback-test.xml

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="10 seconds">
-
-    <contextName>logback</contextName>
-
-
-    <!-- 格式化输出:%date表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %msg:日志消息,%n是换行符-->
-    <property name="LOG_PATTERN" value="%date{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
-
-    <!-- 定义日志存储的路径,不要配置相对路径 -->
-    <property name="FILE_PATH" value="/data/webapp/log/spring-log.%d{yyyy-MM-dd}.%i.log"/>
-
-    <!-- 控制台输出日志 -->
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-        <!-- 日志级别过滤INFO以下 -->
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>INFO</level>
-        </filter>
-        <encoder>
-            <!-- 按照上面配置的LOG_PATTERN来打印日志 -->
-            <pattern>${LOG_PATTERN}</pattern>
-        </encoder>
-    </appender>
-
-    <!--每天生成一个日志文件,保存30天的日志文件。rollingFile用来切分文件的 -->
-    <appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
-
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-
-            <fileNamePattern>${FILE_PATH}</fileNamePattern>
-
-            <!-- keep 15 days' worth of history -->
-            <maxHistory>30</maxHistory>
-
-            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <!-- 日志文件的最大大小 -->
-                <maxFileSize>2MB</maxFileSize>
-            </timeBasedFileNamingAndTriggeringPolicy>
-
-            <!-- 超出删除老文件 -->
-            <totalSizeCap>1GB</totalSizeCap>
-        </rollingPolicy>
-
-        <encoder>
-            <pattern>${LOG_PATTERN}</pattern>
-        </encoder>
-    </appender>
-
-    <!-- project default level -->
-    <logger name="net.sh.rgface.serive" level="ERROR"/>
-
-    <!-- 日志输出级别 -->
-    <root level="INFO">
-        <appender-ref ref="console"/>
-        <appender-ref ref="rollingFile"/>
-    </root>
-</configuration>

+ 0 - 6
log-server/src/main/resources/quartz.properties

@@ -1,6 +0,0 @@
-org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
-org.quartz.threadPool.threadCount=20
-org.quartz.threadPool.threadPriority=5
-org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true
-org.quartz.jobStore.misfireThreshold=60000
-org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore

+ 0 - 13
log-server/src/test/java/cn/com/ctop/logserver/LogServerApplicationTests.java

@@ -1,13 +0,0 @@
-package cn.com.ctop.logserver;
-
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-class LogServerApplicationTests {
-
-    @Test
-    void contextLoads() {
-    }
-
-}

+ 12 - 1
module-report/src/main/java/cn/com/ctop/bytedance/entity/BytedancePlanHourlyReport.java

@@ -8,9 +8,11 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.common.util.DateUtils;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.math.BigDecimal;
+import java.text.ParseException;
 import java.util.Date;
 
 /**
@@ -44,6 +46,8 @@ public class BytedancePlanHourlyReport {
     @Excel(name = "数据起始时间", width = 15)
     @ApiModelProperty(value = "数据起始时间")
     private String statDatetime;
+
+    private Integer statHour;
     /**
      * 展示量
      */
@@ -391,6 +395,8 @@ public class BytedancePlanHourlyReport {
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
 
+    private String channelCode;
+
     public BytedancePlanHourlyReport(JSONObject data, Long setAdvertiserId) {
         Long playFeedBreak75 = data.getLong("play_75_feed_break");
         if (null != playFeedBreak75) {
@@ -434,7 +440,12 @@ public class BytedancePlanHourlyReport {
         }
         String statDatetime = data.getString("stat_datetime");
         if (null != statDatetime && !"".equals(statDatetime.trim())) {
-            this.statDatetime = statDatetime;
+            try {
+                this.statDatetime = DateUtils.getDateByDateStr(statDatetime);
+                this.statHour = DateUtils.getHour(statDatetime);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
         }
         Long shopping = data.getLong("shopping");
         if (null != shopping) {

+ 4 - 4
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/ReportServiceImpl.java

@@ -236,7 +236,7 @@ public class ReportServiceImpl implements IReportService {
         }
         var dataArray = getObject.getJSONObject("data").getJSONArray("list");
         if (null == dataArray || dataArray.size() <= 0) {
-            log.info("广告计划报表信息为空=》accountId:{}", token.getAccountId());
+            log.info("广告计划报表获取完成=》accountId:{}", token.getAccountId());
             return;
         }
         for (var i = 0; i < dataArray.size(); i++) {
@@ -819,7 +819,7 @@ public class ReportServiceImpl implements IReportService {
      */
     public JSONObject getCreativeStat(CtopOauthToken token, JSONObject conditions) {
         // 请求地址
-        String url = PropertiesUtils.getConfig("bytedance_api_url") + PropertiesUtils.getConfig("bytedance_v2_ad_creative_get");
+        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_creative_get");
         JSONArray groupBy = new JSONArray();
         groupBy.add("STAT_GROUP_BY_FIELD_ID");
         groupBy.add("STAT_GROUP_BY_FIELD_STAT_TIME");
@@ -836,7 +836,7 @@ public class ReportServiceImpl implements IReportService {
      */
     private JSONObject getAdStat(CtopOauthToken token, JSONObject conditions) {
         // 请求地址
-        String url = PropertiesUtils.getConfig("bytedance_api_url") + PropertiesUtils.getConfig("bytedance_v2_ad_report_get");
+        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_ad_report_get");
         JSONArray groupBy = new JSONArray();
         groupBy.add("STAT_GROUP_BY_FIELD_ID");
         groupBy.add("STAT_GROUP_BY_FIELD_STAT_TIME");
@@ -853,7 +853,7 @@ public class ReportServiceImpl implements IReportService {
      */
     public JSONObject getCampaignStat(CtopOauthToken token, JSONObject conditions) {
         // 请求地址
-        String url = PropertiesUtils.getConfig("bytedance_api_url") + PropertiesUtils.getConfig("bytedance_v2_campaign_report_get");
+        String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + PropertiesUtils.getValue("bytedance_config", "bytedance_v2_campaign_report_get");
         JSONArray groupBy = new JSONArray();
         groupBy.add("STAT_GROUP_BY_FIELD_ID");
         groupBy.add("STAT_GROUP_BY_FIELD_STAT_TIME");

+ 2 - 5
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/ByteDanceAdvertisePlan.java

@@ -1,6 +1,6 @@
 package cn.com.ctop.toutiao.entity;
 
-import cn.com.ctop.common.module.utils.BigDecimalUtil;
+import cn.com.ctop.common.module.utils.Check;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -505,10 +505,7 @@ public class ByteDanceAdvertisePlan {
             this.externalUrl = externalUrl;
         }
 
-        BigDecimal deepCpabid = params.getBigDecimal("deep_cpabid");
-        if (BigDecimalUtil.compareToDecimal(deepCpabid, new BigDecimal(0)) > 0) {
-            this.deepCpabid = deepCpabid;
-        }
+
 
 
     }

+ 4 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/ByteDanceVideoInfo.java

@@ -102,15 +102,15 @@ public class ByteDanceVideoInfo {
     private Date updateTime;
 
     public ByteDanceVideoInfo(JSONObject data, CtopOauthToken token) {
-        this.id = data.getString("video_id");
-        this.fileId = id;
+        this.id = data.getString("id");
+        this.fileId = data.getString("video_id");
         this.accountId = token.getAccountId();
         this.advertiserId = token.getAdvertiserId();
         this.width = data.getInteger("width");
-        this.height = data.getInteger("width");
+        this.height = data.getInteger("height");
         this.size = data.getLong("size");
         this.duration = data.getDouble("duration");
-        this.videoUrl = data.getString("video_url");
+        this.videoUrl = "https://aweme.snssdk.com/aweme/v1/playwm/?video_id="+data.getString("id")+"&line=0";
         this.signature = data.getString("signature");
         this.status = 1;
         Date now = new Date();

+ 14 - 7
module-toutiao/src/main/java/cn/com/ctop/toutiao/service/impl/ByteDanceAdvertiserDataServiceImpl.java

@@ -119,13 +119,18 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         }
         JSONArray data = resultObject.getJSONObject("data").getJSONArray("list");
         if (null == data || data.size() <= 0) {
-            log.error("获取广告计划信息不存在==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
+//            log.info("获取广告计划信息完成==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
             return;
         }
         for (int i = 0; i < data.size(); i++) {
             JSONObject dataObject = data.getJSONObject(i);
-            System.err.println(dataObject);
             ByteDanceAdvertisePlan advertisePlan = new ByteDanceAdvertisePlan(dataObject, String.valueOf(token.getAccountId()));
+            BigDecimal deepCpabid = dataObject.getBigDecimal("deep_cpabid");
+            if (null != deepCpabid) {
+                advertisePlan.setDeepCpabid(deepCpabid);
+            }
+
+
             advertisePlanService.saveOrUpdate(advertisePlan);
         }
         getAd(token, pageNum + 1, ids, date, updateDate);
@@ -166,7 +171,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         Integer code = jsonObject.getInteger("code");
 
         if (null == code || !code.equals(0)) {
-            log.info("获取广告预算信息接口异常==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
+            log.error("获取广告预算信息接口异常==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
             resultMap.put("code", -1);
             resultMap.put("message", "获取广告预算信息接口异常");
             return resultMap;
@@ -208,14 +213,14 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         Integer code = jsonObject.getInteger("code");
 
         if (null == code || !code.equals(0)) {
-            log.info("获取广告主创意素材信息接口异常==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
+            log.error("获取广告主创意素材信息接口异常==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
             resultMap.put("code", -1);
             resultMap.put("message", "获取广告主创意素材信息接口异常");
             return resultMap;
         }
         JSONArray data = jsonObject.getJSONArray("data");
         if (null == data || data.size() <= 0) {
-            log.info("广告主创意素材信息不存在==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
+//            log.info("广告主创意素材信息不存在==》accountId:{},message:{}", accountId, jsonObject.getString("message"));
             resultMap.put("code", 0);
             resultMap.put("message", "获取广告主预算信息完成");
             return resultMap;
@@ -807,7 +812,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
 
     @Override
     public void getMaterialList(CtopOauthToken token) {
-        getAdImageByPage(token, "", 1);
+//        getAdImageByPage(token, "", 1);
         getVideoByPage(token, "", 1);
     }
 
@@ -833,6 +838,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         }
 
         JSONObject resultObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, param);
+        System.out.println(resultObject);
         Integer code = resultObject.getInteger("code");
         if (null == code || !code.equals(0)) {
             log.error("获取视频素材库接口异常==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
@@ -840,7 +846,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         }
         JSONArray data = resultObject.getJSONObject("data").getJSONArray("list");
         if (null == data || data.size() <= 0) {
-            log.info("获取视频素材信息不存在==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
+            log.info("获取视频素材完成==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));
             return;
         }
         for (int i = 0; i < data.size(); i++) {
@@ -872,6 +878,7 @@ public class ByteDanceAdvertiserDataServiceImpl implements IByteDanceAdvertiserD
         }
 
         JSONObject resultObject = HttpUtils.bytedanceGetRequest(token.getAccessToken(), url, param);
+        System.out.println(resultObject.toJSONString());
         Integer code = resultObject.getInteger("code");
         if (null == code || !code.equals(0)) {
             log.error("获取图片素材库接口异常==》accountId:{},message:{}", token.getAccountId(), resultObject.getString("message"));

+ 1 - 0
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/UserDto2.java

@@ -38,4 +38,5 @@ public class UserDto2 implements Serializable {
 
     private BigDecimal cost;
 
+    private Integer appType;
 }

+ 11 - 11
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/xml/UserEfficientVideoMapMapper.xml

@@ -500,12 +500,12 @@
     <!-- 头条根据plan_id获取视频总消耗 -->
     <select id="toutiaoGetTotalCostByPlanId" resultType="java.math.BigDecimal">
             select
-            sum(a.charge) as charge
-            ctop_bytedance_report_creative_daily a
+            sum(a.cost) as charge
+        from    ctop_bytedance_report_creative_daily a
         left join ctop_bytedance_creative b on a.creative_id = b.id
         left join ctop_bytedance_video_info c on b.video_id = c.id
         left join ctop_material_info d on c.signature = d.code
-        left join ctop_material_ascription e on on d.id = e.material_id
+        left join ctop_material_ascription e on d.id = e.material_id
         where c.signature is not null and d.id is not null
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &gt;= #{startDate}
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &lt;= #{endDate}
@@ -515,12 +515,12 @@
     <!-- 头条根据clip_id获取视频总消耗 -->
     <select id="toutiaoGetTotalCostByClipId" resultType="java.math.BigDecimal">
             select
-            sum(a.charge) as charge
-            ctop_bytedance_report_creative_daily a
+            sum(a.cost) as charge
+         from   ctop_bytedance_report_creative_daily a
         left join ctop_bytedance_creative b on a.creative_id = b.id
         left join ctop_bytedance_video_info c on b.video_id = c.id
         left join ctop_material_info d on c.signature = d.code
-        left join ctop_material_ascription e on on d.id = e.material_id
+        left join ctop_material_ascription e on d.id = e.material_id
         where c.signature is not null and d.id is not null
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &gt;= #{startDate}
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &lt;= #{endDate}
@@ -530,12 +530,12 @@
     <!-- 头条根据shot_id获取视频总消耗 -->
     <select id="toutiaoGetTotalCostByShotId" resultType="java.math.BigDecimal">
             select
-            sum(a.charge) as charge
-            ctop_bytedance_report_creative_daily a
+            sum(a.cost) as charge
+           from ctop_bytedance_report_creative_daily a
         left join ctop_bytedance_creative b on a.creative_id = b.id
         left join ctop_bytedance_video_info c on b.video_id = c.id
         left join ctop_material_info d on c.signature = d.code
-        left join ctop_material_ascription e on on d.id = e.material_id
+        left join ctop_material_ascription e on d.id = e.material_id
         where c.signature is not null and d.id is not null
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &gt;= #{startDate}
         and DATE_FORMAT(d.create_time,'%Y-%m-%d') &lt;= #{endDate}
@@ -787,7 +787,7 @@
         AND
             dailiAccount.stat_date &gt;= #{startDate}
         AND
-            dailiAccount.stat_date &lt; #{endDate}
+            dailiAccount.stat_date &lt;= #{endDate}
         AND
             allocation.media_id = #{appType}
     </select>
@@ -795,7 +795,7 @@
     <!-- 获取头条单个优化师当前账户下的总消耗 -->
     <select id="getToutiaoYunyingTotalCost" resultType="java.math.BigDecimal">
         SELECT
-            SUM(dailiAccount.charge) as totalCost
+            SUM(dailiAccount.cost) as totalCost
         FROM
             ctop_bytedance_report_advertiser_daily dailiAccount
         LEFT JOIN