package com.hai.common.exception;

/**
 * 
 * @ClassName:  ErrorCode   
 * @Description:
 * 代码code规则：	
 * 		0000-0999   系统异常 
 * 		1000-1999 app异常
 * 		2000-2999 biz异常
 * 		999999	      未知异常
 * @author: 机器猫 
 * @date:   2018年8月12日 上午11:43:30   
 *     
 * @Copyright: 2018 www.shinwoten.com Inc. All rights reserved.
 */
public enum ErrorCode {
	
    //////////////////sys////////////////
	DB_CONNECT_ERROR("0000","数据库连接异常"),
	FTP_CONNECT_ERROR("0001","FTP服务器连接失败"),
	FTP_CONFIG_NOT_FOUND("0002","FTP服务地址路径配置缺失"),
	
	//////////////////APP///////////////
    WECHAT_DECRYPT_ERROR("3001","微信解密错误->%s"),
    WECHAT_LOGIN_ERROR("3002","微信登录失败"),
    WECHAT_LOGIN_TEACHER_ERROR("3003","当前微信用户不是老师，请联系管理员"),
    SERVER_BUSY_ERROR("3004","服务器繁忙，请稍后重试"),
    FREQUENT_REQUESTS("3005","服务器繁忙，请稍后重试"),

    //////////////////业务异常/////////////
    COMMON_ERROR("2000",""),
    REQ_PARAMS_ERROR("2001","请求参数校验失败"),
    PHONE_REGISTER_ERROR("2002","手机号已注册"),
    VERIFICATION_CODE_ERROR("2003","验证码错误"),
    SEC_USER_OR_PASSWORD_ERROR("2005","手机号或密码错误"),
    NOT_FOUND_PHONE("2006","未找到手机号"),
    OLD_PASSWORD("2007","旧密码错误"),
    BS_COMPANY_UNAVAILABLE("2013","公司不可用"),
    NOT_FOUND_USER_ERROR("2016","用户不存在"),
    NOT_FOUND_COMPANY("2018","未找到公司"),
    USER_PHONE_HAS_ONE_ERROR("2020","该用户电话已被绑定，请更换"),
    USER_ROLE_PERMISSION_ALLOT_ERROR("2011","请联系管理员核实用户角色权限是否启用"),
    COMPANY_REGION_HAS_IN_CITY_ERROR("2031","单位区域必须选择到市级区域"),
    UN_FIND_ORGANIZATION_ERROR("2032","未找到该部门信息"),
    COMPANY_ADMIN_USER_ERROR("2033","公司主账号异常"),
    ORGANIZATION_NAME_IS_EXIST_ERROR("2034","部门名称已经存在"),
    TOP_ORGANIZATION_DELETE_ERROR("2035","顶级组织不允许删除"),
    SON_ORGANIZATION_IS_EXIST_ERROR("2036","存在子级部门，不能删除"),
    ORG_REGION_HAS_IN_REGION_ERROR("2037","区级单位所属区域必须选择到区级"),
    CMS_CATEGORY_NOT_FOUND("2038", "未找到分类"),
    CMS_CATEGORY_MODULE_NOT_FOUND("2039", "未找到模板"),
    CMS_CATEGORY_MODULE_EXISTS("2040", "同一分类下存在相同名称的模板"),
    CMS_CATEGORY_EXISTS_CHILDREN("2041", "分类存在子级，无法删除"),
    CMS_CATEGORY_EXISTS("2042", "存在相同编码的分类"),
    CMS_CREATE_HTML_ERROR("2043", "生成页面错误"),
    CMS_CONTENT_NOT_FOUND("2044", "未找到内容信息"),
    CMS_PATCH_NOT_FOUND("2045", "未找到附件"),
    MENU_TREE_HAS_NOT_ERROR("2041","该主角色没有权限"),
    PERMISSION_NAME_IS_EXIST_ERROR("2043","该权限名称已经存在"),
    PERMISSION_CODE_IS_EXIST_ERROR("2044","该权限编码已经存在"),
    MENU_TYPE_IS_NOT_EDIT_ERROR("2046","菜单类型不允许修改"),
    MENU_HAS_SON_ERROR("2047","存在子菜单，不能删除"),
    ROLE_NAME_IS_EXIST_ERROR("2048","该角色名已经存在"),
    USER_LOGIN_NAME_IS_EXIST_ERROR("2049","该登录用户名已经存在"),
    USER_ROLE_HAS_ALLOT_ERROR("2050","该角色已分配给用户，不能删除"),
    COMPANY_NAME_IS_EXIST_ERROR("2055","公司已经存在"),
    UN_FIND_TOP_ORGANIZATION_ERROR("2051","找不到顶级组织架构"),
    BASE_ORGANIZATION_HAS_NOT_MANAGE_ERROR("2056","该部门暂无管理员"),
    BASE_ORGANIZATION_HAS_NOT_PARENT_ERROR("2057","该部门无上级部门"),
    SEC_USER_EXPIRED("2068","用户身份错误或已过期"),
    UN_MEMBER_ERROR("2084","未找到用户"),
    SING_ERROR("2089","签名错误"),
    REGION_ABBREVIATE_EXIST("2098","地区简称已存在"),
    NOT_FOUND_CHANNEL("2099","未找到渠道商"),
    PASSWORD_ERROR("2102","密码错误"),
    SMS_CODE_ERROR("2103","验证码错误"),
    ID_CARD_NUM_IS_ERROR("2104","身份证号码错误"),
    MERCHANT_NOF_FOUND("2105","未找到商户"),
    MERCHANT_STORE_NOF_FOUND("2106","未找到商户门店"),
    PHONE_NUM_IS_ERROR("2107","请输入正确的电话号码"),
    PHONE_NUM_EXISTED("2108","电话号码已被使用"),
    MERCHANT_STATUS_ERROR("2109","商户状态不正常，请联系管理员"),
    SELECT_HANDSEL_COUPON_ERROR("2110","请选择赠送卡卷名单"),
    NOT_FOUND_COUPON("2111","未找到卡券信息"),
    WRITE_COUPON_NUMBER_ERROR("2112","请填写卡卷数量"),
    COUPON_UNABLE_UP_SHELF("2113","卡卷状态错误"),
    NOT_FOUND_APPROVE("2114","未找到审批记录"),
    APPROVE_PROCESSED("2115","审批已处理"),
    COUPON_STOCK_ERROR("2116","卡卷库存数量错误"),
    COUPON_TYPE_ERROR("2117","卡卷类型错误"),
    COUPON_STATUS_ERROR("2118","卡卷状态错误"),
    GOODS_PRICE_REFER_ERROR("2119","未找到价格信息"),
    DISCOUNT_PRICE_BIG_SALES_PRICE_ERROR("2120","折扣价格不能大于原价"),
    INVALID_TIME_BIG_EFFECTIVE_TIME_ERROR("2121","失效时间不能大于生效时间"),
    PRICE_REFER_STATUS_ERROR("2122","暂时无法增加，有处于在待编辑、待生效、审批中的价格"),
    NEED_WRITE_NEW_SALE_PRICE("2123","请填写正确的新销售价格"),
    NEED_WRITE_DISCOUNT_PRICE("2124","请填写正确的折扣数,折扣数范围【0】 ~ 【10】"),
    DISCOUNT_PRICE_RANGE("2125","请输入正确的"),
    TEL_EXISTED("2126","联系方式已被使用"),
    ORDER_TYPE_ERROR("2127","订单类型错误"),
    COUPON_STOCK_INSUFFICIENT("2118","卡卷库存数量不足"),
    NOT_FOUND_ORDER("2119","未找到订单信息"),
    ORDER_NO_STAY_PAY("2120","订单不处于待支付状态"),
    NOT_FOUND_COUPON_CODE("2121","销售码不存在"),
    COUPON_CODE_STATUS("2122","卡券码状态错误"),
    COUPON_CODE_OVERDUE("2122","卡券码已过期"),
    COUPON_CODE_NAME("2123","卡券名称已存在"),
    AGENT_NAME("2124","代理商名称已存在"),
    NOT_FOUND_DISCOUNT("2125","未找到优惠券信息"),
    NOT_FOUND_AGENT("2126","未找到代理商信息"),
    DISCOUNT_STOCK_COUNT_ERROR("2127","优惠券库存数量不足"),
    RECHARGE_CLOSE("2128","系统已关闭，请稍后充值"),
    REPEAT_SET_USER_PAY_PWD("2129","已设置支付密码"),
    NOT_SET_USER_PAY_PWD("2130","未设置支付密码"),
    NOT_ENTER_USER_PAY_PWD("2131","未输入支付密码"),
    USER_PAY_PWD_ERROR("2132","支付密码错误"),
    NO_BIND_PHONE("2133","未绑定手机号"),
    title_("2134","名称已存在"),
    ADD_REPEATEDLY("2135","重复添加"),
    NOT_FOUND_TOW_PWD("2136","未设置二级密码"),


