| | |
| | | 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; |
| | |
| | | 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{ |