浏览代码

Merge branch 'master' into test

yumeng 5 年之前
父节点
当前提交
8159757ca3
共有 21 个文件被更改,包括 547 次插入181 次删除
  1. 0 1
      jeecg-boot-module-system/src/main/java/org/jeecg/JeecgApplication.java
  2. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  3. 38 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java
  4. 67 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  5. 37 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/UReportFileBindUserController.java
  6. 6 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/entity/Advertiser.java
  7. 14 4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedanceDailyReportLoadJob.java
  8. 119 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/BytedancePlanDailyReportLoadJob.java
  9. 1 1
      jeecg-boot-module-system/src/main/resources/application-prod.yml
  10. 183 164
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  11. 4 1
      module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java
  12. 1 1
      module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java
  13. 6 1
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java
  14. 10 0
      module-common/src/main/java/cn/com/ctop/common/module/utils/StringUtils.java
  15. 1 0
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java
  16. 4 0
      module-report/pom.xml
  17. 24 0
      module-report/src/main/java/cn/com/ctop/bytedance/entity/BytedancePlanDailyReport.java
  18. 1 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedancePlanDailyReportService.java
  19. 24 0
      module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedancePlanDailyReportServiceImpl.java
  20. 4 1
      module-toutiao/src/main/java/cn/com/ctop/toutiao/entity/ByteDanceCreative.java
  21. 1 0
      module-toutiao/src/main/resources/bytedance_config.properties

+ 0 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/JeecgApplication.java

@@ -19,7 +19,6 @@ import java.net.UnknownHostException;
 @EnableSwagger2
 @EnableSwagger2
 @SpringBootApplication
 @SpringBootApplication
 @ComponentScan(basePackages = {"cn.com.ctop", "org.jeecg"})
 @ComponentScan(basePackages = {"cn.com.ctop", "org.jeecg"})
