| | |
| | | import com.yeshi.fanli.dto.HongBaoDTO;
|
| | | import com.yeshi.fanli.dto.money.AccountDetails;
|
| | | import com.yeshi.fanli.dto.order.OrderItem;
|
| | | import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.PreviewInfo.PreviewEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.SMSHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.GiveVIPApplyInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | |
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.exception.goods.CollectionGoodsException;
|
| | |
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.AccountMessageService;
|
| | | import com.yeshi.fanli.service.inter.user.BindRemindService;
|
| | | import com.yeshi.fanli.service.inter.user.MaskKeyService;
|
| | | import com.yeshi.fanli.service.inter.user.PreviewInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.TeamFansInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.GiveVIPApplyInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | | import com.yeshi.fanli.service.manger.user.UserLevelManager;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import com.yeshi.fanli.util.HongBaoUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | | import com.yeshi.fanli.vo.user.MineInfoVO;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | | import com.yeshi.fanli.vo.user.UserSettingsVO;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserVipConfigService userVipConfigService;
|
| | |
|
| | | @Resource
|
| | | private RedPackForbidService redPackForbidService;
|
| | |
|
| | | private static final String PASSWORD_MAX_ERROR = "password_max_error";
|
| | | private static final String EXTRACT_MIN_MONEY = "extract_min_money";
|
| | | private static final String EXTRACT_MAX_MONEY = "extract_max_money";
|
| | | @Resource
|
| | | private UserInviteService userInviteService;
|
| | |
|
| | | @Resource
|
| | | private TeamFansInfoService teamFansInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserLevelManager userLevelManager;
|
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private GiveVIPApplyInfoService giveVIPApplyInfoService;
|
| | | |
| | | @Resource
|
| | | private PreviewInfoService previewInfoService;
|
| | | |
| | |
|
| | | private static final String EXTRACT_MIN_MONEY = ConfigKeyEnum.extractMoneyMin.getKey();
|
| | | private static final String EXTRACT_MAX_MONEY = ConfigKeyEnum.extractMoneyMAX.getKey();
|
| | |
|
| | | /**
|
| | | * 获取用户信息
|
| | |
| | | form.setPortrait(weiXinUser.getHeadimgurl());
|
| | | String wxHeadImg = COSManager.getInstance()
|
| | | .uploadFile(HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl()),
|
| | | Constant.WXHEADURL + UUID.randomUUID().toString())
|
| | | FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString())
|
| | | .getUrl();
|
| | | form.setWxPic(wxHeadImg);
|
| | | form.setNickName(weiXinUser.getNickname());
|
| | |
| | | form.setWxName(xinUser.getNickname());
|
| | | String wxHeadImg = COSManager.getInstance()
|
| | | .uploadFile(HttpUtil.getAsInputStream(xinUser.getHeadimgurl()),
|
| | | Constant.WXHEADURL + UUID.randomUUID().toString())
|
| | | FilePathEnum.userPortrait + UUID.randomUUID().toString())
|
| | | .getUrl();
|
| | | form.setWxPic(wxHeadImg);
|
| | | } else if (formLoginType == Constant.TAOBAO) {
|
| | |
| | | data.put("inviteList", String.format("http://%s/%s/client/share/friends_new_online.html",
|
| | | Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
|
| | | else
|
| | | data.put("inviteList", configService.get("team_list"));
|
| | | data.put("inviteList", configService.get(ConfigKeyEnum.teamList.getKey()));
|
| | |
|
| | | // 界面状态
|
| | | UserSettingsVO mySettings = null;
|
| | |
| | | find.setWxUnionId(weiXinUser.getUnionid());
|
| | | String wxHeadImg = COSManager.getInstance()
|
| | | .uploadFile(HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl()),
|
| | | Constant.WXHEADURL + UUID.randomUUID().toString())
|
| | | FilePathEnum.userPortrait.getPath() + UUID.randomUUID().toString())
|
| | | .getUrl();
|
| | | find.setWxPic(wxHeadImg);
|
| | | } else { // 绑定淘宝
|
| | |
| | | data.put("maxError", 1);
|
| | | String minMoney = configService.get(EXTRACT_MIN_MONEY); // 单笔提现的最小金额
|
| | | String maxMoney = configService.get(EXTRACT_MAX_MONEY); // 单笔提现的最小金额
|
| | | String maxDayMoney = configService.get("extract_money_day"); // 每日最大提现金额
|
| | | int maxDayCount = Integer.parseInt(configService.get("extract_count_day"));
|
| | | String maxDayMoney = configService.get(ConfigKeyEnum.extractMoneyDay.getKey()); // 每日最大提现金额
|
| | | int maxDayCount = Integer.parseInt(configService.get(ConfigKeyEnum.extractDayCount.getKey()));
|
| | | ExtractRecord extractRecord = extractRecordService.getExtractRecordByUid(uid);
|
| | | boolean canExtract = true;
|
| | | String errorMsg = "";
|
| | |
| | | }
|
| | |
|
| | | String minMoney = configService.get(EXTRACT_MIN_MONEY); // 单笔提现的最小金额
|
| | | String maxDayMoney = configService.get("extract_money_day"); // 每日最大提现金额
|
| | | int maxDayCount = Integer.parseInt(configService.get("extract_count_day"));
|
| | | String maxDayMoney = configService.get(ConfigKeyEnum.extractMoneyDay.getKey()); // 每日最大提现金额
|
| | | int maxDayCount = Integer.parseInt(configService.get(ConfigKeyEnum.extractDayCount.getKey()));
|
| | | ExtractRecord extractRecord = extractRecordService.getExtractRecordByUid(uid);
|
| | | boolean canExtract = true;
|
| | | String errorMsg = "";
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | // 判断手机验证码的正确性
|
| | | String oldCode = redisManager.getSMSVCode(user.getPhone(), SMSHistory.TYPE_LOGIN);
|
| | | if (StringUtil.isNullOrEmpty(oldCode) || !oldCode.equalsIgnoreCase(vcode)) {
|
| | | out.print(JsonUtil.loadFalseResult(90001, "验证码错误"));
|
| | | return;
|
| | | if (!Constant.IS_TEST) {
|
| | | // 判断手机验证码的正确性
|
| | | String oldCode = redisManager.getSMSVCode(user.getPhone(), SMSHistory.TYPE_LOGIN);
|
| | | if (StringUtil.isNullOrEmpty(oldCode) || !oldCode.equalsIgnoreCase(vcode)) {
|
| | | out.print(JsonUtil.loadFalseResult(90001, "验证码错误"));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | |
| | | }
|
| | |
|
| | | long[] targetUids = new long[] { 3L, 4L };
|
| | | Config config = configService.getConfig("extract_code_email_from");
|
| | | Config config = configService.getConfig(ConfigKeyEnum.extractCodeEmailFrom.getKey());
|
| | | String[] sts = config.getValue().split(",");
|
| | | String account = sts[0];
|
| | | String pwd = sts[1];
|
| | |
| | |
|
| | | JSONObject resultData = new JSONObject();
|
| | | if (type == 1) {
|
| | | resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid, null);
|
| | | resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid);
|
| | | } else if (type == 2) {
|
| | | resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid, null);
|
| | | resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid);
|
| | | }
|
| | |
|
| | | // 安卓系统返回所有数据
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform)) {
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
|
| | | long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null);
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid);
|
| | |
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
|
| | | long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(uid);
|
| | |
|
| | | JSONObject bossData = null;
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | |
| | | bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime));
|
| | | }
|
| | |
|
| | | String helpLink = configService.get("team_help_url");
|
| | | String helpLink = configService.get(ConfigKeyEnum.teamHelpUrl.getKey());
|
| | | if (helpLink == null) {
|
| | | helpLink = "";
|
| | | }
|
| | |
| | | hasCode = true; // 已有邀请码
|
| | | } else {
|
| | | // 邀请激活链接
|
| | | resultData.put("activationlink", configService.get("invite_activation_url"));
|
| | | resultData.put("activationlink", configService.get(ConfigKeyEnum.inviteActivationUrl.getKey()));
|
| | | }
|
| | | resultData.put("hasCode", hasCode);
|
| | |
|
| | | resultData.put("helpLink", helpLink);
|
| | | resultData.put("firstTeam", firstTeam);
|
| | | resultData.put("firstTeamTotal", firstTeamTotal);
|
| | | resultData.put("firstTeamTotal", firstTeam);
|
| | | resultData.put("secondTeam", secondTeam);
|
| | | resultData.put("secondTeamTotal", secondTeamTotal);
|
| | | resultData.put("secondTeamTotal", secondTeam);
|
| | | resultData.put("boss", bossData);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | |
| | |
|
| | | JSONObject resultData = new JSONObject();
|
| | | if (type == 1) {
|
| | | resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid, 1);
|
| | | resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid);
|
| | | } else if (type == 2) {
|
| | | resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid, 1);
|
| | | resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid);
|
| | | }
|
| | |
|
| | | // 安卓系统返回所有数据
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform)) {
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid);
|
| | |
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(uid);
|
| | |
|
| | | JSONObject bossData = null;
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | |
| | | bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime));
|
| | | }
|
| | |
|
| | | String helpLink = configService.get("team_help_url");
|
| | | String helpLink = configService.get(ConfigKeyEnum.teamHelpUrl.getKey());
|
| | | if (helpLink == null) {
|
| | | helpLink = "";
|
| | | }
|
| | |
| | | hasCode = true; // 已有邀请码
|
| | | } else {
|
| | | // 邀请激活链接
|
| | | resultData.put("activationlink", configService.get("invite_activation_url"));
|
| | | resultData.put("activationlink", configService.get(ConfigKeyEnum.inviteActivationUrl.getKey()));
|
| | | }
|
| | | resultData.put("hasCode", hasCode);
|
| | |
|
| | |
| | | @RequestMapping(value = "countMyTeam", method = RequestMethod.POST)
|
| | | public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) {
|
| | | try {
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
|
| | | long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null);
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid);
|
| | |
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
|
| | | long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(uid);
|
| | | JSONObject bossData = new JSONObject();
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | | if (threeSale != null) {
|
| | |
| | |
|
| | | JSONObject resultData = new JSONObject();
|
| | |
|
| | | String helpLink = configService.get("team_help_url");
|
| | | String helpLink = configService.get(ConfigKeyEnum.teamHelpUrl.getKey());
|
| | | if (helpLink == null) {
|
| | | helpLink = "";
|
| | | }
|
| | | resultData.put("helpLink", helpLink);
|
| | | resultData.put("firstTeam", firstTeam);
|
| | | resultData.put("firstTeamTotal", firstTeamTotal);
|
| | | resultData.put("firstTeamTotal", firstTeam);
|
| | | resultData.put("secondTeam", secondTeam);
|
| | | resultData.put("secondTeamTotal", secondTeamTotal);
|
| | | resultData.put("secondTeamTotal", secondTeam);
|
| | | resultData.put("boss", bossData);
|
| | |
|
| | | boolean hasCode = false;
|
| | |
| | | hasCode = true; // 已有邀请码
|
| | | } else {
|
| | | // 邀请激活链接
|
| | | resultData.put("activationlink", configService.get("invite_activation_url"));
|
| | | resultData.put("activationlink", configService.get(ConfigKeyEnum.inviteActivationUrl.getKey()));
|
| | | }
|
| | | resultData.put("hasCode", hasCode);
|
| | |
|
| | |
| | | */
|
| | | @RequestMapping(value = "setextrainfo", method = RequestMethod.POST)
|
| | | public void setExtraInfo(AcceptData acceptData, long uid, long inviteId, String memoName, PrintWriter out) {
|
| | | List<ThreeSale> listThreeSale = threeSaleSerivce.listbyIdAndBossId(inviteId, uid, null);
|
| | | if (listThreeSale == null || listThreeSale.size() == 0) {
|
| | | ThreeSale threeSale = threeSaleSerivce.selectByPrimaryKey(inviteId);
|
| | | if (threeSale == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该记录不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo worker = listThreeSale.get(0).getWorker();
|
| | | UserInfo worker = threeSale.getWorker();
|
| | | if (worker == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该记录不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | int type = 1;
|
| | | if (threeSale.getBoss().getId() != uid) {
|
| | | type = 2;
|
| | | }
|
| | |
|
| | | ThreeSaleExtraInfo extraInfo = threeSaleExtraInfoSerivce.getbyBossIdAndWorkerId(uid, worker.getId());
|
| | | if (extraInfo == null) {
|
| | | extraInfo = new ThreeSaleExtraInfo();
|
| | | Long bossUid = threeSale.getBoss().getId();
|
| | | if (uid == bossUid) {
|
| | | extraInfo.setType(1); // 直接
|
| | | } else {
|
| | | extraInfo.setType(2); // 间接
|
| | | }
|
| | |
|
| | | extraInfo.setWorker(worker);
|
| | | extraInfo.setNickname(memoName);
|
| | | extraInfo.setCreateTime(new Date());
|
| | |
| | | updateInfo.setUpdateTime(new Date());
|
| | | threeSaleExtraInfoSerivce.updateByPrimaryKeySelective(updateInfo);
|
| | | }
|
| | |
|
| | | // 更新粉丝记录信息
|
| | | teamFansInfoService.updateMemoName(worker.getId(), type, memoName);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除队员关系
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param inviteId
|
| | | * 邀请id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "removethreesale", method = RequestMethod.POST)
|
| | | public void removethreesale(AcceptData acceptData, long uid, long inviteId, PrintWriter out) {
|
| | | try {
|
| | | List<ThreeSale> listThreeSale = threeSaleSerivce.listbyIdAndBossId(inviteId, uid, 1);
|
| | | if (listThreeSale == null || listThreeSale.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("操作数据无效"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo worker = listThreeSale.get(0).getWorker();
|
| | | if (worker == null) {
|
| | | out.print(JsonUtil.loadFalseResult("操作数据无效"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 删除关系
|
| | | threeSaleSerivce.deleteByPrimaryKey(inviteId);
|
| | | // 删除备注
|
| | | threeSaleExtraInfoSerivce.deleteByBossIdAndWorkerId(uid, worker.getId());
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult("删除成功"));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | if (inviteCode == null || inviteCode.trim().length() == 0) {
|
| | | // 无邀请码
|
| | | inviteData.put("content", "邀请激活");
|
| | | inviteData.put("link", configService.get("invite_activation_url"));
|
| | | inviteData.put("link", configService.get(ConfigKeyEnum.inviteActivationUrl.getKey()));
|
| | | } else {
|
| | | // 已有邀请码
|
| | | inviteData.put("content", "邀请码");
|
| | | inviteData.put("link", configService.get("invite_activation_success_url"));
|
| | | inviteData.put("link", configService.get(ConfigKeyEnum.inviteActivationSuccessUrl.getKey()));
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | mySettings.setNoInvitationBonus(0);
|
| | | }
|
| | |
|
| | | if (mySettings.getNoDisplayPhoneNum() == null) {
|
| | | mySettings.setNoDisplayPhoneNum(0);
|
| | | }
|
| | |
|
| | | if (mySettings.getOpenSpreadHongBao() == null) {
|
| | | if (userTaoLiJinDetailService.countDetail(uid) > 0) {
|
| | | mySettings.setOpenSpreadHongBao(1);
|
| | |
| | | }
|
| | | data.put("moduleState", mySettings);
|
| | |
|
| | | boolean tailor = false;
|
| | | int welfareCenterNews = 0;
|
| | | String invitCode = null;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | |
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip())) {
|
| | | invitCode = userInfoExtra.getInviteCodeVip();
|
| | | } else if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tailor = true;
|
| | | invitCode = userInfoExtra.getInviteCode();
|
| | | }
|
| | | |
| | |
|
| | | if (userInfoExtra.getUserRank() != null) {
|
| | | String picture = userInfoExtra.getUserRank().getPicture();
|
| | | String icon = userInfoExtra.getUserRank().getIcon();
|
| | |
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin()))
|
| | | userInfo.setWeiXin(userInfoExtra.getWeiXin());
|
| | | }
|
| | |
|
| | | // 二维码
|
| | | userInfo.setErCode(userInfoExtra.getErCode());
|
| | | }
|
| | | // 显示邀请码特制入口
|
| | | data.put("tailor", tailor);
|
| | |
|
| | | // 1.6.5 之后返回 微信号提示
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | userInfo.setWeiXinTip("添加微信号后,你的邀请人和一级队员可以通过微信与你建立联系。");
|
| | | userInfo.setWeiXinTip("添加微信号后,你的邀请人和直接粉丝可以通过微信与你建立联系。");
|
| | |
|
| | | // 查询是否为VIP
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | userInfo.setVip(userVIPInfoService.isVIP(uid));
|
| | |
|
| | | boolean verifyForbid = redPackForbidService.verifyForbid(uid);
|
| | | data.put("redPackLock", verifyForbid);
|
| | | }
|
| | |
|
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
|
| | |
| | | else
|
| | | data.put("invitCodeUpdated", false);
|
| | | data.put("welfareCenterNews", welfareCenterNews);// 福利中心消息
|
| | | data.put("vipLink", configService.get("vip_link"));// 超级会员升级链接
|
| | | data.put("vipLink", userVipConfigService.getValueByKey("vip_link"));// 超级会员升级链接
|
| | |
|
| | | // 2.0.1之后绑定手机号
|
| | | if (VersionUtil.greaterThan_2_0_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | |
| | | data.put("bindPhone", bindPhone);
|
| | | }
|
| | |
|
| | | // 2.0.2 版本
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | boolean verifyForbid = redPackForbidService.verifyForbid(uid);
|
| | | data.put("redPackLock", verifyForbid);
|
| | | if (!StringUtil.isNullOrEmpty(invitCode)) {
|
| | | // 2.0.6 返回邀请人
|
| | | if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | String bossName = "";
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | | if (threeSale != null && threeSale.getBoss() != null) {
|
| | | bossName = threeSale.getBoss().getNickName();
|
| | | }
|
| | | data.put("bossName", bossName);
|
| | | }
|
| | | }
|
| | |
|
| | | if (VersionUtil.greaterThan_2_0_7(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | UserInviteLevelEnum level = null;
|
| | | // VIP预览信息
|
| | | if (VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | String redisContent = previewInfoService.getRedisContent(uid, PreviewEnum.mineInfo);
|
| | | if (!StringUtil.isNullOrEmpty(redisContent)) {
|
| | | MineInfoVO vo = new Gson().fromJson(redisContent, MineInfoVO.class);
|
| | | if (vo != null) {
|
| | | if (!StringUtil.isNullOrEmpty(vo.getBalance()))
|
| | | userInfo.setMyHongBao(new BigDecimal(vo.getBalance()));
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(vo.getLevel()))
|
| | | for (UserInviteLevelEnum levelEnum: UserInviteLevelEnum.values()) {
|
| | | if (levelEnum.name().equals(vo.getLevel())) {
|
| | | level = levelEnum;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | if (level == null) {
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | level = userInviteService.getUserInviteLevelNew(uid);
|
| | | } else {
|
| | | level = userInviteService.getUserInviteLevel(uid);
|
| | | }
|
| | | }
|
| | | JSONObject inviteLevel = new JSONObject();
|
| | | inviteLevel.put("level", level.name());
|
| | | inviteLevel.put("link", level.getLink());
|
| | | data.put("inviteLevel", inviteLevel);
|
| | | }
|
| | |
|
| | | if (VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | data.put("fansCountLink", configService.get(ConfigKeyEnum.teamStatisticsLink.getKey()));
|
| | | // 会员动作
|
| | | // 查询是否为超级会员,是的话返回超会管理链接
|
| | | UserLevelEnum level = userLevelManager.getUserLevel(uid);
|
| | |
|
| | | JSONObject vipAction = null;
|
| | | if (level == UserLevelEnum.superVIP || level == UserLevelEnum.tearcher) {
|
| | | vipAction = new JSONObject();
|
| | | vipAction.put("name", "超会管理");
|
| | | vipAction.put("jumpDetail",
|
| | | jumpDetailV2Service.getByTypeCache("web",
|
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2,
|
| | | Integer.parseInt(acceptData.getVersion())));
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", userVipConfigService.getValueByKey("vip_manager_link"));
|
| | | vipAction.put("params", params);
|
| | |
|
| | | } else {
|
| | | // 查询是否可以提交会员申请,是的话返回资料填写页面
|
| | | List<GiveVIPApplyInfo> list = giveVIPApplyInfoService.listByStateAndTargetUid(uid,
|
| | | GiveVIPApplyInfo.STATE_NO_INFO, 1, 20);
|
| | | if (list != null && list.size() > 0) {
|
| | | String link = userVipConfigService.getValueByKey("apply_vip_upload_info_link");
|
| | | if (!StringUtil.isNullOrEmpty(link)) {
|
| | | vipAction = new JSONObject();
|
| | | vipAction.put("name", "申请会员");
|
| | | vipAction.put("jumpDetail",
|
| | | jumpDetailV2Service.getByTypeCache("web",
|
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2,
|
| | | Integer.parseInt(acceptData.getVersion())));
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", link.replace("[ID]", list.get(0).getId()));
|
| | | vipAction.put("params", params);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (vipAction != null)
|
| | | data.put("vipAction", vipAction);
|
| | |
|
| | | }
|
| | | |
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | |
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | @RequestMapping(value = "saveInfo")
|
| | | public void saveInfo(AcceptData acceptData, String nickName, String weiXin, Integer sex, Long uid,
|
| | | String inviteCode, PrintWriter out) {
|
| | | String inviteCode, MultipartFile qrCodeFile, HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 修改邀请码
|
| | | if (!StringUtil.isNullOrEmpty(inviteCode)) {// 邀请码不为空
|
| | | inviteCode = inviteCode.trim();
|
| | | if (inviteCode.length() >= 4 && inviteCode.length() <= 12) {
|
| | |
|
| | | if (!userVIPInfoService.isVIP(uid)) {
|
| | | out.print(JsonUtil.loadFalseResult(20, "只有超级会员才能修改"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | userInfoExtraService.updateInviteCodeVip(inviteCode, uid);
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | |
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | // 二维码
|
| | | if (qrCodeFile != null) {
|
| | | userInfoExtraService.uploadERCode(qrCodeFile, uid);
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (UserInfoException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|