Browse Source

添加头条有效视频统计逻辑

syh 5 năm trước cách đây
mục cha
commit
e44b87c262
18 tập tin đã thay đổi với 228 bổ sung41 xóa
  1. 10 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java
  2. 1 1
      jeecg-boot-module-system/src/main/resources/application-wps.yml
  3. 22 2
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java
  4. 17 19
      module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java
  5. 0 2
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAdvertisePlan.java
  6. 1 16
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceVideoInfo.java
  7. 36 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/BytedanceEffectVideoInfo.java
  8. 8 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/BytedanceEffectVideoInfoMapper.java
  9. 5 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/BytedanceEffectVideoInfoMapper.xml
  10. 2 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceVideoInfoService.java
  11. 10 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceEffectVideoInfoService.java
  12. 9 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceVideoInfoServiceImpl.java
  13. 51 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceEffectVideoInfoServiceImpl.java
  14. 15 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/vo/BytedanceVideoVo.java
  15. 3 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceReportMaterialDailyMapper.java
  16. 13 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceReportMaterialDailyMapper.xml
  17. 5 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceReportMaterialDailyService.java
  18. 20 0
      module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportMaterialDailyServiceImpl.java

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

@@ -10,6 +10,7 @@ import cn.com.ctop.common.module.utils.StatusCode;
 import cn.com.ctop.kuaishou.modules.batch.service.*;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceEffectVideoInfoService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanDailyReportService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedancePlanHourlyReportService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
@@ -764,5 +765,13 @@ public class TestController {
             bytedanceReportService.bytedanceAsyncTaskCreate(startDate, endDate, token, 4);
         }
     }
-
+    @Autowired
+    private IBytedanceEffectVideoInfoService effectVideoInfoService;
+    @GetMapping("/bytedance/effectVideo/get")
+    public Map<String,Object>effectVideoGet(String date){
+        Map<String,Object>result = new HashMap<>();
+        effectVideoInfoService.loadEffectVideo(date);
+        ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
+        return result;
+    }
 }

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

@@ -103,7 +103,7 @@ spring:
 #          username: hcst
 #          password: test@20190531
 #          driver-class-name: com.mysql.jdbc.Driver、
-          url: jdbc:mysql://39.106.184.70:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
+          url: jdbc:mysql://139.186.27.96:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false
           username: hcst
           password: test@20190531
           driver-class-name: com.mysql.jdbc.Driver

+ 22 - 2
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -10,6 +10,7 @@ import cn.com.ctop.crawler.modules.pangolin.service.PangolinCrawlerService;
 import cn.com.ctop.crawler.modules.pangolin.service.PangolinLoginService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceEffectVideoInfoService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
