Commit 8fb561c3 by 朱亚洁

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

parent 321137d6
......@@ -503,4 +503,6 @@ public interface BookAdviserBiz {
* 获取编辑的立项书数量和非立项书数量
*/
Map<Long, AdviserBookStatisDto> getAdviserBookStatis(AdviserBookStatisRequestDto requestDto);
Integer getBookIsOpenCatalog(Long bookId, Long channelId, Long adviserId);
}
......@@ -3544,4 +3544,10 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
}
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> {
void batchUpdateIsPrint(List<BookRequestVO> bookRequestVOS);
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
public List<AdviserBookStatisDto> getAdviserBookStatis(AdviserBookStatisRequestDto 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 {
public ResponseEntity<ResponseDto<Integer>> getBookIsOpenCatalog(@RequestParam("bookId") Long bookId,
@RequestParam("channelId") Long channelId,
@RequestParam("adviserId") Long adviserId) throws BizException {
Integer isOpenCatalog = 0;
BookAdviserDto base = bookAdviserBiz.getBase(bookId, channelId, adviserId);
if (null != base) {
isOpenCatalog = base.getIsOpenCatalog();
}
Integer isOpenCatalog = bookAdviserBiz.getBookIsOpenCatalog(bookId, channelId, adviserId);
return ResponseHandleUtil.toResponse(isOpenCatalog);
}
......
......@@ -1406,4 +1406,18 @@
HAVING bookCount >= #{bookCount}
</if>
</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>
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