Prechádzať zdrojové kódy

库存多扣的问题

liudongzhi 2 dní pred
rodič
commit
28d92919a3

+ 2 - 1
alien-store/src/main/java/shop/alien/store/service/impl/LifeDiscountCouponStoreFriendServiceImpl.java

@@ -573,6 +573,7 @@ public class LifeDiscountCouponStoreFriendServiceImpl extends ServiceImpl<LifeDi
                                     .or(sub -> sub.isNull(LifeDiscountCouponStoreFriend::getReceiverStoreId)
                                             .eq(LifeDiscountCouponStoreFriend::getStoreUserId, storeId)))
                             .eq(LifeDiscountCouponStoreFriend::getReleaseType, 1)
+                            .gt(LifeDiscountCouponStoreFriend::getSingleQty, 0)
    //                         .in(LifeDiscountCouponStoreFriend::getCouponId, couponList)
             );
 
@@ -598,7 +599,7 @@ public class LifeDiscountCouponStoreFriendServiceImpl extends ServiceImpl<LifeDi
                     LifeDiscountCoupon lifeDiscountCoupon = lifeDiscountCouponMapper.selectOne(queryWrapper);
 
                     // 如果查询到符合条件的优惠券,说明该优惠券可领
-                    if (lifeDiscountCoupon != null) {
+                    if (lifeDiscountCoupon != null  ) {
                         // 设定本次领取优惠券的数量,这里固定为1张
                         Integer receiveQuantity = 1;