package com.jwipc.constant;

import lombok.Getter;

@Getter
public enum SignProcessType {

    CONTRACT( "contract", "合同发起E签宝业务",1),

    ACCOUNT_STATEMENT("account_statement", "对账单",1),
    COST_ACCOUNT_STATEMENT("cost_account_statement", "费用对账单",1),
    COMPANY_ACCOUNT_STATEMENT("company_account_statement", "跨公司销售对账单",1),
    PURCHASE_ORDER("purchase_order", "采购订单",1),
    PURCHASE_SALE("purchase_sale_contract", "购销合同",1),
    PURCHASE_PROCESS_SALE("purchase_sale_process_contract", "购销合同",1);

    ;

    private final String businessNo;
    private final String title;
    /**
     * 印章类型 1:合同章；2 公章；3: 财务章；
     */
    private final Integer contractSealType;

    SignProcessType(String businessNo, String title,Integer contractSealType) {
        this.businessNo = businessNo;
        this.title = title;
        this.contractSealType = contractSealType;
    }

    public static SignProcessType getObj(String type){
        for(SignProcessType obj: SignProcessType.values()){
            if(obj.getBusinessNo().equals(type)){
                return obj;
            }
        }
        return null;
    }

    public static String getTitle(String type){
        for(SignProcessType obj: SignProcessType.values()){
            if(obj.getBusinessNo().equals(type)){
                return obj.getTitle();
            }
        }
        return null;
    }
}
