Commit 096cf9ee by 田超

Merge branch 'fixbug/1024035' into 'master'

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

See merge request rays/pcloud-book!775
parents b15c58dd 017aa605
...@@ -745,7 +745,7 @@ public interface BookGroupBiz { ...@@ -745,7 +745,7 @@ public interface BookGroupBiz {
* @param bookId * @param bookId
* @return * @return
*/ */
BookGroupStatistic4AgentDTO getBookGroupStatisticsByAgent(Long bookId); BookGroupStatistic4AgentDTO getBookGroupStatisticsByAgent(Long bookId,Long agentId,Long adviserId,Long channelId);
/** /**
* 获取群分类关键词数据 * 获取群分类关键词数据
......
...@@ -4589,8 +4589,8 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -4589,8 +4589,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
} }
@Override @Override
public BookGroupStatistic4AgentDTO getBookGroupStatisticsByAgent( Long bookId ) { public BookGroupStatistic4AgentDTO getBookGroupStatisticsByAgent( Long bookId ,Long agentId,Long adviserId,Long channelId) {
BookGroupStatistic4AgentDTO groupStatistic4AgentDTO = bookGroupDao.getBaseInfoByBookId(bookId); BookGroupStatistic4AgentDTO groupStatistic4AgentDTO = bookGroupDao.getBaseInfoByBookId(bookId,agentId,adviserId,channelId);
if (null == groupStatistic4AgentDTO) { if (null == groupStatistic4AgentDTO) {
return new BookGroupStatistic4AgentDTO(); return new BookGroupStatistic4AgentDTO();
} }
......
...@@ -297,7 +297,7 @@ public interface BookGroupDao extends BaseDao<BookGroup> { ...@@ -297,7 +297,7 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
* @param bookId * @param bookId
* @return * @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 ...@@ -333,8 +333,13 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
} }
@Override @Override
public BookGroupStatistic4AgentDTO getBaseInfoByBookId(Long bookId) { public BookGroupStatistic4AgentDTO getBaseInfoByBookId(Long bookId,Long agentId,Long adviserId,Long channelId) {
return getSessionTemplate().selectOne(getStatement("getBaseInfoByBookId"), bookId); 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 @Override
......
...@@ -678,7 +678,9 @@ public interface BookGroupFacade { ...@@ -678,7 +678,9 @@ public interface BookGroupFacade {
@GetMapping("getBookGroupStatisticsByAgent") @GetMapping("getBookGroupStatisticsByAgent")
ResponseDto<?> getBookGroupStatisticsByAgent( ResponseDto<?> getBookGroupStatisticsByAgent(
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestParam("bookId") Long bookId @RequestParam("bookId") Long bookId,
@RequestParam("adviserId") Long adviserId,
@RequestParam("channelId") Long channelId
) throws BizException, PermissionException, JsonParseException; ) throws BizException, PermissionException, JsonParseException;
@ApiOperation("获取群分类关键词数据") @ApiOperation("获取群分类关键词数据")
......
...@@ -1100,13 +1100,15 @@ public class BookGroupFacadeImpl implements BookGroupFacade { ...@@ -1100,13 +1100,15 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
@Override @Override
public ResponseDto<?> getBookGroupStatisticsByAgent( public ResponseDto<?> getBookGroupStatisticsByAgent(
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestParam("bookId") Long bookId @RequestParam("bookId") Long bookId,
@RequestParam("adviserId") Long adviserId,
@RequestParam("channelId") Long channelId
) throws BizException, PermissionException, JsonParseException { ) throws BizException, PermissionException, JsonParseException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); Long agentId = (Long)SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (bookId == null) { if (bookId == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "bookId不能为空!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "bookId不能为空!");
} }
return new ResponseDto<>(bookGroupBiz.getBookGroupStatisticsByAgent(bookId)); return new ResponseDto<>(bookGroupBiz.getBookGroupStatisticsByAgent(bookId, agentId, adviserId, channelId));
} }
@Override @Override
......
...@@ -911,7 +911,7 @@ ...@@ -911,7 +911,7 @@
</update> </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 SELECT
id bookGroupId, id bookGroupId,
group_qrcode_name groupQrcodeName, group_qrcode_name groupQrcodeName,
...@@ -923,6 +923,9 @@ ...@@ -923,6 +923,9 @@
WHERE WHERE
is_delete = 0 is_delete = 0
AND book_id = #{bookId} AND book_id = #{bookId}
AND create_user = #{adviserId}
AND channel_id = #{channelId}
AND agent_id = #{agentId}
</select> </select>
......
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