qmj 2 недель назад
Родитель
Сommit
4bb771c762

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/dto/PromotionCalcResponse.java

@@ -1,6 +1,7 @@
 package com.ruoyi.system.dto;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import lombok.Data;
@@ -157,5 +158,7 @@ public class PromotionCalcResponse {
         private Boolean usable;
         /** 是否与当前促销冲突 */
         private Boolean conflictWithPromotion;
+        /** 过期时间 */
+        private Date expireTime;
     }
 }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PromotionCalcServiceImpl.java

@@ -457,6 +457,7 @@ public class PromotionCalcServiceImpl implements IPromotionCalcService
         ac.setDiscountRate((BigDecimal) couponMap.get("discountRate"));
         ac.setUsable((Boolean) couponMap.get("usable"));
         ac.setConflictWithPromotion((Boolean) couponMap.get("conflictWithPromotion"));
+        ac.setExpireTime((java.util.Date) couponMap.get("expireTime"));
         return ac;
     }
 
@@ -816,6 +817,7 @@ public class PromotionCalcServiceImpl implements IPromotionCalcService
             couponInfo.put("threshold", rule.getThreshold());
             couponInfo.put("amount", rule.getAmount());
             couponInfo.put("discountRate", rule.getDiscountRate());
+            couponInfo.put("expireTime", uc.getExpireTime());
 
             boolean usable = true;
             int isMutex = rule.getIsMutex() != null ? rule.getIsMutex() : 0;