Explorar el Código

清除无用的头条图片报表数据清洗逻辑

syh hace 4 años
padre
commit
dbdd1fe32d

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

@@ -47,9 +47,9 @@ public interface BytedanceReportMaterialDailyMapper extends BaseMapper<Bytedance
 );
 
     void replaceImageBatch(@Param("infos")List<BytedanceReportMaterialDaily> bytedanceReportImageDailyList);
-    void updateImageReportCode();
-    void updateImageReportProjectId();
-    void updateImageReportProjectName();
+    void updateImageReportCode(@Param("accountId")Long accountId);
+    void updateImageReportProjectId(@Param("accountId")Long accountId);
+    void updateImageReportProjectName(@Param("accountId")Long accountId);
     void updateImageReportPlaneId();
     void updateImageReportPlaneName();
 

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

@@ -320,17 +320,17 @@
 
     <update id="updateImageReportCode">
         update ctop_bytedance_report_image_daily a inner join ctop_bytedance_image_info image on image.material_id =a.material_id  set a.code = image.signature,a.image_url = image.image_url
-        where a.material_id is not null and a.code is null
+        where a.material_id is not null and a.code is null and a.account_id = #{accountId}
     </update>
 
     <update id="updateImageReportProjectId">
         update ctop_bytedance_report_image_daily a inner join ctop_user_allocation allocation on allocation.account_id =a.account_id  set a.project_id = allocation.project_id
-        where a.account_id is not null and a.project_id is null
+        where a.account_id is not null and a.project_id is null and a.account_id = #{accountId}
     </update>
 
     <update id="updateImageReportProjectName">
         update ctop_bytedance_report_image_daily a inner join ctop_project p on p.id =a.project_id  set a.project_name = p.project_name
-        where a.project_id is not null and a.project_name is null
+        where a.project_id is not null and a.project_name is null and a.account_id = #{accountId}
     </update>
 
     <update id="updateImageReportPlaneId">

+ 3 - 3
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/service/impl/BytedanceReportServiceImpl.java

@@ -516,9 +516,9 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             retry.setType(1);
             bytedanceReportMaterialDailyMapper.replaceMaterialRetry(retry);
         }
-        bytedanceReportMaterialDailyMapper.updateImageReportCode();
-        bytedanceReportMaterialDailyMapper.updateImageReportProjectId();
-        bytedanceReportMaterialDailyMapper.updateImageReportProjectName();
+        bytedanceReportMaterialDailyMapper.updateImageReportCode(token.getAccountId());
+        bytedanceReportMaterialDailyMapper.updateImageReportProjectId(token.getAccountId());
+        bytedanceReportMaterialDailyMapper.updateImageReportProjectName(token.getAccountId());
         log.info("头条素材报表结束 当前accountId为:{}  {}~{}" , accountId, startDate,endDate);
         return code;
     }