Commit a7eb2ddb by 裴大威

Merge branch 'feat-1002472' into 'master'

书名替换

See merge request rays/pcloud-book!488
parents b3d073e9 94481998
......@@ -594,6 +594,9 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
Integer type=item.getReplyType();
if (ReplyTypeEnum.TEXT.value.equals(type)&&item.getContent().contains(USER_SEND_CONTENT)) {
item.setContent(item.getContent().replace(USER_SEND_CONTENT,userSendContent));
//保持用户输入的内容
String key ="BOOK:USER_SEND_CONTENT:" + userWxId + "-" +robotId;
JedisClusterUtils.setJson(key, userSendContent);
}
}
return itemNew;
......@@ -614,7 +617,26 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
if(content.indexOf(PersonalStageConstant.PERSONAL_STAGE_PROJECT_PROGRESS_TEMPLATE) > -1){
tryInsertNumber(personalStageUserId);
String longUrl = wechatLinkPrefix.concat(PersonalStageConstant.PERSONAL_STAGE_PROJECT_PROGRESS).concat("?wxUserId=" + userWxId + "&robotId=" + robotId + "&personalStageUserId=" + personalStageUserId);
return content.replace(PersonalStageConstant.PERSONAL_STAGE_PROJECT_PROGRESS_TEMPLATE, UrlUtils.getShortUrl4Own(longUrl));
content = content.replace(PersonalStageConstant.PERSONAL_STAGE_PROJECT_PROGRESS_TEMPLATE, UrlUtils.getShortUrl4Own(longUrl));
}
content = replaceUserSendContent(content, robotId, userWxId);
return content;
}
/**
* 替换用户发送内容(书名)
* @param content
* @param robotId
* @param userWxId
* @return
*/
public String replaceUserSendContent(String content, String robotId, String userWxId) {
if(content.indexOf(USER_SEND_CONTENT) > -1){
String key ="BOOK:USER_SEND_CONTENT:" + userWxId + "-" +robotId;
String userSendContent = JedisClusterUtils.getJson(key, String.class);
if (!StringUtil.isEmpty(userSendContent)){
content = content.replace(USER_SEND_CONTENT, userSendContent);
}
}
return content;
}
......
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