Преглед на файлове

Merge remote-tracking branch 'origin/master'

zhaoxian преди 3 години
родител
ревизия
5bdb63c5c7

+ 9 - 5
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -4,6 +4,7 @@ import cn.com.ctop.common.module.entity.BindAccountLogin;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.IBindAccountLoginService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
 import cn.com.ctop.common.module.service.ICtopOauthTokenService;
+import cn.com.ctop.common.module.service.ISendMessageService;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.Check;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouUnitLevelOperationRecord;
 import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouUnitLevelOperationRecord;
@@ -11,9 +12,8 @@ import cn.com.ctop.kuaishou.modules.ai.mapper.AiKuaishouUnitLevelOperationRecord
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouOperationRecord;
 import cn.com.ctop.kuaishou.modules.batch.entity.KuaishouOperationRecord;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouOperationRecordMapper;
 import cn.com.ctop.kuaishou.modules.batch.mapper.KuaishouOperationRecordMapper;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouReportDailyMaterialService;
-import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService2;
-import cn.com.ctop.kuaishou.modules.batch.service.impl.KuaishouInterfaceServiceImpl2;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService;
+import cn.com.ctop.kuaishou.modules.batch.service.IKuaishouInterfaceService2;
 import cn.com.ctop.kuaishou.modules.dimension.service.IKuaiShouDimensionStrategyService;
 import cn.com.ctop.kuaishou.modules.dimension.service.IKuaiShouDimensionStrategyService;
 import cn.com.ctop.kuaishou.modules.dimension.service.IKuaiShouDimensionVariableService;
 import cn.com.ctop.kuaishou.modules.dimension.service.IKuaiShouDimensionVariableService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
@@ -99,12 +99,16 @@ public class SampleTest {
     private IKuaiShouDimensionVariableService dimensionVariableService;
     private IKuaiShouDimensionVariableService dimensionVariableService;
     @Autowired
     @Autowired
     IRuleKuaiShouPlanService ruleKuaiShouPlanService;
     IRuleKuaiShouPlanService ruleKuaiShouPlanService;
+    @Autowired
+    private ISendMessageService sendMessageService;
 
 
 
 
     @Test
     @Test
     public void loadKuaishouCookie() throws ParseException {
     public void loadKuaishouCookie() throws ParseException {
-        CtopOauthToken oauthToken = tokenService.getTokenByAccountId(10571378L);
-        ruleKuaiShouPlanService.cleanRuleDataTarget(10571378L, oauthToken.getAccessToken(), 1);
+      /*  CtopOauthToken oauthToken = tokenService.getTokenByAccountId(10571378L);
+        ruleKuaiShouPlanService.cleanRuleDataTarget(10571378L, oauthToken.getAccessToken(), 1);*/
+
+        sendMessageService.sendMessage("eb003a809ff44ee6bd1d9be5384ef4b8","测试发送消息");
     }
     }
 
 
 
 
@@ -440,7 +444,7 @@ public class SampleTest {
     }
     }
 
 
     public void testfreshBytedanceUrl(){
     public void testfreshBytedanceUrl(){
-        etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
+        etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob(null);
         etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
         etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
         etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
         etlReportBytedanceVideoService.etlBytedanceVideoShotInfoJob();
     }
     }

+ 6 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/BytedanceEtlVideoJob.java

@@ -80,7 +80,9 @@ public class BytedanceEtlVideoJob {
      */
      */
     @XxlJob("etlBytedanceVideoClipInfoJob")
     @XxlJob("etlBytedanceVideoClipInfoJob")
     public void etlBytedanceVideoClipInfoJob() throws Exception {
     public void etlBytedanceVideoClipInfoJob() throws Exception {
-        etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob();
+        String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
+        String date = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -2);
+        etlReportBytedanceVideoService.etlBytedanceVideoClipIdJob(date);
     }
     }
 
 
     /**
     /**
@@ -89,9 +91,12 @@ public class BytedanceEtlVideoJob {
      */
      */
     @XxlJob("etlBytedanceVideoPlanInfoJob")
     @XxlJob("etlBytedanceVideoPlanInfoJob")
     public void etlBytedanceVideoPlanInfoJob() throws Exception {
     public void etlBytedanceVideoPlanInfoJob() throws Exception {
+
         etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
         etlReportBytedanceVideoService.etlBytedanceVideoPlanInfoJob();
     }
     }
 
 
