|
|
@@ -158,4 +158,19 @@ public class FamilyMember implements Serializable {
|
|
|
java.time.LocalDate now = java.time.LocalDate.now();
|
|
|
return java.time.Period.between(birth, now).getYears();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 成员类型: login=可登录成员(有openid) / local=不可登录成员(用户创建,无openid)
|
|
|
+ * 判定依据: userId 关联的 User 是否有 openid
|
|
|
+ * 注意: 该字段为 VO 层计算值,不落库;由 service 层传入 userId 对应的 openid 状态后设置
|
|
|
+ */
|
|
|
+ private String memberType;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否可被切换(不可登录成员才可被切换)
|
|
|
+ */
|
|
|
+ public boolean isSwitchable(String userOpenid) {
|
|
|
+ // userId 为空 或 user 无 openid → 不可登录 → 可切换
|
|
|
+ return userOpenid == null || userOpenid.isEmpty();
|
|
|
+ }
|
|
|
}
|