Commit a00ca20c by 裴大威

Merge branch 'fix-rsy-1023078' into 'master'

fixbug1023078

See merge request rays/pcloud-book!695
parents 5293145b 5d481d01
...@@ -95,7 +95,7 @@ public interface RightsSettingBiz { ...@@ -95,7 +95,7 @@ public interface RightsSettingBiz {
* @Param [rightsSettingId, wechatUserId, type] * @Param [rightsSettingId, wechatUserId, type]
* @return com.pcloud.book.rightsSetting.entity.RightsSetting * @return com.pcloud.book.rightsSetting.entity.RightsSetting
**/ **/
RightsSetting getRightsSettingRightsNowItemsByType(Long rightsSettingId, Long wechatUserId, Integer type); RightsSetting getRightsSettingRightsNowItemsByType(Long rightsSettingId, Long wechatUserId, Integer type, Long adviserId, Long bookId, Long channelId);
RightsSetting getRightsSettingGiftCoupons(Long rightsSettingId, Long wechatUserId); RightsSetting getRightsSettingGiftCoupons(Long rightsSettingId, Long wechatUserId);
......
...@@ -1021,11 +1021,15 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1021,11 +1021,15 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
@ParamLog("根据权益id和类型获取即享权益项") @ParamLog("根据权益id和类型获取即享权益项")
@Override @Override
public RightsSetting getRightsSettingRightsNowItemsByType(Long rightsSettingId, Long wechatUserId, Integer type) { public RightsSetting getRightsSettingRightsNowItemsByType(Long rightsSettingId, Long wechatUserId, Integer type, Long adviserId, Long bookId, Long channelId) {
RightsSetting rightsSetting = rightsSettingDAO.selectByPrimaryKey(rightsSettingId); RightsSetting rightsSetting = rightsSettingDAO.selectByPrimaryKey(rightsSettingId);
if (rightsSetting == null) { if (rightsSetting == null) {
throw new BookBizException(BookBizException.ERROR, "未找到权益!"); throw new BookBizException(BookBizException.ERROR, "未找到权益!");
} }
// 获取配套资料
if (RightsNowItemType.SERVES.value.equals(type)){
return setServe(rightsSetting,adviserId, bookId, channelId);
}
// 获取抽奖权益 // 获取抽奖权益
if (RightsNowItemType.DRAW.value.equals(type)) { if (RightsNowItemType.DRAW.value.equals(type)) {
return setDraw(rightsSetting, wechatUserId); return setDraw(rightsSetting, wechatUserId);
...@@ -1045,6 +1049,14 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1045,6 +1049,14 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
return rightsSetting; return rightsSetting;
} }
@ParamLog(value = "填充配套资料", isAfterReturn = false)
private RightsSetting setServe(RightsSetting rightsSetting,Long adviserId, Long bookId, Long channelId) {
RightsSettingTitle rightsSettingTitle = rightsSettingTitleMapper.getByRightSettingIdAndType(rightsSetting.getId(),RightsNowItemType.SERVES.value);
rightsSetting.setServesTitle(rightsSettingTitle != null ? rightsSettingTitle : new RightsSettingTitle());
rightsSetting.setRightsItemGroups(getRightsItemGroups(rightsSetting.getId(), adviserId, bookId, channelId, true));
return rightsSetting;
}
@ParamLog("根据权益id获取即享权益项专享礼包") @ParamLog("根据权益id获取即享权益项专享礼包")
@Override @Override
public RightsSetting getRightsSettingGiftCoupons(Long rightsSettingId, Long wechatUserId) { public RightsSetting getRightsSettingGiftCoupons(Long rightsSettingId, Long wechatUserId) {
......
...@@ -151,9 +151,12 @@ public class RightsSettingFacede { ...@@ -151,9 +151,12 @@ public class RightsSettingFacede {
@RequestParam("rightsSettingId") @Min(value = 1, @RequestParam("rightsSettingId") @Min(value = 1,
message = "权益id不能小于1") Long rightsSettingId, message = "权益id不能小于1") Long rightsSettingId,
@RequestParam("rightsSettingType") @Min(value = 1, @RequestParam("rightsSettingType") @Min(value = 1,
message = "权益类型不能小于1") Integer rightsSettingType ) { message = "权益类型不能小于1") Integer rightsSettingType ,
@RequestParam(value = "adviserId",required = false) Long adviserId,
@RequestParam(value = "bookId", required = false)Long bookId,
@RequestParam(value = "channelId", required = false)Long channelId) {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
return new ResponseDto<>(rightsSettingBiz.getRightsSettingRightsNowItemsByType(rightsSettingId, wechatUserId, rightsSettingType)); return new ResponseDto<>(rightsSettingBiz.getRightsSettingRightsNowItemsByType(rightsSettingId, wechatUserId, rightsSettingType,adviserId,bookId,channelId));
} }
@ApiOperation("根据权益id获取即享权益项专享礼包") @ApiOperation("根据权益id获取即享权益项专享礼包")
......
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