| | |
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.InviteCodeActiveMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserActiveMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TearcherInfo;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | InviteCodeActiveMQMsg.class);
|
| | | if (inviteCodeActiveMQMsg != null) {
|
| | | // 顶级为测试用户的全部分配官方导师微信
|
| | |
|
| | | // 获取顶级boss
|
| | | Long bossId = threeSaleSerivce.getTopBoss(inviteCodeActiveMQMsg.getUid());
|
| | | if (bossId != null) {
|
| | |
|
| | | if (officialUids == null) {
|
| | | officialUids = new HashSet<>();
|
| | | List<UserInfo> userList = userInfoService.listByType(1, 1, 10000);
|
| | |
|
| | | for (UserInfo user : userList)
|
| | | officialUids.add(user.getId());
|
| | | }
|
| | |
|
| | | if (officialUids.contains(bossId)) {
|
| | | List<TearcherInfo> tearcherList = tearcherService.listByType(TearcherInfo.TYPE_OFFICIAL, 1,
|
| | | 1);
|
| | | if (tearcherList != null && tearcherList.size() > 0) {
|
| | | tearcherService.addUserTearcherMap(tearcherList.get(0).getId(),
|
| | | inviteCodeActiveMQMsg.getUid());
|
| | | }
|
| | | }
|
| | | }
|
| | | initTearcher(inviteCodeActiveMQMsg.getUid());
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.userActve.name())) {
|
| | | UserActiveMQMsg userActiveMQMsg = new Gson().fromJson(new String(message.getBody()),
|
| | | UserActiveMQMsg.class);
|
| | | if (userActiveMQMsg != null) {
|
| | | initTearcher(userActiveMQMsg.getUid());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return Action.CommitMessage;
|
| | | }
|
| | |
|
| | | private void initTearcher(Long uid) {
|
| | | if (tearcherService.selectByUid(uid) != null)
|
| | | return;
|
| | |
|
| | | // 获取顶级boss
|
| | | Long bossId = threeSaleSerivce.getTopBoss(uid);
|
| | | if (bossId != null) {
|
| | |
|
| | | if (officialUids == null) {
|
| | | officialUids = new HashSet<>();
|
| | | List<UserInfo> userList = userInfoService.listByType(1, 1, 10000);
|
| | |
|
| | | for (UserInfo user : userList)
|
| | | officialUids.add(user.getId());
|
| | | }
|
| | |
|
| | | if (officialUids.contains(bossId)) {
|
| | | List<TearcherInfo> tearcherList = tearcherService.listByType(TearcherInfo.TYPE_OFFICIAL, 1, 1);
|
| | | if (tearcherList != null && tearcherList.size() > 0) {
|
| | | tearcherService.addUserTearcherMap(tearcherList.get(0).getId(), uid);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|