admin
2020-04-21 0b57cfd62e842b309d03467b96a331c673ecad7c
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ConfigController.java
@@ -45,6 +45,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;
@@ -101,18 +102,23 @@
   @Resource
   private UserInfoService userInfoService;
   @Resource
   private UserVIPInfoService userVIPInfoService;
   @Resource
   private UserVIPPreInfoService userVIPPreInfoService;
   @Resource
   private UserLevelUpgradedNotifyService userLevelUpgradedNotifyService;
   @Resource
   private UserVIPPreInfoService userVIPPreInfoService;
   @Resource
   private UserVIPInfoService userVIPInfoService;
   @Resource
   private ThreeSaleSerivce threeSaleSerivce;
   @Resource
   private UserVipConfigService userVipConfigService;
   /**
    * s 首页配置信息
@@ -365,6 +371,36 @@
               data.put("tearcherLink", tearcherLink);
            }
         }
         if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            // TODO 验证是否是导师
            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) {
               // 是否导师 TODO
               if (userVIPInfoService.isVIP(uid)) {
                  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", "升级会员");
               } 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", "升级超级会员");
                     }
                  }
               }
            }
            data.put("vip", inner);
         }
         if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()) && uid != null) {
            UserLevelUpgradedNotify notify = userLevelUpgradedNotifyService.getNeedNotifyByUid(uid);
@@ -383,16 +419,16 @@
                  data.put("vipUpgradedNotify", notifyVO);
               }
            }
         }
         out.print(JsonUtil.loadTrueResult(data));
      } catch (Exception e) {
         out.print(JsonUtil.loadFalseResult("获取失败"));
         e.printStackTrace();
      }
   }
   // 获取升级时间
   private Date getUpgradedTime(Long uid, UserLevelEnum level) {
@@ -402,7 +438,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();