小程序分享奖励管理字段统一
This commit is contained in:
@@ -67,7 +67,7 @@ public class ShopShareDTO implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 新用户获得券
|
* 新用户获得券
|
||||||
*/
|
*/
|
||||||
private List<Long> newCouponIdList;
|
private List<Long> newCouponList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 邀请人数
|
* 邀请人数
|
||||||
@@ -77,7 +77,7 @@ public class ShopShareDTO implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 奖励券
|
* 奖励券
|
||||||
*/
|
*/
|
||||||
private List<Long> rewardCouponIdList;
|
private List<Long> rewardCouponList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取方法 get-新用户领取获得 use-新用户使用获得
|
* 获取方法 get-新用户领取获得 use-新用户使用获得
|
||||||
|
|||||||
@@ -54,16 +54,16 @@ public class ShopShareServiceImpl extends ServiceImpl<ShopShareMapper, ShopShare
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean add(Long shopId, ShopShareDTO shopShareDTO) {
|
public Boolean add(Long shopId, ShopShareDTO shopShareDTO) {
|
||||||
if (shopShareDTO.getNewCouponIdList() != null && !shopShareDTO.getRewardCouponIdList().isEmpty()) {
|
if (shopShareDTO.getNewCouponList() != null && !shopShareDTO.getRewardCouponList().isEmpty()) {
|
||||||
long count = shopCouponService.count(new QueryWrapper().in(ShopCoupon::getId, shopShareDTO.getNewCouponIdList()).eq(ShopCoupon::getShopId, shopId));
|
long count = shopCouponService.count(new QueryWrapper().in(ShopCoupon::getId, shopShareDTO.getNewCouponList()).eq(ShopCoupon::getShopId, shopId));
|
||||||
if (count != shopShareDTO.getNewCouponIdList().size()) {
|
if (count != shopShareDTO.getNewCouponList().size()) {
|
||||||
throw new ApiNotPrintException("优惠券不存在");
|
throw new ApiNotPrintException("优惠券不存在");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shopShareDTO.getRewardCouponIdList() != null && !shopShareDTO.getRewardCouponIdList().isEmpty()) {
|
if (shopShareDTO.getRewardCouponList() != null && !shopShareDTO.getRewardCouponList().isEmpty()) {
|
||||||
long count = shopCouponService.count(new QueryWrapper().in(ShopCoupon::getId, shopShareDTO.getRewardCouponIdList()).eq(ShopCoupon::getShopId, shopId));
|
long count = shopCouponService.count(new QueryWrapper().in(ShopCoupon::getId, shopShareDTO.getRewardCouponList()).eq(ShopCoupon::getShopId, shopId));
|
||||||
if (count != shopShareDTO.getRewardCouponIdList().size()) {
|
if (count != shopShareDTO.getRewardCouponList().size()) {
|
||||||
throw new ApiNotPrintException("优惠券不存在");
|
throw new ApiNotPrintException("优惠券不存在");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,8 +72,8 @@ public class ShopShareServiceImpl extends ServiceImpl<ShopShareMapper, ShopShare
|
|||||||
shopShare = new ShopShareVO();
|
shopShare = new ShopShareVO();
|
||||||
shopShare.setShopId(shopId);
|
shopShare.setShopId(shopId);
|
||||||
}
|
}
|
||||||
shopShare.setRewardCoupon(JSONArray.toJSONString(shopShareDTO.getRewardCouponIdList()));
|
shopShare.setRewardCoupon(JSONArray.toJSONString(shopShareDTO.getRewardCouponList()));
|
||||||
shopShare.setNewCoupon(JSONArray.toJSONString(shopShareDTO.getNewCouponIdList()));
|
shopShare.setNewCoupon(JSONArray.toJSONString(shopShareDTO.getNewCouponList()));
|
||||||
BeanUtil.copyProperties(shopShareDTO, shopShare);
|
BeanUtil.copyProperties(shopShareDTO, shopShare);
|
||||||
return saveOrUpdate(shopShare);
|
return saveOrUpdate(shopShare);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user