-@EnableAutoConfiguration
 @Configuration
 @Configuration
 
 
 
 

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -143,7 +143,8 @@ public class ShiroConfig {
 		//爬虫接口
 		//爬虫接口
 		filterChainDefinitionMap.put("/graphql/video", "anon");
 		filterChainDefinitionMap.put("/graphql/video", "anon");
 		filterChainDefinitionMap.put("/ks/web/test", "anon");
 		filterChainDefinitionMap.put("/ks/web/test", "anon");
-
+		filterChainDefinitionMap.put("/ctop/materialInfo/excellent/set", "anon");
+        filterChainDefinitionMap.put("/ctop/materialInfo/excellent/list", "anon");
         filterChainDefinitionMap.put("/ureport/**", "anon");
         filterChainDefinitionMap.put("/ureport/**", "anon");
 
 
 		// 添加自己的过滤器并且取名为jwt
 		// 添加自己的过滤器并且取名为jwt

+ 38 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/MaterialInfoController.java

@@ -73,7 +73,6 @@ public class MaterialInfoController {
     @GetMapping(value = "/report")
     @GetMapping(value = "/report")
     public JSONObject report(String userId) {
     public JSONObject report(String userId) {
         return materialInfoService.report(userId);
         return materialInfoService.report(userId);
-
     }
     }
 
 
 
 
@@ -94,6 +93,16 @@ public class MaterialInfoController {
         return result;
         return result;
     }
     }
 
 
+    @GetMapping("excellent/set")
+    public Result<Object> setExcellent(@RequestParam(name = "id") String code, @RequestParam(name = "excellent") Integer excellent) {
+        Result<Object> result = new Result<>();
+        materialInfoService.setExcellent(code, excellent);
+        result.setCode(200);
+        result.setSuccess(true);
+        result.setMessage("设置成功");
+        return result;
+    }
+
 
 
     /**
     /**
      * 分页列表查询
      * 分页列表查询
@@ -107,6 +116,34 @@ public class MaterialInfoController {
     @Autowired
     @Autowired
     private IProjectMemberService memberService;
     private IProjectMemberService memberService;
 
 
+    @GetMapping("/excellent/list")
+    public Result<IPage<MaterialInfo>> excellentList(MaterialInfo materialInfo,
+                                                     @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                     @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                     HttpServletRequest req) {
+        Result<IPage<MaterialInfo>> result = new Result<>();
+        QueryWrapper<MaterialInfo> queryWrapper = new QueryWrapper<>();
+        Object createTime = materialInfo.getCreateTime();
+        materialInfo.setCreateTime(null);
+        materialInfo.setExcellent(1);
+        queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap());
+        if (!Check.isNull(createTime)) {
+            try {
+                Map<String, Object> map = DateUtils.getStartEndTime(createTime.toString());
+                queryWrapper.ge("create_time", map.get("start"));
+                queryWrapper.lt("create_time", map.get("end"));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+        }
+
+        Page<MaterialInfo> page = new Page<>(pageNo, pageSize);
+        IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper);
+        result.setSuccess(true);
+        result.setResult(pageList);
+        return result;
+    }
+
     @AutoLog(value = "素材信息-分页列表查询")
     @AutoLog(value = "素材信息-分页列表查询")
     @ApiOperation(value = "素材信息-分页列表查询", notes = "素材信息-分页列表查询")
     @ApiOperation(value = "素材信息-分页列表查询", notes = "素材信息-分页列表查询")
     @GetMapping(value = "/list")
     @GetMapping(value = "/list")

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

@@ -32,6 +32,9 @@ public class TestController {
     @Autowired
     @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
 
 
+    @Autowired
+    private CtopOauthTokenMapper oauthTokenMapper;
+
     @PostMapping(value = "/create")
     @PostMapping(value = "/create")
     public Map<String, Object> authorization(@RequestBody JSONObject jsonObject) {
     public Map<String, Object> authorization(@RequestBody JSONObject jsonObject) {
         return createInternalService.createInternal(jsonObject);
         return createInternalService.createInternal(jsonObject);
@@ -122,8 +125,7 @@ public class TestController {
         return "Success";
         return "Success";
     }
     }
 
 
-    @Autowired
-    private CtopOauthTokenMapper oauthTokenMapper;
+
 
 
 
 
     @GetMapping(value = "/gerCreative")
     @GetMapping(value = "/gerCreative")
@@ -136,6 +138,7 @@ public class TestController {
                 @Override
                 @Override
                 public void run() {
                 public void run() {
                     try {
                     try {
+                        System.err.println("获取创意,accountId:" + token.getAccountId());
                         kuaishouInterfaceService.getCreativeList(token, null, null);
                         kuaishouInterfaceService.getCreativeList(token, null, null);
                         //  kuaishouInterfaceService.getVideoList2(token, null, null,1);
                         //  kuaishouInterfaceService.getVideoList2(token, null, null,1);
                         //3: 获取图片信息数据
                         //3: 获取图片信息数据
@@ -159,8 +162,8 @@ public class TestController {
             @Override
             @Override
             public void run() {
             public void run() {
                 SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
                 SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
-                Date startDate = sim.parse("2020-01-30");
-                Date endDate = sim.parse("2020-01-31");
+                Date startDate = sim.parse("2020-02-10");
+                Date endDate = sim.parse("2020-02-11");
                 //1:查询当日数据
                 //1:查询当日数据
                 //executorService = Executors.newFixedThreadPool(3);
                 //executorService = Executors.newFixedThreadPool(3);
                 QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
                 QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
@@ -170,7 +173,7 @@ public class TestController {
                     executorService.submit(new Runnable() {
                     executorService.submit(new Runnable() {
                         @Override
                         @Override
                         public void run() {
                         public void run() {
-                            System.err.println("accountId:" + token.getAccountId());
+                            System.err.println("创意报表accountId:" + token.getAccountId());
                             kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, startDate, endDate);
                             kuaishouInterfaceService.getAdvertiserCreativeReportDaily(token, startDate, endDate);
                         }
                         }
                     });
                     });
@@ -181,4 +184,63 @@ public class TestController {
         };
         };
         thread.start();
         thread.start();
     }
     }
+
+
+
+
+
+
+    @GetMapping(value = "/gerCreativeByAccount")
+    public void gerCreative(Long accountId) {
+        QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
+        oauthTokenQueryWrapper.eq("media_id", 2);
+        oauthTokenQueryWrapper.eq("account_id", accountId);
+        oauthTokenQueryWrapper.last("limit 1");
+        CtopOauthToken token = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
+            executorService.submit(new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        System.err.println("获取创意,accountId:" + token.getAccountId());
+                        kuaishouInterfaceService.getCreativeList(token, null, null);
+                        //  kuaishouInterfaceService.getVideoList2(token, null, null,1);
+                        //3: 获取图片信息数据
+                        // kuaishouInterfaceService.getImageList2(token, null, null,1);
+                        Thread.sleep(1 * 200);
+                        //  kuaishouInterfaceService.getAppList(token.getAccountId(), token.getAccessToken());
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            });
+
+
+    }
+
+
+
+    @GetMapping(value = "/gerCreativeReportByAccount")
+    public void gerCreativeReportByAccount(Long accountId, String startDateStr, String endDateStr, QueryWrapper<CtopOauthToken> account_id) {
+        Thread thread = new Thread() {
+            @SneakyThrows
+            @Override
+            public void run() {
+                SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd");
+                Date startDate = sim.parse(startDateStr);
+                Date endDate = sim.parse(endDateStr);
+                //1:查询当日数据
+                //executorService = Executors.newFixedThreadPool(3);
+                QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
+                oauthTokenQueryWrapper.eq("media_id", 2);
+                oauthTokenQueryWrapper.eq("account_id", accountId);
+                CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);
+                System.err.println("创意报表accountId:" + ctopOauthToken.getAccountId());
+                kuaishouInterfaceService.getAdvertiserCreativeReportDaily(ctopOauthToken, startDate, endDate);
+
+
+            }
+        };
+        thread.start();
+    }
+
 }
 }

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

@@ -1,5 +1,9 @@
 package org.jeecg.modules.ctop.controller;
 package org.jeecg.modules.ctop.controller;
 
 
+import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
+import cn.com.ctop.common.module.utils.ResultMapUtils;
+import cn.com.ctop.common.module.utils.StatusCode;
+import cn.com.ctop.common.module.utils.StringUtils;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -19,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Map;
 
 
 /**
 /**
@@ -35,7 +40,39 @@ import java.util.Map;
 public class UReportFileBindUserController {
 public class UReportFileBindUserController {
     @Autowired
     @Autowired
     private IUReportFileBindUserService uReportFileBindUserService;
     private IUReportFileBindUserService uReportFileBindUserService;
+    @Autowired
+    private IBytedancePlanDailyReportService planDailyReportService;
+    @PostMapping("loadRegistOrderDate")
+    public Map<String,Object>loadData(String data,String date){
+        Map<String,Object>result = new HashMap<>();
+        try {
+            planDailyReportService.loadData(data,date);
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
+            return result;
+        }catch (Exception e){
+            e.printStackTrace();
+            ResultMapUtils.setResultMap(result, StatusCode.COMMON_SERVER_ERROR);
+            return result;
+        }
+    }
+    public static void main(String[] args) {
+        String data = "yk_xxl_jrtt_sxdx03hctddxc06_17\t,\t4\t,\t1\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc06_19\t,\t17\t,\t14\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc06_23\t,\t1\t,\t1\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc06_25\t,\t2\t,\t2\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc06_26\t,\t2\t,\t1\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc07_02\t,\t4\t,\t2\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc07_10\t,\t1\t,\t1\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc07_11\t,\t1\t,\t1\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc07_12\t,\t2\t,\t1\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc07_15\t,\t1\t,\t1\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc07_28\t,\t1\t,\t0\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc07_45\t,\t7\t,\t3\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc07_46\t,\t16\t,\t11\t|\n" +
+                "yk_xxl_jrtt_sxdx03hctddxc07_48\t,\t1\t,\t0\t";
+        System.out.println(StringUtils.replaceBlank(data));
 
 
+    }
     /**
     /**
      * 分页列表查询
      * 分页列表查询
      *
      *

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

@@ -47,6 +47,12 @@ public class Advertiser {
     @ApiModelProperty(value = "行业ID")
     @ApiModelProperty(value = "行业ID")
     private String industryId;
     private String industryId;
     /**
     /**
+     * 销售ID
+     */
+    @Excel(name = "销售ID", width = 15)
+    @ApiModelProperty(value = "销售ID")
+    private String saleId;
+    /**
      * 联系人姓名
      * 联系人姓名
      */
      */
     @Excel(name = "联系人姓名", width = 15)
     @Excel(name = "联系人姓名", width = 15)

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

@@ -1,9 +1,14 @@
 package org.jeecg.modules.ctop.job;
 package org.jeecg.modules.ctop.job;
 
 
+import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
+import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
 import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 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.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.IUserAllocationService;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.DateUtils;
 import org.quartz.Job;
 import org.quartz.Job;
@@ -24,6 +29,8 @@ public class BytedanceDailyReportLoadJob implements Job {
     private ICtopOauthTokenService tokenService;
     private ICtopOauthTokenService tokenService;
     @Autowired
     @Autowired
     private IReportService reportService;
     private IReportService reportService;
+    @Autowired
+    private IUserAllocationService userAllocationService;
 
 
     @Override
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
@@ -37,12 +44,15 @@ public class BytedanceDailyReportLoadJob implements Job {
         tokens.forEach(token -> {
         tokens.forEach(token -> {
             //1: 获取广告主信息数据
             //1: 获取广告主信息数据
             reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
             reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-            //2:获取广告组信息数据
-            //reportService.getAdvertiserCampaignReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+//            2:获取广告组信息数据
+//            reportService.getAdvertiserCampaignReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
             //3:获取广告计划信息数据
             //3:获取广告计划信息数据
-            //reportService.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+//            reportService.getAdvertiserPlanReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
             //4: 获取广告创意信息数据
             //4: 获取广告创意信息数据
-            //reportService.getAdvertiserCreativeReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+//            reportService.getAdvertiserCreativeReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
         });
         });
     }
     }
+
+    @Autowired
+    private IBytedancePlanDailyReportService planDailyReportService;
 }
 }

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

