zhaotx 1 vuosi sitten
vanhempi
commit
7fd2c9865e

+ 2 - 2
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/BytedanceProductUpdateMapper.xml

@@ -29,14 +29,14 @@
         FROM deepthink.bytedance_product_main_advertiser t1
         left join deepthink.bytedance_advertiser_list t2 on t1.advertiser_id=t2.advertiser_id
         left join deepthink.bytedance_auth_list t3 on t2.admin_advertiser_id=t3.admin_advertiser_id
-        where t1.`type`=2 and t1.`_status`=0 and platform_type=1
+        where t1.`type`=2 and t1.`_status`=0 and platform_type=1 and t1.mini_instance_id is not null
     </select>
     <select id="getIAAPlatformList" resultType="com.alibaba.fastjson.JSONObject">
         select t1.*, t3.access_token
         FROM deepthink.bytedance_product_main_advertiser t1
         left join deepthink.bytedance_advertiser_list t2 on t1.advertiser_id=t2.advertiser_id
         left join deepthink.bytedance_auth_list t3 on t2.admin_advertiser_id=t3.admin_advertiser_id
-        where t1.`type`=1 and t1.`_status`=0 and platform_type=1
+        where t1.`type`=1 and t1.`_status`=0 and platform_type=1 and t1.mini_instance_id is not null
     </select>
     <select id="getIAPVideoList" resultType="com.alibaba.fastjson.JSONObject">
         select third.album_id, third.platform_type, detail.platform_config, video.id as video_id, detail.id as video_detail_id, video.name as name, video.cover_img as img,ifnull(category.name, '其他') as 'theme', video.play_platform,

+ 29 - 29
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/ReportsAdPushMapper.xml

@@ -53,7 +53,7 @@
         FROM
             (select sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
              from application.media_ad_report_daily
-             where stat_date = ${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+             where stat_date = ${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
             ) tb1,
             (select sum(pay_amount) as pay_amount,
                     sum(iaa_amount) as iaa_amount,
@@ -61,7 +61,7 @@
                     sum(share_pay_amount) as share_pay_amount,
                     sum(share_iaa_amount) as share_iaa_amount
              from application.user_data_report_daily
-             where stat_date = ${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+             where stat_date = ${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
             ) tb2
     </select>
     <select id="adHourData" resultType="java.util.Map">
@@ -75,13 +75,13 @@
         from
         (select sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount
         from application.media_ad_report_hourly
-        where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         ) tb1,
         (select sum(pay_amount) as pay_amount, sum(iaa_amount) as iaa_amount,
         sum(share_iaa_amount_3) as share_iaa_amount_3,
         sum(share_iaa_amount) as share_iaa_amount, sum(share_pay_amount) as share_pay_amount
         from application.user_data_report_hourly
-        where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         ) tb2
     </select>
     <select id="tmpTopMovie" resultType="java.util.Map">
@@ -94,8 +94,8 @@
         concat(round(if(ifnull(sum(iaa_real_cost_amount),0)=0, 0, sum(share_iaa_amount_3)/sum(iaa_real_cost_amount)*100), 2), '%') AS iaa_roi,
         concat(round(if(ifnull(sum(iap_real_cost_amount),0)=0, 0, sum(share_pay_amount)/sum(iap_real_cost_amount)*100), 2), '%') AS iap_roi
         from
-        (select product_id from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
-        union select movie_id from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        (select product_id from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
+        union select movie_id from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         ) tb1
         left join
         (select product_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
@@ -104,12 +104,12 @@
         sum(iaa_real_cost_amount)+sum(iap_real_cost_amount) as real_cost_amount
         from
         (select product_id, round(ifnull(sum(cost_amount),0),2) as iaa_cost_amount, sum(real_cost_amount) as iaa_real_cost_amount, 0 as iap_cost_amount, 0 as iap_real_cost_amount
-        from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8) and business_method='IAA')
+        from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11) and business_method='IAA')
         group by product_id
         union all
         select product_id, 0 as iaa_cost_amount, 0 as iaa_real_cost_amount,
         round(ifnull(sum(cost_amount),0),2) as cost_amount, sum(real_cost_amount) as real_cost_amount
-        from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8) and business_method='IAP')
+        from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11) and business_method='IAP')
         group by product_id) subt2
         group by product_id
         ) tb2 on tb1.product_id=tb2.product_id
