| | |
| | | return;
|
| | | }
|
| | |
|
| | | String newCode = userInfoExtraService.activateInviteCode(uid, inviteCode);
|
| | | String newCode = userInfoExtraService.activateInviteCode(uid, inviteCode, acceptData.getPlatform(), acceptData.getVersion());
|
| | | if (newCode == null || newCode.trim().length() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("激活失败"));
|
| | | return;
|
| | |
| | | @RequestMapping(value = "activationInviteWX")
|
| | | public void activationInviteWX(AcceptData acceptData, Long uid, String code, PrintWriter out) {
|
| | | try {
|
| | | userInfoExtraService.activationInviteWX(uid, code);
|
| | | userInfoExtraService.activationInviteWX(uid, code, acceptData.getPlatform(), acceptData.getVersion());
|
| | | out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.cmq.ThreeSaleCMQManager;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter) throws ThreeSaleException {
|
| | | public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter, String platform, String version) throws ThreeSaleException {
|
| | |
|
| | | if (invitee == null || inviter == null)
|
| | | throw new ThreeSaleException(1, "用户信息为空");
|
| | |
| | | // 邀请消息
|
| | | userInviteMsgNotificationService.inviteSuccess(inviter.getId(), threeSale);
|
| | |
|
| | | // 奖励淘礼金红包
|
| | | try {
|
| | | String inviteName= invitee.getNickName();
|
| | | if (StringUtil.isNullOrEmpty(inviteName)) {
|
| | | UserInfo userInfo = userInfoService.selectByPKey(invitee.getId());
|
| | | if (userInfo != null) {
|
| | | inviteName= userInfo.getNickName();
|
| | | if (VersionUtil.greaterThan_1_5_60(platform, version)) {
|
| | | // 奖励淘礼金红包
|
| | | try {
|
| | | String inviteName= invitee.getNickName();
|
| | | if (StringUtil.isNullOrEmpty(inviteName)) {
|
| | | UserInfo userInfo = userInfoService.selectByPKey(invitee.getId());
|
| | | if (userInfo != null) {
|
| | | inviteName= userInfo.getNickName();
|
| | | }
|
| | | }
|
| | | userTaoLiJinOriginService.addInviteWinMoney(inviter.getId(), inviteName);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | userTaoLiJinOriginService.addInviteWinMoney(inviter.getId(), inviteName);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld) throws ThreeSaleException {
|
| | | public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld, String platform, String version) throws ThreeSaleException {
|
| | |
|
| | | if (invitee == null || (inviterId == null && threeSaleOld == null))
|
| | | throw new ThreeSaleException(1, "用户信息为空");
|
| | |
| | | // 邀请消息
|
| | | userInviteMsgNotificationService.inviteSuccess(threeSale.getBoss().getId(), threeSale);
|
| | |
|
| | | // 奖励淘礼金红包
|
| | | try {
|
| | | String inviteName= invitee.getNickName();
|
| | | if (StringUtil.isNullOrEmpty(inviteName)) {
|
| | | UserInfo userInfo = userInfoService.selectByPKey(invitee.getId());
|
| | | if (userInfo != null) {
|
| | | inviteName= userInfo.getNickName();
|
| | | if (VersionUtil.greaterThan_1_5_60(platform, version)) {
|
| | | // 奖励淘礼金红包
|
| | | try {
|
| | | String inviteName= invitee.getNickName();
|
| | | if (StringUtil.isNullOrEmpty(inviteName)) {
|
| | | UserInfo userInfo = userInfoService.selectByPKey(invitee.getId());
|
| | | if (userInfo != null) {
|
| | | inviteName= userInfo.getNickName();
|
| | | }
|
| | | }
|
| | | userTaoLiJinOriginService.addInviteWinMoney(inviterId, inviteName);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | userTaoLiJinOriginService.addInviteWinMoney(inviterId, inviteName);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public String activateInviteCode(Long uid, String inviteCode) throws UserInfoExtraException{
|
| | | public String activateInviteCode(Long uid, String inviteCode, String platform, String version) throws UserInfoExtraException{
|
| | | if (uid == null || inviteCode == null) {
|
| | | throw new UserInfoExtraException(1, "用户id、邀请码不能为空");
|
| | | }
|
| | |
| | |
|
| | | // 绑定关系
|
| | | try {
|
| | | threeSaleSerivce.bindRelationshipByInviteCode(invitee, inviter);
|
| | | threeSaleSerivce.bindRelationshipByInviteCode(invitee, inviter, platform, version);
|
| | | } catch (ThreeSaleException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public void activationInviteWX(Long uid, String code) throws UserInfoExtraException{
|
| | | public void activationInviteWX(Long uid, String code, String platform, String version) throws UserInfoExtraException{
|
| | | if (uid == null || code == null) {
|
| | | throw new UserInfoExtraException(1, "激活信息不完整");
|
| | | }
|
| | |
| | |
|
| | | // 绑定关系
|
| | | try {
|
| | | threeSaleSerivce.bindRelationshipByWX(invitee, inviterId, threeSale);
|
| | | threeSaleSerivce.bindRelationshipByWX(invitee, inviterId, threeSale, platform, version);
|
| | | } catch (ThreeSaleException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | * @param inviter
|
| | | * @throws ThreeSaleException
|
| | | */
|
| | | public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter) throws ThreeSaleException;
|
| | | public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter, String platform, String version) throws ThreeSaleException;
|
| | |
|
| | | /**
|
| | | * 统计邀请成功队员数量
|
| | |
| | | * @param threeSaleOld
|
| | | * @throws ThreeSaleException
|
| | | */
|
| | | public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld) throws ThreeSaleException;
|
| | | public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld, String platform, String version) throws ThreeSaleException;
|
| | |
|
| | | /**
|
| | | * 根据下级查找对象
|
| | |
| | | * @return
|
| | | * @throws UserInfoExtraException
|
| | | */
|
| | | public String activateInviteCode(Long uid, String inviteCode) throws UserInfoExtraException;
|
| | | public String activateInviteCode(Long uid, String inviteCode, String platform, String version) throws UserInfoExtraException;
|
| | |
|
| | | /**
|
| | | * 获取用户附加信息
|
| | |
| | | * @param code
|
| | | * @throws UserInfoExtraException
|
| | | */
|
| | | public void activationInviteWX(Long uid, String code) throws UserInfoExtraException;
|
| | | public void activationInviteWX(Long uid, String code, String platform, String version) throws UserInfoExtraException;
|
| | |
|
| | | /**
|
| | | * 判断是否是新用户
|