Browse Source

商品库上传优化

zhaotx 1 year ago
parent
commit
132e8e784c

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

@@ -24,14 +24,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
+        where t1.`type`=2 and t1.`_status`=0 and platform_type=1
     </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
+        where t1.`type`=1 and t1.`_status`=0 and platform_type=1
     </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,
@@ -47,7 +47,7 @@
         LEFT JOIN (select * from thirtpart.ly_videos) video ON third.video_id = video.id
         LEFT JOIN thirtpart.ly_video_category category ON video.category_id = category.id
         LEFT JOIN (select video_id, min(sort) as sort, max(pay_amount/100.0) as maxpay, min(pay_amount/100.0) as minpay from thirtpart.ly_video_details where is_pay=1 group by video_id) payinfo ON video.id = payinfo.video_id
-        where video.is_free = 1
+        where video.is_free = 1 or (payinfo.sort is not null and maxpay>0)
     </select>
     <select id="getIAAVideoList" 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,

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

@@ -268,7 +268,7 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
                 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, iaaVideoList, errorBlanket);
+            Map<String, String> albumIdToLinkMap = getBytedancePlayletPromoteLink(advertiserId, accessToken, instanceId, iaaVideoDouyinList, errorBlanket);
             advertiserToLinkMap.put(advertiserId, albumIdToLinkMap);
         }
 
@@ -294,7 +294,7 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
                 }
                 int code = uploadIaaProduct(platform, obj, advertiserToLinkMap, errorBlanket, iaaProductTypeMap.get(theme));
                 if (code !=0){
-                    return;
+
                 }
 //                System.out.println(res);
 //                System.out.println("\n\n\n");
@@ -353,9 +353,9 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
         request.put("advertiser_id", platform.getLongValue("advertiser_id"));
         request.put("platform_id", platform.getLongValue("platform_id"));
 
-//                System.out.println("请求地址:" + url);
-//                System.out.println("请求头:" + headers);
-//                System.out.println("请求参数:" + request.toJSONString());
+                System.out.println("请求地址:" + url);
+                System.out.println("请求头:" + headers);
+                System.out.println("请求参数:" + request.toJSONString());
         String res = HttpUtils.httpPostRequest(url, request, headers);
         JSONObject btRes = JSONObject.parseObject(res);
         int code = btRes.getIntValue("code");