@@ -0,0 +1,119 @@
+package org.jeecg.modules.ctop.job;
+
+import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
+import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
+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 BytedancePlanDailyReportLoadJob implements Job {
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IReportService reportService;
+    @Autowired
+    private IUserAllocationService userAllocationService;
+
+    @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;
+        }
+        tokens.forEach(token -> {
+            //3:获取广告计划信息数据
+            reportService.getAdvertiserPlanReport(token, getDate, getDate, 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(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.setAdsense(tags[1]);
+                        report.setPlanCode(tags[2]);
+                        String tag = tags[3];
+                        if(tag.contains("其他")){
+                            report.setMaterialType("其他");
+                        }else if (tag.contains("图片轮播")){
+                            report.setMaterialType("图片轮播");
+                        }else if(tag.contains("大字报")){
+                            report.setMaterialType("大字报");
+                        }else if(tag.contains("文字动画")){
+                            report.setMaterialType("文字动画");
+                        }else if(tag.contains("采访形式")){
+                            report.setMaterialType("采访形式");
+                        }else if(tag.contains("剧情")){
+                            report.setMaterialType("剧情");
+                        }else if(tag.contains("口播")){
+                            report.setMaterialType("口播");
+                        }else{
+                            report.setMaterialType("其他");
+                        }
+                        planDailyReportService.updateById(report);
+                    });
+                }
+            });
+        }
+
+        //清洗关于缘多多数据
+        //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);
+                    });
+                }
+            });
+        }
+    }
+
+    @Autowired
+    private IBytedancePlanDailyReportService planDailyReportService;
+}

