Commit 5d481d01 by 阮思源

fixbug1023078

parent 5293145b
......@@ -95,7 +95,7 @@ public interface RightsSettingBiz {
* @Param [rightsSettingId, wechatUserId, type]
* @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);
......
......@@ -1021,11 +1021,15 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
@ParamLog("根据权益id和类型获取即享权益项")
@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);
if (rightsSetting == null) {
throw new BookBizException(BookBizException.ERROR, "未找到权益!");
}
// 获取配套资料
if (RightsNowItemType.SERVES.value.equals(type)){
return setServe(rightsSetting,adviserId, bookId, channelId);
}
// 获取抽奖权益
if (RightsNowItemType.DRAW.value.equals(type)) {
return setDraw(rightsSetting, wechatUserId);
......@@ -1045,6 +1049,14 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
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获取即享权益项专享礼包")
@Override
public RightsSetting getRightsSettingGiftCoupons(Long rightsSettingId, Long wechatUserId) {
......
......@@ -151,9 +151,12 @@ public class RightsSettingFacede {
@RequestParam("rightsSettingId") @Min(value = 1,
message = "权益id不能小于1") Long rightsSettingId,
@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);
return new ResponseDto<>(rightsSettingBiz.getRightsSettingRightsNowItemsByType(rightsSettingId, wechatUserId, rightsSettingType));
return new ResponseDto<>(rightsSettingBiz.getRightsSettingRightsNowItemsByType(rightsSettingId, wechatUserId, rightsSettingType,adviserId,bookId,channelId));
}
@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