Pu Zhibing
2024-12-24 af243c209737fbae0671638f0e73a9e670f3d6fa
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TCouponServiceImpl.java
@@ -34,6 +34,13 @@
        StringBuilder couponIds = new StringBuilder();
        for (TCoupon tCoupon : list) {
            couponIds.append(tCoupon.getId()).append(",");
            // 如果优惠券库存为0 那么将优惠券状态改为下架 不启用
            if (tCoupon.getInventoryQuantity()==0){
                tCoupon.setStatus(2);
                this.baseMapper.updateById(tCoupon);
            }
        }
        if (!list.isEmpty()){
            if (StringUtils.hasLength(couponIds)){