Commit ce0c5f92 by 朱亚洁

feat:[1003754]答案搜索优化

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