    STATUS_ERROR("3000","状态错误"),
    ADD_DATA_ERROR("3001","增加数据失败"),
    UPDATE_DATA_ERROR("3002","修改数据失败"),
    DELETE_DATA_ERROR("3003","删除数据失败"),
    COMPETENCE_INSUFFICIENT("3004","权限不足"),
    REQUEST_ERROR("3005","请求错误"),
    REQUEST_TIMED_OUT("3006","请求超时，请稍后重试"),

    SIGN_VERIFY("6001","签名校验失败"),
    ACCOUNT_NOT_EXIST("6002","帐户不存在"),
    PHONE_ERROR("6003","手机号码格式有误"),
    INSUFFICIENT_BALANCE("6006","账户余额不足，请及时充值"),
    ORDER_ALREADY_EXISTS("6007","订单已存在"),
    IP_ERROR("6008","IP不在白名单"),
    PRODUCT_ERROR("6009","商品错误"),
    MERCHANT_NOT_AUTHORIZED("6010","帐户无权限"),
    TIME_OUT("6011","请求时间超时"),

    MSG_EVENT_NULL("2999","消息类型为空"),
	USE_VISIT_ILLEGAL("4001","用户身份错误"),
	RC_VISIT_ERROR("2998",""),
	UNKNOW_ERROR("999999","未知异常"),
	EXCEL_ERROR("80000","Excel处理异常"),
    ;//注意：上面为逗号，此次为分号


    private String code;
    private String msg;
    ErrorCode(String code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

//    public void setCode(String code) {
//        this.code = code;
//    }

    public String getMsg() {
        return msg;
    }

//    public void setMsg(String msg) {
//        this.msg = msg;
//    }
}
