|
|
@@ -0,0 +1,90 @@ |
|
|
|
package com.hz.pm.api.external.model.enumeration; |
|
|
|
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.Getter; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
/** |
|
|
|
* <p> |
|
|
|
* MhUnitTypeEnum |
|
|
|
* </p> |
|
|
|
* |
|
|
|
* @author WendyYang |
|
|
|
* @since 09:11 2024/1/25 |
|
|
|
*/ |
|
|
|
@Getter |
|
|
|
@AllArgsConstructor |
|
|
|
public enum MhUnitTypeEnum { |
|
|
|
|
|
|
|
REGION("A", "区域"), |
|
|
|
NODE("N", "节点"), |
|
|
|
UNIT("U", "单位"), |
|
|
|
PFPI("Y", "公益一类事业单位"), |
|
|
|
PSPI("S", "公益二类事业单位"), |
|
|
|
DEPT("D", "部门"), |
|
|
|
OFFICE("O", "科室"), |
|
|
|
SASAC("G", "国资委"), |
|
|
|
TWO_GOV_COMPANY("C", "一级国企"), |
|
|
|
ONE_GOV_COMPANY("E", "二级国企"), |
|
|
|
KEY_INDUSTRY("K", "重点行业"), |
|
|
|
INDUSTRY_MANAGE_DEPT("Z", "行业主管部门"), |
|
|
|
INDUSTRY_COMPANY_UNIT("Q", "行业企事业单位"); |
|
|
|
|
|
|
|
private final String code; |
|
|
|
private final String val; |
|
|
|
|
|
|
|
//================================================================================================================== |
|
|
|
|
|
|
|
public static Optional<MhUnitTypeEnum> getByCode(String code) { |
|
|
|
return Arrays.stream(values()).filter(w -> w.getCode().equals(code)).findFirst(); |
|
|
|
} |
|
|
|
|
|
|
|
private static final List<MhUnitTypeEnum> INDUSTRIES; |
|
|
|
private static final List<MhUnitTypeEnum> GOV_COMPANIES; |
|
|
|
|
|
|
|
static { |
|
|
|
// 行业 |
|
|
|
INDUSTRIES = new ArrayList<>(); |
|
|
|
INDUSTRIES.add(KEY_INDUSTRY); |
|
|
|
INDUSTRIES.add(INDUSTRY_MANAGE_DEPT); |
|
|
|
INDUSTRIES.add(INDUSTRY_COMPANY_UNIT); |
|
|
|
|
|
|
|
// 国资委 |
|
|
|
GOV_COMPANIES = new ArrayList<>(); |
|
|
|
GOV_COMPANIES.add(SASAC); |
|
|
|
GOV_COMPANIES.add(ONE_GOV_COMPANY); |
|
|
|
GOV_COMPANIES.add(TWO_GOV_COMPANY); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 是否是国企 |
|
|
|
* |
|
|
|
* @return \ |
|
|
|
*/ |
|
|
|
public boolean isGovCompany() { |
|
|
|
return GOV_COMPANIES.contains(this); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 是否是行业 |
|
|
|
* |
|
|
|
* @return \ |
|
|
|
*/ |
|
|
|
public boolean isIndustry() { |
|
|
|
return INDUSTRIES.contains(this); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 是否是党政 |
|
|
|
* |
|
|
|
* @return \ |
|
|
|
*/ |
|
|
|
public boolean isPartyOrGov() { |
|
|
|
return !isGovCompany() && !isIndustry(); |
|
|
|
} |
|
|
|
|
|
|
|
} |