From b5e19564dcbf1b7ec12946209d74313479f9dfe1 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 24 十二月 2021 19:51:31 +0800
Subject: [PATCH] 布丸vivo上架兼容

---
 src/main/java/com/yeshi/buwan/controller/api/VideoPlayController.java |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/yeshi/buwan/controller/api/VideoPlayController.java b/src/main/java/com/yeshi/buwan/controller/api/VideoPlayController.java
index ca59293..9f6ad90 100644
--- a/src/main/java/com/yeshi/buwan/controller/api/VideoPlayController.java
+++ b/src/main/java/com/yeshi/buwan/controller/api/VideoPlayController.java
@@ -7,6 +7,7 @@
 import com.yeshi.buwan.domain.video.VideoWatchHistory;
 import com.yeshi.buwan.domain.vip.VideoBuyRecord;
 import com.yeshi.buwan.exception.ParamsException;
+import com.yeshi.buwan.service.imp.DetailSystemConfigService;
 import com.yeshi.buwan.videos.pptv.PPTVApiUtil;
 import com.yeshi.buwan.videos.pptv.PPTVUtil;
 import com.yeshi.buwan.videos.pptv.entity.PPTVProgram;
@@ -50,6 +51,9 @@
 
     @Resource
     private SystemConfigService systemConfigService;
+
+    @Resource
+    private DetailSystemConfigService detailSystemConfigService;
 
     @Resource
     private VIPService vipService;
@@ -276,7 +280,17 @@
         data.put("vipVideo", isVIPVideo);
         data.put("bought", isBought);
         data.put("canBuy", canBuy);
-        data.put("showInterstitialAd", true);
+
+
+        //鍗庝负鏄惁鍦ㄤ笂绾匡紝鍦ㄤ笂绾垮氨涓嶅睍绀�
+        String onLiningVersionInfo = detailSystemConfigService.getConfigValueByKey("ad_hw_online_version_info", acceptData.getDetailSystem().getId(), acceptData.getVersion());
+        net.sf.json.JSONObject onLiningVersionInfoJson = net.sf.json.JSONObject.fromObject(onLiningVersionInfo);
+        int onLiningVersionCode = onLiningVersionInfoJson.optInt("versionCode");
+
+        if ("huawei".equalsIgnoreCase(acceptData.getChannel()) && onLiningVersionCode <= acceptData.getVersion()) {
+            data.put("showInterstitialAd", false);
+        } else
+            data.put("showInterstitialAd", true);
         data.put("showPreVideoAd", false);
         if (pptvSeries != null)
             data.put("title", pptvSeries.getName());

--
Gitblit v1.8.0