package com.iotechn.unimall.core.exception;

/**
 * Created by rize on 2019/7/1.
 */
public class ExceptionDefinition {

    public static  ServiceExceptionDefinition THIRD_PART_SERVICE_EXCEPTION =
            new ServiceExceptionDefinition(0, "第三方服务异常");

    public static  ServiceExceptionDefinition PLUGIN_EXCEPTION =
            new ServiceExceptionDefinition(1, "插件异常: ${0}");

    public static  ServiceExceptionDefinition THIRD_PART_IO_EXCEPTION =
            new ServiceExceptionDefinition(2, "第三方网络异常");

    public static  ServiceExceptionDefinition APP_UNKNOWN_EXCEPTION =
            new ServiceExceptionDefinition(10000, "系统未知异常");

    public static  ServiceExceptionDefinition PARAM_CHECK_FAILED =
            new ServiceExceptionDefinition(10002, "参数校验失败");

    public static  ServiceExceptionDefinition SYSTEM_BUSY =
            new ServiceExceptionDefinition(10007, "系统繁忙～");

    public static  ServiceExceptionDefinition USER_UNKNOWN_EXCEPTION =
            new ServiceExceptionDefinition(11000, "用户系统未知异常");

    public static  ServiceExceptionDefinition USER_SEND_VERIFY_FAILED =
            new ServiceExceptionDefinition(11001, "发送验证码失败");

    public static  ServiceExceptionDefinition USER_VERIFY_CODE_NOT_EXIST =
            new ServiceExceptionDefinition(11002, "验证码未发送或已过期");

    public static  ServiceExceptionDefinition USER_VERIFY_CODE_NOT_CORRECT =
            new ServiceExceptionDefinition(11003, "验证码不正确");

    public static  ServiceExceptionDefinition USER_PHONE_HAS_EXISTED =
            new ServiceExceptionDefinition(11004, "手机已经被注册");

    public static  ServiceExceptionDefinition USER_PHONE_NOT_EXIST =
            new ServiceExceptionDefinition(11005, "手机尚未绑定账号");

    public static  ServiceExceptionDefinition USER_PHONE_OR_PASSWORD_NOT_CORRECT =
            new ServiceExceptionDefinition(11006, "手机号或密码错误!");

    public static  ServiceExceptionDefinition USER_THIRD_PART_LOGIN_FAILED =
            new ServiceExceptionDefinition(11007, "用户第三方登录失败");

    public static  ServiceExceptionDefinition USER_THIRD_UNEXPECT_RESPONSE =
            new ServiceExceptionDefinition(11008, "第三方登录期望之外的错误");

    public static  ServiceExceptionDefinition USER_THIRD_PART_NOT_SUPPORT =
            new ServiceExceptionDefinition(11009, "未知的第三方登录平台");

    public static  ServiceExceptionDefinition USER_INFORMATION_MISSING =
            new ServiceExceptionDefinition(11010, "用户信息缺失，不能添加");

    public static  ServiceExceptionDefinition USER_PHONE_ALREADY_EXIST =
            new ServiceExceptionDefinition(11011, "用户电话已经存在，不能添加");

    public static  ServiceExceptionDefinition USER_CAN_NOT_ACTICE =
            new ServiceExceptionDefinition(11012, "用户处于冻结状态，请联系管理员");

    public static  ServiceExceptionDefinition ADDRESS_DATABASE_QUERY_FAILED  =
            new ServiceExceptionDefinition(16002, "执行语句失败");
    public static  ServiceExceptionDefinition PURCHASE_OVER_NUM  =
            new ServiceExceptionDefinition(16002, "送粮人每年收购总量不得超过五百吨");

    public static  ServiceExceptionDefinition ADVERTISEMENT_SQL_ADD_FAILED =
            new ServiceExceptionDefinition(22001, "添加广告数据库失败");