+ 1 - 1
jeecg-boot-module-system/src/main/resources/application-prod.yml

@@ -105,7 +105,7 @@ spring:
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
         connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
       datasource:
       datasource:
         master:
         master:
-          url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://39.97.120.42:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: hcst
           username: hcst
           password: test@20190531
           password: test@20190531
           driver-class-name: com.mysql.jdbc.Driver
           driver-class-name: com.mysql.jdbc.Driver

+ 183 - 164
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -1,31 +1,22 @@
 package org.jeecg;
 package org.jeecg;
 
 
-import cn.com.ctop.bytedance.service.IByteDanceHourlyAccountWarningService;
+import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
+import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
 import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.bytedance.service.IReportService;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
-import cn.com.ctop.common.module.mapper.CtopOauthTokenMapper;
+import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 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 cn.com.ctop.common.module.utils.CtopAdConstant;
-import cn.com.ctop.common.module.utils.HttpUtils2;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumJobService;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumJobService;
-import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskService;
-import cn.com.ctop.kuaishou.modules.batch.service.IAccountWarningService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.toutiao.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.service.IByteDanceCreativeService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.http.impl.client.BasicCookieStore;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.DateUtils;
-import org.jeecg.modules.ctop.service.IBidWarningService;
-import org.jeecg.modules.ctop.service.ICreateInternalService;
 import org.jeecg.modules.mq.Sender;
 import org.jeecg.modules.mq.Sender;
 import org.junit.Test;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runner.RunWith;
-import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.chrome.ChromeOptions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -34,8 +25,6 @@ import org.springframework.test.context.junit4.SpringRunner;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 
 
 @RunWith(SpringRunner.class)
 @RunWith(SpringRunner.class)
 @SpringBootTest
 @SpringBootTest
