Jelajahi Sumber

cps结算任务

zhaotx 1 tahun lalu
induk
melakukan
0902ade1af

+ 12 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/CPSReportMapper.java

@@ -14,9 +14,20 @@ public interface CPSReportMapper {
     List<JSONObject> queryCPSIaaDaily(@Param("nowDate") Integer nowDate, @Param("dateStr") String dateStr);
 
     boolean cleanCPSIaaDailyReportsDS(@Param("list") List<JSONObject> list);
+    @DS("selectdb")
+    int runCPSDysSettlementData(@Param("dateStr") String dateStr, @Param("dateLong") String dateLong, @Param("st") Long st);
+
+    int runCPSIapSettlementData(@Param("dateStr") String dateStr, @Param("dateLong") String dateLong, @Param("st") Long st);
+    @DS("selectdb")
+    List<JSONObject> runCPSIaaDySettlementData(@Param("dateStr") String dateStr, @Param("dateLong") String dateLong, @Param("st") Long st);
+    @DS("selectdb")
+    List<JSONObject> runCPSIaaWxSettlementData(@Param("dateStr") String dateStr, @Param("dateLong") String dateLong, @Param("st") Long st);
 
+//    int saveDysSettlementData(List<JSONObject> list);
+//    int saveIapSettlementData(List<JSONObject> list);
+    int saveIaaWxSettlementData(List<JSONObject> list);
+    int saveIaaDySettlementData(List<JSONObject> list);
 
-    int runCPSIapSettlementData(@Param("dateStr") String dateStr, @Param("dateLong") String dateLong);
 
 
 }

+ 324 - 34
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/CPSReportMapper.xml