    public static  ServiceExceptionDefinition ADVERTISEMENT_SQL_DELETE_FAILED =
            new ServiceExceptionDefinition(22002, "删除广告数据库失败");

    public static  ServiceExceptionDefinition ADVERTISEMENT_SQL_UPDATE_FAILED =
            new ServiceExceptionDefinition(22003, "修改广告数据库失败");


    public static  ServiceExceptionDefinition ADMIN_UNKNOWN_EXCEPTION =
            new ServiceExceptionDefinition(50000, "管理员系统未知异常");

    public static  ServiceExceptionDefinition COLLECT_ERROR =
            new ServiceExceptionDefinition(50000, "预收款不足，请仔细检查");
    public static  ServiceExceptionDefinition ADMIN_NOT_EXIST =
            new ServiceExceptionDefinition(50001, "管理员不存在");

    public static  ServiceExceptionDefinition ADMIN_PASSWORD_ERROR =
            new ServiceExceptionDefinition(50002, "密码错误");

    public static  ServiceExceptionDefinition ADMIN_NOT_BIND_WECHAT =
            new ServiceExceptionDefinition(50003, "管理员尚未绑定微信");

    public static  ServiceExceptionDefinition ADMIN_APPLY_NOT_BELONGS_TO_YOU =
            new ServiceExceptionDefinition(50004, "用户申请表并不属于您");

    public static  ServiceExceptionDefinition ADMIN_APPLY_NOT_SUPPORT_ONE_KEY =
            new ServiceExceptionDefinition(50005, "未定义类型不支持一键发布");

    public static  ServiceExceptionDefinition ADMIN_ROLE_IS_EMPTY =
            new ServiceExceptionDefinition(50006, "管理员角色为空！");

    public static  ServiceExceptionDefinition ADMIN_USER_NAME_REPEAT =
            new ServiceExceptionDefinition(50007, "管理员用户名重复");

    public static  ServiceExceptionDefinition ADMIN_VERIFYCODE_ERROR =
            new ServiceExceptionDefinition(50008, "登陆验证码错误");

    public static  ServiceExceptionDefinition ADMIN_USER_NOT_EXITS =
            new ServiceExceptionDefinition(50009, "管理员不存在，请输入正确账号密码");

    public static  ServiceExceptionDefinition ADMIN_GUEST_NOT_NEED_VERIFY_CODE =
            new ServiceExceptionDefinition(50010, "游客用户无须验证码，请直接输入666666");

    public static  ServiceExceptionDefinition ADMIN_VERIFY_CODE_SEND_FAIL=
            new ServiceExceptionDefinition(50011, "登陆验证码发送失败");

    public static  ServiceExceptionDefinition ADMIN_GENERATOR_WORK_DIR_NOT_EXIST =
            new ServiceExceptionDefinition(50012, "工作路径不正确");

    public static  ServiceExceptionDefinition ADMIN_GENERATOR_FILE_ALREADY_EXIST =
            new ServiceExceptionDefinition(50013, "欲生成的文件已经存在");

    public static  ServiceExceptionDefinition ADMIN_GENERATOR_IO_EXCEPTION =
            new ServiceExceptionDefinition(50013, "代码生成网络异常");

    public static  ServiceExceptionDefinition ADMIN_GENERATOR_TEMPLATE_EXCEPTION =
            new ServiceExceptionDefinition(50013, "代码生成模板异常");