@@ -119,7 +119,7 @@
         ifnull(sum(share_pay_amount), 0) as share_pay_amount,
         ifnull(sum(share_iaa_amount), 0) as share_iaa_amount,
         round(ifnull(sum(share_iaa_amount_3), 0),2) as share_iaa_amount_3
-        from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by movie_id
         ) tb3 on tb1.product_id=tb3.movie_id
         left join
@@ -143,13 +143,13 @@
         from
         (select sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
         from application.media_ad_report_daily
-        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         ) tb1,
         (select sum(pay_amount) as pay_amount, sum(iaa_amount) as iaa_amount,
         sum(share_iaa_amount) as share_iaa_amount, sum(share_pay_amount) as share_pay_amount,
         sum(share_iaa_amount_3) as share_iaa_amount_3
         from application.user_data_report_daily
-        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         ) tb2
     </select>
 
@@ -165,8 +165,8 @@
         concat(round(if(ifnull(sum(iap_real_cost_amount),0)=0, 0, sum(share_pay_amount)/sum(iap_real_cost_amount)*100), 2), '%') AS iap_roi,
         round(ifnull(sum(hour_cost_amount), 0), 2) as hour_cost_amount
         from
-        (select product_id from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
-        union select movie_id from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))) tb1
+        (select product_id from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
+        union select movie_id from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))) tb1
         left join
         (
         select product_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
@@ -175,11 +175,11 @@
         sum(iaa_real_cost_amount)+sum(iap_real_cost_amount) as real_cost_amount
         from
         (select product_id, round(ifnull(sum(cost_amount),0),2) as iaa_cost_amount, sum(real_cost_amount) as iaa_real_cost_amount, 0 as iap_cost_amount, 0 as iap_real_cost_amount
-        from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8) and business_method='IAA')
+        from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11) and business_method='IAA')
         group by product_id
         union all
         select product_id, 0 as iaa_cost_amount, 0 as iaa_real_cost_amount,round(ifnull(sum(cost_amount),0),2) as cost_amount, sum(real_cost_amount) as real_cost_amount
-        from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8) and business_method='IAP')
+        from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11) and business_method='IAP')
         group by product_id) subt2
         group by product_id
         ) tb2 on tb1.product_id=tb2.product_id
@@ -188,7 +188,7 @@
         sum(share_iaa_amount_3) as share_iaa_amount_3,
         ifnull(sum(share_iaa_amount), 0) as share_iaa_amount,
         ifnull(sum(share_pay_amount), 0) as share_pay_amount
-        from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by movie_id
         ) tb3 on tb1.product_id=tb3.movie_id
         left join
@@ -196,7 +196,7 @@
         ) tb4 on tb1.product_id=tb4.moive_id
         left join
         (select product_id, ifnull(sum(cost_amount), 0) as hour_cost_amount from application.media_product_report_hourly
-        where stat_date=${date} and `hour`=${hour}  and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        where stat_date=${date} and `hour`=${hour}  and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by product_id) tb5 on tb1.product_id=tb5.product_id
         where 1=1 and tb1.product_id != '-9999'
         group by tb4.standard_movie_name
@@ -220,11 +220,11 @@
         sum(iaa_real_cost_amount)+sum(iap_real_cost_amount) as real_cost_amount
         FROM
         (select advertiser_id, round(ifnull(sum(cost_amount),0),2) as iaa_cost_amount, sum(real_cost_amount) as iaa_real_cost_amount, 0 as iap_cost_amount, 0 as iap_real_cost_amount
-        from application.media_ad_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8) and business_method='IAA')
+        from application.media_ad_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11) and business_method='IAA')
         group by advertiser_id
         UNION ALL
         select advertiser_id, 0 as iaa_cost_amount, 0 as iaa_real_cost_amount,round(ifnull(sum(cost_amount),0),2) as iap_cost_amount, sum(real_cost_amount) as iap_real_cost_amount
