From 42411e4a26461229c6bca6e89ca55e98a80f5a4e Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 30 九月 2021 18:08:17 +0800
Subject: [PATCH] bug修改

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java |   35 +++++++++++++++++------------------
 1 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
index decec1e..505e496 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
@@ -714,27 +714,26 @@
     @RequestMapping(value = "getShowAd")
     public void showAd(AcceptData acceptData, Long uid, PrintWriter out) {
         String value = configService.getValue(ConfigKeyEnum.showSplashAd.getKey(), acceptData.getSystem());
-        boolean huaweiShowAd = true;
-        if ("huawei".equalsIgnoreCase(acceptData.getChannel())) {
-            String version = configService.getValue(ConfigKeyEnum.huaweiOnLineVersionCode.getKey(), acceptData.getSystem());
-            if (!StringUtil.isNullOrEmpty(version)) {
-                if (Integer.parseInt(version) == Integer.parseInt(acceptData.getVersion())) {
-                    huaweiShowAd = false;
-                }
-            }
+        JSONObject configData = JSONObject.fromObject(value);
+        String channel = acceptData.getChannel().toLowerCase();
+        if (configData.optString(channel) == null) {
+            channel = "qq";
+        }
+        int version = configData.optInt(channel);
+        JSONObject data = new JSONObject();
+        boolean show;
+        if (Integer.parseInt(acceptData.getVersion()) >= version) {
+            show = false;
+        } else {
+            show = true;
         }
 
-        JSONObject data = new JSONObject();
-        if ("0".equalsIgnoreCase(value.trim())) {
+        if (show) {
+            data.put("show", true);
+            //鍔犺浇骞垮憡鏁版嵁
+            data.put("ad", configService.getValue(ConfigKeyEnum.gdtAdInfo, acceptData.getSystem()));
+        } else
             data.put("show", false);
-        } else {
-            if (huaweiShowAd) {
-                data.put("show", true);
-                //鍔犺浇骞垮憡鏁版嵁
-                data.put("ad", configService.getValue(ConfigKeyEnum.gdtAdInfo, acceptData.getSystem()));
-            } else
-                data.put("show", false);
-        }
         out.print(JsonUtil.loadTrueResult(data));
     }
 

--
Gitblit v1.8.0