Commit 55ce35ad by 田超

Merge branch 'feature/1004265' into 'master'

feat: [1004265] 本书服务页展示系列书

See merge request rays/pcloud-book!1192
parents bcb864b5 c0afca9f
...@@ -413,25 +413,25 @@ public class BookConstant { ...@@ -413,25 +413,25 @@ public class BookConstant {
put(3, Lists.newArrayList(20, 137)); put(3, Lists.newArrayList(20, 137));
put(4, Lists.newArrayList(20, 137)); put(4, Lists.newArrayList(20, 137));
put(5, Lists.newArrayList(20, 137)); put(5, Lists.newArrayList(20, 137));
put(6, Lists.newArrayList(335, 970)); put(6, Lists.newArrayList(100, 200));
put(7, Lists.newArrayList(480, 2280)); put(7, Lists.newArrayList(200, 500));
put(8, Lists.newArrayList(664, 5091)); put(8, Lists.newArrayList(300, 1000));
put(9, Lists.newArrayList(1095, 10859)); put(9, Lists.newArrayList(350, 1500));
put(10, Lists.newArrayList(992, 15224)); put(10, Lists.newArrayList(360, 2000));
put(11, Lists.newArrayList(772, 11455)); put(11, Lists.newArrayList(350, 2000));
put(12, Lists.newArrayList(1162, 12907)); put(12, Lists.newArrayList(500, 2100));
put(13, Lists.newArrayList(687, 11108)); put(13, Lists.newArrayList(300, 2200));
put(14, Lists.newArrayList(795, 10891)); put(14, Lists.newArrayList(300, 2000));
put(15, Lists.newArrayList(1100, 12153)); put(15, Lists.newArrayList(400, 2100));
put(16, Lists.newArrayList(890, 11433)); put(16, Lists.newArrayList(300, 2000));
put(17, Lists.newArrayList(1336, 9118)); put(17, Lists.newArrayList(400, 1500));
put(18, Lists.newArrayList(2448, 11952)); put(18, Lists.newArrayList(420, 1400));
put(19, Lists.newArrayList(3106, 14088)); put(19, Lists.newArrayList(500, 1500));
put(20, Lists.newArrayList(3179, 14980)); put(20, Lists.newArrayList(500, 1600));
put(21, Lists.newArrayList(2249, 12156)); put(21, Lists.newArrayList(400, 1500));
put(22, Lists.newArrayList(1050, 7955)); put(22, Lists.newArrayList(100, 1000));
put(23, Lists.newArrayList(628, 3280)); put(23, Lists.newArrayList(50, 500));
put(0, Lists.newArrayList(890, 2250)); put(0, Lists.newArrayList(50, 400));
} }
}; };
......
...@@ -719,7 +719,7 @@ public interface BookBiz { ...@@ -719,7 +719,7 @@ public interface BookBiz {
* @date:2020/11/23 19:19 * @date:2020/11/23 19:19
* * @param null * * @param null
*/ */
PageBeanNew<BookDto> getSeriesBookList(Long seriesBookId, Long subLabelId, Long graLabelId, Integer currentPage, Integer numPerPage); PageBeanNew<BookDto> getSeriesBookList(Long seriesBookId, Long subLabelId, Long graLabelId, Integer currentPage, Integer numPerPage, Long verLabelId, Long volLabelId, Long ignorSubLabelId);
/** /**
* 系列书查询记录 * 系列书查询记录
* @author:zhuyajie * @author:zhuyajie
......
...@@ -3546,7 +3546,7 @@ public class BookBizImpl implements BookBiz { ...@@ -3546,7 +3546,7 @@ public class BookBizImpl implements BookBiz {
List<Long> adviserIds = adviserConsr.getByAgentId(seriesBook.getAgentId()); List<Long> adviserIds = adviserConsr.getByAgentId(seriesBook.getAgentId());
Integer currentPage = 0; Integer currentPage = 0;
Integer numPerPage = 50; Integer numPerPage = 50;
Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getAdviserBooks4SeriesBook(keywordList, currentPage, numPerPage, adviserIds, seriesBook.getAgentId(), null, graLabelId, seriesBook.getSerialNumber()); Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getAdviserBooks4SeriesBook(keywordList, currentPage, numPerPage, adviserIds, seriesBook.getAgentId(), null, graLabelId, seriesBook.getSerialNumber(), null, null);
List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent(); List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent();
if (ListUtils.isEmpty(esBookAndAdvisers)) { if (ListUtils.isEmpty(esBookAndAdvisers)) {
return new ArrayList<>(); return new ArrayList<>();
...@@ -3612,7 +3612,7 @@ public class BookBizImpl implements BookBiz { ...@@ -3612,7 +3612,7 @@ public class BookBizImpl implements BookBiz {
} }
if (isSeriesBook){ if (isSeriesBook){
List<Long> adviserIds = adviserConsr.getByAgentId(agentId); List<Long> adviserIds = adviserConsr.getByAgentId(agentId);
Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getAdviserBooks4SeriesBook(keywordList, 0, 50, adviserIds, agentId, null, bookAdviserDto.getGraLabelId(), serialNumber); Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getAdviserBooks4SeriesBook(keywordList, 0, 50, adviserIds, agentId, null, bookAdviserDto.getGraLabelId(), serialNumber, null, null);
List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent(); List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent();
List<Long> subjectLabels = new ArrayList<>(); List<Long> subjectLabels = new ArrayList<>();
if (!ListUtils.isEmpty(esBookAndAdvisers)) { if (!ListUtils.isEmpty(esBookAndAdvisers)) {
...@@ -3625,6 +3625,8 @@ public class BookBizImpl implements BookBiz { ...@@ -3625,6 +3625,8 @@ public class BookBizImpl implements BookBiz {
map.put("seriesBookId", seriesBookId); map.put("seriesBookId", seriesBookId);
map.put("subLabelId", bookAdviserDto.getSubLabelId()); map.put("subLabelId", bookAdviserDto.getSubLabelId());
map.put("graLabelId", bookAdviserDto.getGraLabelId()); map.put("graLabelId", bookAdviserDto.getGraLabelId());
map.put("volLabelId", bookAdviserDto.getVolLabelId());
map.put("verLabelId", bookAdviserDto.getVerLabelId());
} }
} }
map.put("isSeriesBook", isSeriesBook); map.put("isSeriesBook", isSeriesBook);
...@@ -3632,7 +3634,8 @@ public class BookBizImpl implements BookBiz { ...@@ -3632,7 +3634,8 @@ public class BookBizImpl implements BookBiz {
} }
@Override @Override
public PageBeanNew<BookDto> getSeriesBookList(Long seriesBookId, Long subLabelId, Long graLabelId, Integer currentPage, Integer numPerPage) { public PageBeanNew<BookDto> getSeriesBookList(Long seriesBookId, Long subLabelId, Long graLabelId, Integer currentPage, Integer numPerPage,
Long verLabelId, Long volLabelId, Long ignorSubLabelId) {
SeriesBook seriesBook = seriesBookDao.getById(seriesBookId); SeriesBook seriesBook = seriesBookDao.getById(seriesBookId);
if (null == seriesBook){ if (null == seriesBook){
return new PageBeanNew<>(); return new PageBeanNew<>();
...@@ -3646,11 +3649,18 @@ public class BookBizImpl implements BookBiz { ...@@ -3646,11 +3649,18 @@ public class BookBizImpl implements BookBiz {
currentPage = 0; currentPage = 0;
numPerPage = 50; numPerPage = 50;
} }
Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getAdviserBooks4SeriesBook(keywordList, currentPage, numPerPage, adviserIds, seriesBook.getAgentId(), subLabelId, graLabelId, seriesBook.getSerialNumber()); Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getAdviserBooks4SeriesBook(keywordList, currentPage, numPerPage, adviserIds,
seriesBook.getAgentId(), subLabelId, graLabelId, seriesBook.getSerialNumber(), verLabelId, volLabelId);
List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent(); List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent();
if (ListUtils.isEmpty(esBookAndAdvisers)) { if (ListUtils.isEmpty(esBookAndAdvisers)) {
return new PageBeanNew<>(); return new PageBeanNew<>();
} }
if (null != ignorSubLabelId) {
esBookAndAdvisers = esBookAndAdvisers.stream().filter(e -> !Objects.equals(ignorSubLabelId, e.getSubLabelId())).collect(Collectors.toList());
}
if (ListUtils.isEmpty(esBookAndAdvisers)) {
return new PageBeanNew<>();
}
List<BookDto> bookDtos = changeToBookDto(esBookAndAdvisers); List<BookDto> bookDtos = changeToBookDto(esBookAndAdvisers);
fillOtherBookInfo(bookDtos); fillOtherBookInfo(bookDtos);
fillBookInfo(bookDtos); fillBookInfo(bookDtos);
......
...@@ -1247,9 +1247,12 @@ public class BookFacadeImpl implements BookFacade { ...@@ -1247,9 +1247,12 @@ public class BookFacadeImpl implements BookFacade {
public ResponseDto<?> getSeriesBookList(@RequestParam("seriesBookId") Long seriesBookId, public ResponseDto<?> getSeriesBookList(@RequestParam("seriesBookId") Long seriesBookId,
@RequestParam(value = "subLabelId", required = false) Long subLabelId, @RequestParam(value = "subLabelId", required = false) Long subLabelId,
@RequestParam(value = "graLabelId", required = false) Long graLabelId, @RequestParam(value = "graLabelId", required = false) Long graLabelId,
@RequestParam(value = "verLabelId", required = false) Long verLabelId,
@RequestParam(value = "volLabelId", required = false) Long volLabelId,
@RequestParam(value = "ignorSubLabelId", required = false) Long ignorSubLabelId,
@RequestParam(value = "currentPage", required = false, defaultValue = "0") Integer currentPage, @RequestParam(value = "currentPage", required = false, defaultValue = "0") Integer currentPage,
@RequestParam(value = "numPerPage", required = false, defaultValue = "10") Integer numPerPage){ @RequestParam(value = "numPerPage", required = false, defaultValue = "10") Integer numPerPage){
return new ResponseDto<>(bookBiz.getSeriesBookList(seriesBookId, subLabelId, graLabelId, currentPage, numPerPage)); return new ResponseDto<>(bookBiz.getSeriesBookList(seriesBookId, subLabelId, graLabelId, currentPage, numPerPage,verLabelId,volLabelId,ignorSubLabelId));
} }
@ApiOperation("系列书查询记录埋点") @ApiOperation("系列书查询记录埋点")
......
...@@ -40,7 +40,7 @@ public interface ESBookAndAdviserBiz { ...@@ -40,7 +40,7 @@ public interface ESBookAndAdviserBiz {
* @date:2020/11/23 17:26 * @date:2020/11/23 17:26
* * @param null * * @param null
*/ */
Page<ESBookAndAdviser> getAdviserBooks4SeriesBook(List<String> keywords, Integer currentPage, Integer numPerPage, List<Long> adviserIds, Long agentId, Long subLabelId, Long graLabelId, String serialNumber); Page<ESBookAndAdviser> getAdviserBooks4SeriesBook(List<String> keywords, Integer currentPage, Integer numPerPage, List<Long> adviserIds, Long agentId, Long subLabelId, Long graLabelId, String serialNumber, Long verLabelId, Long volLabelId);
Map<String, Object> getNotFoundBookId(String lastBookId)throws Exception; Map<String, Object> getNotFoundBookId(String lastBookId)throws Exception;
......
...@@ -501,7 +501,7 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz { ...@@ -501,7 +501,7 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
@Override @Override
public Page<ESBookAndAdviser> getAdviserBooks4SeriesBook(List<String> keywords, Integer currentPage, Integer numPerPage, List<Long> adviserIds, public Page<ESBookAndAdviser> getAdviserBooks4SeriesBook(List<String> keywords, Integer currentPage, Integer numPerPage, List<Long> adviserIds,
Long agentId, Long subLabelId, Long graLabelId, String serialNumber) { Long agentId, Long subLabelId, Long graLabelId, String serialNumber, Long verLabelId, Long volLabelId) {
//k12教育分类校验 //k12教育分类校验
List<Long> templetIds = Arrays.asList(RightsSettingConstant.K12_TEMPLET_ID_NEW); List<Long> templetIds = Arrays.asList(RightsSettingConstant.K12_TEMPLET_ID_NEW);
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery() BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery()
...@@ -510,6 +510,8 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz { ...@@ -510,6 +510,8 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
.filter(null == agentId ? QueryBuilders.boolQuery() : QueryBuilders.termsQuery("adviserId", adviserIds)) .filter(null == agentId ? QueryBuilders.boolQuery() : QueryBuilders.termsQuery("adviserId", adviserIds))
.filter(null == subLabelId ? QueryBuilders.boolQuery() : QueryBuilders.termQuery("subLabelId", subLabelId)) .filter(null == subLabelId ? QueryBuilders.boolQuery() : QueryBuilders.termQuery("subLabelId", subLabelId))
.filter(null == graLabelId ? QueryBuilders.boolQuery() : QueryBuilders.termQuery("graLabelId", graLabelId)) .filter(null == graLabelId ? QueryBuilders.boolQuery() : QueryBuilders.termQuery("graLabelId", graLabelId))
.filter(null == graLabelId ? QueryBuilders.boolQuery() : QueryBuilders.termQuery("verLabelId", verLabelId))
.filter(null == graLabelId ? QueryBuilders.boolQuery() : QueryBuilders.termQuery("volLabelId", volLabelId))
.filter(ListUtils.isEmpty(templetIds) ? QueryBuilders.boolQuery() : QueryBuilders.termsQuery("templetId", templetIds)); .filter(ListUtils.isEmpty(templetIds) ? QueryBuilders.boolQuery() : QueryBuilders.termsQuery("templetId", templetIds));
//关键词 //关键词
for (String keyword:keywords){ for (String keyword:keywords){
......
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