-        from application.media_ad_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8) and business_method='IAP')
+        from application.media_ad_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11) and business_method='IAP')
         group by advertiser_id)subtb2
         group by advertiser_id
         ) tb2
@@ -233,7 +233,7 @@
         round(ifnull(sum(share_iaa_amount_3), 0),2) as share_iaa_amount_3,
         sum(share_iaa_amount) as share_iaa_amount,
         sum(share_pay_amount) as share_pay_amount
-        from application.user_data_report_daily where stat_date=${date}  and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        from application.user_data_report_daily where stat_date=${date}  and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by advertiser_id) tb3
         on tb1.advertiser_id = tb3.advertiser_id
         left join (select user_id, nick_name, phonenumber, dept_id from tidb.deepthink.sys_user) tb4
@@ -256,13 +256,13 @@
         left join
         (select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
         from application.media_ad_report_daily
-        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by advertiser_id) tb2 on tb1.advertiser_id = tb2.advertiser_id
         left join
         (select advertiser_id, sum(pay_amount) as pay_amount, sum(iaa_amount) as iaa_amount,
         sum(share_iaa_amount) as share_iaa_amount, sum(share_pay_amount) as share_pay_amount
         from application.user_data_report_daily
-        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by advertiser_id) tb3 on tb1.advertiser_id = tb3.advertiser_id
         left join (select user_id, nick_name, phonenumber, dept_id from tidb.deepthink.sys_user) tb4
         on tb1.user_id=tb4.user_id
@@ -280,13 +280,13 @@
         left join
         (select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
         from application.media_ad_report_hourly
-        where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by advertiser_id) tb2 on tb1.advertiser_id = tb2.advertiser_id
         left join
         (select advertiser_id, sum(pay_amount) as pay_amount, sum(iaa_amount) as iaa_amount,
         sum(share_iaa_amount) as share_iaa_amount, sum(share_pay_amount) as share_pay_amount
         from application.user_data_report_hourly
-        where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by advertiser_id) tb3 on tb1.advertiser_id = tb3.advertiser_id
         left join (select user_id, nick_name, phonenumber from tidb.deepthink.sys_user) tb4
         on tb1.user_id=tb4.user_id
@@ -303,11 +303,11 @@
         from
         (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info) tb1
         left join (select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount
-        from application.media_ad_report_daily where stat_date=#{date}  and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        from application.media_ad_report_daily where stat_date=#{date}  and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by advertiser_id) tb2
         on tb1.advertiser_id = tb2.advertiser_id
         left join (select advertiser_id, sum(cost_amount) as cost_amount_hour
-        from application.media_ad_report_hourly where stat_date=#{date} and `hour`= ${hour}  and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        from application.media_ad_report_hourly where stat_date=#{date} and `hour`= ${hour}  and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by advertiser_id) tb3
         on tb1.advertiser_id = tb3.advertiser_id
         left join (select user_id, nick_name, phonenumber, dept_id from tidb.deepthink.sys_user) tb4
@@ -398,11 +398,11 @@
         sum(iaa_real_cost_amount)+sum(iap_real_cost_amount) as real_cost_amount
         FROM
         (select advertiser_id, round(ifnull(sum(cost_amount),0),2) as iaa_cost_amount, sum(real_cost_amount) as iaa_real_cost_amount, 0 as iap_cost_amount, 0 as iap_real_cost_amount
-        from application.media_ad_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8) and business_method='IAA')
+        from application.media_ad_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11) and business_method='IAA')
         group by advertiser_id
         UNION ALL
         select advertiser_id, 0 as iaa_cost_amount, 0 as iaa_real_cost_amount,round(ifnull(sum(cost_amount),0),2) as cost_amount, sum(real_cost_amount) as real_cost_amount
