From 7547b6b14b7d58b66459357dd50c79fb49e2a303 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Mon, 17 Oct 2022 14:23:57 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E9=80=89=E6=8B=A9=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95=E4=BF=A1=E6=81=AF=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/club/joylink/rtss/vo/AccountVO.java | 14 ++++++++++++++ .../java/club/joylink/rtss/vo/LoginUserInfoVO.java | 5 +++++ 2 files changed, 19 insertions(+) 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); + } }