# ServiceRequestCenterDepartmentEnum.java

    package cloud.wconnect.it.cons.servicerequestcenter;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

    import java.util.Arrays;
    import java.util.List;
    import java.util.Objects;

    /**
     *
     * @author: yyt
     * 2025-12-17
     */
    @AllArgsConstructor
    @Getter
    public enum ServiceRequestCenterDepartmentEnum {

        // 财务部门：Accounting US，Accounting TW，管理员职位：Accounting Manager，Corporate Controller，员工职位：Property Accountant，Cost Analyst
        ACCOUNTING_US(ServiceRequestCenterTypeEnum.ACCOUNT.getCode(), "Accounting US", List.of("Accounting Manager", "Corporate Controller"), List.of("Property Accountant", "Cost Analyst")),
        ACCOUNTING_TW(ServiceRequestCenterTypeEnum.ACCOUNT.getCode(), "Accounting TW", List.of("Accounting Manager", "Corporate Controller"), List.of("Property Accountant", "Cost Analyst")),

        // it 部门：W-connect，管理员职位：Tech lead，员工职位：developer
        IT(ServiceRequestCenterTypeEnum.IT.getCode(), "W-connect", List.of("Tech lead"), List.of("developer")),

        // 产品部门：Product Team，管理员职位：Product Lead，员工职位：Product Manager，Project Manager
        PRODUCT(ServiceRequestCenterTypeEnum.PRODUCT.getCode(),"Product Team", List.of("Product Lead"), List.of("Product Manager", "Project Manager"));

        private final int code;

        private final String department;

        private final List<String> managerPositions;

        private final List<String> staffPositions;

        public static ServiceRequestCenterDepartmentEnum getDepartment(String department, int code) {
            return Arrays.stream(ServiceRequestCenterDepartmentEnum.values())
                    .filter(item -> Objects.equals(item.getDepartment(), department) && Objects.equals(item.getCode(), code))
                    .findFirst()
                    .orElse(null);
        }

        public static ServiceRequestCenterDepartmentEnum getDepartment(String department) {
            return Arrays.stream(ServiceRequestCenterDepartmentEnum.values())
                    .filter(item -> Objects.equals(item.getDepartment(), department))
                    .findFirst()
                    .orElse(null);
        }

        public static List<ServiceRequestCenterDepartmentEnum> listDepartments(int code) {
            return Arrays.stream(ServiceRequestCenterDepartmentEnum.values())
                    .filter(item -> Objects.equals(item.getCode(), code))
                    .toList();
        }
    }