@@ -110,7 +110,7 @@
               FROM (SELECT DATE_FORMAT(activation_time, '%Y%m%d') AS 'date', link_id,
                            count(DISTINCT uid) AS 'new_users'
                     FROM thirtpart.ly_user_activation_info
-                    WHERE created_at >= unix_timestamp(#{nowDate})
+                    WHERE created_at &gt;= unix_timestamp(#{nowDate})
                       AND created_at &lt; unix_timestamp(DATE_ADD(#{nowDate}, INTERVAL 1 day))
                     GROUP BY link_id) t3
                        LEFT JOIN thirtpart.ly_link t0 ON t0.id = t3.link_id
@@ -210,7 +210,7 @@
                                    count(DISTINCT t.uid) AS 'new_users'
                             FROM tidb.thirtpart.ly_user_activation_info t
                                      LEFT JOIN tidb.thirtpart.ly_link t0 ON t.link_id = t0.id
-                            WHERE t.created_at >= unix_timestamp(#{nowDate})
+                            WHERE t.created_at &gt;= unix_timestamp(#{nowDate})
                               AND t.created_at &lt; unix_timestamp(DATE_ADD(#{nowDate}, INTERVAL 1 day))
                             GROUP BY 1, 2, 3, 4) t1 ON tt.id = t1.id
                  LEFT JOIN (SELECT link_id,
@@ -284,60 +284,350 @@
     </insert>
 
 
-
+    <insert id="runCPSDysSettlementData">
+        insert into media_api.playlet_distribution_income_detail
+        select a.playlet_id,
+        stat_date,
+        playlet_name,
+        distributor_id,
+        distributor_name,
+        iaa_income,
+        iap_income,
+        refund_amount,
+        ifnull(c.reback_iaa_income, iaa_income)   as reback_iaa_income,
+        ifnull(b.reback_iap_income, a.iap_income) as reback_iap_income
+        from (select playlet_id,
+        stat_date,
+        playlet_name,
+        distributor_id,
+        distributor_name,
+        iaa_income,
+        iap_income,
+        refund_amount
+        from media_api.playlet_distribution_income_detail
+        where stat_date = #{dateLong}) a
+        left join
+        (select playlet_id, reback_iap_income
+        from (select playlet_id,
+        playlet_name,
+        distributor_id,
+        scale,
+        commission_scale,
+        a.iap_income * (1 - commission_scale / 100) * (scale / 100) as reback_iap_income,
+        stat_date,
+        start_time,
+        end_time
+        from (select playlet_id,
+        playlet_name,
+        distributor_id,
+        distributor_name,
+        iaa_income,
+        iap_income,
+        refund_amount,
+        stat_date
+        from media_api.playlet_distribution_income_detail
+        where stat_date = #{dateLong}) a
+        left join
+        (select company_id,
+        name,
+        scale,
+        commission_scale,
+        source,
+        dis_id,
+        start_time,
+        end_time
+        from (select a.company_id,
+        a.name,
+        b.source                                         as source,
+        b.scale,
+        b.commission_scale,
+        original_id,
+        date_format(from_unixtime(start_time), '%Y%m%d') as start_time,
+        date_format(from_unixtime(end_time), '%Y%m%d')   as end_time
+        from tidb.thirtpart.ly_responsibility_person a
+        left join tidb.thirtpart.ly_responsibility_person_scale b
+        on a.company_id = b.company_id
+        where b.source = 10) t LATERAL VIEW EXPLODE(split_by_string(original_id,','))dis_id AS dis_id
+        group by 1, 2, 3, 4, 5, 6, 7, 8) c
+        on a.distributor_id = c.dis_id) t
+        where stat_date &gt;= start_time
+        and stat_date &lt;= end_time) b
+        on a.playlet_id = b.playlet_id
+        left join (select playlet_id, reback_iaa_income
+        from (select playlet_id,
+        playlet_name,
+        distributor_id,
+        scale,
+        commission_scale,
+        a.iaa_income * (scale / 100) as reback_iaa_income,
+        stat_date,
+        start_time,
+        end_time
+        from (select playlet_id,
+        playlet_name,
+        distributor_id,
+        distributor_name,
+        iaa_income,
+        iap_income,
+        refund_amount,
+        stat_date
+        from media_api.playlet_distribution_income_detail
+        where stat_date = #{dateLong}) a
+        left join
+        (select company_id,
+        name,
+        scale,
+        commission_scale,
+        source,
+        dis_id,
+        start_time,
+        end_time
+        from (select a.company_id,
+        a.name,
+        b.source                                         as source,
+        b.scale,
+        b.commission_scale,
+        original_id,
+        date_format(from_unixtime(start_time), '%Y%m%d') as start_time,
+        date_format(from_unixtime(end_time), '%Y%m%d')   as end_time
+        from tidb.thirtpart.ly_responsibility_person a
+        left join tidb.thirtpart.ly_responsibility_person_scale b
+        on a.company_id = b.company_id
+        where b.source = 11) t LATERAL VIEW EXPLODE(split_by_string(original_id,','))dis_id AS dis_id
+        group by 1, 2, 3, 4, 5, 6, 7, 8) c
+        on a.distributor_id = c.dis_id) t
+        where stat_date &gt;= start_time
+        and stat_date &lt;= end_time) c
+        on a.playlet_id = c.playlet_id
+    </insert>
 
     <insert id="runCPSIapSettlementData">
         replace into deepthink.distribution_iap_settlement
-        (stat_date, link_id, app_id, person_id, person_pid, company_id,
-        all_pay_amount, all_refund_amount, all_settlement_amount,
-        virtual_pay_amount, virtual_commission_amount, virtual_refund_amount, virtual_settlement_amount,
-        un_virtual_pay_amount, un_virtual_commission_amount, un_virtual_refund_amount, un_virtual_settlement_amount
-        )
+        (stat_date, link_id, app_id, person_id, person_pid, company_id, all_pay_amount, all_refund_amount, all_settlement_amount, virtual_pay_amount, virtual_commission_amount, virtual_refund_amount, virtual_settlement_amount, un_virtual_pay_amount, un_virtual_commission_amount, un_virtual_refund_amount, un_virtual_settlement_amount)
+        select
+        #{dateLong} as stat_date,
+        ifnull(link_id, 0) as link_id,
+        ifnull(app_id, '') as app_id,
+        ifnull(person_id, 0) as person_id,
+        ifnull(person_pid, 0) as person_pid,
+        ifnull(company_id, 0) as company_id,
+        all_pay_amount,
+        all_refund_amount,
+        (wx_virtual_pay_amount-wx_virtual_commission_amount-wx_virtual_refund_amount) * wx_virtual_scale_rate + (wx_common_pay_amount-wx_common_commission_amount-wx_common_refund_amount) * wx_common_scale_rate
+        + (tt_common_pay_amount-tt_common_commission_amount-tt_common_refund_amount) * tt_common_scale_rate as all_settlement_amount,
+        wx_virtual_pay_amount as virtual_pay_amount,
+        wx_virtual_commission_amount as virtual_commission_amount,
+        wx_virtual_refund_amount as virtual_refund_amount,
+        (wx_virtual_pay_amount-wx_virtual_commission_amount-wx_virtual_refund_amount) * wx_virtual_scale_rate as virtual_settlement_amount,
+        (wx_common_pay_amount+tt_common_pay_amount) un_virtual_pay_amount,
+        (wx_common_commission_amount+tt_common_commission_amount) un_virtual_commission_amount,
+        (wx_common_refund_amount+tt_common_refund_amount) un_virtual_refund_amount,
+        (wx_common_pay_amount-wx_common_commission_amount-wx_common_refund_amount) * wx_common_scale_rate
+        + (tt_common_pay_amount-tt_common_commission_amount-tt_common_refund_amount) * tt_common_scale_rate as un_virtual_settlement_amount
+        from
+        (select
+        stat_date, t2.*,
+        ifnull(sum(t3.all_pay_amount),0) as all_pay_amount,
+        ifnull(sum(t4.refund_amount), 0) as all_refund_amount,
+        ifnull(sum(case when t1.pay_merchant=15 then ifnull(t3.all_pay_amount,0) else 0 end), 0) as wx_virtual_pay_amount,
+        ifnull(sum(case when t1.pay_merchant=15 then ifnull(t3.all_pay_amount,0)* wx_virtual_commission_rate else 0 end), 0) as wx_virtual_commission_amount,
+        ifnull(sum(case when t1.pay_merchant=15 then ifnull(t4.refund_amount,0) else 0 end), 0) as wx_virtual_refund_amount,
+        ifnull(sum(case when t1.pay_merchant in (22,23) then ifnull(t3.all_pay_amount,0) else 0 end), 0) as wx_common_pay_amount,
+        ifnull(sum(case when t1.pay_merchant in (22,23) then ifnull(t3.all_pay_amount,0)* wx_common_commission_rate else 0 end), 0) as wx_common_commission_amount,
+        ifnull(sum(case when t1.pay_merchant in (22,23) then ifnull(t4.refund_amount,0) else 0 end), 0) as wx_common_refund_amount,
+        ifnull(sum(case when t1.pay_merchant=30 then ifnull(t3.all_pay_amount,0) else 0 end), 0) as tt_common_pay_amount,
+        ifnull(sum(case when t1.pay_merchant=30 then ifnull(t3.all_pay_amount,0)* tt_common_commission_rate else 0 end), 0) as tt_common_commission_amount,
+        ifnull(sum(case when t1.pay_merchant=30 then ifnull(t4.refund_amount,0) else 0 end), 0) as tt_common_refund_amount
 
-        select #{dateLong} as stat_date,
-        ifnull(t1.link_id, 0) as link_id,
-        ifnull(t2.person_id, 0) as person_id,
-        ifnull(t2.person_pid, 0) as person_pid,
-        ifnull(t2.company_id, 0) as company_id,
-        ifnull(t2.app_id, '') as app_id,
-        ifnull(all_pay_amount, 0) as all_pay_amount,
-        ifnull(refund_amount, 0) as refund_amount
-        from (
-        select consume_date stat_date,link_id
+        from
+        (
+        select consume_date stat_date, link_id, pay_merchant
         from thirtpart.ly_pay_record p
         where consume_date=#{dateLong} and status=1
-        group by 1,2
-
+        group by 1,2,3
         union
-
-        select date_format(refund_time,'%Y%m%d') stat_date,link_id
+        select date_format(refund_time,'%Y%m%d') stat_date,link_id, pay_merchant
         from thirtpart.ly_refund_record lrr
         where refund_time &gt;= concat(#{dateStr}, ' 00:00:00') and refund_time &lt;= concat(#{dateStr}, ' 23:59:59')
         and status = 1
-        group by 1,2
-        )t1
-        join (
-        select l.id link_id,l.responsibility_person_id person_id,p.pid person_pid,p.company_id,la.app_id
+        group by 1,2,3
+        ) t1
+        inner join
+        (
+        select l.id link_id,
+        l.responsibility_person_id person_id,
+        p.pid person_pid,
+        p.company_id,
+        la.app_id,
+        ifnull(scale_wx_virtual.scale/100.0, 0) as wx_virtual_scale_rate,
+        ifnull(scale_wx_virtual.commission_scale/100.0, 0) as wx_virtual_commission_rate,
+        ifnull(scale_wx_common.scale/100.0, 0) as wx_common_scale_rate,
+        ifnull(scale_wx_common.commission_scale/100.0, 0) as wx_common_commission_rate,
+        ifnull(scale_tt_common.scale/100.0, 0) as tt_common_scale_rate,
+        ifnull(scale_tt_common.commission_scale/100.0, 0) as tt_common_commission_rate
         from thirtpart.ly_link l
         join thirtpart.ly_responsibility_person p on l.responsibility_person_id = p.id
         left join thirtpart.ly_official_accounts a on l.official_account_id = a.id
         left join thirtpart.ly_applet la on a.applet_id = la.id
-        where p.is_distributor = 1
-        )t2 on t1.link_id = t2.link_id
+        left join (select company_id, scale, ifnull(commission_scale, 10) as commission_scale from thirtpart.ly_responsibility_person_scale where source=7
+        and #{st} &gt;= start_time and #{st} &lt;= end_time
+        ) scale_wx_virtual on p.company_id = scale_wx_virtual.company_id
+        left join (select company_id, scale, ifnull(commission_scale, 1) as commission_scale from thirtpart.ly_responsibility_person_scale where source=1
+        and #{st} &gt;= start_time and #{st} &lt;= end_time
+        ) scale_wx_common on p.company_id = scale_wx_virtual.company_id
+        left join (select company_id, scale, ifnull(commission_scale, 1) as commission_scale from thirtpart.ly_responsibility_person_scale where source=2
+        and #{st} &gt;= start_time and #{st} &lt;= end_time
+        ) scale_tt_common on p.company_id = scale_tt_common.company_id
+        where p.is_distributor = 1 or p.pid in (select id from thirtpart.ly_responsibility_person where is_distributor=1)
+        group by 1,2,3,4,5,6,7,8,9,10,11
+        ) t2 on t1.link_id = t2.link_id
         left join
         (
-        select consume_date,link_id,ifnull(sum(total_fee), 0) all_pay_amount
+        select consume_date,link_id,pay_merchant, sum(total_fee) all_pay_amount
         from thirtpart.ly_pay_record p
         where consume_date=#{dateLong} and status=1
-        group by 1,2
-        )t3 on t1.stat_date = t3.consume_date and t1.link_id = t3.link_id
+        group by 1,2,3
+        )t3 on t1.stat_date = t3.consume_date and t1.link_id = t3.link_id and t1.pay_merchant=t3.pay_merchant
         left join
         (
-        select date_format(refund_time,'%Y%m%d') refund_date,link_id,ifnull(sum(refund_price), 0) refund_amount
+        select date_format(refund_time,'%Y%m%d') refund_date,link_id, pay_merchant, sum(refund_price) refund_amount
         from thirtpart.ly_refund_record r
         where refund_time &gt;= concat(#{dateStr}, ' 00:00:00') and refund_time &lt;= concat(#{dateStr}, ' 23:59:59')
         and status = 1
-        group by 1,2
-        )t4 on t1.stat_date = t4.refund_date and t1.link_id = t4.link_id
+        group by 1,2,3
+        )t4 on t1.stat_date = t4.refund_date and t1.link_id = t4.link_id and t1.pay_merchant=t4.pay_merchant
+        group by consume_date, t2.person_id) tb
+
     </insert>
+    <select id="runCPSIaaDySettlementData" resultType="com.alibaba.fastjson.JSONObject">
+        select stat_date, link_id, app_id, person_id, person_pid, company_id,
+        ad_total_income,
+        ad_total_income*scale/100.0 ad_settlement_amount,
+        ad_original_income, ad_platform_subsidy, pre_ecpm,
+        concat(round(if(ad_total_income=0, 0, (pre_ecpm-ad_total_income)/ad_total_income)*100, 2), '%') data_gap
+        from
+        (select t1.stat_date,t1.link_id,t1.app_id,t1.person_id,t1.person_pid, t1.company_id,ifnull(t1.scale,0) scale,
+        link_cost/100000/0.7 pre_ecpm,
+        (ifnull(income,0) + ifnull(incentive_fund_cost,0))/100*(link_cost/all_cost) ad_total_income,
+        income/100*(link_cost/all_cost) ad_original_income,
+        incentive_fund_cost/100*(link_cost/all_cost) ad_platform_subsidy
+        from
+        (
+        select stat_date,app_id,link_id,ll.responsibility_person_id as person_id, lrp.pid as person_pid, lrp.company_id, scale.scale, sum(cost) link_cost
+        from media_api.bytedance_webhook_ma_ecpm bwme
+        left join tidb.thirtpart.ly_link ll on bwme.link_id=ll.id
+        left join tidb.thirtpart.ly_responsibility_person lrp on ll.responsibility_person_id=lrp.id
+        left join (select company_id, scale, ifnull(commission_scale, 10) as commission_scale from tidb.thirtpart.ly_responsibility_person_scale
+        where source=9 and #{st} &gt;= start_time and #{st} &lt;= end_time
+        ) scale on lrp.company_id = scale.company_id
+        where stat_date = #{dateLong} and link_id is not null
+        and (lrp.is_distributor=1 or lrp.pid in (select id from tidb.thirtpart.ly_responsibility_person where is_distributor=1))
+        group by 1,2,3,4,5,6,7
+        )t1
+        left join
+        (
+        select stat_date,app_id,sum(cost) all_cost
+        from media_api.bytedance_webhook_ma_ecpm bwme
+        where stat_date = #{dateLong}
+        group by 1,2
+        )t2 on t1.stat_date = t2.stat_date and t1.app_id = t2.app_id
+        left join
+        (
+        select stat_date,ma_appid,income,incentive_fund_cost
+        from tidb.media_api.bytedance_miniapp_ad_income
+        where stat_date = #{dateLong}
+        )t3 on t1.stat_date = t3.stat_date and t1.app_id = t3.ma_appid
+        )tb
+    </select>
+    <select id="runCPSIaaWxSettlementData" resultType="com.alibaba.fastjson.JSONObject">
+        select stat_date, link_id, app_id, person_id, person_pid, company_id,
+        ad_total_income, ad_play_user_count,
+        ad_total_income*scale/100.0 ad_settlement_amount
+        from
+        (select t1.stat_date, t1.link_id,t1.app_id, lrp.id as person_id, lrp.pid as person_pid, lrp.company_id, scale.scale,
+        (ifnull(income,0))/100*(link_count/all_count) ad_total_income,
+        ifnull(user_count, 0) ad_play_user_count
+        from (
+        select m.stat_date,m.app_id,coalesce(m.link_id,t1.link_id,u.link_id) link_id, count(*) link_count,
+        count(distinct m.login_id) user_count
+        from hr_playlet.mp_event m
+        left join
+        (
+        select app_id,uid, link_id
+        from (
+        select app_id,uid, link_id,row_number() over (partition by app_id,uid order by created_at ) r
+        from hr_playlet.server_event se
+        where stat_date = #{dateLong} and event = 'ACTIVATION' and link_id is not null
+        )t  where r = 1
+        )t1 on m.app_id = t1.app_id and m.login_id = t1.uid
+        left join hr_playlet.user_event u on m.app_id = u.app_id and m.login_id= u.uid
+        where m.stat_date = #{dateLong} and media_type = 'wx' and event = 'ADSHOW'
+        and coalesce(m.link_id,t1.link_id,u.link_id) is not null
+        group by 1,2,3
+        )t1
+        left join
+        (
+        select m.stat_date,m.app_id,count(*) all_count
+        from hr_playlet.mp_event m
+        where m.stat_date = #{dateLong} and media_type = 'wx' and event = 'ADSHOW'
+        group by 1,2
+        )t2 on t1.stat_date = t2.stat_date and t1.app_id = t2.app_id
+        left join
+        (
+        select stat_date,app_id,sum(income) income
+        from tidb.media_api.adq_publisher_adunit_general
+        where stat_date = #{dateLong}
+        group by 1,2
+        )t3 on t1.stat_date = t3.stat_date and t1.app_id = t3.app_id
+        left join tidb.thirtpart.ly_link ll on t1.link_id=ll.id
+        left join tidb.thirtpart.ly_responsibility_person lrp on ll.responsibility_person_id=lrp.id
+        left join (select company_id, scale, ifnull(commission_scale, 10) as commission_scale from tidb.thirtpart.ly_responsibility_person_scale
+        where source=8 and #{st} &gt;= start_time and #{st} &lt;= end_time
+        ) scale on lrp.company_id = scale.company_id
+        where link_id is not null
+        )tb
+    </select>
+
+
+
+    <update id="saveIaaWxSettlementData">
+        replace into deepthink.distrubution_iaa_weixin_settlement
+        (stat_date, link_id, app_id, person_id, person_pid, company_id,
+        ad_total_income, ad_play_user_count, ad_settlement_amount)
+        values
+        <foreach collection="list" item="item" separator=",">
+            (
+            #{item.stat_date},
+            #{item.link_id},
+            #{item.app_id},
+            #{item.person_id},
+            #{item.person_pid},
+            #{item.company_id},
+            #{item.ad_total_income},
+            #{item.ad_play_user_count},
+            #{item.ad_settlement_amount}
+            )
+        </foreach>
+    </update>
+    <update id="saveIaaDySettlementData">
+        replace into deepthink.distrubution_iaa_douyin_settlement
+        (stat_date, link_id, app_id, person_id, person_pid, company_id,
+        ad_total_income, ad_settlement_amount, ad_original_income, ad_platform_subsidy, pre_ecpm, data_gap)
+        <foreach collection="list" item="item" separator=",">
+            (
+            #{item.stat_date},
+            #{item.link_id},
+            #{item.app_id},
+            #{item.person_id},
+            #{item.person_pid},
+            #{item.company_id},
+            #{item.ad_total_income},
+            #{item.ad_settlement_amount},
+            #{item.ad_original_income},
+            #{item.ad_platform_subsidy},
+            #{item.pre_ecpm},
+            #{item.data_gap}
+            )
+        </foreach>
+    </update>
 </mapper>

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/ICPSReportService.java

@@ -5,5 +5,5 @@ public interface ICPSReportService {
     void cleanCPSDailyReports(String nowDate);
 
 
-    void runCPSIapSettlementData(String nowDate);
+    void runCPSSettlementData(String nowDate);
 }

+ 24 - 2
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/CPSReportServiceImpl.java

@@ -2,10 +2,15 @@ package cn.com.ctop.job.bytedance.data.service.impl;
 
 import cn.com.ctop.job.bytedance.data.mapper.CPSReportMapper;
 import cn.com.ctop.job.bytedance.data.service.ICPSReportService;
+import cn.com.ctop.job.bytedance.data.utils.DateUtils;
+import com.alibaba.fastjson.JSONObject;
 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 CPSReportServiceImpl implements ICPSReportService {
@@ -25,11 +30,28 @@ public class CPSReportServiceImpl implements ICPSReportService {
     }
 
     @Override
-    public void runCPSIapSettlementData(String nowDate) {
+    public void runCPSSettlementData(String nowDate) {
         try {
+            //根据nowDate获取这一天开始和结束的时间戳(10位)
+            Date date = DateUtils.getDateByPattern(nowDate, "yyyy-MM-dd");
+            Long st = date.getTime() / 1000 + 3600;
             String dateLong = nowDate.replaceAll("-", "");
-            int count = cpsReportMapper.runCPSIapSettlementData(nowDate, dateLong);
+            int count = cpsReportMapper.runCPSIapSettlementData(nowDate, dateLong, st);
             log.info("CPSIAP结算数据处理完成,影响行数:{}", count);
+            List<JSONObject> dyList =cpsReportMapper.runCPSIaaDySettlementData(nowDate, dateLong, st);
+            count = dyList==null ? 0: dyList.size();
+            if (count>0){
+                cpsReportMapper.saveIaaDySettlementData(dyList);
+            }
+            log.info("CPSIaa(抖音)结算数据处理完成,影响行数:{}", count);
+            List<JSONObject> wxList = cpsReportMapper.runCPSIaaWxSettlementData(nowDate, dateLong, st);
+            count = wxList==null ? 0: wxList.size();
+            if (count>0){
+                cpsReportMapper.saveIaaWxSettlementData(wxList);
+            }
+            log.info("CPSIaa(微信)结算数据处理完成,影响行数:{}", count);
+            count = cpsReportMapper.runCPSDysSettlementData(nowDate, dateLong, st);
+            log.info("CPSDYS结算数据处理完成,影响行数:{}", count);
         } catch (Exception e) {
             e.printStackTrace();
             log.error("CPSIAP结算数据处理异常");

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/CPSReportJob.java

@@ -57,7 +57,7 @@ public class CPSReportJob {
         log.info("[runCPSIapSettlementData] 任务启动...");
         try {
             String nowDate = DateUtils.getNowDate("yyyy-MM-dd");
-            cpsReportService.runCPSIapSettlementData(nowDate);
+            cpsReportService.runCPSSettlementData(nowDate);
             log.info("[runCPSIapSettlementData] 任务完成");
         } catch (Exception e) {
             e.printStackTrace();