Commit de3cc30f by 郑永强

解决小睿出版社收录无响应的问题

parent df578ffe
......@@ -547,13 +547,14 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
//判断是否是平台端配置的小号,如果是,走平台端
PcloudRobot pcloudRobot = pcloudRobotDao.getByWxId(sendTextDTO.getWxId());
if (pcloudRobot!=null){
// 小睿对话索要出版社信息
boolean _continue = replySelfKeywordTemplate(sendTextDTO);
// 判断是否需要继续走下去
if(!_continue) { return; }
sendPcloudKeyword(sendTextDTO,pcloudRobot);
return;
}
if (SendMessageTypeEnum.SELF.getCode().equals(sendTextDTO.getCode())) {
// 小睿对话索要出版社信息
boolean _continue = replySelfKeywordTemplate(sendTextDTO);
if(_continue) {
dealBookGroupCipher(sendTextDTO);
//判断是否为某个群分类名称
inviteToGroupByKeyword(sendTextDTO);
......@@ -563,10 +564,10 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
replySelfKeyword(sendTextDTO);
}
}
}
@ParamLog("小睿根据书名推送匹配的资源")
private boolean replySelfKeywordTemplate(SendTextDTO sendTextDTO) {
try {
String content = sendTextDTO.getTextContent();
String redisKey = "replySelfKeywordTemplate:"+sendTextDTO.getWxId()+":"+sendTextDTO.getWechatUserId();
List<SelfRobotKeywordReplyTemplate> replyTemplateList = selfRobotKeywordReplyTemplateDao.getList();
......@@ -584,7 +585,8 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
return true;
}
String agentName = content.substring(index + 4);
if(StringUtil.isNotNull(agentName)){
// 如果出版社名称为空,则直接return走非关键逻辑
if(StringUtil.isEmpty(agentName)){ return true; }
// 从redis取出书名
String bookName = JedisClusterUtils.get(redisKey);
// 删掉书名
......@@ -601,7 +603,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
}
Optional<SelfRobotKeywordReplyTemplate> replyTemplate = replyTemplateList.stream().filter(x -> x.getStatus().equals(2)).findFirst();
sendText(sendTextDTO, replyTemplate.get().getReplyContentTemplate());
}
return false;
}
String bookName = matcher.group(1).trim();
......@@ -614,6 +616,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
// 呃,小睿刚才仔细的找了下,发现书刊的配套资源我这边还没有呢,要不等小睿看完整理好后再给你吧
Optional<SelfRobotKeywordReplyTemplate> replyTemplate = replyTemplateList.stream().filter(x -> x.getStatus().equals(3)).findFirst();
sendText(sendTextDTO, replyTemplate.get().getReplyContentTemplate().replace("${bookName}",bookName));
return false;
} else {
// 根据bookIds查询资源数;
Integer totalCount = channelConsr.getMessageCountByBookIds(bookIds);
......@@ -644,9 +647,13 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
Optional<SelfRobotKeywordReplyTemplate> replyTemplate = replyTemplateList.stream().filter(x -> x.getStatus().equals(1)).findFirst();
sendText(sendTextDTO, replyTemplate.get().getReplyContentTemplate().replace("${bookName}",bookName));
}
}
return false;
}
} catch (Exception e) {
log.info("小睿收集出版社信息异常;异常信息:" + e.getMessage());
return true;
}
}
@ParamLog("发送平台端小号的")
private void sendPcloudKeyword(SendTextDTO sendTextDTO,PcloudRobot pcloudRobot) {
......
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