diff --git a/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/ShopCouponServiceImpl.java b/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/ShopCouponServiceImpl.java index f81567d5..4401e825 100644 --- a/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/ShopCouponServiceImpl.java +++ b/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/ShopCouponServiceImpl.java @@ -252,18 +252,11 @@ public class ShopCouponServiceImpl extends ServiceImpl shopNames = shopInfoService.listAs(new QueryWrapper().select(ShopInfo::getShopName) + coupon.setUseShops(coupon.getUseShops() + "," + coupon.getShopId()); + QueryWrapper queryWrapper = QueryWrapper.create().select(ShopInfo::getShopName) .in(ShopInfo::getId, Arrays.stream(coupon.getUseShops().split(",")).map(Long::parseLong).toList()) - .eq(ShopInfo::getStatus, 1), String.class); - Long mainId = shopInfoService.getMainIdByShopId(coupon.getShopId()); - String mainShopName = ""; - if (!mainId.equals(coupon.getShopId())) { - ShopInfo mainShop = shopInfoService.getById(mainId); - mainShopName = mainShop.getShopName(); - } - if (StrUtil.isNotBlank(mainShopName)) { - coupon.setUseShops(mainShopName); - } + .eq(ShopInfo::getStatus, 1); + List shopNames = shopInfoService.listAs(queryWrapper, String.class); if (CollUtil.isNotEmpty(shopNames)) { StringBuilder result = new StringBuilder(); for (int i = 0; i < shopNames.size(); i++) { @@ -276,10 +269,7 @@ public class ShopCouponServiceImpl extends ServiceImpl