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

/**
 * 承销商管理枚举常量。
 */
public final class DistributorRules
{
    public static final int TYPE_INDIVIDUAL = 1;

    public static final int TYPE_ENTERPRISE = 2;

    public static final int SALES_DESTINATION_LOCAL_CITY = 1;

    public static final int SALES_DESTINATION_LOCAL_PROVINCE = 2;

    public static final int SALES_DESTINATION_OUT_PROVINCE = 3;

    public static final int MAX_DISTRIBUTOR_CODE = 99;

    public static final String DEL_FLAG_NORMAL = "0";

    public static final String DEL_FLAG_DELETED = "2";

    /** 承销商平台角色（sys_role.role_id） */
    /**
     * 历史常量；分配账号请使用 {@link TradePartnerAccountRules#ROLE_KEY_DISTRIBUTOR} 解析角色。
     */
    public static final long ROLE_ID_DISTRIBUTOR = 104L;

    public static final String MSG_DELETE_UNPAID_ORDER = "存在未支付订单，无法删除";

    private DistributorRules()
    {
    }

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

    public static String salesDestinationName(Integer salesDestination)
    {
        if (salesDestination == null)
        {
            return "";
        }
        switch (salesDestination)
        {
            case SALES_DESTINATION_LOCAL_CITY:
                return "本市";
            case SALES_DESTINATION_LOCAL_PROVINCE:
                return "本省";
            case SALES_DESTINATION_OUT_PROVINCE:
                return "外省";
            default:
                return "";
        }
    }
}