-        from application.media_ad_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8) and business_method='IAP')
+        from application.media_ad_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11) and business_method='IAP')
         group by advertiser_id)subtb2
         group by advertiser_id
         ) tb2
@@ -411,7 +411,7 @@
         round(ifnull(sum(share_iaa_amount_3), 0),2) as share_iaa_amount_3,
         ifnull(sum(share_iaa_amount), 0) as share_iaa_amount,
         sum(share_pay_amount) as share_pay_amount
-        from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8))
+        from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
         group by advertiser_id) tb3
         on tb1.advertiser_id = tb3.advertiser_id
         left join (select user_id, nick_name, phonenumber, dept_id from tidb.deepthink.sys_user) tb4

+ 58 - 30
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/BytedanceProductUpdateServiceImpl.java

@@ -38,7 +38,7 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
         iapProductUpdate(errors);
         log.info("付费商品库更新完成");
         log.info("免费商品库更新中...");
-        iaaProductUpdate(errors);
+//        iaaProductUpdate(errors);
         log.info("免费商品库更新完成");
         if (!Check.isNull(errors)){
             List<String> info = new ArrayList<>();
@@ -76,18 +76,20 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
                     String res = HttpUtils.httpPostRequest(url, body, headers);
                     System.out.println("授权结果: " + res);
                     JSONObject resObj = JSONObject.parseObject(res);
-                    int code = resObj.getIntValue("code");
+                    int code = resObj.getIntValue("err_no");
                     if (code != 0){
                         log.error("授权失败,code: " + code + ", msg: " + resObj.getString("message") + ", 社会信用代码: " + socialCreditCode);
                     }else {
                         JSONObject data = resObj.getJSONObject("data");
                         if (data.getBooleanValue("authed")){
-                            log.info("授权成功,社会信用代码: " + socialCreditCode + ", 企业名称: " + obj.getJSONArray("authed_corps").toJSONString());
+                            log.info("授权成功,社会信用代码: " + socialCreditCode + ", 企业名称: " + data.getJSONArray("authed_corps").toJSONString());
                             bytedanceProductUpdateMapper.updateMovieAuthStatus(obj.getString("platform_id"));
                         }
                     }
+                    Thread.sleep(4000);
                 }
             }catch (Exception e){
+                e.printStackTrace();
                 log.error("获取字节小程序access_token失败", e);
             }
         }
@@ -146,18 +148,18 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
 
             String res = HttpUtils.httpPostRequest(createLinkUrl, requestBody, headers);
             if (res == null || res.isEmpty()){
-                System.out.println("创建字节小程序失败");
-                return;
+                System.out.println("创建字节小程序失败,advertiser_id:"+advertiser_id);
             }else {
                 JSONObject jsonObject = JSONObject.parseObject(res);
+                System.out.println("创建字节小程序响应: " + jsonObject.toJSONString());
                 int code = jsonObject.getIntValue("code");
                 if (code != 0) {
-                    System.out.println("创建字节小程序失败,code: " + code + ", msg: " + jsonObject.getString("message"));
-                    break;
+                    System.out.println("创建字节小程序失败,advertiser_id: "+advertiser_id+",code: " + code + ", msg: " + jsonObject.getString("message"));
                 }else {
                     String instanceId = jsonObject.getJSONObject("data").getString("instance_id");
                     //更新表
                     bytedanceProductUpdateMapper.updateInstanceId(advertiser_id, instanceId);
+                    System.out.println("创建字节小程序成功,广告主ID: " + advertiser_id + ", 实例ID: " + instanceId);
                 }
             }
         }
@@ -178,11 +180,6 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
             String advertiserId = obj.getString("advertiser_id");
             String accessToken = obj.getString("access_token");
             String instanceId = obj.getString("mini_instance_id");
