admin
2020-07-14 eec7e789a87863c25d92c10ad5dfc22ad80c448d
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java
@@ -20,6 +20,7 @@
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.system.SystemClientParams;
import com.yeshi.fanli.exception.NotExistObjectException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
@@ -35,8 +36,10 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.account.UserUtil;
import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
import com.yeshi.fanli.vo.homemodule.BannerVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -102,8 +105,8 @@
         data.put("moneyLastMonth", "---");
      } else {
         // 我的队员
         long myFirstTeamCount = threeSaleSerivce.getFirstUsersCount(Long.parseLong(uid));
         long mySecondTeamCount = threeSaleSerivce.getSecondUsersCount(Long.parseLong(uid));
         long myFirstTeamCount = threeSaleSerivce.countFirstTeam(Long.parseLong(uid));
         long mySecondTeamCount = threeSaleSerivce.countSecondTeam(Long.parseLong(uid));
         long myTeamCount = myFirstTeamCount + mySecondTeamCount;
         data.put("myTeam", myTeamCount);
         // 1.5.0后已经不使用此字段
@@ -126,9 +129,10 @@
      data.put("activityRules", valueBr);
      data.put("inviteList", String.format("http://%s/%s/client/share/friends_new.html",
            Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
      List<SwiperPicture> pictureList = swiperPictureService.getByBannerCard("invite_top_banner");
      List<BannerVO> pictureList = swiperPictureService.getByBannerCardAndVersion("invite_top_banner",
            acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
      if (pictureList != null && pictureList.size() > 0) {
         SwiperPicture picture = pictureList.get(0);
         BannerVO picture = pictureList.get(0);
         com.alibaba.fastjson.JSONObject pictureJson = new com.alibaba.fastjson.JSONObject();
         pictureJson.put("src", picture.getSrc());
         pictureJson.put("jumpDetail", picture.getJumpDetail());
@@ -136,7 +140,7 @@
         data.put("topBanner", pictureJson);
      }
      data.put("desc", configService.get("invite_desc"));
      data.put("desc", configService.getValue(ConfigKeyEnum.inviteDesc.getKey(),acceptData.getSystem()));
      boolean hasCode = false;
      if (uid != null && uid.trim().length() > 0) {
@@ -148,7 +152,7 @@
      // 邀请激活链接
      if (!hasCode) {
         data.put("activationlink", configService.get("invite_activation_url"));
         data.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(),acceptData.getSystem()));
      }
      data.put("hasCode", hasCode);
@@ -164,7 +168,6 @@
    * 方法说明: 分享好友邀请图片
    * 
    * @author mawurui createTime 2018年4月3日 下午3:49:05
    * @param pageIndex
    * @param out
    * @param uid
    * @throws NotExistObjectException
@@ -181,8 +184,10 @@
      }
      // 邀请链接
//      String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
//            + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
      // String shortLink = HttpUtil.getShortLink("http://" +
      // Constant.wxGZConfig.getLoginHost() + "/"
      // + Constant.systemCommonConfig.getProjectName() +
      // "/client/threeShareNew?uid=" + uid);
      data.put("inviteLink", "http://a.app.qq.com/o/simple.jsp?pkgname=com.yeshi.ec.rebate");
      String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
@@ -201,7 +206,7 @@
      String valueN = values.getValue();
      String valueBr = valueN.replace("\n", "<br><br>");
      data.put("helpLink", configService.get("invite_help_link"));
      data.put("helpLink", configService.getValue(ConfigKeyEnum.inviteHelpLink.getKey(),acceptData.getSystem()));
      data.put("inviteRules", valueBr);
      out.print(JsonUtil.loadTrue(0, JsonUtil.getSimpleGson().toJson(data), "成功"));
@@ -216,7 +221,7 @@
   @RequestMapping(value = "getActivationTip")
   public void getActivationTip(AcceptData acceptData, String callback, PrintWriter out) {
      try {
         String tip = configService.get("invite_activation_tip");
         String tip = configService.getValue(ConfigKeyEnum.inviteActivationTip.getKey(),acceptData.getSystem());
         if (tip == null || tip.trim().length() == 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无提醒"));
            return;
@@ -257,8 +262,14 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("激活失败"));
            return;
         }
         if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
            String myInviteCode = userInfoExtraService.getInviteCodeByUid(uid);
            JSONObject data = new JSONObject();
            data.put("inviteCode", myInviteCode);
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("邀请码激活成功"));
         } else
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("邀请码激活成功"));
      } catch (UserInfoExtraException e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -271,10 +282,8 @@
   /**
    * 激活邀请
    * 
    * @param callback
    * @param uid
    *            用户id
    * @param inviteCode
    *            邀请嘛
    * @param out
    */
@@ -284,7 +293,14 @@
      try {
         userInfoExtraService.activationInviteWX(
               Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion()), uid, code);
         out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
         if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
            String myInviteCode = userInfoExtraService.getInviteCodeByUid(uid);
            JSONObject data = new JSONObject();
            data.put("inviteCode", myInviteCode);
            JsonUtil.printMode(out, "", JsonUtil.loadTrueResult(data));
         } else
            out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
      } catch (UserInfoExtraException e) {
         out.print(JsonUtil.loadFalseResult(e.getMsg()));
      } catch (Exception e) {
@@ -315,7 +331,7 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("邀请码不存在"));
            return;
         }
         String tip = configService.get("invite_activation_success_tip");
         String tip = configService.getValue(ConfigKeyEnum.inviteActivationSuccessTip.getKey(),acceptData.getSystem());
         JSONObject data = new JSONObject();
         data.put("inviteCode", inviteCode);