Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

yumeng před 1 rokem
rodič
revize
bab4f7712b

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

@@ -68,6 +68,7 @@
         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 or (payinfo.sort is not null and maxpay>0))
         and video.source=1 and video.created_at > 1743436800
+        and video.created_at > unix_timestamp(date_sub(now(), interval 3 day))
     </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,

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

@@ -173,6 +173,7 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
         //IAP
         List<JSONObject> iapPlatformList = bytedanceProductUpdateMapper.getIAPPlatformList(); //商品库列表
         List<JSONObject> iapVideoList = bytedanceProductUpdateMapper.getIAPVideoList(); //剧目列表
+        System.out.println("待上传付费商品数: " + iapVideoList.size());
         List<JSONObject> iapProductTypeEnums = bytedanceProductUpdateMapper.getIAPProductTypeEnums(); //商品类型
         Map<String, Map<String, String>> advertiserToLinkMap = new HashMap<>();
 
@@ -465,10 +466,10 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
         Map<String, String> res = new HashMap<>(reqAlbumIds.size());
 
         List<JSONObject> unfound = new ArrayList<>(requests);
-        for (int page=1; page<60; page++){
+        for (int page=1; page<=5; page++){
             JSONArray playletDetailInfo = getPlayletDetail(advertiserId, accessToken, instanceId, errorBlanket,page);
             if (playletDetailInfo == null || playletDetailInfo.isEmpty()){
-                return null;
+                break;
             }
             for (int i = 0; i < playletDetailInfo.size(); i++) {
                 JSONObject obj = playletDetailInfo.getJSONObject(i);
@@ -485,6 +486,11 @@ public class BytedanceProductUpdateServiceImpl implements IBytedanceProductUpdat
             if (unfound.isEmpty()){
                 break;
             }
+            try {
+                Thread.sleep(500);
+            }catch (Exception ignored){
+
+            }
         }
 
         if (unfound.isEmpty()){