yumeng 1 gadu atpakaļ
vecāks
revīzija
f022f7c22a

+ 2 - 1
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/settlementJob.java

@@ -109,7 +109,8 @@ public class settlementJob {
     public void cleanPromoterBindChannel() {
         Long date = Long.valueOf(DateUtils.getNowDate("yyyyMMdd"));
         ikuaishouSupplyChainService.deletePromoterBindChannelByDate(date);
-        ikuaishouSupplyChainService.cleanPromoterBindChannel(date);
+        ikuaishouSupplyChainService.cleanKuaiShouPromoterBindChannel(date);
+        ikuaishouSupplyChainService.cleanBytedancePromoterBindChannel(date);
 
     }
 

+ 3 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/KuaishouSupplyChainMapper.java

@@ -29,7 +29,9 @@ public interface KuaishouSupplyChainMapper extends BaseMapper<KuaishouSupplyChai
 
     void deletePromoterBindChannelByDate(@Param("date") Long date);
 
-    void cleanPromoterBindChannel(@Param("date") Long date);
+    void cleanKuaiShouPromoterBindChannel(@Param("date") Long date);
 
     List<JSONObject> getSamplesData(@Param("startDate") String startDate);
+
+    void cleanBytedancePromoterBindChannel(@Param("date") Long date);
 }

+ 17 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouSupplyChainMapper.xml

@@ -82,7 +82,7 @@
             )
         </foreach>
     </insert>
-    <insert id="cleanPromoterBindChannel" parameterType="java.lang.Long">
+    <insert id="cleanKuaiShouPromoterBindChannel" parameterType="java.lang.Long">
         insert into ruixuan.promoter_bind_channel_date (promoter_id, promoter_name,promoter_url, user_id, user_name, stat_date,media_id)
         select t1.promoter_id, t1.promoter_nick_name, t1.promoter_url,t1.user_id, t1.user_name, #{date},media_id
         from ruixuan.kuaishou_promoter t1
@@ -91,6 +91,7 @@
         left join ruixuan.sys_role t3
         on t2.role_id = t3.role_id
         where  1 = 1
+        and t1.media_id = '2'
         and t3.role_key in ('bdManager', 'bd')
         and date_format(t1.create_time, '%Y%m%d')  &lt; #{date}
         group by t1.promoter_id
@@ -165,5 +166,20 @@ group by t1.promoter_id;
       and collect_sample_status  = 4
       and collect_sample_desc = '单号异常'
     </select>
+    <select id="cleanBytedancePromoterBindChannel" parameterType="java.lang.Long">
+          insert into ruixuan.promoter_bind_channel_date (promoter_id, promoter_name,promoter_url, user_id, user_name, stat_date,media_id)
+        select t1.promoter_id, t1.promoter_nick_name, t1.promoter_url,t1.user_id, t1.user_name, #{date},media_id
+        from ruixuan.kuaishou_promoter t1
+        left join ruixuan.sys_user_role t2
+        on t1.user_id = t2.user_id
+        left join ruixuan.sys_role t3
+        on t2.role_id = t3.role_id
+        where  1 = 1
+        and t1.media_id = '1'
+        and t3.role_key in ('bdManager', 'bd')
+        and date_format(t1.create_time, '%Y%m%d')  &lt;= #{date}
+        group by t1.promoter_id
+
+    </select>
 
 </mapper>

+ 3 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/IKuaishouSupplyChainService.java

@@ -26,7 +26,9 @@ public interface IKuaishouSupplyChainService extends IService<KuaishouSupplyChai
 
     void deletePromoterBindChannelByDate(Long date);
 
-    void cleanPromoterBindChannel(Long date);
+    void cleanKuaiShouPromoterBindChannel(Long date);
 
     List<JSONObject> getSamplesData(String startDate);
+
+    void cleanBytedancePromoterBindChannel(Long date);
 }

+ 7 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouSupplyChainServiceImpl.java

@@ -208,8 +208,8 @@ public class KuaishouSupplyChainServiceImpl extends ServiceImpl<KuaishouSupplyCh
     }
 
     @Override
-    public void cleanPromoterBindChannel(Long date) {
-        supplyChainMapper.cleanPromoterBindChannel(date);
+    public void cleanKuaiShouPromoterBindChannel(Long date) {
+        supplyChainMapper.cleanKuaiShouPromoterBindChannel(date);
     }
 
     @Override
@@ -217,6 +217,11 @@ public class KuaishouSupplyChainServiceImpl extends ServiceImpl<KuaishouSupplyCh
         return supplyChainMapper.getSamplesData(startDate);
     }
 
+    @Override
+    public void cleanBytedancePromoterBindChannel(Long date) {
+        supplyChainMapper.cleanBytedancePromoterBindChannel(date);
+    }
+
     public static String filterSupplement(String content) {
         StringBuilder sb = new StringBuilder();
         for (char ch : content.toCharArray()) {