| | |
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserActiveMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoRegister;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.exception.user.vip.UserVIPPreInfoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoRegisterService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamUserLevelStatisticService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | |
| | | @Resource
|
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | |
|
| | |
| | | // 老用户同步绑定信息
|
| | | userInfoModifyRecordService.syncBeforeInfo(uid);
|
| | |
|
| | | //同步老用户等级
|
| | | // 同步老用户等级
|
| | | UserActiveLog log = userActiveLogService.getUserLatestActiveInfo(uid);
|
| | | if (log != null && VersionUtil.greaterThan_2_1(
|
| | |
|
| | | // 低版本全部升级普通会员
|
| | | if (log != null && !VersionUtil.greaterThan_2_1(
|
| | | "appstore".equalsIgnoreCase(log.getChannel()) ? "ios" : "android", log.getVersionCode())) {
|
| | | //线上老用户升级到2.1,自动计算等级
|
| | | |
| | | UserVIPPreInfo vipInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (vipInfo == null) {
|
| | | vipInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (vipInfo == null) {// 没有生成高级及以上会员
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (extra != null && !StringUtil.isNullOrEmpty(extra.getInviteCode())) {
|
| | | // 老用户生成普通会员
|
| | | UserVIPPreInfo vip = new UserVIPPreInfo();
|
| | | vip.setCreateTime(new Date());
|
| | | vip.setProcess(UserVIPPreInfo.PROCESS_1);
|
| | | vip.setUid(uid);
|
| | | try {
|
| | | userVIPPreInfoService.addUserVIPPreInfo(vip);
|
| | | } catch (UserVIPPreInfoException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | } else if (log != null && VersionUtil.greaterThan_2_1(
|
| | | "appstore".equalsIgnoreCase(log.getChannel()) ? "ios" : "android", log.getVersionCode())) {// 2.1后升级其他等级
|
| | | // 线上老用户升级到2.1,自动计算等级
|
| | | List<Long> uids = new ArrayList<>();
|
| | | uids.add(uid);
|
| | | List<UserInfoRegister> list = userInfoRegisterService.listByMultipleUids(uids);
|
| | |
| | | userVIPPreInfoService.upgradeVipByTeamNum(uid);
|
| | | vipInfo = userVIPPreInfoService.getLatestProcessInfo(uid);
|
| | | if (vipInfo == null) {// 没有生成高级及以上会员
|
| | | // 老用户生成普通会员
|
| | | UserVIPPreInfo vip = new UserVIPPreInfo();
|
| | | vip.setCreateTime(new Date());
|
| | | vip.setProcess(UserVIPPreInfo.PROCESS_1);
|
| | | vip.setUid(uid);
|
| | | try {
|
| | | userVIPPreInfoService.addUserVIPPreInfo(vip);
|
| | | } catch (UserVIPPreInfoException e) {
|
| | | e.printStackTrace();
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (extra != null && !StringUtil.isNullOrEmpty(extra.getInviteCode())) {
|
| | | // 老用户生成普通会员
|
| | | UserVIPPreInfo vip = new UserVIPPreInfo();
|
| | | vip.setCreateTime(new Date());
|
| | | vip.setProcess(UserVIPPreInfo.PROCESS_1);
|
| | | vip.setUid(uid);
|
| | | try {
|
| | | userVIPPreInfoService.addUserVIPPreInfo(vip);
|
| | | } catch (UserVIPPreInfoException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|