Commit b626f5d8 by 阮思源

编辑端社群书关键词不区分标签通用

parent 2c4c9a24
......@@ -53,7 +53,7 @@ public interface BookKeywordWarehouseBiz {
/**
* 热门关键词
*/
PageBeanNew<BookKeywordProductVO> hotKeyword(Integer currentPage, Integer numPerPage, Long adviserId, Long bookGroupId, String keyword, Long depthLabelId, Long classifyId);
PageBeanNew<BookKeywordProductVO> hotKeyword(Integer currentPage, Integer numPerPage, Long adviserId, Long bookGroupId, String keyword, Long depthLabelId, Long classifyId, Boolean isForAdviser);
/**
* 审核关键词
......
......@@ -404,12 +404,13 @@ public class BookKeywordWarehouseBizImpl implements BookKeywordWarehouseBiz {
@Override
@ParamLog("[hotKeyword]")
public PageBeanNew<BookKeywordProductVO> hotKeyword(Integer currentPage, Integer numPerPage, Long adviserId, Long bookGroupId, String keyword, Long depthLabelId, Long classifyId) {
public PageBeanNew<BookKeywordProductVO> hotKeyword(Integer currentPage, Integer numPerPage, Long adviserId, Long bookGroupId, String keyword, Long depthLabelId, Long classifyId, Boolean isForAdviser) {
final Map<String, Object> map = Maps.newHashMap();
map.put("keyword", keyword);
map.put("depthLabelId", depthLabelId);
map.put("bookGroupId", bookGroupId);
map.put("adviserId", adviserId);
map.put("isForAdviser", isForAdviser);
final PageBeanNew<BookKeywordProductVO> hotKeyword = this.keywordWarehouseDetailDao.listPageNew(new PageParam(currentPage, numPerPage), map, "hotKeyword");
if (null == hotKeyword || CollectionUtils.isEmpty(hotKeyword.getRecordList())) {
return hotKeyword;
......
......@@ -92,9 +92,10 @@ public class BookKeywordWarehouseFacadeImpl {
public ResponseDto<PageBeanNew<BookKeywordProductVO>> hotKeyword(@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage, @RequestParam("bookGroupId") Long bookGroupId,
@RequestParam(value = "keyword", required = false) String keyword,
@RequestParam("depthLabelId") Long depthLabelId, @RequestParam("classifyId") Long classifyId) throws PermissionException {
@RequestParam(value = "depthLabelId", required = false) Long depthLabelId, @RequestParam("classifyId") Long classifyId,
@RequestParam(value = "isForAdviser", required = false) Boolean isForAdviser) throws PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
final PageBeanNew<BookKeywordProductVO> pageBeanNew = this.bookKeywordWarehouseBiz.hotKeyword(currentPage, numPerPage, adviserId, bookGroupId, keyword, depthLabelId, classifyId);
final PageBeanNew<BookKeywordProductVO> pageBeanNew = this.bookKeywordWarehouseBiz.hotKeyword(currentPage, numPerPage, adviserId, bookGroupId, keyword, depthLabelId, classifyId, isForAdviser);
return new ResponseDto<>(pageBeanNew);
}
......
......@@ -56,7 +56,17 @@
on a.keyword_id = b.id
WHERE
a.is_delete = 0 and b.is_delete = 0
and (b.scope = 0 or b.editor_id = #{adviserId})
<if test="isForAdviser!=null">
<if test="isForAdviser">
and b.editor_id = #{adviserId}
</if>
<if test="!isForAdviser">
and b.scope = 0
</if>
</if>
<if test="isForAdviser == null">
and (b.scope = 0 or b.editor_id = #{adviserId})
</if>
<if test="depthLabelId != null and depthLabelId != '' ">
and a.depth_label_id = #{depthLabelId}
</if>
......
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