package com.zcloud.fire.check.domain.enums;

import lombok.Getter;

@Getter
public enum UserTypeEnum {
    JG(1,"监管"),
    QY(2,"企业"),
    XGF(3,"相关方")
    ;
    private final Integer code;
    private final String name;

    UserTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static Integer getUserType(Integer corpType){
        if (corpType.equals(CorpTypeEnum.OrdinaryEnterprises.getCode()) ||
            corpType.equals(CorpTypeEnum.groupUnits.getCode())){
            return UserTypeEnum.QY.getCode();
        }else if (corpType.equals(CorpTypeEnum.share.getCode())){
            return UserTypeEnum.JG.getCode();
        }else {
            return UserTypeEnum.XGF.getCode();
        }
    }

}
