Commit f90e8245 by 裴大威

fix 统一字段

parent 65bd192b
...@@ -199,9 +199,12 @@ public class BookApplication { ...@@ -199,9 +199,12 @@ public class BookApplication {
return RabbitMQFactory.bindingExchange(wxGroupLearningReportQueue(), MQTopicProducer.WXGROUP_LEARNING_REPORT); return RabbitMQFactory.bindingExchange(wxGroupLearningReportQueue(), MQTopicProducer.WXGROUP_LEARNING_REPORT);
} }
/**
* 微信个人机器人同意加好友
*/
@Bean @Bean
public Queue wxGroupAgreeAddUserQueue() { public Queue wxGroupAgreeAddUserQueue() {
return RabbitMQFactory.queueBuilder(MQTopicConumer.WXGROUP_AGREE_ADD_USER); return RabbitMQFactory.queueBuilder(MQTopicConumer.WX_AGREE_ADD_USER);
} }
@Bean @Bean
......
...@@ -312,7 +312,7 @@ public class AdNewsBizImpl implements AdNewsBiz { ...@@ -312,7 +312,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setContent(content); sendTextMessageVO.setContent(content);
sendTextMessageVO.setAltId(robotId); sendTextMessageVO.setAltId(robotId);
sendTextMessageVO.setGroupId(weixinGroupId); sendTextMessageVO.setWxGroupId(weixinGroupId);
sendTextMessageVO.setIp(findIp(weixinGroupId)); sendTextMessageVO.setIp(findIp(weixinGroupId));
WxGroupSDK.sendTextMessage(sendTextMessageVO); WxGroupSDK.sendTextMessage(sendTextMessageVO);
LOGGER.info("发送编辑端早晚报" + sendTextMessageVO.toString()); LOGGER.info("发送编辑端早晚报" + sendTextMessageVO.toString());
......
...@@ -719,7 +719,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -719,7 +719,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
} }
} }
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setGroupId(groupId); sendTextMessageVO.setWxGroupId(groupId);
sendTextMessageVO.setAltId(altId); sendTextMessageVO.setAltId(altId);
sendTextMessageVO.setContent(adTitle); sendTextMessageVO.setContent(adTitle);
sendTextMessageVO.setIp(findIp(groupId)); sendTextMessageVO.setIp(findIp(groupId));
...@@ -730,7 +730,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -730,7 +730,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
sendArticleMessageVO.setAltId(altId); sendArticleMessageVO.setAltId(altId);
sendArticleMessageVO.setTitle(advertisingSpace.getAdTitle()); sendArticleMessageVO.setTitle(advertisingSpace.getAdTitle());
sendArticleMessageVO.setDescription(advertisingSpace.getAdSlogan()); sendArticleMessageVO.setDescription(advertisingSpace.getAdSlogan());
sendArticleMessageVO.setGroupId(groupId); sendArticleMessageVO.setWxGroupId(groupId);
String adLink = ""; String adLink = "";
if (!StringUtil.isEmpty(advertisingSpace.getAdLink())) { if (!StringUtil.isEmpty(advertisingSpace.getAdLink())) {
if (advertisingSpace.getAdLink().contains("?")) { if (advertisingSpace.getAdLink().contains("?")) {
...@@ -752,7 +752,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -752,7 +752,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
} else if (AdPositionModeEnum.JUST_PIC.modeCode.equals(advertisingSpace.getAdPositionMode())) { } else if (AdPositionModeEnum.JUST_PIC.modeCode.equals(advertisingSpace.getAdPositionMode())) {
SendPicMessageVO sendPicMessageVO = new SendPicMessageVO(); SendPicMessageVO sendPicMessageVO = new SendPicMessageVO();
sendPicMessageVO.setAltId(altId); sendPicMessageVO.setAltId(altId);
sendPicMessageVO.setGroupId(groupId); sendPicMessageVO.setWxGroupId(groupId);
sendPicMessageVO.setPicUrl(advertisingSpace.getAdPic()); sendPicMessageVO.setPicUrl(advertisingSpace.getAdPic());
sendPicMessageVO.setIp(findIp(groupId)); sendPicMessageVO.setIp(findIp(groupId));
LOGGER.info("发送微信消息-纯图片" + sendPicMessageVO.toString()); LOGGER.info("发送微信消息-纯图片" + sendPicMessageVO.toString());
......
...@@ -377,7 +377,7 @@ public class BookClockBizImpl implements BookClockBiz { ...@@ -377,7 +377,7 @@ public class BookClockBizImpl implements BookClockBiz {
//获取机器人微信号 //获取机器人微信号
String altId = wechatGroupConsr.getRobotIdByGroupId(weixinGroupId); String altId = wechatGroupConsr.getRobotIdByGroupId(weixinGroupId);
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setGroupId(weixinGroupId); sendTextMessageVO.setWxGroupId(weixinGroupId);
sendTextMessageVO.setAltId(altId); sendTextMessageVO.setAltId(altId);
sendTextMessageVO.setContent(bookClockInfoDTO.getNoticeContent()); sendTextMessageVO.setContent(bookClockInfoDTO.getNoticeContent());
if(!MapUtils.isEmpty(wxQrcodeDTOMap) && wxQrcodeDTOMap.containsKey(weixinGroupId)){ if(!MapUtils.isEmpty(wxQrcodeDTOMap) && wxQrcodeDTOMap.containsKey(weixinGroupId)){
......
...@@ -161,13 +161,13 @@ public class SendWeixinRequestTools { ...@@ -161,13 +161,13 @@ public class SendWeixinRequestTools {
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setContent(sendMessageDTO.getContent()); sendTextMessageVO.setContent(sendMessageDTO.getContent());
sendTextMessageVO.setAltId(robotId); sendTextMessageVO.setAltId(robotId);
sendTextMessageVO.setGroupId(weixinGroupId); sendTextMessageVO.setWxGroupId(weixinGroupId);
sendTextMessageVO.setIp(ip); sendTextMessageVO.setIp(ip);
sendTextMessageVO.setCode(code); sendTextMessageVO.setCode(code);
WxGroupSDK.sendTextMessage(sendTextMessageVO); WxGroupSDK.sendTextMessage(sendTextMessageVO);
} else if (ReplyTypeEnum.IMAGE.value.equals(sendMessageDTO.getReplyType())) { } else if (ReplyTypeEnum.IMAGE.value.equals(sendMessageDTO.getReplyType())) {
SendPicMessageVO sendPicMessageVO = new SendPicMessageVO(); SendPicMessageVO sendPicMessageVO = new SendPicMessageVO();
sendPicMessageVO.setGroupId(weixinGroupId); sendPicMessageVO.setWxGroupId(weixinGroupId);
sendPicMessageVO.setAltId(robotId); sendPicMessageVO.setAltId(robotId);
sendPicMessageVO.setPicUrl(sendMessageDTO.getPicUrl()); sendPicMessageVO.setPicUrl(sendMessageDTO.getPicUrl());
sendPicMessageVO.setIp(ip); sendPicMessageVO.setIp(ip);
...@@ -178,7 +178,7 @@ public class SendWeixinRequestTools { ...@@ -178,7 +178,7 @@ public class SendWeixinRequestTools {
sendArticleMessageVO.setAltId(robotId); sendArticleMessageVO.setAltId(robotId);
sendArticleMessageVO.setDescription(sendMessageDTO.getDescription()); sendArticleMessageVO.setDescription(sendMessageDTO.getDescription());
sendArticleMessageVO.setLinkUrl(sendMessageDTO.getLinkUrl()); sendArticleMessageVO.setLinkUrl(sendMessageDTO.getLinkUrl());
sendArticleMessageVO.setGroupId(weixinGroupId); sendArticleMessageVO.setWxGroupId(weixinGroupId);
sendArticleMessageVO.setPicUrl(sendMessageDTO.getPicUrl()); sendArticleMessageVO.setPicUrl(sendMessageDTO.getPicUrl());
sendArticleMessageVO.setTitle(sendMessageDTO.getContent()); sendArticleMessageVO.setTitle(sendMessageDTO.getContent());
sendArticleMessageVO.setIp(ip); sendArticleMessageVO.setIp(ip);
...@@ -192,7 +192,7 @@ public class SendWeixinRequestTools { ...@@ -192,7 +192,7 @@ public class SendWeixinRequestTools {
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setContent(nickNameStr); sendTextMessageVO.setContent(nickNameStr);
sendTextMessageVO.setAltId(robotId); sendTextMessageVO.setAltId(robotId);
sendTextMessageVO.setGroupId(weixinGroupId); sendTextMessageVO.setWxGroupId(weixinGroupId);
sendTextMessageVO.setIp(ip); sendTextMessageVO.setIp(ip);
WxGroupSDK.sendTextMessage(sendTextMessageVO); WxGroupSDK.sendTextMessage(sendTextMessageVO);
...@@ -220,11 +220,11 @@ public class SendWeixinRequestTools { ...@@ -220,11 +220,11 @@ public class SendWeixinRequestTools {
} }
sendTextMessageVO.setContent(recommendLanguage); sendTextMessageVO.setContent(recommendLanguage);
sendTextMessageVO.setAltId(robotId); sendTextMessageVO.setAltId(robotId);
sendTextMessageVO.setGroupId(weixinGroupId); sendTextMessageVO.setWxGroupId(weixinGroupId);
sendTextMessageVO.setIp(ip); sendTextMessageVO.setIp(ip);
WxGroupSDK.sendTextMessage(sendTextMessageVO); WxGroupSDK.sendTextMessage(sendTextMessageVO);
SendPicMessageVO sendPicMessageVO = new SendPicMessageVO(); SendPicMessageVO sendPicMessageVO = new SendPicMessageVO();
sendPicMessageVO.setGroupId(weixinGroupId); sendPicMessageVO.setWxGroupId(weixinGroupId);
sendPicMessageVO.setAltId(robotId); sendPicMessageVO.setAltId(robotId);
sendPicMessageVO.setPicUrl(accountSettingDto.getQrcodeUrl()); sendPicMessageVO.setPicUrl(accountSettingDto.getQrcodeUrl());
sendPicMessageVO.setIp(ip); sendPicMessageVO.setIp(ip);
...@@ -299,7 +299,7 @@ public class SendWeixinRequestTools { ...@@ -299,7 +299,7 @@ public class SendWeixinRequestTools {
private static void sendTextMessageToSelf(String content, String robotId, String toWxId, String ip){ private static void sendTextMessageToSelf(String content, String robotId, String toWxId, String ip){
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setCode(SendMessageTypeEnum.SELF.getCode()); sendTextMessageVO.setCode(SendMessageTypeEnum.SELF.getCode());
sendTextMessageVO.setGroupId(toWxId); sendTextMessageVO.setWxGroupId(toWxId);
sendTextMessageVO.setContent(content); sendTextMessageVO.setContent(content);
sendTextMessageVO.setAltId(robotId); sendTextMessageVO.setAltId(robotId);
sendTextMessageVO.setIp(ip); sendTextMessageVO.setIp(ip);
...@@ -310,7 +310,7 @@ public class SendWeixinRequestTools { ...@@ -310,7 +310,7 @@ public class SendWeixinRequestTools {
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setContent(content); sendTextMessageVO.setContent(content);
sendTextMessageVO.setAltId(robotId); sendTextMessageVO.setAltId(robotId);
sendTextMessageVO.setGroupId(weixinGroupId); sendTextMessageVO.setWxGroupId(weixinGroupId);
sendTextMessageVO.setIp(ip); sendTextMessageVO.setIp(ip);
WxGroupSDK.sendTextMessage(sendTextMessageVO); WxGroupSDK.sendTextMessage(sendTextMessageVO);
} }
...@@ -319,7 +319,7 @@ public class SendWeixinRequestTools { ...@@ -319,7 +319,7 @@ public class SendWeixinRequestTools {
// SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); // SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
// sendTextMessageVO.setContent("关键词1:a" + "\n" + "换行换行换行" + "\n"); // sendTextMessageVO.setContent("关键词1:a" + "\n" + "换行换行换行" + "\n");
// sendTextMessageVO.setAltId("wxid_qj200bf0key022"); // sendTextMessageVO.setAltId("wxid_qj200bf0key022");
// sendTextMessageVO.setGroupId("14108963419@chatroom"); // sendTextMessageVO.setWxGroupId("14108963419@chatroom");
// WxGroupSDK.sendTextMessage(sendTextMessageVO); // WxGroupSDK.sendTextMessage(sendTextMessageVO);
} }
...@@ -365,7 +365,7 @@ public class SendWeixinRequestTools { ...@@ -365,7 +365,7 @@ public class SendWeixinRequestTools {
public static void sendClockKeywordsInfo(List<BookClockKeywordDTO> keywords, String robotId, String weixinGroupId, String ip) { public static void sendClockKeywordsInfo(List<BookClockKeywordDTO> keywords, String robotId, String weixinGroupId, String ip) {
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setAltId(robotId); sendTextMessageVO.setAltId(robotId);
sendTextMessageVO.setGroupId(weixinGroupId); sendTextMessageVO.setWxGroupId(weixinGroupId);
sendTextMessageVO.setIp(ip); sendTextMessageVO.setIp(ip);
if (ListUtils.isEmpty(keywords)) { if (ListUtils.isEmpty(keywords)) {
return; return;
......
...@@ -116,7 +116,7 @@ public class BookGuideBizImpl implements BookGuideBiz { ...@@ -116,7 +116,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
vo.setContent("你好,我是本书智能小助手,请回复你的进群暗号,获取本书资源服务,以及入群链接如果忘了进群暗号,请重新扫描书上的二维码,点击入群即可获取"); vo.setContent("你好,我是本书智能小助手,请回复你的进群暗号,获取本书资源服务,以及入群链接如果忘了进群暗号,请重新扫描书上的二维码,点击入群即可获取");
vo.setCode(SendMessageTypeEnum.SELF.getCode()); vo.setCode(SendMessageTypeEnum.SELF.getCode());
vo.setWxId(agreeAddUserDTO.getRobotWxId()); vo.setWxId(agreeAddUserDTO.getRobotWxId());
vo.setGroupId(agreeAddUserDTO.getUserWxId()); vo.setWxGroupId(agreeAddUserDTO.getUserWxId());
log.info("[同意加好友发送欢迎语] : {}", vo); log.info("[同意加好友发送欢迎语] : {}", vo);
WxGroupSDK.sendTextMessage(vo); WxGroupSDK.sendTextMessage(vo);
// 根据暗号获取分类id和bookGroupId推送关键词欢迎语 // 根据暗号获取分类id和bookGroupId推送关键词欢迎语
......
...@@ -6,12 +6,15 @@ import com.pcloud.book.keywords.vo.GuideVO; ...@@ -6,12 +6,15 @@ import com.pcloud.book.keywords.vo.GuideVO;
import com.pcloud.book.keywords.vo.ReplyMessageVO; import com.pcloud.book.keywords.vo.ReplyMessageVO;
import com.pcloud.book.keywords.vo.SetGuideVO; import com.pcloud.book.keywords.vo.SetGuideVO;
import com.pcloud.book.keywords.vo.UpdateGuideVO; import com.pcloud.book.keywords.vo.UpdateGuideVO;
import com.pcloud.common.core.constant.MQTopicProducer;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException; import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.ResponseHandleUtil; import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.common.utils.SessionUtil; import com.pcloud.common.utils.SessionUtil;
import com.pcloud.wechatgroup.message.dto.AgreeAddUserDTO;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -26,16 +29,34 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -26,16 +29,34 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import lombok.extern.slf4j.Slf4j;
/** /**
* @author lily * @author lily
* @date 2019/4/23 15:24 * @date 2019/4/23 15:24
*/ */
@Slf4j
@RestController("bookGuideFacade") @RestController("bookGuideFacade")
@RequestMapping("bookGuide") @RequestMapping("bookGuide")
public class BookGuideFacadeImpl implements BookGuideFacade { public class BookGuideFacadeImpl implements BookGuideFacade {
@Autowired @Autowired
private BookGuideBiz bookGuidBiz; private BookGuideBiz bookGuidBiz;
@Autowired
private AmqpTemplate amqpTemplate;
@PostMapping("test")
public void test() {
final AgreeAddUserDTO agreeAddUserDTO = new AgreeAddUserDTO();
agreeAddUserDTO.setNickName("大威");
agreeAddUserDTO.setRobotWxId("wxid_arjobo1bbk2i22");
// 当消息为个人消息时,wechatGroupId为发送人id
agreeAddUserDTO.setUserWxId("p867263500");
agreeAddUserDTO.setIp("http://192.168.92.122:8081");
log.info("[processSelfMessage] start convertAndSend agreeAddUserDTO:{}", agreeAddUserDTO);
// 发送topic book处理后续欢迎语,关键词和拉群操作
amqpTemplate.convertAndSend(MQTopicProducer.EXCHAGE, MQTopicProducer.WX_AGREE_ADD_USER, agreeAddUserDTO);
}
@Override @Override
@PostMapping("insertGuide") @PostMapping("insertGuide")
......
...@@ -73,6 +73,6 @@ public class MQTopicConumer { ...@@ -73,6 +73,6 @@ public class MQTopicConumer {
/** /**
* 微信群同意添加好友成功 * 微信群同意添加好友成功
*/ */
public static final String WXGROUP_AGREE_ADD_USER = PREFIX + MQTopicProducer.WX_AGREE_ADD_USER; public static final String WX_AGREE_ADD_USER = PREFIX + MQTopicProducer.WX_AGREE_ADD_USER;
} }
...@@ -67,7 +67,7 @@ public class UpdateWXGroupNameListener { ...@@ -67,7 +67,7 @@ public class UpdateWXGroupNameListener {
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setContent("@"+groupNameDTO.getNickName()+",为方便群友入群分享好的助学方法,请不要随意修改群名。如再修改,会将您移出群聊。谢谢配合。"); sendTextMessageVO.setContent("@"+groupNameDTO.getNickName()+",为方便群友入群分享好的助学方法,请不要随意修改群名。如再修改,会将您移出群聊。谢谢配合。");
sendTextMessageVO.setAltId(altId); sendTextMessageVO.setAltId(altId);
sendTextMessageVO.setGroupId(wechatGroupId); sendTextMessageVO.setWxGroupId(wechatGroupId);
LOGGER.info("发送警告文本消息"+sendTextMessageVO.toString()); LOGGER.info("发送警告文本消息"+sendTextMessageVO.toString());
sendTextMessageVO.setIp(findIp(wechatGroupId)); sendTextMessageVO.setIp(findIp(wechatGroupId));
WxGroupSDK.sendTextMessage(sendTextMessageVO); WxGroupSDK.sendTextMessage(sendTextMessageVO);
......
...@@ -25,6 +25,7 @@ import com.pcloud.wechatgroup.message.dto.GroupLearningReportDTO; ...@@ -25,6 +25,7 @@ import com.pcloud.wechatgroup.message.dto.GroupLearningReportDTO;
import com.sdk.wxgroup.SendPicMessageVO; import com.sdk.wxgroup.SendPicMessageVO;
import com.sdk.wxgroup.SendTextMessageVO; import com.sdk.wxgroup.SendTextMessageVO;
import com.sdk.wxgroup.WxGroupSDK; import com.sdk.wxgroup.WxGroupSDK;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitHandler;
...@@ -63,8 +64,9 @@ public class WXGroupLearningReportListener { ...@@ -63,8 +64,9 @@ public class WXGroupLearningReportListener {
try { try {
if (groupLearningReportDTO == null if (groupLearningReportDTO == null
|| groupLearningReportDTO.getWechatGroupId() == null || groupLearningReportDTO.getWechatGroupId() == null
|| groupLearningReportDTO.getWechatUserId() == null) || groupLearningReportDTO.getWechatUserId() == null) {
return; return;
}
String wechatUserId = groupLearningReportDTO.getWechatUserId(); String wechatUserId = groupLearningReportDTO.getWechatUserId();
String wechatGroupId = groupLearningReportDTO.getWechatGroupId(); String wechatGroupId = groupLearningReportDTO.getWechatGroupId();
//新增触发记录 //新增触发记录
...@@ -102,7 +104,7 @@ public class WXGroupLearningReportListener { ...@@ -102,7 +104,7 @@ public class WXGroupLearningReportListener {
return; return;
} }
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setGroupId(wechatGroupId); sendTextMessageVO.setWxGroupId(wechatGroupId);
sendTextMessageVO.setAltId(alt); sendTextMessageVO.setAltId(alt);
sendTextMessageVO.setContent("个人专属学习报告,及群成员元气排行榜。点击获取" + resultUrl); sendTextMessageVO.setContent("个人专属学习报告,及群成员元气排行榜。点击获取" + resultUrl);
sendTextMessageVO.setIp(findIp(wechatGroupId)); sendTextMessageVO.setIp(findIp(wechatGroupId));
...@@ -115,7 +117,7 @@ public class WXGroupLearningReportListener { ...@@ -115,7 +117,7 @@ public class WXGroupLearningReportListener {
} }
SendPicMessageVO sendPicMessageVO = new SendPicMessageVO(); SendPicMessageVO sendPicMessageVO = new SendPicMessageVO();
sendPicMessageVO.setPicUrl(imageUrl); sendPicMessageVO.setPicUrl(imageUrl);
sendPicMessageVO.setGroupId(wechatGroupId); sendPicMessageVO.setWxGroupId(wechatGroupId);
sendPicMessageVO.setAltId(alt); sendPicMessageVO.setAltId(alt);
sendPicMessageVO.setIp(findIp(wechatGroupId)); sendPicMessageVO.setIp(findIp(wechatGroupId));
LOGGER.info("发送分享图消息开始"+sendTextMessageVO.toString()); LOGGER.info("发送分享图消息开始"+sendTextMessageVO.toString());
......
package com.pcloud.book.mq.topic; package com.pcloud.book.mq.topic;
import com.pcloud.book.keywords.biz.BookGuideBiz; import com.pcloud.book.keywords.biz.BookGuideBiz;
import com.pcloud.book.keywords.biz.BookKeywordBiz;
import com.pcloud.book.mq.config.MQTopicConumer; import com.pcloud.book.mq.config.MQTopicConumer;
import com.pcloud.common.core.aspect.ParamLog; import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.wechatgroup.message.dto.AgreeAddUserDTO; import com.pcloud.wechatgroup.message.dto.AgreeAddUserDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -24,7 +20,6 @@ import lombok.extern.slf4j.Slf4j; ...@@ -24,7 +20,6 @@ import lombok.extern.slf4j.Slf4j;
*/ */
@Slf4j @Slf4j
@Component @Component
@RabbitListener(queues = MQTopicConumer.WXGROUP_AGREE_ADD_USER)
public class WxAgreeAddUserListener { public class WxAgreeAddUserListener {
@Resource @Resource
...@@ -34,7 +29,7 @@ public class WxAgreeAddUserListener { ...@@ -34,7 +29,7 @@ public class WxAgreeAddUserListener {
* 接收微信用户进群消息 * 接收微信用户进群消息
*/ */
@ParamLog("同意加好友发送欢迎语") @ParamLog("同意加好友发送欢迎语")
@RabbitHandler @RabbitListener(queues = MQTopicConumer.WX_AGREE_ADD_USER)
public void onMessage(AgreeAddUserDTO agreeAddUserDTO) throws BizException { public void onMessage(AgreeAddUserDTO agreeAddUserDTO) throws BizException {
try { try {
bookGuideBiz.sendGuide(agreeAddUserDTO); bookGuideBiz.sendGuide(agreeAddUserDTO);
......
...@@ -320,7 +320,7 @@ public class PushBizImpl implements PushBiz { ...@@ -320,7 +320,7 @@ public class PushBizImpl implements PushBiz {
Integer itemType = pushItem.getItemType(); Integer itemType = pushItem.getItemType();
if (ItemTypeEnum.TEXT.value.equals(itemType)) { if (ItemTypeEnum.TEXT.value.equals(itemType)) {
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setGroupId(groupId); sendTextMessageVO.setWxGroupId(groupId);
sendTextMessageVO.setAltId(altId); sendTextMessageVO.setAltId(altId);
sendTextMessageVO.setContent(pushItem.getTextContent()); sendTextMessageVO.setContent(pushItem.getTextContent());
sendTextMessageVO.setPushGroupRecordId(pushGroupRecordId); sendTextMessageVO.setPushGroupRecordId(pushGroupRecordId);
...@@ -331,7 +331,7 @@ public class PushBizImpl implements PushBiz { ...@@ -331,7 +331,7 @@ public class PushBizImpl implements PushBiz {
SendArticleMessageVO sendArticleMessageVO = new SendArticleMessageVO(); SendArticleMessageVO sendArticleMessageVO = new SendArticleMessageVO();
sendArticleMessageVO.setAltId(altId); sendArticleMessageVO.setAltId(altId);
sendArticleMessageVO.setDescription(pushItem.getLinkDescription()); sendArticleMessageVO.setDescription(pushItem.getLinkDescription());
sendArticleMessageVO.setGroupId(groupId); sendArticleMessageVO.setWxGroupId(groupId);
String url = pushItem.getLinkUrl(); String url = pushItem.getLinkUrl();
if (url.contains("?")) { if (url.contains("?")) {
url = url + "&" + otherUrl; url = url + "&" + otherUrl;
...@@ -359,7 +359,7 @@ public class PushBizImpl implements PushBiz { ...@@ -359,7 +359,7 @@ public class PushBizImpl implements PushBiz {
SendArticleMessageVO sendArticleMessageVO = new SendArticleMessageVO(); SendArticleMessageVO sendArticleMessageVO = new SendArticleMessageVO();
sendArticleMessageVO.setAltId(altId); sendArticleMessageVO.setAltId(altId);
sendArticleMessageVO.setDescription(appDto.getTypeName()); sendArticleMessageVO.setDescription(appDto.getTypeName());
sendArticleMessageVO.setGroupId(groupId); sendArticleMessageVO.setWxGroupId(groupId);
// 处理链接地址 // 处理链接地址
String endUrl = pushItem.getAppUrl() + "&" + otherUrl; String endUrl = pushItem.getAppUrl() + "&" + otherUrl;
String linkUrl = SendWeixinRequestTools.splitUrl(accountSettingDto, endUrl); String linkUrl = SendWeixinRequestTools.splitUrl(accountSettingDto, endUrl);
...@@ -381,7 +381,7 @@ public class PushBizImpl implements PushBiz { ...@@ -381,7 +381,7 @@ public class PushBizImpl implements PushBiz {
if (productDto.getProductTypeDto() != null) { if (productDto.getProductTypeDto() != null) {
sendArticleMessageVO.setDescription(productDto.getProductTypeDto().getTypeName()); sendArticleMessageVO.setDescription(productDto.getProductTypeDto().getTypeName());
} }
sendArticleMessageVO.setGroupId(groupId); sendArticleMessageVO.setWxGroupId(groupId);
// 处理链接地址 // 处理链接地址
String endUrl = pushItem.getProductUrl() + "&" + otherUrl; String endUrl = pushItem.getProductUrl() + "&" + otherUrl;
String linkUrl = SendWeixinRequestTools.splitUrl(accountSettingDto, endUrl); String linkUrl = SendWeixinRequestTools.splitUrl(accountSettingDto, endUrl);
...@@ -399,7 +399,7 @@ public class PushBizImpl implements PushBiz { ...@@ -399,7 +399,7 @@ public class PushBizImpl implements PushBiz {
if (ItemTypeEnum.IMAGE.value.equals(itemType)) { if (ItemTypeEnum.IMAGE.value.equals(itemType)) {
SendPicMessageVO sendPicMessageVO = new SendPicMessageVO(); SendPicMessageVO sendPicMessageVO = new SendPicMessageVO();
sendPicMessageVO.setAltId(altId); sendPicMessageVO.setAltId(altId);
sendPicMessageVO.setGroupId(groupId); sendPicMessageVO.setWxGroupId(groupId);
sendPicMessageVO.setPicUrl(pushItem.getImageUrl()); sendPicMessageVO.setPicUrl(pushItem.getImageUrl());
sendPicMessageVO.setPushGroupRecordId(pushGroupRecordId); sendPicMessageVO.setPushGroupRecordId(pushGroupRecordId);
sendPicMessageVO.setIp(findIp(groupId)); sendPicMessageVO.setIp(findIp(groupId));
...@@ -980,7 +980,7 @@ public class PushBizImpl implements PushBiz { ...@@ -980,7 +980,7 @@ public class PushBizImpl implements PushBiz {
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setContent(content); sendTextMessageVO.setContent(content);
sendTextMessageVO.setAltId(robotId); sendTextMessageVO.setAltId(robotId);
sendTextMessageVO.setGroupId(weixinGroupId); sendTextMessageVO.setWxGroupId(weixinGroupId);
sendTextMessageVO.setIp(findIp(weixinGroupId)); sendTextMessageVO.setIp(findIp(weixinGroupId));
WxGroupSDK.sendTextMessage(sendTextMessageVO); WxGroupSDK.sendTextMessage(sendTextMessageVO);
LOGGER.info("发送早晚报" + sendTextMessageVO.toString()); LOGGER.info("发送早晚报" + sendTextMessageVO.toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment