Commit a667f982 by 田超

Merge branch 'feature/1003754-02' into 'master'

feat: [1003754] 答案搜索优化

See merge request rays/pcloud-book!1040
parents c1a56883 ce0c5f92
......@@ -716,5 +716,5 @@ public interface BookBiz {
* @date:2020/11/4 14:13
* * @param null
*/
List<BookDto> getESAdviserBooks4Answer(Long wechatUserId, BookSearchParamVO bookSearchParamVO);
PageBeanNew<BookDto> getESAdviserBooks4Answer(Long wechatUserId, BookSearchParamVO bookSearchParamVO);
}
......@@ -3418,19 +3418,21 @@ public class BookBizImpl implements BookBiz {
}
@Override
public List<BookDto> getESAdviserBooks4Answer(Long wechatUserId, BookSearchParamVO bookSearchParamVO) {
public PageBeanNew<BookDto> getESAdviserBooks4Answer(Long wechatUserId, BookSearchParamVO bookSearchParamVO) {
Long graLabelId = bookSearchParamVO.getGraLabelId();
Long subLabelId = bookSearchParamVO.getSubLabelId();
Long verLabelId = bookSearchParamVO.getVerLabelId();
Integer currentPage = bookSearchParamVO.getCurrentPage() == null?0:bookSearchParamVO.getCurrentPage();
Integer numPerPage = bookSearchParamVO.getNumPerPage() == null?10:bookSearchParamVO.getNumPerPage();
List<Long> templetIds = new ArrayList<>();
if (null != graLabelId || null != subLabelId || null != verLabelId){
templetIds = Arrays.asList(RightsSettingConstant.K12_VOLUME_ID);
}
Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getESAdviserBooks4Answer(bookSearchParamVO.getGrayStatus(), bookSearchParamVO.getKeyword(),
graLabelId, subLabelId, verLabelId, 0, 3, templetIds);
graLabelId, subLabelId, verLabelId, currentPage, numPerPage, templetIds);
List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent();
if (ListUtils.isEmpty(esBookAndAdvisers)) {
return new ArrayList<>();
return new PageBeanNew<>(currentPage, numPerPage, (int) esPage.getTotalElements(),new ArrayList<>());
}
List<BookDto> bookDtos = changeToBookDto(esBookAndAdvisers);
fillOtherBookInfo(bookDtos);
......@@ -3460,6 +3462,7 @@ public class BookBizImpl implements BookBiz {
}
bookDto.setSubscribeState(subscribeState);
}
return bookDtos;
PageBeanNew<BookDto> page = new PageBeanNew<>(currentPage, numPerPage, (int) esPage.getTotalElements(), bookDtos);
return page;
}
}
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