@@ -23,6 +24,7 @@ import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.CountDownLatch;
@@ -38,7 +40,19 @@ public class SampleTest {
     @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
     @Autowired
+    private IBytedanceEffectVideoInfoService effectVideoInfoService;
+    @Autowired
     private IReportService reportService;
+    @Autowired
+    private IBindAccountLoginService bindAccountLoginService;
+    @Test
+    public void getBytedanceData(){
+        CtopOauthToken token5 = oauthTokenService.getTokenByAccountId(1668362864699400L);
+        for(int i=10;i<120;i++){
+            Date date = DateUtils.addDay(new Date(), -i);
+            reportService.getAdvertiserReport(token5,date,date,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        }
+    }
     @Test
     public void testOceanEngineJob() {
         List<CtopOauthToken>tokens = oauthTokenService.selectToutiaoToken();
@@ -48,8 +62,14 @@ public class SampleTest {
         });
     }
 
-    @Autowired
-    private IBindAccountLoginService bindAccountLoginService;
+    @Test
+    public void loadEffectVideo(){
+        String date = "2020-07-10";
+        for(int i=0;i<150;i++){
+            String getDate = DateUtils.addDay(date,i);
+            effectVideoInfoService.loadEffectVideo(getDate);
+        }
+    }
     @Autowired
     private IKuaishouWebInterfaceService kuaishouWebInterfaceService;
 

+ 17 - 19
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -26,14 +26,14 @@ import java.util.*;
 @Service
 public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper, CtopOauthToken> implements ICtopOauthTokenService {
     @Autowired
-    private CtopOauthTokenMapper cTopOauthTokenMapper;
+    private CtopOauthTokenMapper ctopOauthTokenMapper;
 
     @Override
     public CtopOauthToken getOauthTokenByAccountId(String accountId) {
         QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("account_id", accountId).orderByDesc("create_time");
         queryWrapper.last("limit 1");
-        return cTopOauthTokenMapper.selectOne(queryWrapper);
+        return this.getOne(queryWrapper);
     }
 
 
@@ -42,7 +42,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
         QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("account_id", accountId).orderByDesc("create_time");
         queryWrapper.last("limit 1");
-        return cTopOauthTokenMapper.selectOne(queryWrapper);
+        return this.getOne(queryWrapper);
     }
 
     /**
@@ -77,7 +77,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
             QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("access_token", token);
             queryWrapper.eq("media_id", 1);
-            int i = cTopOauthTokenMapper.update(updateRefreshToken, queryWrapper);
+            int i = ctopOauthTokenMapper.update(updateRefreshToken, queryWrapper);
             if (i > 0) {
                 XxlJobLogger.log("头条刷新token成功:token:{}", token);
             }
@@ -100,9 +100,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
      */
     @Override
     public void getKuaiShouRefreshToken(Long accountId, String token, String refreshToken, Integer agentType) {
-
         log.info("快手刷新token入参,accountId:{},token:{},refreshToken:{}", accountId, token, refreshToken);
-
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + "/rest/openapi/oauth2/authorize/refresh_token";
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", " application/json");
@@ -117,7 +115,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
 
         param.put("refresh_token", refreshToken);
         try {
-            CtopOauthToken oauthToken = cTopOauthTokenMapper.selectByAccountId(accountId);
+            CtopOauthToken oauthToken = ctopOauthTokenMapper.selectByAccountId(accountId);
             if (null == oauthToken) {
                 log.error("查询token信息返回结果为空,accountId:{}", accountId);
                 return;
@@ -152,7 +150,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
             QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
             queryWrapper.eq("account_id", accountId);
             queryWrapper.eq("media_id", 2);
-            int i = cTopOauthTokenMapper.update(oauthToken, queryWrapper);
+            int i = ctopOauthTokenMapper.update(oauthToken, queryWrapper);
             if (i > 0) {
                 log.info("快手刷新token成功,accountId:{}", accountId);
             }
@@ -180,7 +178,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
 
     @Override
     public List<CtopOauthToken> selectKuaiShouToken() {
-        return cTopOauthTokenMapper.selectKuaiShouToken();
+        return ctopOauthTokenMapper.selectKuaiShouToken();
     }
 
 
@@ -192,25 +190,18 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
 
     @Override
     public List<CtopOauthToken> selectToutiaoToken() {
-        return cTopOauthTokenMapper.selectToutiaoToken();
+        return ctopOauthTokenMapper.selectToutiaoToken();
     }
 
 
     @Override
     public CtopOauthToken getAccessTokenByAccountIdAndMediaId(Integer mediaId, Long accountId) {
-        return cTopOauthTokenMapper.getAccessTokenByAccountIdAndMediaId(mediaId, accountId);
+        return ctopOauthTokenMapper.getAccessTokenByAccountIdAndMediaId(mediaId, accountId);
     }
 
     @Override
     public List<CtopOauthToken> getToutiaoTokenByCreateTime(String createTime) {
-        return cTopOauthTokenMapper.getToutiaoTokenByCreateTime(createTime);
-    }
-
-    private static Date addSecond(Date date, int seconds) {
-        Calendar calendar = Calendar.getInstance();
-        calendar.setTime(date);
-        calendar.add(Calendar.SECOND, seconds);
-        return calendar.getTime();
+        return ctopOauthTokenMapper.getToutiaoTokenByCreateTime(createTime);
     }
     @Override
     public List<CtopOauthToken> getByProjectId(long projectId) {
@@ -219,5 +210,12 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
         return this.list(queryWrapper);
     }
 
+    private Date addSecond(Date date, int seconds) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.SECOND, seconds);
+        return calendar.getTime();
+    }
+
 
 }

+ 0 - 2
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceAdvertisePlan.java

@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -26,7 +25,6 @@ import java.util.Date;
 @TableName("ctop_bytedance_advertise_plan")
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-@ApiModel(value = "ctop_bytedance_advertise_plan对象", description = "今日头条广告计划信息")
 public class ByteDanceAdvertisePlan {
 
     /**

+ 1 - 16
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/ByteDanceVideoInfo.java

@@ -77,28 +77,13 @@ public class ByteDanceVideoInfo {
     /**
      * 视频地址
      */
-    @Excel(name = "视频地址", width = 15)
     @ApiModelProperty(value = "视频地址")
     private String videoUrl;
-
-    @Excel(name = "md5码", width = 64)
     @ApiModelProperty(value = "md5码")
     private String signature;
-    /**
-     * status
-     */
-    @Excel(name = "status", width = 15)
-    @ApiModelProperty(value = "status")
     private Integer status;
-    /**
-     * createTime
-     */
-    @ApiModelProperty(value = "createTime")
     private Date createTime;
-    /**
-     * updateTime
-     */
-    @ApiModelProperty(value = "updateTime")
+
     private Date updateTime;
 
     private String url;

+ 36 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/entity/BytedanceEffectVideoInfo.java

@@ -0,0 +1,36 @@
+package cn.com.ctop.toutiao.modules.material.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@TableName("ctop_bytedance_effect_video_info")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BytedanceEffectVideoInfo {
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    private String code;
+    private String url;
+    private String initialCostDate;
+    private String finalCostDate;
+    private String plane;
+    private String plan;
+    private String shot;
+    private String clip;
+    private String manager;
+    private BigDecimal twoWeekCost;
+    private BigDecimal totalCost;
+    private Date createTime;
+    private Date updateTime;
+
+
+
+}

+ 8 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/BytedanceEffectVideoInfoMapper.java

@@ -0,0 +1,8 @@
+package cn.com.ctop.toutiao.modules.material.mapper;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceEffectVideoInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+public interface BytedanceEffectVideoInfoMapper extends BaseMapper<BytedanceEffectVideoInfo> {
+
+}

+ 5 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/mapper/xml/BytedanceEffectVideoInfoMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.com.ctop.toutiao.modules.material.mapper.BytedanceEffectVideoInfoMapper">
+
+</mapper>

+ 2 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IByteDanceVideoInfoService.java

@@ -14,4 +14,6 @@ import java.util.List;
 public interface IByteDanceVideoInfoService extends IService<ByteDanceVideoInfo> {
 
     void replaceBatch(List<ByteDanceVideoInfo> videoInfoList);
+
+    ByteDanceVideoInfo getOneByParams(Long materialId);
 }

+ 10 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/IBytedanceEffectVideoInfoService.java

@@ -0,0 +1,10 @@
+package cn.com.ctop.toutiao.modules.material.service;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceEffectVideoInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+public interface IBytedanceEffectVideoInfoService extends IService<BytedanceEffectVideoInfo> {
+    void loadEffectVideo(String date);
+
+    BytedanceEffectVideoInfo getVideoByCode(String code);
+}

+ 9 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/ByteDanceVideoInfoServiceImpl.java

@@ -3,6 +3,7 @@ package cn.com.ctop.toutiao.modules.material.service.impl;
 import cn.com.ctop.toutiao.modules.material.entity.ByteDanceVideoInfo;
 import cn.com.ctop.toutiao.modules.material.mapper.ByteDanceVideoInfoMapper;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceVideoInfoService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
@@ -26,4 +27,12 @@ public class ByteDanceVideoInfoServiceImpl extends ServiceImpl<ByteDanceVideoInf
     public void replaceBatch(List<ByteDanceVideoInfo> videoInfoList) {
         videoInfoMapper.replaceBatch(videoInfoList);
     }
+
+    @Override
+    public ByteDanceVideoInfo getOneByParams(Long materialId) {
+        QueryWrapper<ByteDanceVideoInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("material_id",materialId);
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
 }

+ 51 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/service/impl/BytedanceEffectVideoInfoServiceImpl.java

@@ -0,0 +1,51 @@
+package cn.com.ctop.toutiao.modules.material.service.impl;
+
+import cn.com.ctop.toutiao.modules.material.entity.BytedanceEffectVideoInfo;
+import cn.com.ctop.toutiao.modules.material.mapper.BytedanceEffectVideoInfoMapper;
+import cn.com.ctop.toutiao.modules.material.service.IByteDanceVideoInfoService;
+import cn.com.ctop.toutiao.modules.material.service.IBytedanceEffectVideoInfoService;
+import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
+import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+@Service
+@Slf4j
+public class BytedanceEffectVideoInfoServiceImpl extends ServiceImpl<BytedanceEffectVideoInfoMapper, BytedanceEffectVideoInfo> implements IBytedanceEffectVideoInfoService {
+    @Autowired
+    private IBytedanceReportMaterialDailyService bytedanceReportMaterialDailyService;
+    @Autowired
+    private IByteDanceVideoInfoService videoInfoService;
+    @Override
+    public void loadEffectVideo(String date) {
+        //1:查询素材报表
+        List<BytedanceVideoVo> vos = bytedanceReportMaterialDailyService.getVideoVoByDate(date);
+        if(null == vos||vos.isEmpty()){
+            log.info("素材数据报表为空");
+            return;
+        }
+        for (BytedanceVideoVo vo:vos) {
+            BytedanceEffectVideoInfo effectVideoInfo = new BytedanceEffectVideoInfo();
+            effectVideoInfo.setCode(vo.getCode());
+            effectVideoInfo.setUrl(vo.getUrl());
+            effectVideoInfo.setInitialCostDate(vo.getInitialCostDate());
+            effectVideoInfo.setCreateTime(new Date());
+            effectVideoInfo.setUpdateTime(new Date());
+            this.save(effectVideoInfo);
+        }
+    }
+
+    @Override
+    public BytedanceEffectVideoInfo getVideoByCode(String code) {
+        QueryWrapper<BytedanceEffectVideoInfo>queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("code",code);
+        queryWrapper.last("limit 1");
+        return this.getOne(queryWrapper);
+    }
+}

+ 15 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/material/vo/BytedanceVideoVo.java

@@ -0,0 +1,15 @@
+package cn.com.ctop.toutiao.modules.material.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author 宋英豪
+ */
+@Data
+public class BytedanceVideoVo implements Serializable {
+    private String code;
+    private String url;
+    private String initialCostDate;
+}

+ 3 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/BytedanceReportMaterialDailyMapper.java

@@ -1,5 +1,6 @@
 package cn.com.ctop.toutiao.modules.report.mapper;
 
+import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialRetry;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportVideoMaterialDaily;
@@ -25,4 +26,6 @@ public interface BytedanceReportMaterialDailyMapper extends BaseMapper<Bytedance
     List<BytedanceReportMaterialRetry> getRetryList();
 
     void updateRetry(@Param("retry") BytedanceReportMaterialRetry retry);
+
+    List<BytedanceVideoVo> getVideoVoByDate(@Param("date")String date);
 }

+ 13 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceReportMaterialDailyMapper.xml

@@ -238,6 +238,19 @@
         ctop_bytedance_report_material_retry
         where status = 0
     </select>
+    <select id="getVideoVoByDate" resultType="cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo">
+        select
+            distinct video.signature as 'code',video.video_url as 'url',report.stat_datetime as 'initial_cost_date'
+        from
+            ctop_bytedance_report_material_daily report
+        left join ctop_bytedance_video_info video on video.material_id = report.material_id
+        where
+            report.stat_datetime = #{date}
+        and
+            video.signature is not null
+        and
+            video.signature not in (select distinct code from ctop_bytedance_effect_video_info)
+    </select>
 
     <update id="updateRetry">
         update

+ 5 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/IBytedanceReportMaterialDailyService.java

@@ -1,8 +1,11 @@
 package cn.com.ctop.toutiao.modules.report.service;
 
+import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * 素材报表
  * @author jeecg-boot
@@ -11,4 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IBytedanceReportMaterialDailyService extends IService<BytedanceReportMaterialDaily> {
 
+    List<BytedanceReportMaterialDaily> getListByParams(String date);
+    List<BytedanceVideoVo> getVideoVoByDate(String date);
 }

+ 20 - 0
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportMaterialDailyServiceImpl.java

@@ -1,12 +1,17 @@
 package cn.com.ctop.toutiao.modules.report.service.impl;
 
+import cn.com.ctop.toutiao.modules.material.vo.BytedanceVideoVo;
 import cn.com.ctop.toutiao.modules.report.entity.BytedanceReportMaterialDaily;
 import cn.com.ctop.toutiao.modules.report.mapper.BytedanceReportMaterialDailyMapper;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportMaterialDailyService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 素材报表
  * @author jeecg-boot
@@ -17,5 +22,20 @@ import org.springframework.stereotype.Service;
 @Primary
 
 public class BytedanceReportMaterialDailyServiceImpl extends ServiceImpl<BytedanceReportMaterialDailyMapper, BytedanceReportMaterialDaily> implements IBytedanceReportMaterialDailyService {
+    @Autowired
+    private BytedanceReportMaterialDailyMapper bytedanceReportMaterialDailyMapper;
+    @Override
+    public List<BytedanceReportMaterialDaily> getListByParams(String date) {
+        QueryWrapper<BytedanceReportMaterialDaily>queryWrapper = new QueryWrapper<>();
+        if(null != date&&!date.trim().equals("")){
+            queryWrapper.eq("stat_datetime",date);
+        }
+        queryWrapper.orderByAsc("stat_datetime");
+        return this.list(queryWrapper);
+    }
 
+    @Override
+    public List<BytedanceVideoVo> getVideoVoByDate(String date) {
+        return bytedanceReportMaterialDailyMapper.getVideoVoByDate(date);
+    }
 }