Commit 9b49d486 by zhuyajie

书名信息带入需求单

parent 9536bcc3
...@@ -7,6 +7,9 @@ import com.pcloud.book.personalstage.vo.request.UpdateStageJumpRequestVO; ...@@ -7,6 +7,9 @@ import com.pcloud.book.personalstage.vo.request.UpdateStageJumpRequestVO;
import com.pcloud.common.core.mq.DelayQueueDTO; import com.pcloud.common.core.mq.DelayQueueDTO;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import java.util.List;
import java.util.Map;
public interface PersonalStageJumpBiz { public interface PersonalStageJumpBiz {
/** /**
* 新建阶段跳转 * 新建阶段跳转
...@@ -48,4 +51,12 @@ public interface PersonalStageJumpBiz { ...@@ -48,4 +51,12 @@ public interface PersonalStageJumpBiz {
boolean handlePersonalStagePaperJump(String userWxId, String robotWxId, Long paperId); boolean handlePersonalStagePaperJump(String userWxId, String robotWxId, Long paperId);
void sendPaperEmail(String userWxId, String robotWxId); void sendPaperEmail(String userWxId, String robotWxId);
/**
* 获取阶段设置期间用户输入的需求单信息
* @param robotWxId
* @param userWxId
* @return
*/
Map<String, Object> getUserInputPaperInfo(String robotWxId, String userWxId);
} }
...@@ -694,6 +694,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz { ...@@ -694,6 +694,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
content = 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); content = replaceUserSendContent(content, robotId, userWxId);
content = replaceReadingStyle(content, robotId, userWxId);
return content; return content;
} }
...@@ -715,6 +716,23 @@ public class PersonalStageBizImpl implements PersonalStageBiz { ...@@ -715,6 +716,23 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
return content; return content;
} }
@ParamLog("替换阅读偏好")
public String replaceReadingStyle(String linkupContent, String robotWxId, String userWxId){
if (linkupContent.indexOf("${readingStyle=")>-1){
Integer serchch = linkupContent.indexOf("${readingStyle=");
String readingStyle= linkupContent.substring(serchch+15,serchch+19);
String content = linkupContent.substring(serchch,serchch+20);
if (!StringUtil.isEmpty(readingStyle) && !StringUtil.isEmpty(content)){
//保持用户输入的内容
String key ="BOOK:READING_STYLE:" + userWxId + "-" + robotWxId;
JedisClusterUtils.setJson(key, readingStyle);
//去掉衔接语这种替换符 ${readingStyle=xxxx}
linkupContent = linkupContent.replace(content,readingStyle);
}
}
return linkupContent;
}
@ParamLog("替换需求定制单链接") @ParamLog("替换需求定制单链接")
private void replacePaperUrl(List<PersonalStageReplyItem> items, String robotId, String userWxId, Long paperId){ private void replacePaperUrl(List<PersonalStageReplyItem> items, String robotId, String userWxId, Long paperId){
......
...@@ -42,6 +42,7 @@ import com.pcloud.common.page.PageParam; ...@@ -42,6 +42,7 @@ import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.DateNewUtils; import com.pcloud.common.utils.DateNewUtils;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.NumberUtil; import com.pcloud.common.utils.NumberUtil;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.httpclient.UrlUtils; import com.pcloud.common.utils.httpclient.UrlUtils;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.wechatgroup.group.dto.GroupRobotDTO; import com.pcloud.wechatgroup.group.dto.GroupRobotDTO;
...@@ -629,4 +630,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz { ...@@ -629,4 +630,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
} }
} }
} }
@Override
public Map<String, Object> getUserInputPaperInfo(String robotWxId, String userWxId) {
Map<String, Object> map = new HashMap<>();
//书名
String bookKey ="BOOK:USER_SEND_CONTENT:" + userWxId + "-" +robotWxId;
String userSendContent = JedisClusterUtils.getJson(bookKey, String.class);
//阅读偏好
String readingKey ="BOOK:READING_STYLE:" + userWxId + "-" + robotWxId;
String readingStyle = JedisClusterUtils.getJson(readingKey, String.class);
if (!StringUtil.isEmpty(userSendContent)){
map.put("书名",userSendContent);
}
if (!StringUtil.isEmpty(readingStyle)){
map.put("阅读偏好",readingStyle);
}
return map;
}
} }
...@@ -16,6 +16,7 @@ import com.pcloud.common.utils.SessionUtil; ...@@ -16,6 +16,7 @@ import com.pcloud.common.utils.SessionUtil;
import com.pcloud.book.base.exception.BookBizException; import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.common.page.PageParam; import com.pcloud.common.page.PageParam;
import com.pcloud.book.personalstage.biz.PersonalStageJumpBiz; import com.pcloud.book.personalstage.biz.PersonalStageJumpBiz;
import com.pcloud.common.utils.string.StringUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
...@@ -32,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -32,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Optional; import java.util.Optional;
@Api("定制化阶段") @Api("定制化阶段")
...@@ -239,4 +241,16 @@ public class PersonalStageFacade { ...@@ -239,4 +241,16 @@ public class PersonalStageFacade {
return new ResponseDto<>(personalStageBiz.getCurrentPersonalStage(wxId, robotId)); return new ResponseDto<>(personalStageBiz.getCurrentPersonalStage(wxId, robotId));
} }
@ApiOperation("获取阶段设置期间用户输入的需求单信息")
@GetMapping("getUserInputPaperInfo")
public ResponseDto<?> getUserInputPaperInfo(
@RequestParam("robotWxId") @ApiParam("小号id") String robotWxId,
@RequestParam("userWxId") @ApiParam("用户id") String userWxId){
if (StringUtil.isEmpty(robotWxId) || StringUtil.isEmpty(userWxId)){
throw new BookBizException(BookBizException.PARAM_IS_NULL,"缺少用户或小号id");
}
Map<String,Object> map = personalStageJumpBiz.getUserInputPaperInfo(robotWxId, userWxId);
return new ResponseDto<>(map);
}
} }
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