| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPPreInfoMapper;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserLevelChangedMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Service
|
| | | public class UserVIPPreInfoServiceImpl implements UserVIPPreInfoService {
|
| | |
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | | |
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | userInviteSeparateService.updateInvalidByBossId(uid);
|
| | | // 提醒上级
|
| | | remindBoss(uid, "普通会员", item, upgradeTime, true);
|
| | | |
| | | if (!Constant.IS_TEST) {
|
| | | UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, UserLevelEnum.daRen,UserLevelEnum.normalVIP, new Date());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
|
| | | producer.send(message);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | // 升级消息
|
| | | UserLevelEnum fromLevel = UserLevelEnum.normalVIP;
|
| | | int daysBetween = 0;
|
| | | boolean divorced = false;
|
| | | String beforeName = "快省达人";
|
| | |
| | | goldcoinReward(uid);
|
| | | // 需要发送脱离信息
|
| | | divorced = true;
|
| | | fromLevel = UserLevelEnum.daRen;
|
| | | }
|
| | | userAccountMsgNotificationService.vipPreUpgrade(uid, beforeName, "高级会员", daysBetween, limit1, limit2, type);
|
| | |
|
| | | // 提醒上级
|
| | | remindBoss(uid, "高级会员", item, upgradeTime, divorced);
|
| | | |
| | | |
| | | if (!Constant.IS_TEST) {
|
| | | UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, fromLevel,UserLevelEnum.highVIP, new Date());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
|
| | | producer.send(message);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.error(e);
|