yujian
2019-05-20 c4d752a1d340652d9c7d2abb5abff65cdee40d69
fanli/src/main/java/com/yeshi/fanli/controller/client/InviteGetMoneyController.java
@@ -11,6 +11,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.dto.money.InviteGetMoney;
@@ -176,7 +177,7 @@
    * @throws IOException
    */
   @RequestMapping(value = "/listInviteFriendImg", method = RequestMethod.POST)
   public void listInviteFriendImg(AcceptData acceptData, PrintWriter out, Long uid)
   public void listInviteFriendImg(AcceptData acceptData,  Long uid, PrintWriter out)
         throws NotExistObjectException, IOException {
      JSONObject data = new JSONObject();
      if (uid != null && !uid.equals("0")) {
@@ -184,9 +185,19 @@
         data.put("imgUrlList", JsonUtil.getSimpleGsonWithDate().toJson(imgList));
      }
      // 邀请链接
      String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
             + Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
      data.put("inviteLink", shortLink);
      UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
      if (userInfoExtra != null) {
         data.put("inviteCode", userInfoExtra.getInviteCode());
      }
      // 邀请规则
      String key = "inviteRules"; // key值
      com.yeshi.fanli.entity.system.BusinessSystem system = new BusinessSystem();
      BusinessSystem system = new BusinessSystem();
      system.setCreatetime(java.lang.System.currentTimeMillis());
      system.setPlatform(1);
      system.setId(4L);
@@ -195,6 +206,8 @@
      String valueN = values.getValue();
      String valueBr = valueN.replace("\n", "<br><br>");
      data.put("helpLink", configService.get("invite_help_link"));
      data.put("inviteRules", valueBr);
      out.print(JsonUtil.loadTrue(0, JsonUtil.getSimpleGson().toJson(data), "成功"));
   }
@@ -250,7 +263,7 @@
            return;
         }
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("激活成功"));
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("邀请码激活成功"));
      } catch (UserInfoExtraException e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -260,6 +273,31 @@
      }
   }
   /**
    * 激活邀请
    *
    * @param callback
    * @param uid
    *            用户id
    * @param inviteCode
    *            邀请嘛
    * @param out
    */
   @RequestMapping(value = "activationInviteWX")
   public void activationInviteWX(AcceptData acceptData, Long uid, String  code, PrintWriter out) {
      try {
         userInfoExtraService.activationInviteWX(uid, code);
         out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
      } catch (UserInfoExtraException e) {
         out.print(JsonUtil.loadFalseResult(e.getMsg()));
      } catch (Exception e) {
         out.print(JsonUtil.loadFalseResult("邀请码激活失败"));
         e.printStackTrace();
      }
   }
   /**
    * 获取邀请码
    *