package org.springblade.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 系统字典类型枚举
 * 响功能和流程的字典
 * @author vic
 * @date 2024/9/9 8:56 PM
 * @description DictTypeEnum
 */
@Getter
@AllArgsConstructor
public enum DictTypeEnum {
    /**
     *
     */
    DATA_STATUS("data_status", "数据状态"),
    APPROVE_STATUS("approve_state", "通用审批状态"),
    COOPERATE_STATUS("cooperate_status", "合作状态"),
    CUSTOMER_TYPE("customer_type", "客户类型"),
    DELIVERER_TYPE("deliverer_type", "投送人类型"),
    ENTERPRISE_TYPE("enterprise_type", "企业类型"),
    SETTLEMENT_TYPE("settlement_type", "结算中心类型"),
    CUSTOMER_COMPANY_TYPE("company_type","客户管理的企业类型"),
    PARTNER_TYPE("partner_type","合作伙伴类型"),
    SYSTEM_YES_NO("yes_no","系统是否"),
    PLATFORM_TYPE("settlement_type","平台类型/结算中心类型"),
    TAXPAYER_TYPE("taxpayer_type","纳税人分类"),
    //部门简称
    DEPARTMENT_SHORT_NAME("department_short_name","部门简称"),
    PROCESS_TYPE("process_type","流程类型"),

    //评级维度
    RATING_DIMENSION("rating_dimension","评级维度"),
    // oa公司部门同步
    SYNC_COMPANY_NAME("sync_company_name","同步公司名称"),
    SYNC_ROOT_COMPANY_DEPT_NAME("sync_root_company_dept_name","同步根公司下部门名称"),
    DEPARTMENT_CODE("department_code","部门编号"),
    
    //公式管理
    FORMULA_TYPE("formula_type","公式类型"),
    
    //财务管理
    FINANCIAL_TYPE("financial_type","财务类型"),
    SAP_TYPE("sap_type","财务结算类型"),
    SETTLEMENT_CLASSIFICATION("settlement_classification","财务结算分类"),//内部结算、外部结算
    SAP_DATA_STATUS("sap_data_status","财务结算单状态"),
    SETTLEMENT_VOUCHER_TYPE("settlement_voucher_type","结算凭证类型"),
    SETTLEMENT_NEXT_STATUS("settlement_next_status","下一步结算状态"),
    
    PAYMENT_TYPE("payment_type","财务付款分类"),
    PAYMENT_DATA_STATUS("payment_data_status","财务付款单状态"),
    PAYEMENT_CLASSIFICATION("payment_classification","财务付款分类"), //内部付款、外部付款
    PAYMENT_METHOD_TYPE("payment_method_type","财务付款支付方式"),
    
    SAP_VERIFICATION_METHOD("verification_method","验证方式"),
    
    /** 结算管理列表页的开票状态、付款状态 **/
    SETT_PAYMENT_STATUS("payment_status","付款状态"),
    SETT_INVOICE_STATUS("invoice_status","开票状态"),
    

    // 车辆运输凭证
    CERTIFICATE_BATCH_STATUS("certificate_batch_status","车辆运输凭证批次状态"),
    CERTIFICATE_IDENTIFICATION_STATUS("certificate_identification_status","车辆运输凭证识别状态"),
    CERTIFICATE_IDENTIFICATION_RESULT("certificate_identification_result","车辆运输凭证识别结果"),

    // 文件任务状态
    FILE_TASK_STATUS("file_task_status", "文件任务状态"),
    // 运单管理-差异项 总净重
    WEIGHT_STATUS("weight_status", "总净重"),
    // 运单管理-比对结果 差异类型
    DIFFERENCE_TYPE("difference_type", "差异类型"),
    // 收款
    CLAIM_STATUS("claim_status", "认领状态"),
    RECEIPT_SOURCE("receipt_source", "收款来源"),
    CURRENCY("currency", "币种"),

    TRAJECTORY_STATUS("trajectory_status", "轨迹状态"),

    HOME_BASE_TYPE("base_type","基地类型"),

    FEE_NAME_TYPE("fee_name_type","费用类型"),

    TAX_CODE("taxCode","税收编码"),
    INPUT_INVOICE_STATUS("input_invoice_status","录入开票状态"),

    /**
     *  城矿结算公司财务负责人
     */
    SETTLEMENT_FINANCE_CONTROLLER("settlement_finance_controller", "城矿结算公司财务负责人"),

    /**
     *  付款单据类型
     */
    PAYMENT_DOCUMENT_TYPE("payment_document_type", "付款单据类型"),

    /**
     *  归档状态
     */
    ARCHIVE_STATUS("archive_status", "归档状态"),

    /**
     *  预警类型
     */
    WARNING_TYPE("warning_type", "预警类型"),

    /**
     *  消息状态
     */
    MESSAGE_STATUS("message_status", "消息状态"),

    /**
     *  通知类型
     */
    NOTICE_TYPE("notice_type", "通知类型"),

    /**
     *  通知对象类型
     */
    NOTICE_OBJECT_TYPE("notice_object_type", "通知对象类型"),

    /**
     *  项目磅单校验类型
     */
    PROJECT_POUND_VALID_TYPE("project_pound_valid_type", "项目磅单校验类型"),

    /**
     *  推送单据类型
     */
    PUSH_DOC_TYPE("push_doc_type", "推送单据类型"),

    /**
     *  mk流程状态
     */
    MK_STATUS("mk_status", "mk流程状态"),

    ;

    final String type;

    final String text;


    /**
     * 匹配枚举值
     *
     * @param type
     * @return
     */
    public static boolean match(String type) {
        for (DictTypeEnum state : values()) {
            if (state.type.equals(type)) {
                return true;
            }
        }
        return false;
    }

    public static String getNameStr(String type) {
        for (DictTypeEnum state : values()) {
            if (state.type.equals(type)) {
                return state.text;
            }
        }
        return null;
    }

}
