admin
2020-01-01 c8f11c229b87d1652b6da0b15576c166cd51eb8b
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java
@@ -7,11 +7,11 @@
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
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;
@@ -19,7 +19,6 @@
import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
import com.yeshi.fanli.entity.bus.user.ThreeSale;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.system.SystemClientParams;
import com.yeshi.fanli.exception.NotExistObjectException;
@@ -127,7 +126,7 @@
      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<SwiperPicture> pictureList = swiperPictureService.getByBannerCardAndVersion("invite_top_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
      if (pictureList != null && pictureList.size() > 0) {
         SwiperPicture picture = pictureList.get(0);
         com.alibaba.fastjson.JSONObject pictureJson = new com.alibaba.fastjson.JSONObject();
@@ -141,7 +140,7 @@
      boolean hasCode = false;
      if (uid != null && uid.trim().length() > 0) {
         String inviteCode = userInfoExtraService.getUserInviteCode(Long.parseLong(uid));
         String inviteCode = userInfoExtraService.getInviteCodeByUid(Long.parseLong(uid));
         if (inviteCode != null && inviteCode.trim().length() > 0) {
            hasCode = true; // 已有邀请码
         }
@@ -171,23 +170,24 @@
    * @throws NotExistObjectException
    * @throws IOException
    */
   @RequestSerializableByKey(key = "'listInviteFriendImg-'+#uid")
   @RequestMapping(value = "/listInviteFriendImg", method = RequestMethod.POST)
   public void listInviteFriendImg(AcceptData acceptData, Long uid, PrintWriter out)
   public void listInviteFriendImg(AcceptData acceptData, Long uid, PrintWriter out, HttpServletRequest request)
         throws NotExistObjectException, IOException {
      JSONObject data = new JSONObject();
      if (uid != null && !uid.equals("0")) {
         List<String> imgList = spreadUserImgService.getUserSpreadImg(uid);
         List<String> imgList = spreadUserImgService.getUserSpreadImg(uid, request);
         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);
//      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");
      UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
      if (userInfoExtra != null) {
         data.put("inviteCode", userInfoExtra.getInviteCode());
      String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
      if (!StringUtil.isNullOrEmpty(inviteCode)) {
         data.put("inviteCode", inviteCode);
      }
      // 邀请规则
@@ -247,7 +247,6 @@
   @RequestMapping(value = "activationInvite")
   public void activationInvite(AcceptData acceptData, String callback, Long uid, String inviteCode, PrintWriter out) {
      try {
         if (uid == null || inviteCode == null) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("传递参数不正确"));
            return;
@@ -311,15 +310,15 @@
            return;
         }
         UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
         if (userInfoExtra == null || userInfoExtra.getInviteCode() == null) {
         String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
         if (StringUtil.isNullOrEmpty(inviteCode)) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("邀请码不存在"));
            return;
         }
         String tip = configService.get("invite_activation_success_tip");
         JSONObject data = new JSONObject();
         data.put("inviteCode", userInfoExtra.getInviteCode());
         data.put("inviteCode", inviteCode);
         data.put("tip", tip);
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));