| | |
| | | public TokenRecord getNearByTypeAndIdentify(String type, String identify) {
|
| | | return tokenRecordMapper.getNearByTypeAndIdentify(type, identify);
|
| | | }
|
| | | |
| | | @Override
|
| | | public TokenRecord getByTypeAndIdentify(String type, String identify) {
|
| | | return tokenRecordMapper.getByTypeAndIdentify(type, identify);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public TokenVO discernToken(String token, Long uid, AcceptData acceptData) throws TokenRecordException {
|
| | |
| | | state = true;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送人的一级队员;");
|
| | | tips.add("确认领取后,你将成为赠送人的直接粉丝;");
|
| | | tips.add("获赠的免单券,需要激活后才能使用,详情参见免单券激活规则;");
|
| | | tips.add("成功领取后,请到“我的-福利中心”查看。");
|
| | | } else {
|
| | |
| | | state = true;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送人的一级队员;");
|
| | | tips.add("确认领取后,你将成为赠送人的直接粉丝;");
|
| | | tips.add("板栗快省奖励券,可用于“已到账”的返利订单,在返利的基础上再获得一定比例的返利;");
|
| | | tips.add("成功领取后,请到“我的-福利中心”中查看。");
|
| | | } else {
|
| | |
| | | throw new TokenRecordException(1, "口令已失效");
|
| | | }
|
| | | } else if (tokenType == TokenTypeEnum.redPack) {
|
| | | if(!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | if(!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | throw new TokenRecordException(1, "请升级到最新版");
|
| | |
|
| | |
|
| | |
| | | state = true;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送人的一级队员;");
|
| | | tips.add("确认领取后,你将成为赠送人的直接粉丝;");
|
| | | tips.add("红包可提现,可购买折扣商品;");
|
| | | tips.add("成功领取后,请到“我的-红包”中查看。");
|
| | | } else {
|
| | |
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | String beiZhu = "无";
|
| | | if (addTeam)
|
| | | beiZhu = "领取人已经成为你的一级队员";
|
| | | beiZhu = "领取人已经成为你的直接粉丝";
|
| | |
|
| | | String userName = "无";
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | |
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | String beiZhu = "无";
|
| | | if (addTeam)
|
| | | beiZhu = "领取人已经成为你的一级队员";
|
| | | beiZhu = "领取人已经成为你的直接粉丝";
|
| | |
|
| | | String userName = "无";
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | |
| | | }
|
| | | });
|
| | | } else if (tokenType == TokenTypeEnum.redPack) {
|
| | | if(!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | if(!VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | throw new TokenRecordException(1, "请升级到最新版");
|
| | |
|
| | | try {
|
| | |
| | | String beiZhu = "无";
|
| | | String giveBeiZhu = "无";
|
| | | if (addTeam) {
|
| | | beiZhu = "你已成为赠送人的一级队员";
|
| | | giveBeiZhu = "领取人已成为你的一级队员";
|
| | | beiZhu = "你已成为赠送人的直接粉丝";
|
| | | giveBeiZhu = "领取人已成为你的直接粉丝";
|
| | | // 激活邀请信息
|
| | | addInviteMsg(uid, giveUid, giveRecord.getAmount().setScale(2) + "元红包");
|
| | | }
|
| | |
| | | try {
|
| | | UserInfo user = userInfoService.selectByPKey(giveUid);
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | |
| | | String inviteCode = null;
|
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCodeVip())) {
|
| | | inviteCode = userInfoExtra.getInviteCodeVip();
|
| | | } else {
|
| | | inviteCode = userInfoExtra.getInviteCode();
|
| | | }
|
| | | |
| | | MsgInviteContentDTO msgInvite = new MsgInviteContentDTO();
|
| | | msgInvite.setTitle("邀请消息");
|
| | | msgInvite.setState("成功激活邀请");
|
| | | msgInvite.setCode("你的邀请码:" + userInfoExtra.getInviteCode());
|
| | | msgInvite.setCode("你的邀请码:" + inviteCode);
|
| | | msgInvite.setInviter("昵称:"+user.getNickName());
|
| | | msgInvite.setMode("成功领取邀请人的" + giftName);
|
| | | userInviteMsgNotificationService.receiveGift(uid, "邀请关系一旦确立无法更改 ", msgInvite);
|
| | |
| | | return;
|
| | | Date date = new Date();
|
| | | for (TokenRecord tokenRecord: list) {
|
| | | Integer state = tokenRecord.getState();
|
| | | if (state != null && state == 0) |
| | | continue;
|
| | | |
| | | tokenRecord.setState(1);
|
| | | tokenRecord.setUpdateTime(date);
|
| | | tokenRecordMapper.updateByPrimaryKeySelective(tokenRecord);
|