Commit 017aa605 by 郑永强

fixbug: [1024035] 【生产环境】【出版端】【书刊管理】进入一本书详情页,getBookGroupStatisticsByAgen接口500

parent b15c58dd
......@@ -745,7 +745,7 @@ public interface BookGroupBiz {
* @param bookId
* @return
*/
BookGroupStatistic4AgentDTO getBookGroupStatisticsByAgent(Long bookId);
BookGroupStatistic4AgentDTO getBookGroupStatisticsByAgent(Long bookId,Long agentId,Long adviserId,Long channelId);
/**
* 获取群分类关键词数据
......
......@@ -4589,8 +4589,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
@Override
public BookGroupStatistic4AgentDTO getBookGroupStatisticsByAgent( Long bookId ) {
BookGroupStatistic4AgentDTO groupStatistic4AgentDTO = bookGroupDao.getBaseInfoByBookId(bookId);
public BookGroupStatistic4AgentDTO getBookGroupStatisticsByAgent( Long bookId ,Long agentId,Long adviserId,Long channelId) {
BookGroupStatistic4AgentDTO groupStatistic4AgentDTO = bookGroupDao.getBaseInfoByBookId(bookId,agentId,adviserId,channelId);
if (null == groupStatistic4AgentDTO) {
return new BookGroupStatistic4AgentDTO();
}
......
......@@ -297,7 +297,7 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
* @param bookId
* @return
*/
BookGroupStatistic4AgentDTO getBaseInfoByBookId(Long bookId);
BookGroupStatistic4AgentDTO getBaseInfoByBookId(Long bookId,Long agentId,Long adviserId,Long channelId);
/**
* 根据书籍简称获取
......
......@@ -333,8 +333,13 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
}
@Override
public BookGroupStatistic4AgentDTO getBaseInfoByBookId(Long bookId) {
return getSessionTemplate().selectOne(getStatement("getBaseInfoByBookId"), bookId);
public BookGroupStatistic4AgentDTO getBaseInfoByBookId(Long bookId,Long agentId,Long adviserId,Long channelId) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookId", bookId);
paramMap.put("agentId", agentId);
paramMap.put("adviserId", adviserId);
paramMap.put("channelId", channelId);
return getSessionTemplate().selectOne(getStatement("getBaseInfoByBookId"), paramMap);
}
@Override
......
......@@ -678,7 +678,9 @@ public interface BookGroupFacade {
@GetMapping("getBookGroupStatisticsByAgent")
ResponseDto<?> getBookGroupStatisticsByAgent(
@RequestHeader("token") String token,
@RequestParam("bookId") Long bookId
@RequestParam("bookId") Long bookId,
@RequestParam("adviserId") Long adviserId,
@RequestParam("channelId") Long channelId
) throws BizException, PermissionException, JsonParseException;
@ApiOperation("获取群分类关键词数据")
......
......@@ -1100,13 +1100,15 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
@Override
public ResponseDto<?> getBookGroupStatisticsByAgent(
@RequestHeader("token") String token,
@RequestParam("bookId") Long bookId
@RequestParam("bookId") Long bookId,
@RequestParam("adviserId") Long adviserId,
@RequestParam("channelId") Long channelId
) throws BizException, PermissionException, JsonParseException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Long agentId = (Long)SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (bookId == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "bookId不能为空!");
}
return new ResponseDto<>(bookGroupBiz.getBookGroupStatisticsByAgent(bookId));
return new ResponseDto<>(bookGroupBiz.getBookGroupStatisticsByAgent(bookId, agentId, adviserId, channelId));
}
@Override
......
......@@ -911,7 +911,7 @@
</update>
<select id="getBaseInfoByBookId" parameterType="long" resultType="com.pcloud.book.group.dto.BookGroupStatistic4AgentDTO">
<select id="getBaseInfoByBookId" parameterType="map" resultType="com.pcloud.book.group.dto.BookGroupStatistic4AgentDTO">
SELECT
id bookGroupId,
group_qrcode_name groupQrcodeName,
......@@ -923,6 +923,9 @@
WHERE
is_delete = 0
AND book_id = #{bookId}
AND create_user = #{adviserId}
AND channel_id = #{channelId}
AND agent_id = #{agentId}
</select>
......@@ -1053,4 +1056,4 @@
</foreach>
</select>
</mapper>
\ No newline at end of file
</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