| | |
| | | private UserOtherMsgNotificationService userOtherMsgNotificationService;
|
| | |
|
| | |
|
| | | |
| | | @Override
|
| | | public void insertSelective(TokenRecord record) {
|
| | | record.setCreateTime(new Date());
|
| | |
| | |
|
| | | TokenVO tokenVO = new TokenVO();
|
| | | tokenVO.setToken(token);
|
| | | tokenVO.setNickName(nickName);
|
| | | tokenVO.setNickName(nickName + "赠送");
|
| | | tokenVO.setPortrait(portrait);
|
| | |
|
| | | String identify = rokenRecord.getIdentify();
|
| | |
| | | throw new TokenRecordException(1001, "温馨提示,[免单券]需要登录后领取");
|
| | |
|
| | | state = true;
|
| | | tokenVO.setAmount(1);
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送者的一级队员;");
|
| | |
| | | throw new TokenRecordException(1001, "温馨提示,[返利奖励券]需要登录后领取");
|
| | |
|
| | | state = true;
|
| | | tokenVO.setAmount(1);
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送者的一级队员;");
|
| | |
| | | if (uid == null || uid <= 0)
|
| | | throw new TokenRecordException(1001, "温馨提示,[推广红包]需要登录后领取");
|
| | |
|
| | | BigDecimal amount = giveRecord.getAmount();
|
| | | |
| | | state = true;
|
| | | tokenVO.setAmount(Integer.parseInt(amount.setScale(0).toString()));
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) {
|
| | | tips.add("确认领取后,你将成为赠送者的一级队员;");
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void receiveToken(String token, Long uid) throws TokenRecordException {
|
| | | public String receiveToken(String token, Long uid) throws TokenRecordException {
|
| | | if (uid == null || uid <= 0)
|
| | | throw new TokenRecordException(1, "用户未登录");
|
| | |
|
| | |
| | | if (userInfoExtra == null)
|
| | | throw new TokenRecordException(1, "用户信息缺失");
|
| | |
|
| | | |
| | | String msg = "领取成功";
|
| | | TokenTypeEnum tokenType = rokenRecord.getType();
|
| | | if (tokenType == TokenTypeEnum.freeCoupon) {
|
| | | long couponId = Long.parseLong(identify);
|
| | |
| | | giveRecord.setReceiveTime(new Date());
|
| | | userSystemCouponGiveRecordService.updateByPrimaryKeySelective(giveRecord);
|
| | |
|
| | | msg = "领取成功[免单券]成功,请到[我的-福利中心]中查看";
|
| | | // 消息 + 队员
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | |
| | | giveRecord.setReceiveTime(new Date());
|
| | | userSystemCouponGiveRecordService.updateByPrimaryKeySelective(giveRecord);
|
| | |
|
| | | msg = "领取成功[返利奖励券]成功,请到[我的-福利中心]中查看";
|
| | | // 消息 + 队员
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | |
| | | if (addTeam)
|
| | | beiZhu = "领取人已经成为你的一级队员";
|
| | |
|
| | | String userName = "无";
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | | if (user != null && !StringUtil.isNullOrEmpty(user.getNickName()))
|
| | | userName = user.getNickName();
|
| | | |
| | | MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
|
| | | msgOther.setType(MsgOtherGiveContentDTO.TYEP_COUPON);
|
| | | msgOther.setTitle("赠送奖励券");
|
| | | msgOther.setGiveType("你赠送的奖励券被成功领取");
|
| | | msgOther.setReceiveInfo("昵称:[昵称昵称昵称/无]ID:[854245]");
|
| | | msgOther.setReceiveInfo("昵称: " + userName +" ID:" + uid);
|
| | | msgOther.setGiveTime(sd.format(giveRecord.getGiveTime()));
|
| | | msgOther.setReceiveTime(sd.format(new Date()));
|
| | | userOtherMsgNotificationService.tokenGiveMsg(giveUid, beiZhu, msgOther);
|
| | |
| | | updateRecord.setReceiveUid(uid);
|
| | | updateRecord.setState(UserTaoLiJinGiveRecord.STATE_RECEIVE);
|
| | | userTaoLiJinGiveRecordService.updateByPrimaryKeySelective(updateRecord);
|
| | | |
| | | msg = "领取成功[推广红包]成功,请到[我的-推广红包]中查看";
|
| | | |
| | | // 消息 + 队员
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | String beiZhu = "无";
|
| | | if (addTeam)
|
| | | beiZhu = "领取人已经成为你的一级队员";
|
| | | |
| | | String userName = "无";
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | | if (user != null && !StringUtil.isNullOrEmpty(user.getNickName()))
|
| | | userName = user.getNickName();
|
| | | |
| | | MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
|
| | | msgOther.setType(MsgOtherGiveContentDTO.TYEP_COUPON);
|
| | | msgOther.setTitle("赠送推广红包");
|
| | | msgOther.setGiveType("你赠送的推广红包被成功领取");
|
| | | msgOther.setReceiveInfo("昵称: " + userName +" ID:" + uid);
|
| | | msgOther.setGiveTime(sd.format(giveRecord.getGiveTime()));
|
| | | msgOther.setReceiveTime(sd.format(new Date()));
|
| | | userOtherMsgNotificationService.tokenGiveMsg(giveUid, beiZhu, msgOther);
|
| | | }
|
| | | });
|
| | | |
| | | } catch (UserTaoLiJinOriginException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | } else {
|
| | | throw new TokenRecordException(1, "无对应类型");
|
| | | }
|
| | |
|
| | | |
| | | return msg;
|
| | | }
|
| | |
|
| | |
|