循环依赖
This commit is contained in:
@@ -7,6 +7,7 @@ import com.czg.market.entity.ShopCoupon;
|
|||||||
import com.czg.market.service.MkCouponGiftService;
|
import com.czg.market.service.MkCouponGiftService;
|
||||||
import com.czg.market.service.ShopCouponService;
|
import com.czg.market.service.ShopCouponService;
|
||||||
import com.czg.service.market.mapper.MkCouponGiftMapper;
|
import com.czg.service.market.mapper.MkCouponGiftMapper;
|
||||||
|
import com.czg.service.market.mapper.ShopCouponMapper;
|
||||||
import com.czg.utils.PageUtil;
|
import com.czg.utils.PageUtil;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
@@ -27,7 +28,7 @@ import java.util.List;
|
|||||||
public class MkCouponGiftServiceImpl extends ServiceImpl<MkCouponGiftMapper, MkCouponGift> implements MkCouponGiftService {
|
public class MkCouponGiftServiceImpl extends ServiceImpl<MkCouponGiftMapper, MkCouponGift> implements MkCouponGiftService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ShopCouponService shopCouponService;
|
private ShopCouponMapper couponMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MkCouponGiftDTO> getCouponGiftPage(Long couponId) {
|
public Page<MkCouponGiftDTO> getCouponGiftPage(Long couponId) {
|
||||||
@@ -47,9 +48,7 @@ public class MkCouponGiftServiceImpl extends ServiceImpl<MkCouponGiftMapper, MkC
|
|||||||
if (CollUtil.isNotEmpty(couponGiftList)) {
|
if (CollUtil.isNotEmpty(couponGiftList)) {
|
||||||
List newCoupons = new ArrayList<>();
|
List newCoupons = new ArrayList<>();
|
||||||
for (MkCouponGiftDTO giftDTO : couponGiftList) {
|
for (MkCouponGiftDTO giftDTO : couponGiftList) {
|
||||||
ShopCoupon coupon = shopCouponService.queryChain().select(ShopCoupon::getTitle)
|
ShopCoupon coupon = couponMapper.selectOneByQuery(new QueryWrapper().eq(ShopCoupon::getId, giftDTO.getCouponId()));
|
||||||
.where(ShopCoupon::getId).eq(giftDTO.getCouponId())
|
|
||||||
.one();
|
|
||||||
if (coupon == null) {
|
if (coupon == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user