yumeng 10 kuukautta sitten
vanhempi
commit
556be6d36a

+ 18 - 3
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/settlementJob.java

@@ -187,6 +187,24 @@ public class settlementJob {
         ikuaishouSupplyChainService.deleteYufuPromoterBindChannelByDate(date);
         ikuaishouSupplyChainService.cleanYufuKuaiShouPromoterBindChannel(date);
 
+
+        ikuaishouSupplyChainService.deleteItemBindCourtshipByDate(date);
+        ikuaishouSupplyChainService.cleanKuaiShouItemBindCourtship(date);
+        ikuaishouSupplyChainService.cleanBytedanceItemBindCourtship(date);
+
+
+        ikuaishouSupplyChainService.deleteMgsItemBindCourtshipByDate(date);
+        ikuaishouSupplyChainService.cleanMgsItemBindCourtship(date);
+
+
+        ikuaishouSupplyChainService.deleteRocketItemBindCourtshipByDate(date);
+        ikuaishouSupplyChainService.cleanRocketItemBindCourtship(date);
+
+
+        ikuaishouSupplyChainService.deleteYufuItemBindCourtshipByDate(date);
+        ikuaishouSupplyChainService.cleanYufuItemBindCourtship(date);
+
+
     }
 
 
@@ -257,9 +275,6 @@ public class settlementJob {
     }
 
 
-
-
-
     @XxlJob("getSellerInfoNowDate")
     public void getSellerInfoNowDate() throws InterruptedException {
         List<JSONObject> cookies = ikuaishouSupplyChainService.getCookie();

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

@@ -75,4 +75,22 @@ public interface KuaishouSupplyChainMapper extends BaseMapper<KuaishouSupplyChai
     void replaceRocketSellerInfo(@Param("adds") List<JSONObject> adds);
 
     void replaceYUfuSellerInfo(@Param("adds") List<JSONObject> adds);
+
+    void deleteItemBindCourtshipByDate(@Param("date") Long date);
+
+    void cleanKuaiShouItemBindCourtship(@Param("date") Long date);
+
+    void cleanBytedanceItemBindCourtship(@Param("date") Long date);
+
+    void deleteMgsItemBindCourtshipByDate(@Param("date") Long date);
+
+    void cleanMgsItemBindCourtship(@Param("date") Long date);
+
+    void deleteRocketItemBindCourtshipByDate(@Param("date") Long date);
+
+    void cleanRocketItemBindCourtship(@Param("date") Long date);
+
+    void deleteYufuItemBindCourtshipByDate(@Param("date") Long date);
+
+    void cleanYufuItemBindCourtship(@Param("date") Long date);
 }

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

@@ -222,6 +222,54 @@
         </foreach>
 
     </insert>
+    <insert id="cleanKuaiShouItemBindCourtship" parameterType="java.lang.Long">
+        INSERT INTO ruixuan.item_bind_courtship_date (item_id, item_name, item_url, user_id, user_name, stat_date,
+                                                      media_id)
+        SELECT t1.item_id, t1.item_title, t1.item_img_url, t1.user_id, t1.user_name, #{date}, media_id
+        FROM ruixuan.kuaishou_item_list t1
+        WHERE date_format(t1.create_time, '%Y%m%d') &lt; #{date}
+          AND t1.media_id = 2
+        GROUP BY t1.item_id
+    </insert>
+    <insert id="cleanBytedanceItemBindCourtship" parameterType="java.lang.Long">
+        INSERT INTO ruixuan.item_bind_courtship_date (item_id, item_name, item_url, user_id, user_name, stat_date,
+                                                      media_id)
+        SELECT t1.item_id, t1.item_title, t1.item_img_url, t1.user_id, t1.user_name, #{date}, media_id
+        FROM ruixuan.kuaishou_item_list t1
+        WHERE date_format(t1.create_time, '%Y%m%d') &lt; #{date}
+          AND t1.media_id = 1
+        GROUP BY t1.item_id
+
+    </insert>
+    <insert id="cleanMgsItemBindCourtship" parameterType="java.lang.Long">
+        INSERT INTO miaogousi.item_bind_courtship_date (item_id, item_name, item_url, user_id, user_name, stat_date,
+                                                      media_id)
+        SELECT t1.item_id, t1.item_title, t1.item_img_url, t1.user_id, t1.user_name, #{date}, media_id
+        FROM miaogousi.kuaishou_item_list t1
+        WHERE date_format(t1.create_time, '%Y%m%d') &lt; #{date}
+          AND t1.media_id = 2
+        GROUP BY t1.item_id
+
+    </insert>
+    <insert id="cleanRocketItemBindCourtship" parameterType="java.lang.Long">
+        INSERT INTO rocket.item_bind_courtship_date (item_id, item_name, item_url, user_id, user_name, stat_date,
+                                                        media_id)
+        SELECT t1.item_id, t1.item_title, t1.item_img_url, t1.user_id, t1.user_name, #{date}, media_id
+        FROM rocket.kuaishou_item_list t1
+        WHERE date_format(t1.create_time, '%Y%m%d') &lt; #{date}
+          AND t1.media_id = 2
+        GROUP BY t1.item_id
+
+    </insert>
+    <insert id="cleanYufuItemBindCourtship" parameterType="java.lang.Long">
+        INSERT INTO yufu.item_bind_courtship_date (item_id, item_name, item_url, user_id, user_name, stat_date,
+                                                     media_id)
+        SELECT t1.item_id, t1.item_title, t1.item_img_url, t1.user_id, t1.user_name, #{date}, media_id
+        FROM yufu.kuaishou_item_list t1
+        WHERE date_format(t1.create_time, '%Y%m%d') &lt; #{date}
+          AND t1.media_id = 2
+        GROUP BY t1.item_id
+    </insert>
     <delete id="deletePromoterBindChannelByDate" parameterType="java.lang.Long">
         delete from ruixuan.promoter_bind_channel_date where stat_date = #{date}
     </delete>
