| | |
| | | import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPLevelMapper;
|
| | | import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
|
| | | import com.yeshi.fanli.dto.vip.UserVIPLevel;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | |
|
| | | @Service
|
| | | public class UserInviteServiceImpl implements UserInviteService {
|
| | |
| | |
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserVIPLevelMapper userVIPLevelMapper;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public UserInviteLevelEnum getUserInviteLevel(Long uid) {
|
| | |
| | | if (info.getState() == UserVIPInfo.STATE_VERIFING)
|
| | | return UserInviteLevelEnum.vipApply;
|
| | |
|
| | | |
| | | // TODO 没有判断导师
|
| | |
|
| | | return UserInviteLevelEnum.vip;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public UserInviteLevelEnum getUserInviteLevelNew(Long uid) {
|
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | return UserInviteLevelEnum.noActive;
|
| | | }
|
| | | |
| | | UserVIPInfo info = userVIPInfoService.selectByUid(uid);
|
| | | if (info == null) {
|
| | | UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (userVIPPreInfo != null) {
|
| | |
|
| | | UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (userVIPPreInfo != null) {
|
| | | Integer process = userVIPPreInfo.getProcess();
|
| | | UserLevelEnum levelEnum = UserLevelUtil.getByLevel(process);
|
| | | |
| | | levelEnum = UserLevelUtil.getShowLevel(levelEnum);
|
| | | if (levelEnum == null || levelEnum == UserLevelEnum.daRen) {
|
| | | return UserInviteLevelEnum.actived;
|
| | | }
|
| | |
|
| | | if (levelEnum == UserLevelEnum.highVIP) {
|
| | | UserVIPInfo info = userVIPInfoService.selectByUid(uid);
|
| | | if (info != null && info.getState() == UserVIPInfo.STATE_VERIFING) {
|
| | | return UserInviteLevelEnum.vipApply;
|
| | | }
|
| | | return UserInviteLevelEnum.highVIP;
|
| | | }
|
| | | } else if (info.getState() == UserVIPInfo.STATE_VERIFING) {
|
| | | return UserInviteLevelEnum.vipApply;
|
| | | } else if (info.getState() == UserVIPInfo.STATE_SUCCESS) {
|
| | | return UserInviteLevelEnum.vip;
|
| | |
|
| | | if (levelEnum == UserLevelEnum.superVIP) {
|
| | | return UserInviteLevelEnum.vip;
|
| | | }
|
| | |
|
| | | if (levelEnum == UserLevelEnum.tearcher) {
|
| | | return UserInviteLevelEnum.tearcher;
|
| | | }
|
| | | }
|
| | | |
| | | // TODO 没有判断导师
|
| | | |
| | | return UserInviteLevelEnum.actived;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public boolean verifyVIP(Long uid) {
|
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | return false;
|
| | | }
|
| | | |
| | |
|
| | | UserVIPInfo info = userVIPInfoService.selectByUid(uid);
|
| | | if (info != null && info.getState() == UserVIPInfo.STATE_SUCCESS) {
|
| | | return true;
|
| | | }
|
| | | |
| | |
|
| | | UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (userVIPPreInfo != null) {
|
| | | return true;
|
| | | }
|
| | | |
| | |
|
| | | return false;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public UserVIPLevel getVIPLevelByUid(Long uid) {
|
| | | return userVIPLevelMapper.getLevelByUid(uid);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|