| | |
| | | import com.yeshi.fanli.service.inter.user.UserInviteRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserRankService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.msg.UserAccountMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.notify.UserActivedRecordService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | |
| | | @Resource
|
| | | @Lazy
|
| | | private UserActivedRecordService userActivedRecordService;
|
| | | |
| | | @Resource
|
| | | private UserAccountMsgNotificationService userAccountMsgNotificationService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
| | | inviteCode = inviteCode.toUpperCase();
|
| | | // 邀请码对应用户信息
|
| | | UserInfo inviter = userInfoService.getUserInfoByInviteCode(inviteCode);
|
| | | if (inviter == null)
|
| | | if (inviter == null || inviter.getState() != UserInfo.STATE_NORMAL)
|
| | | throw new UserInfoExtraException(1, "上级邀请码不存在");
|
| | |
|
| | | // 绑定关系
|
| | |
| | | Long inviterId = userInviteRecordService.getNewestInviterId(wxUnionId);
|
| | | if (inviterId == null)
|
| | | throw new UserInfoExtraException(1, "没有对应的邀请关系");
|
| | | |
| | | UserInfo boss = userInfoService.selectByPKey(inviterId);
|
| | | if (boss == null || boss.getState() != UserInfo.STATE_NORMAL) {
|
| | | throw new UserInfoExtraException(1, "没有对应的邀请关系");
|
| | | }
|
| | |
|
| | | // 绑定关系
|
| | | try {
|
| | |
| | | // 邀请人ID -1.5.3新版
|
| | | Long inviterId = userInviteRecordService.getNewestInviterId(wxUnionId);
|
| | | if (inviterId == null) {
|
| | | throw new UserInfoExtraException(1, "没有对应的邀请关系");
|
| | | }
|
| | | |
| | | UserInfo boss = userInfoService.selectByPKey(inviterId);
|
| | | if (boss == null || boss.getState() != UserInfo.STATE_NORMAL) {
|
| | | throw new UserInfoExtraException(1, "没有对应的邀请关系");
|
| | | }
|
| | |
|
| | |
| | | UserInfo inviter = userInfoService.getUserInfoByInviteCode(inviteCode);
|
| | | if (inviter == null)
|
| | | throw new UserInfoExtraException(1, "上级邀请码不存在");
|
| | | |
| | | if (inviter.getState() != UserInfo.STATE_NORMAL) {
|
| | | throw new UserInfoExtraException(1, "上级邀请码不存在");
|
| | | }
|
| | |
|
| | | return inviter;
|
| | | }
|
| | |
| | | if (inviter == null) {
|
| | | throw new UserInfoExtraException(1, "对应的邀请关系不存在");
|
| | | }
|
| | | |
| | | if (inviter.getState() != UserInfo.STATE_NORMAL) {
|
| | | throw new UserInfoExtraException(1, "对应的邀请关系不存在");
|
| | | }
|
| | | |
| | | return inviter;
|
| | | }
|
| | |
|
| | |
| | | new Date())));
|
| | | producer.send(message);
|
| | | }
|
| | | |
| | | // 消息
|
| | | userAccountMsgNotificationService.createChangeInviteCode(uid, extra.getInviteCode(), inviteCodeVip);
|
| | | }
|
| | |
|
| | | @Override
|