Merge branch 'test-training2' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-training2-zhouyin

This commit is contained in:
tiger_zhou 2022-09-29 16:34:14 +08:00
commit db0222843f
4 changed files with 68 additions and 14 deletions

View File

@ -0,0 +1,18 @@
package club.joylink.rtss.entity.org;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class OrgProject {
private Long id;
private Long orgId;
private String projectCode;
private Long creatorId;
private LocalDateTime createTime;
}

View File

@ -140,7 +140,8 @@ public class AccountVO implements Serializable {
private List<String> projectCodes;
public AccountVO() {}
public AccountVO() {
}
public AccountVO(SysAccount account) {
this.id = account.getId();
@ -262,6 +263,7 @@ public class AccountVO implements Serializable {
/**
* 是否管理员
*
* @return
*/
@JsonIgnore
@ -272,6 +274,7 @@ public class AccountVO implements Serializable {
/**
* 是否超级管理员
*
* @return
*/
@JsonIgnore

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.constants.Client;
import club.joylink.rtss.entity.SysAccountLogin;
import club.joylink.rtss.entity.project.Project;
import club.joylink.rtss.util.EncryptUtil;
import club.joylink.rtss.vo.client.org.OrgProjectVO;
import club.joylink.rtss.vo.client.project.ProjectDeviceVO;
import club.joylink.rtss.vo.project.ProjectVO;
import lombok.Getter;
@ -49,6 +50,9 @@ public class LoginUserInfoVO {
private LocalDateTime preLogoutTime;
private LocalDateTime lastQueryTime; // 最后使用时间
// 20220929 增加
private OrgProjectVO orgProjectVO;
public LoginUserInfoVO(AccountVO accountVO, Client client, String project, ProjectDeviceVO deviceVO) {
this.accountVO = accountVO;
this.client = client;
@ -139,4 +143,14 @@ public class LoginUserInfoVO {
public boolean isWechatLogin() {
return Client.Assistant.equals(this.getClient());
}
/**
* 获取顶级组织Id
*/
public Long getTopOrgId() {
if (orgProjectVO == null) {
return null;
}
return orgProjectVO.getTopOrgId();
}
}

View File

@ -0,0 +1,19 @@
package club.joylink.rtss.vo.client.org;
import club.joylink.rtss.entity.org.OrgProject;
import lombok.Data;
@Data
public class OrgProjectVO {
private Long topOrgId;
private Long orgId;
private String projectCode;
public OrgProjectVO(OrgProject orgProject) {
this.orgId = orgProject.getOrgId();
this.projectCode = orgProject.getProjectCode();
}
}