    public static  ServiceExceptionDefinition SALE_NEED_STATUS_ERROR =
            new ServiceExceptionDefinition(53015, "销售信息是该状态,无法改变");
    public static  ServiceExceptionDefinition SALE_UPDATE_SQL_FAILED =
            new ServiceExceptionDefinition(53015, "销售信息执行修改SQL失败");
    public static  ServiceExceptionDefinition SALE_NOT_EXIST =
            new ServiceExceptionDefinition(53015, "销售信息并不存在");
    public static  ServiceExceptionDefinition SALE_TITLE_NOT_EXIST =
            new ServiceExceptionDefinition(53015, "未维护标题");
    public static  ServiceExceptionDefinition SALE_DINGJIA_STATUS_ERROR =
            new ServiceExceptionDefinition(53015, "只能申请状态为未申请的数据");
    public static  ServiceExceptionDefinition ROLE_NOT_EXIST =
            new ServiceExceptionDefinition(53015, "并未决策人角色，无法申请定价");
    public static  ServiceExceptionDefinition PRICE_ERROR =
            new ServiceExceptionDefinition(53015, "指导价不正确");
    public static  ServiceExceptionDefinition WANSHAN_ERROR =
            new ServiceExceptionDefinition(53015, "完善承运信息失败");
    public static  ServiceExceptionDefinition JIEDAN_ERROR =
            new ServiceExceptionDefinition(53015, "接单失败");
    public static  ServiceExceptionDefinition JUJIE_ERROR =
            new ServiceExceptionDefinition(53015, "拒接失败");
    public static  ServiceExceptionDefinition TUIHUI_ERROR =
            new ServiceExceptionDefinition(53015, "退回失败");
    public static  ServiceExceptionDefinition CONTRACT_ERROR =
            new ServiceExceptionDefinition(53015, "生成运输合同异常");
    public static  ServiceExceptionDefinition SIGN_CONTRACT_ERROR =
            new ServiceExceptionDefinition(53015, "签订运输合同异常");
    public static  ServiceExceptionDefinition TRAN_COUNT_ERROR =
            new ServiceExceptionDefinition(53015, "运量任务不足，请额外申请运量");
    public static  ServiceExceptionDefinition WORK_STATUS_ERROR =
            new ServiceExceptionDefinition(53015, "存在未交货的车辆，请完成交货后再完货");
    public static  ServiceExceptionDefinition WORK_STATUS_ERROR1 =
            new ServiceExceptionDefinition(53015, "存在未放货的车辆，请完成放货后再完货");
    public static  ServiceExceptionDefinition WORK_STATUS_ERROR2 =
            new ServiceExceptionDefinition(53015, "存在未完成接货的车辆，请接货后再完成");
    public static  ServiceExceptionDefinition BANK_PERSON_CHECK =
            new ServiceExceptionDefinition(53015, "收款人姓名、身份证号、银行卡号不匹配");
    public static  ServiceExceptionDefinition TIME_EXCEED_RANGE =
            new ServiceExceptionDefinition(53015, "此时间（8：00-11：30/12：30-15：00/20：00-23：00）不可点价");
    public static  ServiceExceptionDefinition TIME_EXCEED_STATUS =
            new ServiceExceptionDefinition(53015, "已受理的合同不可点价");
    public static  ServiceExceptionDefinition  CONTRACT_NO_ERRO=
            new ServiceExceptionDefinition(53015, "采购合同编号重复");
    public static  ServiceExceptionDefinition  CONTRACT_NO_COPY=
            new ServiceExceptionDefinition(53015, "合同编号已存在");
    public static ServiceExceptionDefinition buildVariableException(ServiceExceptionDefinition definition, String ...args) {
        String msg = definition.getMsg();
        for (int i = 0; i < args.length; i++) {
            msg = msg.replace("${" + i + "}", args[i]);
        }
        return new ServiceExceptionDefinition(definition.getCode(), msg);
    }

    public static  ServiceExceptionDefinition IMPORT_STORE_NAME_ERROR =
            new ServiceExceptionDefinition(50000, "存在不正确的库点名称，请检查后重新导入");
    public static  ServiceExceptionDefinition IN_STORE_ERROR =
            new ServiceExceptionDefinition(50000, "入库任务异常");
    public static  ServiceExceptionDefinition FLAT_COUNT_ERROR =
            new ServiceExceptionDefinition(50000, "可平仓数量不足");



}
