Commit a7f063bf by 裴大威

Merge branch 'feat-zyq-1002844-12' into 'master'

【1002844】2.书刊权益新增和修改,默认代入书刊对应权益的基本信息

See merge request rays/pcloud-book!710
parents 15cb709c fa2cd2b4
...@@ -1986,6 +1986,11 @@ public class BookBizImpl implements BookBiz { ...@@ -1986,6 +1986,11 @@ public class BookBizImpl implements BookBiz {
map.put("adviserIds",adviserIds); map.put("adviserIds",adviserIds);
} }
} }
if(!StringUtil.isEmpty(keyword)) {
// 模糊匹配编辑名称
List<Long> adviserIds = adviserConsr.getAdviserIdsByName(keyword);
map.put("adviserIds4Name", adviserIds);
}
PageBeanNew<BookDto> page = bookDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getAdviserBooks4Pcloud", "getAdviserBooksCount4Pcloud"); PageBeanNew<BookDto> page = bookDao.listPageNew(new PageParam(currentPage, numPerPage), map, "getAdviserBooks4Pcloud", "getAdviserBooksCount4Pcloud");
fillBookInfo(page.getRecordList()); fillBookInfo(page.getRecordList());
if(!ListUtils.isEmpty(page.getRecordList())) { if(!ListUtils.isEmpty(page.getRecordList())) {
......
...@@ -105,6 +105,8 @@ public interface RightsSettingBiz { ...@@ -105,6 +105,8 @@ public interface RightsSettingBiz {
List<RightsItemGroup> getRightsItemGroups(Long rightsSettingId, Long adviserId, Long bookId, Long channelId, Boolean removeCanNotBuy); List<RightsItemGroup> getRightsItemGroups(Long rightsSettingId, Long adviserId, Long bookId, Long channelId, Boolean removeCanNotBuy);
RightsSettingDto getRightSettingByBookId(Long bookId, Long adviserId, Long channelId);
List<RightsNowPic> getAllDefaultRightsNowPics(); List<RightsNowPic> getAllDefaultRightsNowPics();
void addRightsNowPic(RightsNowPic rightsNowPic); void addRightsNowPic(RightsNowPic rightsNowPic);
......
...@@ -966,16 +966,20 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -966,16 +966,20 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
baseTempletClassify.setGradeLabelId(bookAdviserDto.getGraLabelId()); baseTempletClassify.setGradeLabelId(bookAdviserDto.getGraLabelId());
baseTempletClassify.setSubjectLabelId(bookAdviserDto.getSubLabelId()); baseTempletClassify.setSubjectLabelId(bookAdviserDto.getSubLabelId());
setClassifyAndLabel(baseTempletClassify); setClassifyAndLabel(baseTempletClassify);
if(NumberUtil.isNumber(baseTempletClassify.getFirstClassify())){
// 通过书刊分类拿群 // 通过书刊分类拿群
groupActivity4AppletDTO = pcloudGroupActivityDao.getGroupActivity4Applet(baseTempletClassify.getFirstClassify(),baseTempletClassify.getSecondClassify(),baseTempletClassify.getGradeLabelId(),baseTempletClassify.getSubjectLabelId()); groupActivity4AppletDTO = pcloudGroupActivityDao.getGroupActivity4Applet(baseTempletClassify.getFirstClassify(),baseTempletClassify.getSecondClassify(),baseTempletClassify.getGradeLabelId(),baseTempletClassify.getSubjectLabelId());
} }
}
if(groupActivity4AppletDTO == null){ if(groupActivity4AppletDTO == null){
// 如果书刊没拿到群,则通过权益分类拿群 // 如果书刊没拿到群,则通过权益分类拿群
RightsSetting rightsSetting = rightsSettingDAO.selectByPrimaryKey(list.get(0).getRightsSettingId()); RightsSetting rightsSetting = rightsSettingDAO.selectByPrimaryKey(list.get(0).getRightsSettingId());
setClassifyAndLabel(rightsSetting); setClassifyAndLabel(rightsSetting);
if(NumberUtil.isNumber(rightsSetting.getFirstClassify())){
groupActivity4AppletDTO = pcloudGroupActivityDao.getGroupActivity4Applet(rightsSetting.getFirstClassify(), rightsSetting.getSecondClassify(),rightsSetting.getGradeLabelId(),rightsSetting.getSubjectLabelId()); groupActivity4AppletDTO = pcloudGroupActivityDao.getGroupActivity4Applet(rightsSetting.getFirstClassify(), rightsSetting.getSecondClassify(),rightsSetting.getGradeLabelId(),rightsSetting.getSubjectLabelId());
} }
}
if(groupActivity4AppletDTO != null){ if(groupActivity4AppletDTO != null){
String filterStr = StringUtilParent.replaceHtml(groupActivity4AppletDTO.getDesc()); String filterStr = StringUtilParent.replaceHtml(groupActivity4AppletDTO.getDesc());
String subStr = filterStr.length() > 60 ? filterStr.substring(0, 60) + "..." : filterStr; String subStr = filterStr.length() > 60 ? filterStr.substring(0, 60) + "..." : filterStr;
......
...@@ -202,6 +202,18 @@ public class RightsSettingFacede { ...@@ -202,6 +202,18 @@ public class RightsSettingFacede {
return new ResponseDto<>(rightsSettingBiz.getRightsItemGroups(rightsSettingId, adviserId, bookId, channelId, true)); return new ResponseDto<>(rightsSettingBiz.getRightsItemGroups(rightsSettingId, adviserId, bookId, channelId, true));
} }
@ApiOperation("根据书刊的分类获取对应的分类权益信息")
@GetMapping("getRightSettingByBookId")
public ResponseDto<?> getRightSettingByBookId(
@RequestHeader("token") String token,
@RequestParam("bookId")Long bookId,
@RequestParam("adviserId") Long adviserId,
@RequestParam("channelId")Long channelId
) throws PermissionException {
SessionUtil.getToken4Redis(token);
return new ResponseDto<>(rightsSettingBiz.getRightSettingByBookId(bookId, adviserId, channelId));
}
@ApiOperation("获取即享权益默认图片库") @ApiOperation("获取即享权益默认图片库")
@GetMapping("getAllDefaultRightsNowPics") @GetMapping("getAllDefaultRightsNowPics")
public ResponseDto<?> getAllDefaultRightsNowPics( public ResponseDto<?> getAllDefaultRightsNowPics(
......
...@@ -2069,7 +2069,14 @@ ...@@ -2069,7 +2069,14 @@
<if test="keyword != null"> <if test="keyword != null">
AND (B.BOOK_NAME LIKE CONCAT('%', #{keyword}, '%') AND (B.BOOK_NAME LIKE CONCAT('%', #{keyword}, '%')
OR B.ISBN LIKE CONCAT(#{keyword},'%') OR B.ISBN LIKE CONCAT(#{keyword},'%')
OR CONCAT('BK',A.BOOK_ID) = #{keyword}) OR CONCAT('BK',A.BOOK_ID) = #{keyword}
<if test="adviserIds4Name!=null and adviserIds4Name.size()>0">
OR
A.ADVISER_ID in
<foreach collection="adviserIds4Name" item="item" open="(" separator="," close=")">
${item}
</foreach>
</if>)
</if> </if>
<if test="templetId != null"> <if test="templetId != null">
AND AND
...@@ -2106,7 +2113,14 @@ ...@@ -2106,7 +2113,14 @@
<if test="keyword != null"> <if test="keyword != null">
AND (B.BOOK_NAME LIKE CONCAT('%', #{keyword}, '%') AND (B.BOOK_NAME LIKE CONCAT('%', #{keyword}, '%')
OR B.ISBN LIKE CONCAT(#{keyword},'%') OR B.ISBN LIKE CONCAT(#{keyword},'%')
OR CONCAT('BK',A.BOOK_ID) = #{keyword}) OR CONCAT('BK',A.BOOK_ID) = #{keyword}
<if test="adviserIds4Name!=null and adviserIds4Name.size()>0">
OR
A.ADVISER_ID in
<foreach collection="adviserIds4Name" item="item" open="(" separator="," close=")">
${item}
</foreach>
</if>)
</if> </if>
<if test="templetId != null"> <if test="templetId != null">
AND AND
......
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