Commit dfe3da7a by 田超

Merge branch 'feature/1006790' into 'master'

feat:[1006790]接口优化书刊目录

See merge request rays/pcloud-book!1515
parents 321137d6 8fb561c3
...@@ -503,4 +503,6 @@ public interface BookAdviserBiz { ...@@ -503,4 +503,6 @@ public interface BookAdviserBiz {
* 获取编辑的立项书数量和非立项书数量 * 获取编辑的立项书数量和非立项书数量
*/ */
Map<Long, AdviserBookStatisDto> getAdviserBookStatis(AdviserBookStatisRequestDto requestDto); Map<Long, AdviserBookStatisDto> getAdviserBookStatis(AdviserBookStatisRequestDto requestDto);
Integer getBookIsOpenCatalog(Long bookId, Long channelId, Long adviserId);
} }
...@@ -3544,4 +3544,10 @@ public class BookAdviserBizImpl implements BookAdviserBiz { ...@@ -3544,4 +3544,10 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
} }
return adviserBookStatisList.stream().collect(Collectors.toMap(x->x.getAdviserId(), Function.identity(), (v1, v2)->v1)); return adviserBookStatisList.stream().collect(Collectors.toMap(x->x.getAdviserId(), Function.identity(), (v1, v2)->v1));
} }
@Override
public Integer getBookIsOpenCatalog(Long bookId, Long channelId, Long adviserId) {
Integer isOpenCatalog = bookAdviserDao.getBookIsOpenCatalog(bookId,channelId,adviserId);
return null == isOpenCatalog?0:isOpenCatalog;
}
} }
...@@ -357,4 +357,6 @@ public interface BookAdviserDao extends BaseDao<BookAdviser> { ...@@ -357,4 +357,6 @@ public interface BookAdviserDao extends BaseDao<BookAdviser> {
void batchUpdateIsPrint(List<BookRequestVO> bookRequestVOS); void batchUpdateIsPrint(List<BookRequestVO> bookRequestVOS);
List<AdviserBookStatisDto> getAdviserBookStatis(AdviserBookStatisRequestDto requestDto); List<AdviserBookStatisDto> getAdviserBookStatis(AdviserBookStatisRequestDto requestDto);
Integer getBookIsOpenCatalog(Long bookId, Long channelId, Long adviserId);
} }
...@@ -547,4 +547,13 @@ public class BookAdviserDaoImpl extends BaseDaoImpl<BookAdviser> implements Book ...@@ -547,4 +547,13 @@ public class BookAdviserDaoImpl extends BaseDaoImpl<BookAdviser> implements Book
public List<AdviserBookStatisDto> getAdviserBookStatis(AdviserBookStatisRequestDto requestDto) { public List<AdviserBookStatisDto> getAdviserBookStatis(AdviserBookStatisRequestDto requestDto) {
return getSessionTemplate().selectList(getStatement("getAdviserBookStatis"), requestDto); return getSessionTemplate().selectList(getStatement("getAdviserBookStatis"), requestDto);
} }
@Override
public Integer getBookIsOpenCatalog(Long bookId, Long channelId, Long adviserId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookId",bookId);
paramMap.put("channelId", channelId);
paramMap.put("adviserId", adviserId);
return getSessionTemplate().selectOne(getStatement("getBookIsOpenCatalog"), paramMap);
}
} }
...@@ -230,11 +230,7 @@ public class BookAdviserServiceImpl implements BookAdviserService { ...@@ -230,11 +230,7 @@ public class BookAdviserServiceImpl implements BookAdviserService {
public ResponseEntity<ResponseDto<Integer>> getBookIsOpenCatalog(@RequestParam("bookId") Long bookId, public ResponseEntity<ResponseDto<Integer>> getBookIsOpenCatalog(@RequestParam("bookId") Long bookId,
@RequestParam("channelId") Long channelId, @RequestParam("channelId") Long channelId,
@RequestParam("adviserId") Long adviserId) throws BizException { @RequestParam("adviserId") Long adviserId) throws BizException {
Integer isOpenCatalog = 0; Integer isOpenCatalog = bookAdviserBiz.getBookIsOpenCatalog(bookId, channelId, adviserId);
BookAdviserDto base = bookAdviserBiz.getBase(bookId, channelId, adviserId);
if (null != base) {
isOpenCatalog = base.getIsOpenCatalog();
}
return ResponseHandleUtil.toResponse(isOpenCatalog); return ResponseHandleUtil.toResponse(isOpenCatalog);
} }
......
...@@ -1406,4 +1406,18 @@ ...@@ -1406,4 +1406,18 @@
HAVING bookCount >= #{bookCount} HAVING bookCount >= #{bookCount}
</if> </if>
</select> </select>
<select id="getBookIsOpenCatalog" resultType="integer" parameterType="map">
SELECT
IFNULL(is_open_catalog,0)
FROM
BOOK_ADVISER
WHERE
BOOK_ID = #{bookId}
AND
CHANNEL_ID = #{channelId}
AND
ADVISER_ID = #{adviserId}
</select>
</mapper> </mapper>
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