Commit 0ec6851e by 田超

Merge branch 'feature/1003901-03' into 'master'

feat: [1003901] 系列书

See merge request rays/pcloud-book!1058
parents a2a72c18 b4713cbb
...@@ -726,7 +726,7 @@ public interface BookBiz { ...@@ -726,7 +726,7 @@ public interface BookBiz {
* @date:2020/11/23 15:46 * @date:2020/11/23 15:46
* * @param null * * @param null
*/ */
List<BookLabelVO> getSubjectLabelList4SeriesBook(Long seriesBookId); List<BookLabelVO> getSubjectLabelList4SeriesBook(Long seriesBookId, Long graLabelId);
/** /**
* 是否是系列书 * 是否是系列书
...@@ -741,7 +741,7 @@ public interface BookBiz { ...@@ -741,7 +741,7 @@ public interface BookBiz {
* @date:2020/11/23 19:19 * @date:2020/11/23 19:19
* * @param null * * @param null
*/ */
List<BookDto> getSeriesBookList(Long seriesBookId, Long subLabelId); List<BookDto> getSeriesBookList(Long seriesBookId, Long subLabelId, Long graLabelId);
/** /**
* 系列书查询记录 * 系列书查询记录
* @author:zhuyajie * @author:zhuyajie
......
...@@ -3480,7 +3480,7 @@ public class BookBizImpl implements BookBiz { ...@@ -3480,7 +3480,7 @@ public class BookBizImpl implements BookBiz {
@Override @Override
public List<BookLabelVO> getSubjectLabelList4SeriesBook(Long seriesBookId) { public List<BookLabelVO> getSubjectLabelList4SeriesBook(Long seriesBookId, Long graLabelId) {
SeriesBook seriesBook = seriesBookDao.getById(seriesBookId); SeriesBook seriesBook = seriesBookDao.getById(seriesBookId);
if (null == seriesBook){ if (null == seriesBook){
return new ArrayList<>(); return new ArrayList<>();
...@@ -3492,7 +3492,7 @@ public class BookBizImpl implements BookBiz { ...@@ -3492,7 +3492,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); Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getAdviserBooks4SeriesBook(keywordList, currentPage, numPerPage, adviserIds, seriesBook.getAgentId(), null, graLabelId);
List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent(); List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent();
if (ListUtils.isEmpty(esBookAndAdvisers)) { if (ListUtils.isEmpty(esBookAndAdvisers)) {
return new ArrayList<>(); return new ArrayList<>();
...@@ -3540,13 +3540,14 @@ public class BookBizImpl implements BookBiz { ...@@ -3540,13 +3540,14 @@ public class BookBizImpl implements BookBiz {
} }
if (isSeriesBook){ if (isSeriesBook){
map.put("subLabelId", bookAdviserDto.getSubLabelId()); map.put("subLabelId", bookAdviserDto.getSubLabelId());
map.put("graLabelId", bookAdviserDto.getGraLabelId());
} }
map.put("isSeriesBook", isSeriesBook); map.put("isSeriesBook", isSeriesBook);
return map; return map;
} }
@Override @Override
public List<BookDto> getSeriesBookList(Long seriesBookId, Long subLabelId) { public List<BookDto> getSeriesBookList(Long seriesBookId, Long subLabelId, Long graLabelId) {
SeriesBook seriesBook = seriesBookDao.getById(seriesBookId); SeriesBook seriesBook = seriesBookDao.getById(seriesBookId);
if (null == seriesBook){ if (null == seriesBook){
return new ArrayList<>(); return new ArrayList<>();
...@@ -3558,7 +3559,7 @@ public class BookBizImpl implements BookBiz { ...@@ -3558,7 +3559,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(), subLabelId); Page<ESBookAndAdviser> esPage = esBookAndAdviserBiz.getAdviserBooks4SeriesBook(keywordList, currentPage, numPerPage, adviserIds, seriesBook.getAgentId(), subLabelId, graLabelId);
List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent(); List<ESBookAndAdviser> esBookAndAdvisers = esPage.getContent();
if (ListUtils.isEmpty(esBookAndAdvisers)) { if (ListUtils.isEmpty(esBookAndAdvisers)) {
return new ArrayList<>(); return new ArrayList<>();
...@@ -3574,7 +3575,7 @@ public class BookBizImpl implements BookBiz { ...@@ -3574,7 +3575,7 @@ public class BookBizImpl implements BookBiz {
if (null == seriesBookRecord.getRecordType() || null == seriesBookRecord.getBookId()){ if (null == seriesBookRecord.getRecordType() || null == seriesBookRecord.getBookId()){
throw new BookBizException(BookBizException.PARAM_IS_NULL,"参数缺失"); throw new BookBizException(BookBizException.PARAM_IS_NULL,"参数缺失");
} }
//操作类型(1分类点击2打卡按钮3保存海报按钮4返回首页按钮 //操作类型(1按钮曝光2按钮点击
ThreadPoolUtils.OTHER_THREAD_POOL.execute(()->{ ThreadPoolUtils.OTHER_THREAD_POOL.execute(()->{
seriesBookRecordDao.insert(seriesBookRecord); seriesBookRecordDao.insert(seriesBookRecord);
}); });
......
...@@ -1197,8 +1197,9 @@ public class BookFacadeImpl implements BookFacade { ...@@ -1197,8 +1197,9 @@ public class BookFacadeImpl implements BookFacade {
@ApiOperation("系列书学科列表") @ApiOperation("系列书学科列表")
@GetMapping("getSubjectLabelList4SeriesBook") @GetMapping("getSubjectLabelList4SeriesBook")
public ResponseDto<?> getSubjectLabelList4SeriesBook(@RequestParam("seriesBookId") Long seriesBookId){ public ResponseDto<?> getSubjectLabelList4SeriesBook(@RequestParam("seriesBookId") Long seriesBookId,
return new ResponseDto<>(bookBiz.getSubjectLabelList4SeriesBook(seriesBookId)); @RequestParam(value = "graLabelId", required = false) Long graLabelId){
return new ResponseDto<>(bookBiz.getSubjectLabelList4SeriesBook(seriesBookId, graLabelId));
} }
@ApiOperation("是否是系列书") @ApiOperation("是否是系列书")
...@@ -1211,8 +1212,10 @@ public class BookFacadeImpl implements BookFacade { ...@@ -1211,8 +1212,10 @@ public class BookFacadeImpl implements BookFacade {
@ApiOperation("根据学科查系列书") @ApiOperation("根据学科查系列书")
@GetMapping("getSeriesBookList") @GetMapping("getSeriesBookList")
public ResponseDto<?> getSeriesBookList(@RequestParam("seriesBookId") Long seriesBookId, @RequestParam("subLabelId") Long subLabelId){ public ResponseDto<?> getSeriesBookList(@RequestParam("seriesBookId") Long seriesBookId,
return new ResponseDto<>(bookBiz.getSeriesBookList(seriesBookId, subLabelId)); @RequestParam("subLabelId") Long subLabelId,
@RequestParam(value = "graLabelId", required = false) Long graLabelId){
return new ResponseDto<>(bookBiz.getSeriesBookList(seriesBookId, subLabelId, graLabelId));
} }
@ApiOperation("系列书查询记录埋点") @ApiOperation("系列书查询记录埋点")
......
...@@ -37,5 +37,5 @@ public interface ESBookAndAdviserBiz { ...@@ -37,5 +37,5 @@ 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); Page<ESBookAndAdviser> getAdviserBooks4SeriesBook(List<String> keywords, Integer currentPage, Integer numPerPage, List<Long> adviserIds, Long agentId, Long subLabelId, Long graLabelId);
} }
...@@ -345,7 +345,7 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz { ...@@ -345,7 +345,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 agentId, Long subLabelId, Long graLabelId) {
//k12教育分类校验 //k12教育分类校验
List<Long> templetIds = Arrays.asList(RightsSettingConstant.K12_VERSION_ID); List<Long> templetIds = Arrays.asList(RightsSettingConstant.K12_VERSION_ID);
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery() BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery()
...@@ -353,6 +353,7 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz { ...@@ -353,6 +353,7 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
.filter(QueryBuilders.termQuery("isBookAdviserDelete", 0)) .filter(QueryBuilders.termQuery("isBookAdviserDelete", 0))
.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(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){
BoolQueryBuilder should = QueryBuilders.boolQuery().should(StringUtil.isEmpty(keyword) ? QueryBuilders.boolQuery() : QueryBuilders.wildcardQuery("bookName", "*" + keyword + "*")); BoolQueryBuilder should = QueryBuilders.boolQuery().should(StringUtil.isEmpty(keyword) ? QueryBuilders.boolQuery() : QueryBuilders.wildcardQuery("bookName", "*" + keyword + "*"));
......
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