-            if (instanceId == null){
-                errorBlanket.add("没有找到字节小程序的实例ID: " + advertiserId);
-                System.out.println("没有找到字节小程序的实例ID: " + advertiserId);
-                continue;
-            }
             List<JSONObject> iapVideoDouyinList = iapVideoList.stream().filter(obj1 -> "1".equals(obj1.getString("platform_type"))).collect(Collectors.toList());
             Map<String, String> albumIdToLinkMap = getBytedancePlayletPromoteLink(advertiserId, accessToken, instanceId, iapVideoDouyinList, errorBlanket);
             advertiserToLinkMap.put(advertiserId, albumIdToLinkMap);
@@ -271,15 +268,35 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
         Map<String, String> linkObj = advertiserToLinkMap.get(platform.getString("advertiser_id"));
         String play_platform = album.getString("play_platform");
         List<String> ad_carrier = new ArrayList<>();
-        if (linkObj != null){
-            profession.put("micro_app_link", linkObj.get(album_id));
+//        if (linkObj != null){
+//            profession.put("micro_app_link", linkObj.get(album_id));
+//            ad_carrier.add("字节小程序");
+//            if (play_platform.contains("1")){
+//                if (bytedanceProductUpdateMapper.getWeixinAuditStatus(album.getLong("video_id"))>0){
+//                    ad_carrier.add("微信小程序");
+//                }
+//            }
+//        }else {
+//            profession.put("album_id", album_id);
+//            ad_carrier.add("微信小程序");
+//        }
+        Integer is_bytedance = platform.getInteger("is_bytedance");
+        Integer is_wechat = platform.getInteger("is_wechat");
+        Integer is_dys = platform.getInteger("is_dys");
+        if (is_bytedance == 1){
             ad_carrier.add("字节小程序");
-            if (play_platform.contains("1")){
-                ad_carrier.add("微信小程序");
-            }
+        }
+        if (is_wechat == 1){
+            ad_carrier.add("微信小程序");
+        }
+        if (is_dys == 1){
+            ad_carrier.add("端原生组件");
+        }
+
+        if (is_bytedance == 1){
+            profession.put("micro_app_link", linkObj.get(album_id));
         }else {
             profession.put("album_id", album_id);
-            ad_carrier.add("微信小程序");
         }
         profession.put("ad_carrier", JSON.toJSONString(ad_carrier));
 
@@ -315,11 +332,7 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
             String advertiserId = obj.getString("advertiser_id");
             String accessToken = obj.getString("access_token");
             String instanceId = obj.getString("mini_instance_id");
-            if (instanceId == null){
-                errorBlanket.add("没有找到字节小程序的实例ID: " + advertiserId);
-                System.out.println("没有找到字节小程序的实例ID: " + advertiserId);
-                continue; //todo
-            }
+
             List<JSONObject> iaaVideoDouyinList = iaaVideoList.stream().filter(obj1 -> "1".equals(obj1.getString("platform_type"))).collect(Collectors.toList());
             Map<String, String> albumIdToLinkMap = getBytedancePlayletPromoteLink(advertiserId, accessToken, instanceId, iaaVideoDouyinList, errorBlanket);
             advertiserToLinkMap.put(advertiserId, albumIdToLinkMap);
@@ -387,18 +400,33 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
         profession.put("membership_types", "5");
         profession.put("starting_unlock_episode", album.getString("starting_unlock_episode"));
         Map<String, String> linkObj = advertiserToLinkMap.get(platform.getString("advertiser_id"));
-        String play_platform = album.getString("play_platform");
         List<String> ad_carrier = new ArrayList<>();
-        if (linkObj != null){
-            profession.put("micro_app_link", linkObj.get(album_id));
+//        if (linkObj != null){
+//            profession.put("micro_app_link", linkObj.get(album_id));
+//            ad_carrier.add("字节小程序");
+//        }else {
+//            profession.put("album_id", album_id);
+//            ad_carrier.add("微信小程序");
+//        }
+        Integer is_bytedance = platform.getInteger("is_bytedance");
+        Integer is_wechat = platform.getInteger("is_wechat");
+        Integer is_dys = platform.getInteger("is_dys");
+        if (is_bytedance == 1){
             ad_carrier.add("字节小程序");
-            if (play_platform.contains("1")){
-                ad_carrier.add("微信小程序");
-            }
+        }
+        if (is_wechat == 1){
+            ad_carrier.add("微信小程序");
+        }
+        if (is_dys == 1){
+            ad_carrier.add("端原生组件");
+        }
+
+        if (is_bytedance == 1){
+            profession.put("micro_app_link", linkObj.get(album_id));
         }else {
             profession.put("album_id", album_id);
-            ad_carrier.add("微信小程序");
         }
+
         profession.put("ad_carrier", JSON.toJSONString(ad_carrier));
 
         product_info.put("profession", profession);

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

@@ -117,11 +117,11 @@ public class DateReportsPushServiceImpl implements IDateReportsPushService {
                 new Pair<>("cost_amount", "消耗金额"),
                 new Pair<>("end_amount", "结算金额"),
                 new Pair<>("pay_amount", "充值金额"),
-                new Pair<>("share_iaa_amount", "广告预估收入"),
+                new Pair<>("share_iaa_amount", "广告预估收入")
 //                new Pair<>("water_roi", "流水ROI"),
 //                new Pair<>("real_roi", "真实ROI"),
 //                new Pair<>("water_profit", "流水利润"),
-                new Pair<>("real_profit", "真实利润")
+//                new Pair<>("real_profit", "真实利润")
 //                new Pair<>("iaa_roi", "广告-ROI"),
 //                new Pair<>("iap_roi", "付费-ROI")
         );

+ 6 - 6
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/ReportsAdPushServiceImpl.java

@@ -56,10 +56,10 @@ public class ReportsAdPushServiceImpl implements IReportsAdPushService {
     public void test() {
         List<String> userIds = Arrays.asList(
                 "44fbaed6" //zhaotx
-//                ,"ebeeced9" //yumeng
-//                ,"58e7a98a"  //xsq
-//                ,"2ga9669f" //angaoqi
-//                ,"43gb7fbc" //huangpingkang
+                ,"ebeeced9" //yumeng
+                ,"58e7a98a"  //xsq
+                ,"2ga9669f" //angaoqi
+                ,"43gb7fbc" //huangpingkang
         );
         send(userIds);
     }
@@ -90,11 +90,11 @@ public class ReportsAdPushServiceImpl implements IReportsAdPushService {
                 new Pair<>("cost_amount", "消耗金额"),
                 new Pair<>("end_amount", "结算金额"),
                 new Pair<>("pay_amount", "充值金额"),
-                new Pair<>("share_iaa_amount", "广告预估收入"),
+                new Pair<>("share_iaa_amount", "广告预估收入")
 //                new Pair<>("water_roi", "流水ROI"),
 //                new Pair<>("real_roi", "真实ROI"),
 //                new Pair<>("water_profit", "流水利润"),
-                new Pair<>("real_profit", "真实利润")
+//                new Pair<>("real_profit", "真实利润")
         );
 
         JSONArray object_list_1 = new JSONArray();

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

@@ -105,11 +105,11 @@ public class ReportsByBusinessPushServiceImpl implements IReportsByBusinessPushS
                 new Pair<>("cost_amount", "消耗金额"),
                 new Pair<>("end_amount", "结算金额"),
                 new Pair<>("pay_amount", "充值金额"),
-                new Pair<>("iaa_amount", "广告预估收入"),
+                new Pair<>("iaa_amount", "广告预估收入")
 //                new Pair<>("water_roi", "流水ROI"),
 //                new Pair<>("real_roi", "真实ROI"),
 //                new Pair<>("water_profit", "流水利润"),
-                new Pair<>("real_profit", "真实利润")
+//                new Pair<>("real_profit", "真实利润")
         );
         JSONArray dateIndicatorTable = new JSONArray();
         for (Pair<String, String> column : columns) {