From f537abe9f3646c739beaf15076246a2f71a347e9 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 20 二月 2025 16:57:55 +0800
Subject: [PATCH] IOS广告增加区域屏蔽

---
 src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java |   74 +++++++++++++++++++++++++++++++++++--
 1 files changed, 70 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java b/src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java
index d795451..4d730e4 100644
--- a/src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java
+++ b/src/main/java/com/yeshi/buwan/util/JuHe/VideoResourceUtil.java
@@ -1,7 +1,13 @@
 package com.yeshi.buwan.util.JuHe;
 
-import com.yeshi.buwan.domain.DetailSystem;
+import com.yeshi.buwan.domain.system.DetailSystem;
+import com.yeshi.buwan.service.imp.DetailSystemConfigService;
+import com.yeshi.buwan.service.inter.video.VideoResourcePlayVersionMapService;
 import com.yeshi.buwan.service.inter.video.VideoResourceVersionMapService;
+import com.yeshi.buwan.util.Constant;
+import com.yeshi.buwan.util.config.SystemConfigUtil;
+import com.yeshi.buwan.videos.funtv.FunTVUtil;
+import net.sf.json.JSONObject;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Component;
 
@@ -14,15 +20,75 @@
     @Resource
     private VideoResourceVersionMapService videoResourceVersionMapService;
 
-    @Cacheable(value = "homeCache", key = "'getAvailableResourceIds-'+'-'+#detailSystem.id+'-'+#versionCode")
-    public List<Long> getAvailableResourceIds(DetailSystem detailSystem, int versionCode) {
-        List<String> ridList = videoResourceVersionMapService.listResourceId(detailSystem.getId(), versionCode);
+    @Resource
+    private VideoResourcePlayVersionMapService videoResourcePlayVersionMapService;
+
+    @Resource
+    private DetailSystemConfigService detailSystemConfigService;
+
+    @Cacheable(value = "homeCache", key = "'getAvailableResourceIds-'+'-'+#detailSystem.id+'-'+#versionCode+'-'+#channel")
+    public List<Long> getAvailableResourceIds(DetailSystem detailSystem, int versionCode,String channel) {
+        List<String> ridList = videoResourceVersionMapService.listResourceId(detailSystem.getId(), versionCode,channel.toLowerCase());
+//        if (detailSystem.getId().equalsIgnoreCase("43") && versionCode > 83) {
+//            ridList = new ArrayList<>();
+////            ridList.add("19");
+////            ridList.add("24");
+//            ridList.add("25");
+//        }
+        ridList.remove(25+"");
+        ridList.remove(28+"");
+        if(Constant.IS_HAVE_FIRST_ONLINE) {
+            ridList.add(FunTVUtil.RESOURCE_ID + "");
+            //鏄惁鏄娆′笂绾�
+            String firstOnLineValue =  detailSystemConfigService.getConfigValueByKey("first_online_versions",detailSystem.getId(), versionCode);
+            if( SystemConfigUtil.isFirstOnLine(firstOnLineValue, channel, versionCode)){
+                // 棣栨涓婄嚎瑕佹墦寮�椋庤
+                ridList.add(FunTVUtil.RESOURCE_ID+"");
+            }
+        }
+        //闊╁墽涓婄嚎鐨勬椂鍊欓渶瑕佹墦寮�
+//        if(detailSystem.getId().equalsIgnoreCase("51")){
+//            ridList.add("28");
+//        }
+
+//        ridList.clear();
+//        ridList.add("13");
+//        ridList.add("22");
+
         List<Long> ids = new ArrayList<>();
         if (ridList != null) {
             for (String id : ridList) {
                 ids.add(Long.parseLong(id));
             }
         }
+
+        return ids;
+    }
+
+
+    @Cacheable(value = "homeCache", key = "'getAvailablePlayResourceIds-'+'-'+#detailSystem.id+'-'+#versionCode+'-'+#channel")
+    public List<Long> getAvailablePlayResourceIds(DetailSystem detailSystem, int versionCode,String channel) {
+        List<String> ridList = videoResourcePlayVersionMapService.listResourceId(detailSystem.getId(), versionCode,channel.toLowerCase());
+        // 闊╁墽涓婄嚎闇�瑕佹墦寮�娉ㄩ噴
+//        if(detailSystem.getId().equalsIgnoreCase("51")){
+//            ridList.add("28");
+//        }
+        // 棣栨涓婄嚎瑕佹墦寮�椋庤
+        if(Constant.IS_HAVE_FIRST_ONLINE) {
+            ridList.add(FunTVUtil.RESOURCE_ID + "");
+            String firstOnLineValue = detailSystemConfigService.getConfigValueByKey("first_online_versions", detailSystem.getId(), versionCode);
+            if (SystemConfigUtil.isFirstOnLine(firstOnLineValue, channel, versionCode)) {
+                ridList.add(FunTVUtil.RESOURCE_ID + "");
+            }
+        }
+
+        List<Long> ids = new ArrayList<>();
+        if (ridList != null) {
+            for (String id : ridList) {
+                ids.add(Long.parseLong(id));
+            }
+        }
+
         return ids;
     }
 

--
Gitblit v1.8.0