|
@@ -81,7 +81,6 @@ public class CouponShareService {
|
|
|
private static final String STATUS_REVOKED = "REVOKED";
|
|
private static final String STATUS_REVOKED = "REVOKED";
|
|
|
private static final String STATUS_EXPIRED = "EXPIRED";
|
|
private static final String STATUS_EXPIRED = "EXPIRED";
|
|
|
private static final String CLAIM_METHOD_SHARE = "SHARE";
|
|
private static final String CLAIM_METHOD_SHARE = "SHARE";
|
|
|
- private static final String GIFTABLE_APPLICABLE_TO = "MEMBERSHIP";
|
|
|
|
|
private static final String AVAILABLE = "AVAILABLE";
|
|
private static final String AVAILABLE = "AVAILABLE";
|
|
|
private static final String ACTIVE = "ACTIVE";
|
|
private static final String ACTIVE = "ACTIVE";
|
|
|
private static final String SHARE_PATH_PREFIX = "/pages/coupon/share-claim?shareToken=";
|
|
private static final String SHARE_PATH_PREFIX = "/pages/coupon/share-claim?shareToken=";
|
|
@@ -140,7 +139,8 @@ public class CouponShareService {
|
|
|
return buildCreateResult(existing);
|
|
return buildCreateResult(existing);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 券校验(属于赠送人家庭 && AVAILABLE && applicableTo=MEMBERSHIP && ACTIVE && 未过期)
|
|
|
|
|
|
|
+ // 券校验(属于赠送人家庭 && AVAILABLE && ACTIVE && 未过期)。
|
|
|
|
|
+ // 需求变更2026-11-23:所有券均可分享(原来限 applicableTo=MEMBERSHIP),仅去掉类型限制,状态/归属/过期校验保留。
|
|
|
FamilyCoupon fc = familyCouponMapper.selectById(familyCouponId);
|
|
FamilyCoupon fc = familyCouponMapper.selectById(familyCouponId);
|
|
|
if (fc == null || !Objects.equals(fc.getFamilyId(), giverFamilyId)
|
|
if (fc == null || !Objects.equals(fc.getFamilyId(), giverFamilyId)
|
|
|
|| !AVAILABLE.equals(fc.getStatus())) {
|
|
|| !AVAILABLE.equals(fc.getStatus())) {
|
|
@@ -150,9 +150,6 @@ public class CouponShareService {
|
|
|
if (coupon == null || !ACTIVE.equals(coupon.getStatus())) {
|
|
if (coupon == null || !ACTIVE.equals(coupon.getStatus())) {
|
|
|
throw new IllegalArgumentException(MSG_COUPON_INVALID);
|
|
throw new IllegalArgumentException(MSG_COUPON_INVALID);
|
|
|
}
|
|
}
|
|
|
- if (!GIFTABLE_APPLICABLE_TO.equals(coupon.getApplicableTo())) {
|
|
|
|
|
- throw new IllegalArgumentException(MSG_ONLY_MEMBERSHIP);
|
|
|
|
|
- }
|
|
|
|
|
if (coupon.getValidFrom() != null && now.before(coupon.getValidFrom())
|
|
if (coupon.getValidFrom() != null && now.before(coupon.getValidFrom())
|
|
|
|| coupon.getValidUntil() != null && now.after(coupon.getValidUntil())) {
|
|
|| coupon.getValidUntil() != null && now.after(coupon.getValidUntil())) {
|
|
|
throw new IllegalArgumentException(MSG_COUPON_EXPIRED);
|
|
throw new IllegalArgumentException(MSG_COUPON_EXPIRED);
|