package com.jwipc.constant;

import lombok.Getter;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@Getter
public enum OaProcessType {
    SUPPLIER_ACCESS(1, "流程ID", "供应商准入OA回调", "/sys/modeling/main/modelingAppView.do?method=modelView&listviewId=${ID}&fdId="),
    SUPPLIER_CHANGE(2, "流程ID", "供应商变更OA回调", "/sys/modeling/main/modelingAppView.do?method=modelView&listviewId=${ID}&fdId="),
    INQUIRY_PRICE(4, "流程ID", "询报价价格OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    TENDER_PRICE(5, "流程ID", "招标价格OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    AUDIT_PRICE(6, "流程ID", "调价OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    PCN_CHANGE(7, "流程ID", "PCN推送OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    DEDUCTION(8, "流程ID", "扣款确认OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    CONTRACT_CHANGE(9, "流程ID", "合同推送OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    CONTRACT_PAY_CHANGE(10, "流程ID", "合同付款申请推送OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    SHOPPING_PAY_CHANGE(11, "流程ID", "商城付款推送OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    PAYMENT_COD_APPLY(13, "流程ID", "对账付款申请推送OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    MATERIAL_DEMO(14, "流程ID", "物料认证OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    CONTRACT_CHANGE_MRO(15, "流程ID", "采购类合同评审创建推送OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    PAYMENT_ADVANCE_APPLY(16, "流程ID", "预付款申请推送OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    QUOTA_PRICE(17, "流程ID", "配额推送OA回调", "/km/review/km_review_main/kmReviewMain.do?method=view&fdId="),
    SUPPLIER_IMPORT_ACCESS(18, "流程ID", "供应商导入OA回调", "/sys/modeling/main/modelingAppView.do?method=modelView&listviewId=${ID}&fdId="),

    ;

    private final int type;
    private final String processId;
    private final String title;
    private final String url;//流程查看的地址

    OaProcessType(int type, String processId, String title, String url) {
        this.type = type;
        this.processId = processId;
        this.title = title;
        this.url = url;
    }

    public static OaProcessType getObj(int type){

        for(OaProcessType obj:OaProcessType.values()){
            if(obj.getType()==type){
                return obj;
            }
        }
        return null;
    }

    public static String getTitle(int type){

        for(OaProcessType obj:OaProcessType.values()){
            if(obj.getType()==type){
                return obj.getTitle();
            }
        }
        return null;
    }
}
