Commit c750476f by 裴大威

欢迎语第一条加链接

parent 8c0322bf
...@@ -43,6 +43,7 @@ import com.pcloud.channelcenter.wechat.dto.AccountSettingDto; ...@@ -43,6 +43,7 @@ import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
import com.pcloud.common.core.aspect.ParamLog; import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils; import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.httpclient.UrlUtils;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.contentcenter.resource.dto.ResourceDTO; import com.pcloud.contentcenter.resource.dto.ResourceDTO;
import com.pcloud.wechatgroup.message.dto.AgreeAddUserDTO; import com.pcloud.wechatgroup.message.dto.AgreeAddUserDTO;
...@@ -121,6 +122,8 @@ public class BookGuideBizImpl implements BookGuideBiz { ...@@ -121,6 +122,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
private String envStr; private String envStr;
@Autowired @Autowired
private SelfRobotKeywordReplyDao selfRobotKeywordReplyDao; private SelfRobotKeywordReplyDao selfRobotKeywordReplyDao;
@Value("${wechat.group.link.prefix}")
private String wechatGroupLinkPrefix;
@ParamLog("同意加好友发送欢迎语") @ParamLog("同意加好友发送欢迎语")
@Override @Override
...@@ -323,9 +326,20 @@ public class BookGuideBizImpl implements BookGuideBiz { ...@@ -323,9 +326,20 @@ public class BookGuideBizImpl implements BookGuideBiz {
String ip = agreeAddUserDTO.getIp(); String ip = agreeAddUserDTO.getIp();
Integer code = SendMessageTypeEnum.SELF.getCode(); Integer code = SendMessageTypeEnum.SELF.getCode();
String robotId = agreeAddUserDTO.getRobotWxId(); String robotId = agreeAddUserDTO.getRobotWxId();
int i=0;
for (BookGroupFriendGuide bookGroupFriendGuide: friendGuideList){ for (BookGroupFriendGuide bookGroupFriendGuide: friendGuideList){
i=i+1;
Integer type = bookGroupFriendGuide.getType(); Integer type = bookGroupFriendGuide.getType();
if (ReplyTypeEnum.TEXT.value.equals(type)) { if (ReplyTypeEnum.TEXT.value.equals(type)) {
if (i==friendGuideList.size()){
String content=bookGroupFriendGuide.getContent();
if (!StringUtil.isEmpty(content)){
String endUrl = wechatGroupLinkPrefix+ "/dialog" + "?book_group_id=" + bookGroupId + "&wxId=" + userWxId + "&robotWxId=" + robotId;
String resultUrl = UrlUtils.getShortUrl4Own(endUrl);
content=content+"\n你可以通过点击"+resultUrl+",或者输入【】内关键词唤醒我\n" + "小睿会在这里时时陪伴你";
bookGroupFriendGuide.setContent(content);
}
}
SendTextMessageVO sendTextMessageVO = new SendTextMessageVO(); SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
sendTextMessageVO.setContent(bookGroupFriendGuide.getContent()); sendTextMessageVO.setContent(bookGroupFriendGuide.getContent());
sendTextMessageVO.setAltId(robotId); sendTextMessageVO.setAltId(robotId);
......
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