heheng
2025-05-16 8485affcb0d4de05059d80cb1e844d6b18291654
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.gkhy.labRiskManage.domain.riskReport.utils;
 
import com.gkhy.labRiskManage.commons.enums.UserRoleEnum;
import com.gkhy.labRiskManage.domain.account.model.dto.SysUserRoleBindDomainDTO;
import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO;
import org.springframework.stereotype.Component;
 
@Component
public class GetRoleTagUtils {
 
    public static int GetRoleTagUtils (UserInfoDomainDTO userInfo){
 
        int roleTag = 0;
        for (SysUserRoleBindDomainDTO role : userInfo.getRoles()) {
            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
                roleTag = 1;
            }
        }
        for (SysUserRoleBindDomainDTO role : userInfo.getRoles()) {
            if (role.getRoleId() == UserRoleEnum.USER_ROLE_6.getCode().byteValue()){
                roleTag = 2;
            }
            if (role.getRoleId() == UserRoleEnum.USER_ROLE_7.getCode().byteValue()){
                roleTag = 2;
            }
        }
 
        return  roleTag;
    }
}