+
+
     /**
     /**
      * 清洗头条拍摄
      * 清洗头条拍摄
      * @throws Exception
      * @throws Exception

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/mapper/ETLReportBytedanceVideoMapper.java

@@ -35,7 +35,7 @@ public interface ETLReportBytedanceVideoMapper extends BaseMapper<ETLReportByted
 
 
     void deleteDuplicateVideoInfo(@Param("video")ETLReportBytedanceVideo video);
     void deleteDuplicateVideoInfo(@Param("video")ETLReportBytedanceVideo video);
 
 
-    List<ETLReportBytedanceVideo> getBytedanceVideoClipInfo();
+    List<ETLReportBytedanceVideo> getBytedanceVideoClipInfo(@Param("date") String date);
     List<ETLReportBytedanceVideo> getBytedanceVideoShotInfo();
     List<ETLReportBytedanceVideo> getBytedanceVideoShotInfo();
     List<ETLReportBytedanceVideo> getBytedanceVideoPlanInfo();
     List<ETLReportBytedanceVideo> getBytedanceVideoPlanInfo();
 
 
@@ -43,6 +43,6 @@ public interface ETLReportBytedanceVideoMapper extends BaseMapper<ETLReportByted
     void updateShotInfo(@Param("shotId")String shotId, @Param("shotName")String shotName, @Param("md5")String md5);
     void updateShotInfo(@Param("shotId")String shotId, @Param("shotName")String shotName, @Param("md5")String md5);
     void updatePlanInfo(@Param("planId")String planId, @Param("planName")String planName, @Param("md5")String md5);
     void updatePlanInfo(@Param("planId")String planId, @Param("planName")String planName, @Param("md5")String md5);
 
 
-    void updateTeamLeader();
-    void updateDesignTeamLeader();
+    void updateTeamLeader(@Param("date") String date);
+    void updateDesignTeamLeader(@Param("date") String date);
 }
 }

+ 25 - 18
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/mapper/xml/ETLReportBytedanceVideoMapper.xml

@@ -211,17 +211,23 @@
         update etl_report_bytedance_video set plan_id=#{planId},plan_name=#{planName} where md5=#{md5}
         update etl_report_bytedance_video set plan_id=#{planId},plan_name=#{planName} where md5=#{md5}
     </update>
     </update>
     <update id="updateDesignTeamLeader">
     <update id="updateDesignTeamLeader">
-        update etl_report_bytedance_video video left join ctop_material_ascription su on video.clip_id = su.clip_id
-            set video.team_leader = su.leader_name
-        where video.clip_id is not null
-            and video.team_leader is null
-            and su.leader_name is not null
-            and su.leader_name != ''
+ UPDATE etl_report_bytedance_video t1
+SET t1.team_leader = (
+	SELECT
+		leader_name
+	FROM
+		ctop_material_ascription
+	WHERE
+		material_id = t1.md5
+limit 1
+) WHERE t1.stat_datetime &gt;= #{date}
+
     </update>
     </update>
     <update id="updateTeamLeader">
     <update id="updateTeamLeader">
         update etl_report_bytedance_video video left join sys_user su on video.clip_id = su.id
         update etl_report_bytedance_video video left join sys_user su on video.clip_id = su.id
             set video.team_leader = su.leader_name
             set video.team_leader = su.leader_name
-        where video.clip_id is not null
+        where video.stat_datetime &gt;= #{date}
+            and video.clip_id is not null
             and su.leader_name is not null
             and su.leader_name is not null
             and video.team_leader is null
             and video.team_leader is null
             and su.leader_name != ''
             and su.leader_name != ''
@@ -234,7 +240,7 @@
           and stat_datetime = #{video.statDatetime}
           and stat_datetime = #{video.statDatetime}
           and account_id = #{video.accountId} and id!=#{video.id};
           and account_id = #{video.accountId} and id!=#{video.id};
     </delete>
     </delete>
-    <select id="queryVideoInfoByMaterialId"  resultType="com.alibaba.fastjson.JSONObject">
+    <select id="queryVideoInfoByMaterialId" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         SELECT
             signature AS md5,
             signature AS md5,
             video_url AS url
             video_url AS url
@@ -244,7 +250,7 @@
             material_id = #{materialId}
             material_id = #{materialId}
         limit 1
         limit 1
     </select>
     </select>
-    <select id="queryMaterialVideoByMd5"  resultType="com.alibaba.fastjson.JSONObject">
+    <select id="queryMaterialVideoByMd5" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         SELECT
             `name`  as materialName,
             `name`  as materialName,
             url,
             url,
@@ -256,7 +262,7 @@
             md5 = #{md5}
             md5 = #{md5}
         LIMIT 1
         LIMIT 1
     </select>
     </select>
-    <select id="queryMaterialVideoByMd5Old"  resultType="com.alibaba.fastjson.JSONObject">
+    <select id="queryMaterialVideoByMd5Old" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         SELECT
             material_name as materialName,
             material_name as materialName,
             url,
             url,
@@ -268,7 +274,7 @@
             code = #{md5}
             code = #{md5}
         LIMIT 1
         LIMIT 1
     </select>
     </select>
-    <select id="queryRelatePersonByMd5"  resultType="com.alibaba.fastjson.JSONObject">
+    <select id="queryRelatePersonByMd5" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         SELECT
             clip_id clipId,
             clip_id clipId,
             clip_name clipaname,
             clip_name clipaname,
@@ -282,7 +288,7 @@
             video_md5 = #{md5}
             video_md5 = #{md5}
         LIMIT 1
         LIMIT 1
     </select>
     </select>
-    <select id="queryRelatePersonByMd5Old"  resultType="com.alibaba.fastjson.JSONObject">
+    <select id="queryRelatePersonByMd5Old" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         SELECT
             clip_id clipId,
             clip_id clipId,
             (select realname from sys_user where id=clip_id) as clipName,
             (select realname from sys_user where id=clip_id) as clipName,
@@ -296,7 +302,7 @@
             code = #{md5}
             code = #{md5}
         LIMIT 1
         LIMIT 1
     </select>
     </select>
-    <select id="queryAccountDetailByAccountId"  resultType="com.alibaba.fastjson.JSONObject">
+    <select id="queryAccountDetailByAccountId" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
         SELECT
             t1.advertiser_id as advertiserId,
             t1.advertiser_id as advertiserId,
             (SELECT `name` from ctop_advertiser where id=t1.advertiser_id limit 1) as advertiserName,
             (SELECT `name` from ctop_advertiser where id=t1.advertiser_id limit 1) as advertiserName,
@@ -310,7 +316,7 @@
         LIMIT 1
         LIMIT 1
     </select>
     </select>
 
 
-    <select id="queryETLData"  resultType="cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo">
+    <select id="queryETLData" resultType="cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo">
         SELECT
         SELECT
             t1.*,
             t1.*,
             t3.clip_id clipId,
             t3.clip_id clipId,
@@ -353,12 +359,13 @@
             u.realname as 'clip_name'
             u.realname as 'clip_name'
         FROM
         FROM
             etl_report_bytedance_video video
             etl_report_bytedance_video video
-                LEFT JOIN ctop_material_ascription cmi ON video.md5 = cmi.
-                CODE LEFT JOIN sys_user u ON u.id = cmi.clip_id
-        WHERE
-            cmi.clip_id IS NOT NULL
+                LEFT JOIN ctop_material_ascription cmi ON video.md5 = cmi.material_id
+                 LEFT JOIN sys_user u ON u.id = cmi.clip_id
+        WHERE video.stat_datetime &gt;= #{date}
+           and cmi.clip_id IS NOT NULL
           AND video.clip_id = ''
           AND video.clip_id = ''
           AND u.realname IS NOT NULL
           AND u.realname IS NOT NULL
+
     </select>
     </select>
     <select id="getBytedanceVideoShotInfo"
     <select id="getBytedanceVideoShotInfo"
             resultType="cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo">
             resultType="cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo">

+ 1 - 1
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/service/IETLReportBytedanceVideoService.java

@@ -17,7 +17,7 @@ public interface IETLReportBytedanceVideoService extends IService<ETLReportByted
 
 
     void cleanData(String data);
     void cleanData(String data);
 
 
-    void etlBytedanceVideoClipIdJob();
+    void etlBytedanceVideoClipIdJob(String date);
 
 
     void etlBytedanceVideoPlanInfoJob();
     void etlBytedanceVideoPlanInfoJob();
 
 

+ 4 - 4
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/link/service/impl/ETLReportBytedanceVideoServiceImpl.java

@@ -62,15 +62,15 @@ public class ETLReportBytedanceVideoServiceImpl extends ServiceImpl<ETLReportByt
     }
     }
 
 
     @Override
     @Override
-    public void etlBytedanceVideoClipIdJob() {
-        List <ETLReportBytedanceVideo> clipInfos = etlReportBytedanceVideoMapper.getBytedanceVideoClipInfo();
+    public void etlBytedanceVideoClipIdJob(String date) {
+        List <ETLReportBytedanceVideo> clipInfos = etlReportBytedanceVideoMapper.getBytedanceVideoClipInfo(date);
         if(null!=clipInfos&&!clipInfos.isEmpty()){
         if(null!=clipInfos&&!clipInfos.isEmpty()){
             clipInfos.forEach(clipInfo->{
             clipInfos.forEach(clipInfo->{
                 etlReportBytedanceVideoMapper.updateClipInfo(clipInfo.getClipId(),clipInfo.getClipName(),clipInfo.getMd5());
                 etlReportBytedanceVideoMapper.updateClipInfo(clipInfo.getClipId(),clipInfo.getClipName(),clipInfo.getMd5());
             });
             });
         }
         }
-        etlReportBytedanceVideoMapper.updateDesignTeamLeader();
-        etlReportBytedanceVideoMapper.updateTeamLeader();
+        etlReportBytedanceVideoMapper.updateDesignTeamLeader(date);
+        etlReportBytedanceVideoMapper.updateTeamLeader(date);
     }
     }
 
 
     @Override
     @Override