diff --git a/src/main/java/club/joylink/rtss/vo/AccountVO.java b/src/main/java/club/joylink/rtss/vo/AccountVO.java index bad7b4c16..4019c16c5 100644 --- a/src/main/java/club/joylink/rtss/vo/AccountVO.java +++ b/src/main/java/club/joylink/rtss/vo/AccountVO.java @@ -3,6 +3,7 @@ package club.joylink.rtss.vo; import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.entity.Org; import club.joylink.rtss.entity.SysAccount; +import club.joylink.rtss.vo.client.org.OrgProjectVO; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; @@ -319,4 +320,17 @@ public class AccountVO implements Serializable { public boolean isThirdChildAccount() { return Type_3.equalsIgnoreCase(this.type) && StringUtils.hasText(this.parentAccount); } + + public void setOrgProjectVO(OrgProjectVO orgProjectVO) { + if (orgProjectVO != null) { + this.companyId = orgProjectVO.getOrgId(); + this.companyName = orgProjectVO.getName(); + this.companyAdmin = !CollectionUtils.isEmpty(orgProjectVO.getRole()) + && orgProjectVO.getRole().contains(BusinessConsts.OrgRole.Admin.name()); + } else { + this.companyId = 0L; + this.companyName = null; + this.companyAdmin = false; + } + } } diff --git a/src/main/java/club/joylink/rtss/vo/LoginUserInfoVO.java b/src/main/java/club/joylink/rtss/vo/LoginUserInfoVO.java index d1031ef52..fb43c506a 100644 --- a/src/main/java/club/joylink/rtss/vo/LoginUserInfoVO.java +++ b/src/main/java/club/joylink/rtss/vo/LoginUserInfoVO.java @@ -153,4 +153,9 @@ public class LoginUserInfoVO { } return orgProjectVO.getTopOrgId(); } + + public void setOrgProjectVO(OrgProjectVO orgProjectVO) { + this.orgProjectVO = orgProjectVO; + this.accountVO.setOrgProjectVO(orgProjectVO); + } }