@@ -45,184 +34,214 @@ public class SampleTest {
     private String chromeDriver;
     private String chromeDriver;
     @Autowired
     @Autowired
     private IAppiumJobService jobService;
     private IAppiumJobService jobService;
-    @Autowired
-    private ICreateInternalService createInternalService;
-    @Autowired
-    private IAppiumTaskService appiumTaskService;
-
-    @Test
-    public void testKs() throws InterruptedException {
-        String url = "https://ad.e.kuaishou.com/#/welcome?redirectUrl=https%3A%2F%2Fad.e.kuaishou.com%2F%23%2Findex";
-        System.getProperties().setProperty("webdriver.chrome.driver", chromeDriver);
-        ChromeOptions chromeOptions = new ChromeOptions();
-//        chromeOptions.addArguments("--headless");
-        chromeOptions.addArguments("--incognito");
-        chromeOptions.addArguments("--disable-gpu");
-//        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);
-        try {
-            Thread.sleep(3000L);
-            HttpUtils2.cookieStore = new BasicCookieStore();
-            webDriver.manage().deleteAllCookies();
-            //获取登录页面
-            webDriver.get(url);
-            Thread.sleep(3000L);
-            WebElement accountElement = webDriver.findElement(By.xpath("//div[@class='phone ']/input[@type='text']"));
-            accountElement.sendKeys("19845004383");
-            Thread.sleep(3000L);
-            WebElement passwordElement = webDriver.findElement(By.xpath("//div[@class='password ']/input[@type='password']"));
-            passwordElement.sendKeys("a123456");
-            WebElement loginElement = webDriver.findElement(By.xpath("//div[@class='foot']"));
-            Thread.sleep(3000L);
-            //点击登录
-            loginElement.click();
-            Thread.sleep(3000L);
-            //获取推广按钮
-            WebElement spreadElement = webDriver.findElement(By.linkText("推广"));
-            spreadElement.click();
-            Thread.sleep(3000L);
-            //选择广告创意
-            WebElement creativeElement = webDriver.findElement(By.xpath("//div[text()='广告创意']"));
-            creativeElement.click();
-            Thread.sleep(3000L);
-            //输入创意名称,点击搜索
-            WebElement searchElement = webDriver.findElement(By.xpath("//input[@type='text']"));
-            searchElement.sendKeys("2-这个是你画的吗-设计-11.19");
-            Thread.sleep(3000L);
-            WebElement searchButton = webDriver.findElement(By.xpath("//button[@class='ant-btn ant-input-search-button ant-btn-primary']"));
-            searchButton.click();
-            Thread.sleep(3000L);
-            WebElement tiyanElement = webDriver.findElement(By.linkText("体验"));
-            tiyanElement.click();
-            Thread.sleep(2000L);
-            WebElement inputKsIdElement = webDriver.findElement(By.xpath("//textarea[@placeholder='请输入快手账号…']"));
-            inputKsIdElement.sendKeys("123456765");
-            Thread.sleep(2000L);
-            WebElement chufaElement = webDriver.findElement(By.xpath("//button[@class='creative-experience-btn-enable']"));
-            chufaElement.click();
-
-
-        } catch (Exception e) {
-            e.printStackTrace();
-            webDriver.manage().deleteAllCookies();
-            webDriver.close();
-        }
-    }
-
-    @Test
-    public void test() {
-        jobService.refreshWebPhone();
-    }
 
 
     @Test
     @Test
     public void testMq() {
     public void testMq() {
         Sender sender = new Sender();
         Sender sender = new Sender();
         sender.send();
         sender.send();
     }
     }
+    @Autowired
+    private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IReportService reportService;
 
 
     @Test
     @Test
-    public void loadKuaishouDataSingle() throws Exception {
-        String url = "https://a201903112120030590198943.szwego.com/static/index.html#/shop_detail/A201903112120030590198943";
-        System.getProperties().setProperty("webdriver.chrome.driver", chromeDriver);
-        ChromeOptions chromeOptions = new ChromeOptions();
-//        chromeOptions.addArguments("--headless");
-        chromeOptions.addArguments("--incognito");
-        chromeOptions.addArguments("--disable-gpu");
-//        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.get(url);
-        Thread.sleep(3000L);
-        ((JavascriptExecutor) webDriver).executeScript("window.scrollTo(0,document.body.scrollHeight)");
-        Thread.sleep(3000L);
-        List<WebElement> elementList = webDriver.findElements(By.xpath("//div[@class='word-break ellipsis-two f14 g3']"));
-        for (WebElement element : elementList) {
-            System.out.println(element.getText());
+    public void getYddData()throws Exception{
+        String dateString = "2020-01-06";
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date getDate = dateFormat.parse(dateString);
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取头条数据异常:为获取到可用的token");
+            return;
+        }
+        tokens.forEach(token -> {
+            reportService.getAdvertiserPlanReport(token,getDate,getDate,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        });
+
+        //清洗关于缘多多数据
+        //1:查询缘多多相关的用户数据
+        QueryWrapper<UserAllocation> yddWrapper = new QueryWrapper<>();
+        yddWrapper.eq("project_id",113);
+        List<UserAllocation> yddallocations = userAllocationService.list(yddWrapper);
+        if(null!=yddallocations&&yddallocations.size()>0){
+            yddallocations.forEach(allocation->{
+                //根据accountId和时间,查询相关的日报表信息
+                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);
+                    });
+                }
+            });
         }
         }
 
 
