From fd57d8b98cec959ee82a79fa34cbbdc81a0cb514 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 24 四月 2026 23:11:06 +0800
Subject: [PATCH] 修改bug
---
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCouponServiceImpl.java | 38 +++++++++++++++++++++++++++++++-------
1 files changed, 31 insertions(+), 7 deletions(-)
diff --git a/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCouponServiceImpl.java b/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCouponServiceImpl.java
index bf21d89..fbfd347 100644
--- a/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCouponServiceImpl.java
+++ b/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCouponServiceImpl.java
@@ -45,6 +45,7 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
@@ -541,19 +542,42 @@
vo.setCouponName(data.getCouponName());
vo.setCouponDesc(data.getCouponDescription());
vo.setEndTime(xpAppUserCoupon.getExpirationTime().toString());
+ Integer expireRules = acticityStrategy.getExpireRules();
vo.setUnavailable("");
- vo.setStackable("");
+ Integer stackedUsage = acticityStrategy.getStackedUsage();
+ if(1 == stackedUsage){
+ vo.setStackable("可叠加:");
+ }else{
+ vo.setStackable("不可叠加:与其他优惠券互斥,不可同时使用");
+ }
Integer effectiveRules = acticityStrategy.getEffectiveRules();
if(1 == effectiveRules){
- vo.setEffectAndInvalid("");
+ if(1 == expireRules){
+ vo.setEffectAndInvalid("生效失效:领取后立即生效,未使用、次日零点失效。");
+ }
+ if(2 == expireRules){
+ Integer expireDays = acticityStrategy.getExpireDays();
+ vo.setEffectAndInvalid("生效失效:领取后立即生效,未使用、" + expireDays + "天后失效。");
+ }
+ if(3 == expireRules){
+ String format1 = acticityStrategy.getExpireDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+ vo.setEffectAndInvalid("生效失效:领取后立即生效,未使用、" + format1 + "失效。");
+ }
}
if(2 == effectiveRules){
-
+ String format = acticityStrategy.getEffectiveDays().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+ if(1 == expireRules){
+ vo.setEffectAndInvalid("生效失效:领取后" + format + "生效,未使用、次日零点失效。");
+ }
+ if(2 == expireRules){
+ Integer expireDays = acticityStrategy.getExpireDays();
+ vo.setEffectAndInvalid("生效失效:领取后" + format + "生效,未使用、" + expireDays + "天后失效。");
+ }
+ if(3 == expireRules){
+ String format1 = acticityStrategy.getExpireDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+ vo.setEffectAndInvalid("生效失效:领取后" + format + "生效,未使用、" + format1 + "失效。");
+ }
}
- if(3 == effectiveRules){
-
- }
-
if(orderMoney.compareTo(data.getConditionalAmount()) >= 0){
usableCouponList.add(vo);
}else{
--
Gitblit v1.7.1