package com.ruoyi.web.modules.trading.support;

/**
 * 供应商管理枚举常量。
 */
public final class SupplierRules
{
    public static final int TYPE_INDIVIDUAL = 1;

    public static final int TYPE_ENTERPRISE = 2;

    public static final int FEE_METHOD_PER_ACCOUNT = 1;

    public static final int FEE_METHOD_PER_HEAD = 2;

    public static final int FEE_METHOD_PER_AMOUNT = 3;

    public static final int MAX_VEHICLE_PLATES = 10;

    public static final int MAX_SUPPLIER_CODE = 99;

    public static final String DEL_FLAG_NORMAL = "0";

    public static final String DEL_FLAG_DELETED = "2";

    /**
     * 历史常量；分配账号请使用 {@link TradePartnerAccountRules#ROLE_KEY_SUPPLIER} 解析角色。
     */
    public static final long ROLE_ID_SUPPLIER = 103L;

    public static final String MSG_DELETE_UNSETTLED_SETTLEMENT = "存在未结算的结算单，无法删除";

    private SupplierRules()
    {
    }

    public static String supplierTypeName(Integer supplierType)
    {
        if (supplierType == null)
        {
            return "";
        }
        switch (supplierType)
        {
            case TYPE_INDIVIDUAL:
                return "个体户";
            case TYPE_ENTERPRISE:
                return "企业";
            default:
                return "";
        }
    }

    public static String feeMethodName(Integer feeMethod)
    {
        if (feeMethod == null)
        {
            return "";
        }
        switch (feeMethod)
        {
            case FEE_METHOD_PER_ACCOUNT:
                return "按户计费";
            case FEE_METHOD_PER_HEAD:
                return "按头计费";
            case FEE_METHOD_PER_AMOUNT:
                return "按额计费";
            default:
                return "";
        }
    }
}