-    }
-
-    @Autowired
-    private IKuaishouInterfaceService kuaishouInterfaceService;
+        //清洗关于缘多多数据
+        //1:查询缘多多相关的用户数据
+        QueryWrapper<UserAllocation> dsjyWrapper = new QueryWrapper<>();
+        yddWrapper.eq("project_id",112);
+        List<UserAllocation> dsjyAllocations = userAllocationService.list(dsjyWrapper);
+        if(null!=dsjyAllocations&&dsjyAllocations.size()>0){
+            dsjyAllocations.forEach(allocation->{
+                //根据accountId和时间,查询相关的日报表信息
+                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);
+                    });
+                }
+            });
+        }
 
 
-    @Test
-    public void testMail() throws Exception {
-        // String accessToken, Long advertiserId, Date startDate, Date endDate, Integer page
-        kuaishouInterfaceService.getTargetingTags(23212L, "101a5c994d0a87322f305a306a30e38e");
+        //清洗关于缘多多数据
+        //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)
+                ;
+                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);
+                    });
+                }
+            });
+        }
     }
     }
-
-
-    @Autowired
-    private IBidWarningService bidWarningService;
-
-    @Autowired
-    private IAccountWarningService accountWarningService;
-    @Autowired
-    private CtopOauthTokenMapper oauthTokenMapper;
-    static ExecutorService executorService = Executors.newFixedThreadPool(5);
-
     @Test
     @Test
-    public void testMa() throws Exception {
-        // accountWarningService.accountWarning(23212L);
-        QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
-        oauthTokenQueryWrapper.eq("media_id", 2);
-        List<CtopOauthToken> ctopOauthTokens = oauthTokenMapper.selectList(oauthTokenQueryWrapper);
-        for (CtopOauthToken token : ctopOauthTokens) {
-            kuaishouInterfaceService.getCreativeList(token, null, null);
+    public void getZybBytedancePlanReport(){
+
+//        Date getDate = DateUtils.addDay(new Date(), -1);
+        Date getDate = new Date();
+        //1:查询作业帮相关的用户数据
+        QueryWrapper<UserAllocation> wrapper = new QueryWrapper<>();
+        wrapper.eq("project_id",215);
+        List<UserAllocation> allocations = userAllocationService.list(wrapper);
+        if(null!=allocations){
+            allocations.forEach(allocation->{
+                CtopOauthToken token = tokenService.getOauthTokenByAccountId(allocation.getAccountId()+"");
+                //3:获取广告计划信息数据
+                reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
+            });
         }
         }
 
 
+        //清洗关于作业帮数据
+        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(getDate)+" 00:00:00";
+                System.out.println(dateString);
+                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();
+                        System.out.println(adName);
+                        String[] tags = adName.split("-");
+                        report.setAdsense(tags[1]);
+                        report.setPlanCode(tags[2]);
+                        String tag = tags[3];
+                        if(tag.contains("其他")){
+                            report.setMaterialType("其他");
+                        }else if (tag.contains("图片轮播")){
+                            report.setMaterialType("图片轮播");
+                        }else if(tag.contains("大字报")){
+                            report.setMaterialType("大字报");
+                        }else if(tag.contains("文字动画")){
+                            report.setMaterialType("文字动画");
+                        }else if(tag.contains("采访形式")){
+                            report.setMaterialType("采访形式");
+                        }else if(tag.contains("剧情")){
+                            report.setMaterialType("剧情");
+                        }else if(tag.contains("口播")){
+                            report.setMaterialType("口播");
+                        }else{
+                            report.setMaterialType("其他");
+                        }
+                        planDailyReportService.updateById(report);
+                    });
+                }
+            });
+        }
+    }
 
 
+    @Test
+    public void getByteDanceCreativeDate()throws Exception{
+        String dateString = "2020-01-06";
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date getDate = dateFormat.parse(dateString);
+        List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+        if (null == tokens || tokens.size() <= 0) {
+            log.info("定时获取头条数据异常:为获取到可用的token");
+            return;
+        }
+        tokens.forEach(token -> {
+            //3:获取广告计划信息数据
+//            creativeService.getAdvertiserCreative(token.getAccountId() + "", "", null);
+            //2:获取全量素材数据
+//            advertiserDataService.getMaterialList(token);
+            reportService.getAdvertiserPlanReport(token,getDate,getDate,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        });
     }
     }
 
 
     @Autowired
     @Autowired
-    private ICtopOauthTokenService tokenService;
+    private IByteDanceAdvertiserDataService advertiserDataService;
     @Autowired
     @Autowired
