Commit b842e438 by 裴大威

Merge branch 'fix-1002594new' into 'master'

qq欢迎语没有发出来bug修复

See merge request rays/pcloud-book!580
parents 8c878638 90833c23
......@@ -291,7 +291,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
}
}else{
//qq同意加好友 并发送欢迎语
PcloudRobot pcloudRobot = pcloudRobotDao.getByWxId(agreeAddUserDTO.getRobotWxId());
PcloudRobot pcloudRobot = pcloudRobotDao.getByWxId(agreeAddUserDTO.getReceiverId().toString());
if (pcloudRobot!=null){
//删除需求单记录
//TODO
......
......@@ -943,7 +943,13 @@ wechatGroupConsr.sendMessage(JSON.toJSONString(sendFileVO));
if(getUserTdState(receiverId.toString(), userId.toString()) == 1) {
return;
}
pcloudRobotSet.fillRobotWelcome(robotWelcomeListByPcloudClassifyId);
for (PcloudRobotWelcome pcloudRobotWelcome:robotWelcomeListByPcloudClassifyId) {
try {
Thread.sleep(1000 * pcloudRobotWelcome.getWelcomeDuration());
} catch (InterruptedException e) {
LOGGER.error("线程睡眠出错==", e);
}
PrivateMsgSendVO privateMsgSendVO = new PrivateMsgSendVO();
privateMsgSendVO.setSenderQQCode(Long.valueOf(receiverId));
privateMsgSendVO.setReceiverQQCode(Long.valueOf(userId));
......@@ -952,30 +958,47 @@ wechatGroupConsr.sendMessage(JSON.toJSONString(sendFileVO));
String message = new MessageBuilder().add(new ComponentText(pcloudRobotWelcome.getContent())).toString();// 文本消息
privateMsgSendVO.setMessage(message);
wechatGroupConsr.sendMessage4QQ(privateMsgSendVO);
return;
continue;
}
if (WelcomeReplyTypeEnum.IMAGE.value.equals(pcloudRobotWelcome.getReplyType())) {
// 构造一个图片消息
String message = new MessageBuilder().add(new ComponentImage(pcloudRobotWelcome.getPicUrl())) .toString(); // 图片消息
privateMsgSendVO.setMessage(message);
wechatGroupConsr.sendMessage4QQ(privateMsgSendVO);
return;
continue;
}
if (WelcomeReplyTypeEnum.AUDIO.value.equals(pcloudRobotWelcome.getReplyType())) {
// 构造一个图片消息
// 构造一个音频消息
String message = new MessageBuilder().add(new ComponentRecord(pcloudRobotWelcome.getResourceUrl(),false)).toString(); // 音频消息
privateMsgSendVO.setMessage(message);
wechatGroupConsr.sendMessage4QQ(privateMsgSendVO);
return;
continue;
}
if (WelcomeReplyTypeEnum.RESOURCE.value.equals(pcloudRobotWelcome.getReplyType())) {
// 构造一个图片消息
// 构造一个资源文件消息
String message = new MessageBuilder().add(new ComponentRecord(pcloudRobotWelcome.getResourceId().toString(),false)).toString(); // 资源文件消息
privateMsgSendVO.setMessage(message);
wechatGroupConsr.sendMessage4QQ(privateMsgSendVO);
return;
continue;
}
}
try {
Thread.sleep(1000 * 5);
} catch (InterruptedException e) {
LOGGER.error("线程睡眠出错==", e);
}
if (robotWelcomeListByPcloudClassifyId != null && robotWelcomeListByPcloudClassifyId.size() >0 && robotWelcomeListByPcloudClassifyId.get(0).getIsOpenPushH5url() == 1) {
//发送H5链接
PrivateMsgSendVO privateMsgSendVO = new PrivateMsgSendVO();
privateMsgSendVO.setSenderQQCode(Long.valueOf(receiverId));
privateMsgSendVO.setReceiverQQCode(Long.valueOf(userId));
String endUrl = wechatLinkPrefix + "/dialog" + "?book_group_id=" + 0 + "&wxId=" + userId + "&robotWxId=" + receiverId;
String resultUrl = UrlUtils.getShortUrl4Own(endUrl);
String h5Content = "你可以通过点击" + resultUrl + ",或者输入【】内关键词唤醒我\n" + "小睿会在这里时时陪伴你";
String message = new MessageBuilder().add(new ComponentText(h5Content)).toString();// 文本消息
privateMsgSendVO.setMessage(message);
wechatGroupConsr.sendMessage4QQ(privateMsgSendVO);
}
}
......
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