记得上下班打卡 | git大法好,push需谨慎

Commit d7fc7daa authored by 张国柄's avatar 张国柄

判断新老会员逻辑调整;

parent 76802106
...@@ -34,7 +34,7 @@ public class AdamUserMemberVo implements Serializable, Cloneable { ...@@ -34,7 +34,7 @@ public class AdamUserMemberVo implements Serializable, Cloneable {
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR) @JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
private LocalDateTime updatedAt; private LocalDateTime updatedAt;
private static final LocalDateTime oldMemberSpotTime = LocalDateTime.parse("2022-09-02 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); private static final LocalDateTime oldMemberSpotTime = LocalDateTime.parse("2022-09-27 17:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
private static final AdamUserMemberVo obj = new AdamUserMemberVo(); private static final AdamUserMemberVo obj = new AdamUserMemberVo();
public static AdamUserMemberVo getNew() { public static AdamUserMemberVo getNew() {
...@@ -70,12 +70,17 @@ public class AdamUserMemberVo implements Serializable, Cloneable { ...@@ -70,12 +70,17 @@ public class AdamUserMemberVo implements Serializable, Cloneable {
/** /**
* 是否为老会员 * 是否为老会员
* <p>
* 实际使用中需结合isActive()判断
* </p>
* *
* @return true-是 * @return true-是
*/ */
@JsonIgnore @JsonIgnore
public boolean isOldMember() { public boolean isOldMember() {
LocalDateTime expiryAt = this.getExpiryAt(); LocalDateTime createdAt = this.getCreatedAt();
return expiryAt.isBefore(oldMemberSpotTime); LocalDateTime updatedAt = this.getUpdatedAt();
// 创建时间在`指定日期`之前,且(更新时间为空或更新时间在`指定时间`之前)
return createdAt.isBefore(oldMemberSpotTime) && (null == updatedAt || (updatedAt.isBefore(oldMemberSpotTime)));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment