Pu Zhibing
2024-09-30 f541eaa5c92cb112af6d3f656275105606d31b39
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)){