admin
2020-05-19 744594ef1a2f530fc3e86ea9dc48b62247f79420
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,11 +46,13 @@
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;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.vo.homemodule.BannerVO;
import com.yeshi.fanli.vo.user.UserDialogBtnVO;
import com.yeshi.fanli.vo.user.UserDialogVO;
import com.yeshi.fanli.vo.user.VIPUpgradedNotifyVO;
@@ -101,11 +104,10 @@
   @Resource
   private UserInfoService userInfoService;
   @Resource
   private UserVIPInfoService userVIPInfoService;
   @Resource
   private UserVIPPreInfoService userVIPPreInfoService;
@@ -114,6 +116,9 @@
   @Resource
   private ThreeSaleSerivce threeSaleSerivce;
   @Resource
   private UserVipConfigService userVipConfigService;
   /**
    * s 首页配置信息
@@ -324,12 +329,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正在上线版本
            if ("ios".equalsIgnoreCase(acceptData.getPlatform())
                  && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) {
               data.put("banner", new JSONArray());
            } else {
               // 我的界面banner
               List<BannerVO> banner = swiperPictureService.getByBannerCardAndVersion("my_interface_banner",
                     acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
               if (banner == null)
                  banner = new ArrayList<BannerVO>();
               data.put("banner", JsonUtil.getApiCommonGson().toJson(banner));
            }
         }
         if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
@@ -366,24 +377,24 @@
               data.put("tearcherLink", tearcherLink);
            }
         }
         if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            // TODO 验证是否是导师
            UserVIPPreInfo info = userVIPPreInfoService.getLatestProcessInfo(uid);
            JSONObject inner = new JSONObject();
            inner.put("link", "https://www.baidu.com/");
            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) {
               // 是否导师 TODO
               if (userVIPInfoService.isVIP(uid)) {
                  inner.put("link", "https://www.baidu.com/");
               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", "拿五险与津贴 享导师权益");
                  inner.put("btnName", "升级会员");
                  if (info.getProcess() == UserVIPPreInfo.PROCESS_4)
                     inner.put("btnName", "板栗快省");
                  else
                     inner.put("btnName", "升级导师");
               } else {
                  UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
                  if (userVIPPreInfo != null) {
@@ -395,8 +406,15 @@
                  }
               }
            }
            data.put("vip", inner);
         }
            // IOS正在上线
            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);
@@ -422,9 +440,6 @@
         e.printStackTrace();
      }
   }
   // 获取升级时间
   private Date getUpgradedTime(Long uid, UserLevelEnum level) {
@@ -434,7 +449,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();