Commit 161649dc by 阮思源

修改下

parent 6616a6ca
...@@ -118,6 +118,8 @@ public class BookGuideBizImpl implements BookGuideBiz { ...@@ -118,6 +118,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
return; return;
} }
final JoinGroupCipherDTO dto = joinGroupCipherDao.getDTOByCipher(cipher); final JoinGroupCipherDTO dto = joinGroupCipherDao.getDTOByCipher(cipher);
//获取群
final String wxGroupId = bookGroupClassifyBiz.getWxGroupIdByClassifyIdAndWechatId(dto.getClassifyId(), dto.getWechatUserId());
if (agreeAddUserDTO.getFirst() != null && agreeAddUserDTO.getFirst()) { if (agreeAddUserDTO.getFirst() != null && agreeAddUserDTO.getFirst()) {
// 如果是第一次就只发欢迎文案 // 如果是第一次就只发欢迎文案
SendTextMessageVO vo = new SendTextMessageVO(); SendTextMessageVO vo = new SendTextMessageVO();
...@@ -134,12 +136,11 @@ public class BookGuideBizImpl implements BookGuideBiz { ...@@ -134,12 +136,11 @@ public class BookGuideBizImpl implements BookGuideBiz {
// 根据暗号获取分类id和bookGroupId推送关键词欢迎语 // 根据暗号获取分类id和bookGroupId推送关键词欢迎语
List<KeywordDTO> keywords = bookKeywordBiz.listFiveKeyword(dto.getClassifyId(), dto.getBookGroupId()); List<KeywordDTO> keywords = bookKeywordBiz.listFiveKeyword(dto.getClassifyId(), dto.getBookGroupId());
//发主打资源 //发主打资源
sendMainKeyword(keywords,agreeAddUserDTO,dto); sendMainKeyword(keywords,agreeAddUserDTO,dto,wxGroupId);
//发关键词列表 //发关键词列表
SendWeixinRequestTools.sendKeywordsInfo(keywords, agreeAddUserDTO.getRobotWxId(), agreeAddUserDTO.getUserWxId(), agreeAddUserDTO.getIp()); SendWeixinRequestTools.sendKeywordsInfo(keywords, agreeAddUserDTO.getRobotWxId(), agreeAddUserDTO.getUserWxId(), agreeAddUserDTO.getIp());
} }
// 拉群 // 拉群
final String wxGroupId = bookGroupClassifyBiz.getWxGroupIdByClassifyIdAndWechatId(dto.getClassifyId(), dto.getWechatUserId());
final Integer peopleCounts = WxGroupSDK.getPeopleCounts(wxGroupId, agreeAddUserDTO.getRobotWxId(), agreeAddUserDTO.getIp()); final Integer peopleCounts = WxGroupSDK.getPeopleCounts(wxGroupId, agreeAddUserDTO.getRobotWxId(), agreeAddUserDTO.getIp());
// 邀请好友进群有次数限制,目前测试为每天只能拉30-40人就操作频繁,所以在此加判断,超过30人或者群人数超过30人就发送邀请链接 // 邀请好友进群有次数限制,目前测试为每天只能拉30-40人就操作频繁,所以在此加判断,超过30人或者群人数超过30人就发送邀请链接
final String num = JedisClusterUtils.get(BookConstant.WXGROUP_ADD_USER_NUM + agreeAddUserDTO.getRobotWxId()); final String num = JedisClusterUtils.get(BookConstant.WXGROUP_ADD_USER_NUM + agreeAddUserDTO.getRobotWxId());
...@@ -178,17 +179,18 @@ public class BookGuideBizImpl implements BookGuideBiz { ...@@ -178,17 +179,18 @@ public class BookGuideBizImpl implements BookGuideBiz {
} }
@ParamLog("发送主打资源") @ParamLog("发送主打资源")
private void sendMainKeyword(List<KeywordDTO> keywords, AgreeAddUserDTO agreeAddUserDTO, JoinGroupCipherDTO dto) { private void sendMainKeyword(List<KeywordDTO> keywords, AgreeAddUserDTO agreeAddUserDTO, JoinGroupCipherDTO dto, String wxGroupId) {
if (!ListUtils.isEmpty(keywords)) { if (!ListUtils.isEmpty(keywords)) {
KeywordDTO keywordDTO = keywords.get(0); KeywordDTO keywordDTO = keywords.get(0);
Keyword keyword = keywordDao.getById(keywordDTO.getKeywordId()); Keyword keyword = keywordDao.getById(keywordDTO.getKeywordId());
if (keyword != null) { GroupQrcodeDTO groupQrcodeInfo = groupQrcodeDao.getGroupQrcodeInfo(wxGroupId);
if (keyword != null && groupQrcodeInfo != null) {
ReplyKeywordDTO replyKeywordDTO = new ReplyKeywordDTO(); ReplyKeywordDTO replyKeywordDTO = new ReplyKeywordDTO();
BeanUtils.copyProperties(keyword, replyKeywordDTO); BeanUtils.copyProperties(keyword, replyKeywordDTO);
if (ReplyTypeEnum.APP.value.equals(replyKeywordDTO.getReplyType()) || ReplyTypeEnum.LINK.value.equals(replyKeywordDTO.getReplyType())) { if (ReplyTypeEnum.APP.value.equals(replyKeywordDTO.getReplyType()) || ReplyTypeEnum.LINK.value.equals(replyKeywordDTO.getReplyType())) {
BookGroupDTO bookGroupDTO = bookGroupDao.getDTOById(dto.getBookGroupId()); BookGroupDTO bookGroupDTO = bookGroupDao.getDTOById(dto.getBookGroupId());
AccountSettingDto accountSettingDto = qrcodeSceneConsr.getWechatInfo(bookGroupDTO.getChannelId()); AccountSettingDto accountSettingDto = qrcodeSceneConsr.getWechatInfo(bookGroupDTO.getChannelId());
String linkUrl = SendWeixinRequestTools.splitUrlNew(accountSettingDto, replyKeywordDTO.getLinkUrl(), dto.getBookGroupId(), dto.getClassifyId(), dto.getQrcodeId()); String linkUrl = SendWeixinRequestTools.splitUrlNew(accountSettingDto, replyKeywordDTO.getLinkUrl(), dto.getBookGroupId(), dto.getClassifyId(), groupQrcodeInfo.getId());
replyKeywordDTO.setLinkUrl(linkUrl); replyKeywordDTO.setLinkUrl(linkUrl);
} }
SendWeixinRequestTools.sendKeywordMessage(replyKeywordDTO, agreeAddUserDTO.getRobotWxId(), agreeAddUserDTO.getRobotWxId(), agreeAddUserDTO.getIp(), SendMessageTypeEnum.SELF.getCode()); SendWeixinRequestTools.sendKeywordMessage(replyKeywordDTO, agreeAddUserDTO.getRobotWxId(), agreeAddUserDTO.getRobotWxId(), agreeAddUserDTO.getIp(), SendMessageTypeEnum.SELF.getCode());
......
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