From 29bb04f5981562726febc3538dbb5bc394017273 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 09 五月 2020 21:41:47 +0800
Subject: [PATCH] 2.1.1相关功能提交
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java | 70 +++++++++++++++++++++++++++++------
1 files changed, 58 insertions(+), 12 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
index b5be310..f2a3b1f 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
@@ -7,6 +7,7 @@
import javax.annotation.Resource;
+import org.json.JSONArray;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -45,6 +46,7 @@
import com.yeshi.fanli.service.inter.user.vip.UserLevelUpgradedNotifyService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
+import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.ThreadUtil;
@@ -103,16 +105,19 @@
private UserInfoService userInfoService;
@Resource
- private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService;
+ private UserVIPInfoService userVIPInfoService;
@Resource
private UserVIPPreInfoService userVIPPreInfoService;
@Resource
- private UserVIPInfoService userVIPInfoService;
+ private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService;
@Resource
private ThreeSaleSerivce threeSaleSerivce;
+
+ @Resource
+ private UserVipConfigService userVipConfigService;
/**
* s 棣栭〉閰嶇疆淇℃伅
@@ -323,12 +328,18 @@
data.put("taoBaoCart", source);
if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
- // 鎴戠殑鐣岄潰banner
- List<SwiperPicture> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",
- acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
- if (banner == null)
- banner = new ArrayList<SwiperPicture>();
- data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
+ // IOS姝e湪涓婄嚎鐗堟湰
+ if ("ios".equalsIgnoreCase(acceptData.getPlatform())
+ && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
+ data.put("banner", new JSONArray());
+ } else {
+ // 鎴戠殑鐣岄潰banner
+ List<SwiperPicture> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",
+ acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
+ if (banner == null)
+ banner = new ArrayList<SwiperPicture>();
+ data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
+ }
}
if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
@@ -366,6 +377,44 @@
}
}
+ if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
+ UserVIPPreInfo info = userVIPPreInfoService.getLatestProcessInfo(uid);
+ JSONObject inner = new JSONObject();
+ inner.put("link", userVipConfigService.getValueByKey("vip_link"));
+ inner.put("ion", "http://img.flqapp.com/resource/vip/icon_vip.png");
+ inner.put("title", "鍏嶈垂鍗囩骇 浜細鍛樻潈鐩�");
+ inner.put("btnName", "鍗囩骇浼氬憳");
+
+ if (uid != null) {
+ if (info != null && info.getProcess() >= UserVIPPreInfo.PROCESS_3) {
+ inner.put("link", userVipConfigService.getValueByKey("vip_link"));
+ inner.put("ion", "http://img.flqapp.com/resource/vip/icon_tearcher.png");
+ inner.put("title", "鎷夸簲闄╀笌娲ヨ创 浜甯堟潈鐩�");
+ if (info.getProcess() == UserVIPPreInfo.PROCESS_4)
+ inner.put("btnName", "鏉挎牀蹇渷");
+ else
+ inner.put("btnName", "鍗囩骇瀵煎笀");
+ } else {
+ UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
+ if (userVIPPreInfo != null) {
+ if (userVIPPreInfo.getProcess() == UserVIPPreInfo.PROCESS_1) {
+ inner.put("btnName", "鍗囩骇楂樼骇浼氬憳");
+ } else if (userVIPPreInfo.getProcess() == UserVIPPreInfo.PROCESS_2) {
+ inner.put("btnName", "鍗囩骇瓒呯骇浼氬憳");
+ }
+ }
+ }
+ }
+ // IOS姝e湪涓婄嚎
+ if ("ios".equalsIgnoreCase(acceptData.getPlatform())
+ && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
+ } else
+ data.put("vip", inner);
+ // 骞冲彴瑙勫垯
+ String platformRuleLink = configService.get(ConfigKeyEnum.platformRule.getKey());
+ data.put("platformRule", platformRuleLink);
+ }
+
if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()) && uid != null) {
UserLevelUpgradedNotify notify = userLevelUpgradedNotifyService.getNeedNotifyByUid(uid);
if (notify != null) {
@@ -383,15 +432,12 @@
data.put("vipUpgradedNotify", notifyVO);
}
}
-
}
-
out.print(JsonUtil.loadTrueResult(data));
} catch (Exception e) {
out.print(JsonUtil.loadFalseResult("鑾峰彇澶辫触"));
e.printStackTrace();
}
-
}
// 鑾峰彇鍗囩骇鏃堕棿
@@ -402,7 +448,7 @@
if (vipInfo != null && vipInfo.getState() == UserVIPInfo.STATE_SUCCESS)
time = vipInfo.getSuccessTime();
- } else if (level == UserLevelEnum.highVIP || level == UserLevelEnum.normalVIP) {
+ } else if (level == UserLevelEnum.highVIP) {
UserVIPPreInfo info = userVIPPreInfoService.selectByUidAndProcess(uid, level.getLevel());
if (info != null)
time = info.getCreateTime();
--
Gitblit v1.8.0