-    private IReportService reportService;
-@Autowired
-private IByteDanceHourlyAccountWarningService byteDanceHourlyAccountWarningService;
-    @Test
-    public void testMa2() throws Exception {
-
+    private IByteDanceCreativeService creativeService;
 
 
-        byteDanceHourlyAccountWarningService.byteDanceAccountWarning(1655337394471943L,"2020-02-06","2020-02-05");
-        /*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);
-        }
+    @Test
+    public void getBytedancePlanHourReport(){
+        Date getDate = DateUtils.addDay(new Date(), -1);
         //1:查询当日数据
         //1:查询当日数据
         List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
         List<CtopOauthToken> tokens = tokenService.getTokenListByType(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
         if (null == tokens || tokens.size() <= 0) {
         if (null == tokens || tokens.size() <= 0) {
-            log.info("定时获取头条小时数据异常:未获取到可用的token");
+            log.info("定时获取头条数据异常:为获取到可用的token");
             return;
             return;
         }
         }
-        Date finalGetDate = getDate;
-
-
-        QueryWrapper<CtopOauthToken> oauthTokenQueryWrapper = new QueryWrapper<>();
-        oauthTokenQueryWrapper.eq("account_id", 1655337394471943L);
-        CtopOauthToken ctopOauthToken = oauthTokenMapper.selectOne(oauthTokenQueryWrapper);*/
-
-
-        //1: 获取广告主信息数据
-          //  reportService.getAdvertiserReport(ctopOauthToken, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-            //2:获取广告组信息数据
-            //reportService.getAdvertiserCampaignReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
+        tokens.forEach(token -> {
             //3:获取广告计划信息数据
             //3:获取广告计划信息数据
-            //reportService.getAdvertiserPlanReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-            //4: 获取广告创意信息数据
-            //reportService.getAdvertiserCreativeReport(token, finalGetDate, finalGetDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
-
+            reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
+        });
+    }
 
 
+    @Test
+    public void loadRegistOrderData(){
 
 
     }
     }
 
 
+    @Autowired
+    private IUserAllocationService userAllocationService;
+
+    @Autowired
+    private IBytedancePlanDailyReportService planDailyReportService;
+
 }
 }
 
 
 
 

+ 4 - 1
module-common/src/main/java/cn/com/ctop/common/module/entity/MaterialInfo.java

@@ -102,7 +102,10 @@ public class MaterialInfo {
      */
      */
     private String creativeCopywriter;
     private String creativeCopywriter;
 
 
-
+    /**
+     * 是否优秀素材
+     */
+    private Integer excellent;
     /**
     /**
      * createTime
      * createTime
      */
      */

+ 1 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/IMaterialInfoService.java

@@ -32,5 +32,5 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
 
 
     void getFile(MaterialInfo materialInfo);
     void getFile(MaterialInfo materialInfo);
 
 
-
+    void setExcellent(String id, Integer excellent);
 }
 }

+ 6 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/impl/MaterialInfoServiceImpl.java

@@ -406,5 +406,10 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
         });
         });
     }
     }
 
 
-
+    @Override
+    public void setExcellent(String code, Integer excellent) {
+        MaterialInfo info = this.getMaterialInfoByCode(code);
+        info.setExcellent(excellent);
+        this.updateById(info);
+    }
 }
 }

+ 10 - 0
module-common/src/main/java/cn/com/ctop/common/module/utils/StringUtils.java

@@ -20,4 +20,14 @@ public class StringUtils {
         }
         }
         return list;
         return list;
     }
     }
+
+    public static String replaceBlank(String str) {
+        String dest = "";
+        if (str!=null) {
+            Pattern p = Pattern.compile("\\s*|\t|\r|\n");
+            Matcher m = p.matcher(str);
+            dest = m.replaceAll("");
+        }
+        return dest;
+    }
 }
 }

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

@@ -3393,6 +3393,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
      * @param endDate
      * @param endDate
      * @param page
      * @param page
      */
      */
