| | |
| | | import com.yeshi.fanli.dto.mq.user.body.UserMoneyChangeMQMsg;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.invite.TeamFansInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleDetailService;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private TeamFansInfoService teamFansInfoService;
|
| | | |
| | | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleDetailService threeSaleDetailService;
|
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | |
|
| | |
| | | if (MQTopicName.TOPIC_USER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (tag.equalsIgnoreCase(UserTopicTagEnum.userActve.name())) {// 用户活跃
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserActiveMQMsg userActiveMQMsg = new Gson().fromJson(json.toString(),UserActiveMQMsg.class);
|
| | | UserActiveMQMsg userActiveMQMsg = new Gson().fromJson(json.toString(), UserActiveMQMsg.class);
|
| | | if (userActiveMQMsg != null) {
|
| | | // 更改用户活跃时间
|
| | | teamFansInfoService.updateActiveTime(userActiveMQMsg.getUid(), userActiveMQMsg.getCreateTime());
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.userInfoUpdate.name())) {// 用户信息更新
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserInfoUpdateMQMsg mqMsg = new Gson().fromJson(json.toString(),UserInfoUpdateMQMsg.class);
|
| | | UserInfoUpdateMQMsg mqMsg = new Gson().fromJson(json.toString(), UserInfoUpdateMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | if (UserInfoUpdateTypeEnum.nickName == mqMsg.getType()) { // 更改昵称
|
| | | teamFansInfoService.updateNickName(mqMsg.getUid(), mqMsg.getValue());
|
| | |
| | | }
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.taobaoBindSuccess.name())) {// 淘宝绑定成功
|
| | | // 更改淘宝绑定状态与原用户淘宝绑定状态
|
| | | // 更改淘宝绑定状态与原用户淘宝绑定状态
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | TaoBaoBindSuccessMQMsg mqMsg = new Gson().fromJson(json.toString(),TaoBaoBindSuccessMQMsg.class);
|
| | | TaoBaoBindSuccessMQMsg mqMsg = new Gson().fromJson(json.toString(), TaoBaoBindSuccessMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | // 更新淘宝绑定
|
| | | teamFansInfoService.updateWeixinBind(mqMsg.getUid(), true);
|
| | |
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.inviteSuccess.name())) {// 邀请成功
|
| | | // 更新粉丝数量
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserInviteMQMsg mqMsg = new Gson().fromJson(json.toString(),UserInviteMQMsg.class);
|
| | | UserInviteMQMsg mqMsg = new Gson().fromJson(json.toString(), UserInviteMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | teamFansInfoService.updateFansNum(mqMsg.getBossId());
|
| | | |
| | | threeSaleDetailService.addByWorkerUid(mqMsg.getWorkerId());
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.userMoneyAdd.name())) {// 资金到账
|
| | | // 更新近60天到账
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserMoneyChangeMQMsg mqMsg = new Gson().fromJson(json.toString(),UserMoneyChangeMQMsg.class);
|
| | | UserMoneyChangeMQMsg mqMsg = new Gson().fromJson(json.toString(), UserMoneyChangeMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | teamFansInfoService.updateIncome(mqMsg.getUid(), mqMsg.getChangeMoney());
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.becomeValidUser.name())) {// 成为有效用户
|
| | | // 有效用户标识
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | BeComeValidUserMQMsg mqMsg = new Gson().fromJson(json.toString(),BeComeValidUserMQMsg.class);
|
| | | BeComeValidUserMQMsg mqMsg = new Gson().fromJson(json.toString(), BeComeValidUserMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | // 更新成为有效粉丝
|
| | | teamFansInfoService.updateStateValid(mqMsg.getUid(), true);
|