|
@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.time.ZoneId;
|
|
import java.time.ZoneId;
|
|
|
import java.time.temporal.ChronoUnit;
|
|
import java.time.temporal.ChronoUnit;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
@@ -32,6 +33,8 @@ public class LawyerUser extends Model<LawyerUser> {
|
|
|
public static final int LOGOUT_FLAG_DONE = 1;
|
|
public static final int LOGOUT_FLAG_DONE = 1;
|
|
|
/** logout_flag:注销冷静期 */
|
|
/** logout_flag:注销冷静期 */
|
|
|
public static final int LOGOUT_FLAG_COOLING = 2;
|
|
public static final int LOGOUT_FLAG_COOLING = 2;
|
|
|
|
|
+ /** 注销完成后禁止重新注册的天数(自 logoutTime 日起,T+14 00:00 起可注册) */
|
|
|
|
|
+ public static final int RE_REGISTER_BLOCK_DAYS = 14;
|
|
|
|
|
|
|
|
public LawyerUser() {
|
|
public LawyerUser() {
|
|
|
}
|
|
}
|
|
@@ -396,5 +399,20 @@ public class LawyerUser extends Model<LawyerUser> {
|
|
|
@TableField("zfb_secondary_merchant_account")
|
|
@TableField("zfb_secondary_merchant_account")
|
|
|
private String zfbSecondaryMerchantAccount;
|
|
private String zfbSecondaryMerchantAccount;
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 注销完成日 T(logoutTime)起,至 T+{@link #RE_REGISTER_BLOCK_DAYS} 日 00:00 前禁止重新注册/登录。
|
|
|
|
|
+ */
|
|
|
|
|
+ public static boolean isWithinReRegisterBlockPeriod(Date logoutTime) {
|
|
|
|
|
+ if (logoutTime == null) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ LocalDateTime allowFrom = logoutTime.toInstant()
|
|
|
|
|
+ .atZone(ZoneId.systemDefault())
|
|
|
|
|
+ .toLocalDate()
|
|
|
|
|
+ .plusDays(RE_REGISTER_BLOCK_DAYS)
|
|
|
|
|
+ .atStartOfDay();
|
|
|
|
|
+ return LocalDateTime.now().isBefore(allowFrom);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|