小程序分享奖励管理字段统一

This commit is contained in:
张松
2025-03-11 09:34:01 +08:00
parent a5ba6d902c
commit 27635d7b0d
2 changed files with 10 additions and 10 deletions

View File

@@ -54,16 +54,16 @@ public class ShopShareServiceImpl extends ServiceImpl<ShopShareMapper, ShopShare
@Override
public Boolean add(Long shopId, ShopShareDTO shopShareDTO) {
if (shopShareDTO.getNewCouponIdList() != null && !shopShareDTO.getRewardCouponIdList().isEmpty()) {
long count = shopCouponService.count(new QueryWrapper().in(ShopCoupon::getId, shopShareDTO.getNewCouponIdList()).eq(ShopCoupon::getShopId, shopId));
if (count != shopShareDTO.getNewCouponIdList().size()) {
if (shopShareDTO.getNewCouponList() != null && !shopShareDTO.getRewardCouponList().isEmpty()) {
long count = shopCouponService.count(new QueryWrapper().in(ShopCoupon::getId, shopShareDTO.getNewCouponList()).eq(ShopCoupon::getShopId, shopId));
if (count != shopShareDTO.getNewCouponList().size()) {
throw new ApiNotPrintException("优惠券不存在");
}
}
if (shopShareDTO.getRewardCouponIdList() != null && !shopShareDTO.getRewardCouponIdList().isEmpty()) {
long count = shopCouponService.count(new QueryWrapper().in(ShopCoupon::getId, shopShareDTO.getRewardCouponIdList()).eq(ShopCoupon::getShopId, shopId));
if (count != shopShareDTO.getRewardCouponIdList().size()) {
if (shopShareDTO.getRewardCouponList() != null && !shopShareDTO.getRewardCouponList().isEmpty()) {
long count = shopCouponService.count(new QueryWrapper().in(ShopCoupon::getId, shopShareDTO.getRewardCouponList()).eq(ShopCoupon::getShopId, shopId));
if (count != shopShareDTO.getRewardCouponList().size()) {
throw new ApiNotPrintException("优惠券不存在");
}
}
@@ -72,8 +72,8 @@ public class ShopShareServiceImpl extends ServiceImpl<ShopShareMapper, ShopShare
shopShare = new ShopShareVO();
shopShare.setShopId(shopId);
}
shopShare.setRewardCoupon(JSONArray.toJSONString(shopShareDTO.getRewardCouponIdList()));
shopShare.setNewCoupon(JSONArray.toJSONString(shopShareDTO.getNewCouponIdList()));
shopShare.setRewardCoupon(JSONArray.toJSONString(shopShareDTO.getRewardCouponList()));
shopShare.setNewCoupon(JSONArray.toJSONString(shopShareDTO.getNewCouponList()));
BeanUtil.copyProperties(shopShareDTO, shopShare);
return saveOrUpdate(shopShare);
}