diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/coupon/entity/Coupon.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/coupon/entity/Coupon.java index f3da2350..cf603ae3 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/coupon/entity/Coupon.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/coupon/entity/Coupon.java @@ -35,13 +35,9 @@ import java.util.List; @ApiModel(value = "优惠券/模版信息管理实体类") public class Coupon extends BaseGeneralInfo { -// @TableField(value = "store_id_list") -// @ApiModelProperty(value = "发布门店id列表", required = "json") -// private List storeIdList; - - @TableField(value = "store_id") - @ApiModelProperty(value = "发布门店id列表") - private String storeId; + @TableField(value = "store_id_list") + @ApiModelProperty(value = "发布门店id列表", required = "json") + private List storeIdList; @TableField(value = "template_id") @ApiModelProperty(value = "模板id") diff --git a/skyeye-shop/shop-store/src/main/java/com/skyeye/coupon/service/impl/CouponServiceImpl.java b/skyeye-shop/shop-store/src/main/java/com/skyeye/coupon/service/impl/CouponServiceImpl.java index 9adb4abb..d3d08bb3 100644 --- a/skyeye-shop/shop-store/src/main/java/com/skyeye/coupon/service/impl/CouponServiceImpl.java +++ b/skyeye-shop/shop-store/src/main/java/com/skyeye/coupon/service/impl/CouponServiceImpl.java @@ -23,6 +23,7 @@ import com.skyeye.common.util.mybatisplus.MybatisPlusUtil; import com.skyeye.coupon.dao.CouponDao; import com.skyeye.coupon.entity.Coupon; import com.skyeye.coupon.entity.CouponMaterial; +import com.skyeye.coupon.entity.CouponStore; import com.skyeye.coupon.enums.CouponValidityType; import com.skyeye.coupon.enums.PromotionDiscountType; import com.skyeye.coupon.enums.PromotionMaterialScope; @@ -136,9 +137,9 @@ public class CouponServiceImpl extends SkyeyeBusinessServiceImpl queryWrapper = new QueryWrapper<>(); String storeId = params.get("storeId").toString(); String type = params.get("type").toString(); - if (StrUtil.isNotEmpty(storeId)) { - queryWrapper.eq(MybatisPlusUtil.toColumns(Coupon::getStoreId), storeId); + List couponStoreList = couponStoreService.queryListByStoreId(storeId); + List couponIdList = couponStoreList.stream().map(CouponStore::getCouponId).distinct().collect(Collectors.toList()); + if(CollectionUtil.isEmpty(couponIdList)){ + return; } + queryWrapper.in(CommonConstants.ID, couponIdList); String typeKey = MybatisPlusUtil.toColumns(Coupon::getTemplateId); if (StrUtil.equals(type, CommonNumConstants.NUM_ZERO.toString())) { queryWrapper.and(wrapper -> {