一款可自主二次开发的微信云控客服crm系统软件(带源码)

case PostMomentsPraiseCountNotice: {//手机回传朋友圈点赞数量
log.debug("socket:msgtype=PostMomentsPraiseCountNotice");
postMomentsPraiseCountNoticeHandler.handleMsg(ctx, msgVo);
break;
}

package com.jubotech.framework.netty.handler.socket;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.google.protobuf.util.JsonFormat;
import com.jubotech.business.web.domain.AccountInfo;
import com.jubotech.business.web.domain.WeChatAccountInfo;
import com.jubotech.business.web.service.AccountService;
import com.jubotech.business.web.service.WeChatAccountService;
import com.jubotech.framework.netty.common.Constant;
import com.jubotech.framework.netty.utils.MessageUtil;
import com.jubotech.framework.netty.utils.NettyConnectionUtil;

import Jubo.JuLiao.IM.Wx.Proto.PostMomentsPraiseCountNotice.PostMomentsPraiseCountNoticeMessage;
import Jubo.JuLiao.IM.Wx.Proto.TransportMessageOuterClass.EnumErrorCode;
import Jubo.JuLiao.IM.Wx.Proto.TransportMessageOuterClass.EnumMsgType;
import Jubo.JuLiao.IM.Wx.Proto.TransportMessageOuterClass.TransportMessage;
import io.netty.channel.ChannelHandlerContext;

@Service
public class PostMomentsPraiseCountNoticeHandler{
private final Logger log = LoggerFactory.getLogger(getClass());
@Autowired
private WeChatAccountService weChatAccountService;
@Autowired
private AccountService accountService;
/**
* 手机回传朋友圈点赞数量
* @author wechatno:tangjinjinwx
* @param ctx
* @param vo
*/
public void handleMsg(ChannelHandlerContext ctx, TransportMessage vo) {
try {
PostMomentsPraiseCountNoticeMessage req = vo.getContent().unpack(PostMomentsPraiseCountNoticeMessage.class);
log.info(JsonFormat.printer().print(req));
//把消息转发给pc端
//a、根据wechatId找到accountid
//b、通过accountid找到account
//c、通过account账号找到通道
WeChatAccountInfo account = weChatAccountService.findWeChatAccountInfoByWeChatId(req.getWeChatId());
if(null != account && null != account.getAccountid() && 1 != account.getIslogined()){
AccountInfo accInfo = accountService.findAccountInfoByid(account.getAccountid());
if(null != accInfo){
//转发给pc端
ChannelHandlerContext chx = NettyConnectionUtil.getClientChannelHandlerContextByUserId(accInfo.getAccount());
if(null != chx){
MessageUtil.sendJsonMsg(chx, EnumMsgType.PostMomentsPraiseCountNotice, NettyConnectionUtil.getNettyId(chx), null, req);
}
}
//告诉客户端消息已收到
MessageUtil.sendMsg(ctx, EnumMsgType.MsgReceivedAck, vo.getAccessToken(), vo.getId(), null);
}else{
//对方不在线
MessageUtil.sendErrMsg(ctx, EnumErrorCode.TargetNotOnline, Constant.ERROR_MSG_NOTONLINE);
}
} catch (Exception e) {
e.printStackTrace();
MessageUtil.sendErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL);
}
}
}


野狼QQ:526165339

作者头像
5G时代智能云科技创始人

微信云控系统采用ipad协议开发无需手机设备,由多年互联网营销工作经验的精英团队研发的一套营销推广工具,批量添加好友,通讯录批量添加,朋友圈营销,爆群成员,爆粉功能,养号功能,客服功能,批量管理账号,无需担心封号,是一种全新升级的互联网营销系统,能协助客户处理营销推广全过程中碰到的难题,提高高效率,5G时代已经来临,微信云控智能系统使互联网营销变的更加方便。

上一篇:已是最后一篇文章
下一篇:群控和云控那个好

发表评论