Browse Source

优惠券列表修改,草稿数据处理

zhangchen 3 months ago
parent
commit
fac3761229

+ 4 - 4
alien-store/src/main/java/shop/alien/store/service/impl/LifeDiscountCouponServiceImpl.java

@@ -775,9 +775,9 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
                     int startResult = localNow.compareTo(lifeDiscountCoupon.getBeginGetDate());
                     int endResult = localNow.compareTo(lifeDiscountCoupon.getEndGetDate());
                     //如果当前时间小于开始时间
-                    if (lifeDiscountCoupon.getSingleQty() == 0) {//无库存则已售罄
+                    if (lifeDiscountCoupon.getSingleQty() == null || lifeDiscountCoupon.getSingleQty() == 0) {//无库存则已售罄
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.HAVE_SOLD_OUT.getValue()));
-                    } else if (lifeDiscountCoupon.getGetStatus().toString().equals(DiscountCouponEnum.NO_GET.getValue())) {
+                    } else if (lifeDiscountCoupon.getGetStatus() == null || lifeDiscountCoupon.getGetStatus().toString().equals(DiscountCouponEnum.NO_GET.getValue())) {
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.SUSPEND_GET.getValue()));
                     } else if (startResult < 0) {
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.HAVE_NOT_STARTED.getValue()));
@@ -855,9 +855,9 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
                     int startResult = localNow.compareTo(record.getBeginGetDate());
                     int endResult = localNow.compareTo(record.getEndGetDate());
                     //如果当前时间小于开始时间
-                    if (record.getSingleQty() == 0) {//无库存则已售罄
+                    if (record.getSingleQty() == null || record.getSingleQty() == 0) {//无库存则已售罄
                         record.setStatus(Integer.parseInt(DiscountCouponEnum.HAVE_SOLD_OUT.getValue()));
-                    } else if (record.getGetStatus().toString().equals(DiscountCouponEnum.NO_GET.getValue())) {
+                    } else if (record.getGetStatus() == null || record.getGetStatus().toString().equals(DiscountCouponEnum.NO_GET.getValue())) {
                         record.setStatus(Integer.parseInt(DiscountCouponEnum.SUSPEND_GET.getValue()));
                     } else if (startResult < 0) {
                         record.setStatus(Integer.parseInt(DiscountCouponEnum.HAVE_NOT_STARTED.getValue()));