@@ -236,6 +284,29 @@
         FROM yufu.promoter_bind_channel_date
         WHERE stat_date = #{date}
     </delete>
+    <delete id="deleteItemBindCourtshipByDate" parameterType="java.lang.Long">
+
+        DELETE
+        FROM ruixuan.item_bind_courtship_date
+        WHERE stat_date = #{date}
+
+    </delete>
+    <delete id="deleteMgsItemBindCourtshipByDate" parameterType="java.lang.Long">
+        DELETE
+        FROM miaogousi.item_bind_courtship_date
+        WHERE stat_date = #{date}
+
+    </delete>
+    <delete id="deleteRocketItemBindCourtshipByDate" parameterType="java.lang.Long">
+        DELETE
+        FROM rocket.item_bind_courtship_date
+        WHERE stat_date = #{date}
+    </delete>
+    <delete id="deleteYufuItemBindCourtshipByDate" parameterType="java.lang.Long">
+        DELETE
+        FROM yufu.item_bind_courtship_date
+        WHERE stat_date = #{date}
+    </delete>
     <select id="getCookie" resultType="com.alibaba.fastjson.JSONObject">
 
         select  id ,cookie  from ruixuan.kuaishou_supply_chain_cookie

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

@@ -62,4 +62,22 @@ public interface IKuaishouSupplyChainService extends IService<KuaishouSupplyChai
     List<String> getActivityKeyWord(String yesDate, String ruixuan);
 
     void getSellerInfo(String cookie, Integer offset, String db,String date) throws InterruptedException;
+
+    void deleteItemBindCourtshipByDate(Long date);
+
+    void cleanKuaiShouItemBindCourtship(Long date);
+
+    void cleanBytedanceItemBindCourtship(Long date);
+
+    void deleteMgsItemBindCourtshipByDate(Long date);
+
+    void cleanMgsItemBindCourtship(Long date);
+
+    void deleteRocketItemBindCourtshipByDate(Long date);
+
+    void cleanRocketItemBindCourtship(Long date);
+
+    void deleteYufuItemBindCourtshipByDate(Long date);
+
+    void cleanYufuItemBindCourtship(Long date);
 }

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

@@ -355,6 +355,51 @@ public class KuaishouSupplyChainServiceImpl extends ServiceImpl<KuaishouSupplyCh
         }
     }
 
+    @Override
+    public void deleteItemBindCourtshipByDate(Long date) {
+        supplyChainMapper.deleteItemBindCourtshipByDate(date);
+    }
+
+    @Override
+    public void cleanKuaiShouItemBindCourtship(Long date) {
+        supplyChainMapper.cleanKuaiShouItemBindCourtship(date);
+    }
+
+    @Override
+    public void cleanBytedanceItemBindCourtship(Long date) {
+        supplyChainMapper.cleanBytedanceItemBindCourtship(date);
+    }
+
+    @Override
+    public void deleteMgsItemBindCourtshipByDate(Long date) {
+        supplyChainMapper.deleteMgsItemBindCourtshipByDate(date);
+    }
+
+    @Override
+    public void cleanMgsItemBindCourtship(Long date) {
+        supplyChainMapper.cleanMgsItemBindCourtship(date);
+    }
+
+    @Override
+    public void deleteRocketItemBindCourtshipByDate(Long date) {
+        supplyChainMapper.deleteRocketItemBindCourtshipByDate(date);
+    }
+
+    @Override
+    public void cleanRocketItemBindCourtship(Long date) {
+        supplyChainMapper.cleanRocketItemBindCourtship(date);
+    }
+
+    @Override
+    public void deleteYufuItemBindCourtshipByDate(Long date) {
+        supplyChainMapper.deleteYufuItemBindCourtshipByDate(date);
+    }
+
+    @Override
+    public void cleanYufuItemBindCourtship(Long date) {
+        supplyChainMapper.cleanYufuItemBindCourtship(date);
+    }
+
 
     @Override
     public List<JSONObject> getCookie() {