| | |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelUpgradedNotify;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
|
| | |
| | | throw new UserVIPInfoException(1, "请先升级为高级会员");
|
| | | }
|
| | |
|
| | | if (!verifyVip(uid))
|
| | | int verifyResult = verifyVip(uid);
|
| | | if (verifyResult <= 0)
|
| | | throw new UserVIPInfoException(1, "不满足升级条件");
|
| | |
|
| | | UserVIPInfo userInfo = userVIPInfoMapper.selectByPrimaryKeyForUpdate(uid);
|
| | |
| | | throw new UserVIPInfoException(1, "该用户还不是高级会员");
|
| | | }
|
| | |
|
| | | if (!verifyVip(uid))
|
| | | int verifyVipResult = verifyVip(uid);
|
| | |
|
| | | if (verifyVipResult <= 0)
|
| | | throw new UserVIPInfoException(1, "系统验证:不满足升级条件");
|
| | |
|
| | | Date upgradeTime = new Date();
|
| | |
| | | UserVIPPreInfo preInfo = new UserVIPPreInfo();
|
| | | preInfo.setCreateTime(new Date());
|
| | | preInfo.setProcess(UserLevelEnum.superVIP.getLevel());
|
| | | preInfo.setSourceType(verifyVipResult);
|
| | | preInfo.setUid(uid);
|
| | |
|
| | | try {
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 验证是否符合VIP
|
| | | * 验证是否符合VIP
|
| | | * @Title: verifyVip
|
| | | * @Description: |
| | | * @param uid
|
| | | * @return
|
| | | * @return 0-不符合 1-订单 2-团队
|
| | | * int 返回类型
|
| | | * @throws
|
| | | */
|
| | | private boolean verifyVip(Long uid) {
|
| | | private int verifyVip(Long uid) {
|
| | | // 自购 + 分享订单
|
| | | long doneOrder = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY);
|
| | | // 有效粉丝
|
| | |
| | | limitSecond = Long.parseLong(second);
|
| | | }
|
| | |
|
| | | if (doneOrder >= limitOrder || (doneFirst >= limitFirst && doneSecond >= limitSecond)) {
|
| | | return true;
|
| | | if (doneOrder >= limitOrder) {
|
| | | return UserVIPPreInfo.SOURCE_TYPE_ORDER;
|
| | | }
|
| | | return false;
|
| | |
|
| | | if ((doneFirst >= limitFirst && doneSecond >= limitSecond))
|
| | |
|
| | | return UserVIPPreInfo.SOURCE_TYPE_TEAM;
|
| | | return 0;
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|