Parcourir la source

商家端代金券 好友证券代码提交

wuchen il y a 2 mois
Parent
commit
47e12ea8a8

+ 4 - 1
alien-entity/src/main/java/shop/alien/entity/store/vo/LifeDiscountCouponVo.java

@@ -87,9 +87,12 @@ public class LifeDiscountCouponVo {
     @ApiModelProperty(value = "类型   1-优惠券  2-红包")
     private Integer type;
 
-    @ApiModelProperty(value = "状态(0:进行中,1:已结束,2:未开始,3:活动暂停)")
+    @ApiModelProperty(value = "状态(0:进行中,1:已结束,2:未开始,3:已暂停,4:已售罄,5:草稿)")
     private Integer status;
 
+    @ApiModelProperty(value = "优惠券状态文案,用于前端展示:进行中/已结束/未开始/已暂停/已售罄/草稿")
+    private String statusDesc;
+
     @ApiModelProperty(value = "收藏可领(0:否,1:是)")
     private Integer attentionCanReceived;
 

+ 8 - 4
alien-store-platform/src/main/java/shop/alien/storeplatform/service/impl/LifeDiscountCouponPlatformServiceImpl.java

@@ -491,25 +491,29 @@ public class LifeDiscountCouponPlatformServiceImpl extends ServiceImpl<LifeDisco
                 int startResult = localNow.compareTo(lifeDiscountCoupon.getBeginGetDate());
                 int endResult = localNow.compareTo(lifeDiscountCoupon.getEndGetDate());
                 if (lifeDiscountCoupon.getCouponStatus() == 0) {
-                    //如果为草稿则状态为未开始
                     lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.DRAFT.getValue()));
-                } else if (lifeDiscountCoupon.getSingleQty() == null || lifeDiscountCoupon.getSingleQty() == 0) {//无库存则已售罄 //如果当前时间小于开始时间
+                    lifeDiscountCouponVo.setStatusDesc("草稿");
+                } else if (lifeDiscountCoupon.getSingleQty() == null || lifeDiscountCoupon.getSingleQty() == 0) {
                     lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.HAVE_SOLD_OUT.getValue()));
+                    lifeDiscountCouponVo.setStatusDesc("已售罄");
                 } else if (startResult < 0) {
                     lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.HAVE_NOT_STARTED.getValue()));
+                    lifeDiscountCouponVo.setStatusDesc("未开始");
                 } else if (lifeDiscountCoupon.getGetStatus() == null || lifeDiscountCoupon.getGetStatus().toString().equals(DiscountCouponEnum.NO_GET.getValue())) {
                     lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.SUSPEND_GET.getValue()));
+                    lifeDiscountCouponVo.setStatusDesc("已暂停");
                 } else if (endResult > 0) {
                     lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.FINISHED.getValue()));
+                    lifeDiscountCouponVo.setStatusDesc("已结束");
                 } else if (startResult >= 0 && endResult <= 0) {
                     lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.UNDER_WAY.getValue()));
+                    lifeDiscountCouponVo.setStatusDesc("进行中");
                 }
             } else {
                 if (lifeDiscountCoupon.getCouponStatus() == 0) {
-                    //如果为草稿则状态为未开始
                     lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.DRAFT.getValue()));
+                    lifeDiscountCouponVo.setStatusDesc("草稿");
                 } else {
-                    // 开始结束时间为空,数据异常跳过
                     continue;
                 }
             }