+    @Override
     public void getVideoList(String token, Long accountId, Date startDate, Date endDate, int page) {
     public void getVideoList(String token, Long accountId, Date startDate, Date endDate, int page) {
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.VIDEO_LIST;
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.VIDEO_LIST;
         Map<String, String> headers = new HashMap<>();
         Map<String, String> headers = new HashMap<>();

+ 4 - 0
module-report/pom.xml

@@ -46,6 +46,10 @@
             <version>2.0.2</version>
             <version>2.0.2</version>
             <scope>compile</scope>
             <scope>compile</scope>
         </dependency>
         </dependency>
+        <!--<dependency>
+            <groupId>org.jeecgframework.boot</groupId>
+            <artifactId>jeecg-boot-base-common</artifactId>
+        </dependency>-->
     </dependencies>
     </dependencies>
 
 
     <build>
     <build>

+ 24 - 0
module-report/src/main/java/cn/com/ctop/bytedance/entity/BytedancePlanDailyReport.java

@@ -390,6 +390,30 @@ public class BytedancePlanDailyReport {
      */
      */
     @ApiModelProperty(value = "updateTime")
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
     private Date updateTime;
+    /**
+     * 广告位
+     */
+    private String adsense;
+    /**
+     * 素材类型
+     */
+    private String materialType;
+    /**
+     * 注册数
+     */
+    private Integer registNum;
+    /**
+     * 成单数
+     */
+    private Integer orderNum;
+    /**
+     * 计划代码
+     */
+    private String planCode;
+    /**
+     * 渠道号
+     */
+    private String channelCode;
 
 
     public BytedancePlanDailyReport(JSONObject data, Long setAdvertiserId) {
     public BytedancePlanDailyReport(JSONObject data, Long setAdvertiserId) {
         Long playFeedBreak75 = data.getLong("play_75_feed_break");
         Long playFeedBreak75 = data.getLong("play_75_feed_break");

+ 1 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/IBytedancePlanDailyReportService.java

@@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
  */
 public interface IBytedancePlanDailyReportService extends IService<BytedancePlanDailyReport> {
 public interface IBytedancePlanDailyReportService extends IService<BytedancePlanDailyReport> {
 
 
+    void loadData(String data, String date);
 }
 }

+ 24 - 0
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedancePlanDailyReportServiceImpl.java

@@ -3,6 +3,8 @@ package cn.com.ctop.bytedance.service.impl;
 import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
 import cn.com.ctop.bytedance.entity.BytedancePlanDailyReport;
 import cn.com.ctop.bytedance.mapper.BytedancePlanDailyReportMapper;
 import cn.com.ctop.bytedance.mapper.BytedancePlanDailyReportMapper;
 import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
 import cn.com.ctop.bytedance.service.IBytedancePlanDailyReportService;
+import cn.com.ctop.common.module.utils.StringUtils;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -15,4 +17,26 @@ import org.springframework.stereotype.Service;
 @Service
 @Service
 public class BytedancePlanDailyReportServiceImpl extends ServiceImpl<BytedancePlanDailyReportMapper, BytedancePlanDailyReport> implements IBytedancePlanDailyReportService {
 public class BytedancePlanDailyReportServiceImpl extends ServiceImpl<BytedancePlanDailyReportMapper, BytedancePlanDailyReport> implements IBytedancePlanDailyReportService {
 
 
+    @Override
+    public void loadData(String data, String date) {
+        String getData = StringUtils.replaceBlank(data);
+        String[]orderDatas = getData.split("|");
+        if(null!=orderDatas&&orderDatas.length>0){
+            for (int i=0;i<orderDatas.length;i++) {
+                String orderData = orderDatas[i];
+                String[] orderObjects = orderData.split(",");
+                String planCode = orderObjects[0].replace("yk_xxl_jrtt_","");
+                String registNum =orderObjects[1];
+                String orderNum =orderObjects[2];
+                QueryWrapper<BytedancePlanDailyReport> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("plan_code",planCode).eq("stat_datetime",date+" 00:00:00");
+                BytedancePlanDailyReport report = this.getOne(queryWrapper);
+                if(null!=report){
+                    report.setOrderNum(Integer.parseInt(orderNum));
+                    report.setRegistNum(Integer.parseInt(registNum));
+                    this.updateById(report);
+                }
+            }
+        }
+    }
 }
 }

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

@@ -20,7 +20,6 @@ import java.util.Date;
  */
  */
 @Data
 @Data
 @TableName("ctop_bytedance_creative")
 @TableName("ctop_bytedance_creative")
-@EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @Accessors(chain = true)
 @ApiModel(value = "ctop_bytedance_creative对象", description = "今日头条创意信息")
 @ApiModel(value = "ctop_bytedance_creative对象", description = "今日头条创意信息")
 public class ByteDanceCreative {
 public class ByteDanceCreative {
@@ -132,6 +131,10 @@ public class ByteDanceCreative {
     @ApiModelProperty(value = "updateTime")
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
     private Date updateTime;
 
 
+    public ByteDanceCreative(){
+
+    }
+
     public ByteDanceCreative(JSONObject dataObject, String accountId) {
     public ByteDanceCreative(JSONObject dataObject, String accountId) {
         this.id = dataObject.getLong("creative_id");
         this.id = dataObject.getLong("creative_id");
         this.planId = dataObject.getLong("ad_id");
         this.planId = dataObject.getLong("ad_id");

+ 1 - 0
module-toutiao/src/main/resources/bytedance_config.properties

@@ -27,3 +27,4 @@ bytedance_v2_file_image_ad=/2/file/image/ad/
 bytedance_v2_creative_update_status=/2/creative/update/status/
 bytedance_v2_creative_update_status=/2/creative/update/status/
 bytedance_v2_creative_material_get=/2/creative/material/read
 bytedance_v2_creative_material_get=/2/creative/material/read
 bytedance_v2_creative_create_v2=/2/creative/create_v2/
 bytedance_v2_creative_create_v2=/2/creative/create_v2/
+bytedance_v2_creative_get=/2/creative/get/