package com.cool.store.enums;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 *  * 通用错误返回处理，后续全部将使用这个返回，请遵守以下规范。
 *  * 1.枚举名必须要大写。
 *  * 2.枚举中包含属性：code,msg,en(英文尽量写)
 *  * 3.code的命名以系统模块划分，前三位为模块划分。逐级细分。（7位数字先到先取原则，细化不浪费）
 * @author zhangchenbiao
 * @FileName: ErrorCodeEnum
 * @Description: 返回响应状态和文案枚举
 * @date 2023-05-19 04:30
 */
public enum ErrorCodeEnum {

    PARTNER_MOBILE_INCORRECT(418, "请输入正确的手机号", null),
    PUBLIC_LINE_NOT_FOLLOW(419, "该线索已存在公海，无跟进人", null),
    LINE_EXIST_FOLLOW(420, "该线索已存在，跟进人为【{0}，{1}】", null),
    INTERNAL_SERVER_ERROR(50000, "服务器异常", null),
    NO_DATA(50001,"无数据导出",null),
    ERROR_MESSAGE(421, "{0}", null),


    /**
     * 000000 未知错误
     */
    UNKNOWN(000000, "未知错误", null),
    /**
     * 2000001 token与当前登录企业不匹配
     */
    TOKEN_ERROR(2000001,"请求异常，与当前登录企业不匹配",null),
    FAIL(400000, "FAIL", null),
    WX_ACCESS_TOKEN_INVALID(400001, "WX_Invalid token", null),
    ACCESS_TOKEN_INVALID(400005, "Invalid token", null),
    PARAMS_VALIDATE_ERROR(400003, "参数校验失败！", null),
    LOGIN_ERROR(400004, "登录失败", null),
    ENTERPRISE_INIT(400006, "企业正在初始化，请稍后访问！",null),
    NOT_AUTH(400007, "暂无权限，请联系管理员！", null),
    REFRESH_TOKEN_INVALID(400008, "refresh token invalid", null),
    USER_FREEZE(1021019,"账号被冻结，请联系管理员",null),
    ENTERPRISE_NOT_EXIST(1021020,"企业不存在",null),
    USER_NOT_EXIST(1021021,"用户不存在",null),
    JOBNUMBER_NOT_EXIST(1021017,"用户工号不存在",null),
    USER_WAIT_AUDIT(1021018,"账号审核中，请联系企业管理员",null),
    OPERATION_OVER_TIME(1021019, "您的操作过于频繁,休息一下~", null),
    GET_APP_SECRET_ERROR(1021020, "获取secret异常", null),
    WX_SERVICE_ERROR(1021021, "调用微信服务异常", null),
    SESSION_KEY_ERROR(1021022, "sessionKey过期", null),
    GET_WECHAT_USER_INFO_FAIL(1021023,"获取小程序用户信息失败", null),
    USER_GROUP_NAME_EXIST(1021076, "用户分组名称已存在", null),
    USER_GROUP_NOT_EXIST(1021077, "用户分组不存在", null),
    GET_INFO_ERROR(1021078, "获取信息异常", null),
    GET_PHONENUMBER_INFO_ERROR(1021079, "手机号归属地获取异常", null),
    IDENTITY_CARD_PARSE_FAIL(1021080, "身份证解析失败", null),
    WECHAT_BIND_OTHER_MOBILE(1021081, "授权号码有误，请核对", null),
    BUSINESS_LICENSE_PARSE_FAIL(1021082, "营业证照解析失败", null),
    BUSINESS_LICENSE_OR_ID_CARD_REPEAT(1021083, "身份证或企业信用编码重复", null),
    PARAMS_REQUIRED(400002, "参数缺失！", null),
    DATA_CONVERT_ERROR(400002, "日期转换异常！", null),
    PARENT_NODE_NOT_EXIST(400002, "父节点不存在", null),
    LOGIN_ERROR_MOBILE_ERROR(418, "登录失败 获取手机号失败！！", null),
    PASSWORD_ERROR_MAX_COUNT(1021084, "密码错误{0}次,今日账号已锁定",null),
    PASSWORD_MISSING(1021085, "密码不能为空！",null),
    IMPROVE_USER_INFO(1021086,"请联系管理员，完善用户信息！",null),
    PASSWORD_ERROR(1021087, "密码输入错误",null),
    PASSWORD_ERROR_MULTI(1021088, "密码错误{0}次,请使用验证码登录",null),

    MOBILE_NOT_MATCH(1023001, "修改失败，手机号与当前用户不匹配",null),
    SMS_CODE_EXPIRE(1023002, "验证码已过期！",null),
    SMS_CODE_ERROR(1023003, "验证码错误！",null),
    SEND_SMS_LIMIT_COUNT(1023004, "短信发送失败，今日发送短信已达上限",null),
    NONSUPPORT_MOBILE(1023005, "暂不支持的手机号格式", null),
    SMS_CODE_MISSING(1023006, "验证码缺失！",null),

    //红圈通
    HQT_SHOP_DECORATION_ATTRIBUTES(1022000, "获取红圈通装修属性错误", null),
    HQT_PARAMS_ERROR(1022001, "构建红圈通请求参数错误", null),

    LINE_ID_IS_NOT_EXIST(500001, "线索信息不存在！", null),
    WORK_FLOW_STAGE_PASS_ERROR(500002, "审核失败，非对应阶段！", null),
    PARTNER_USER_NOT_EXIST(500003, "加盟商用户信息不存在！", null),
    ZONE_NOT_EXIST(500004, "战区不存在！", null),
    PARTNER_BASEINFO_NOT_EXIST(500005, "基本信息不存在！", null),
    INTENT_INFO_NOT_EXIST(500006, "意向信息不存在！", null),
    INTENT_WHAT_NOT_EXIST(500016, "加盟问卷信息不存在！", null),
    INTENT_AREA_NOT_BING_ZONE(500007, "意向区域没有绑定战区 分配招商经理失败！", null),
    PUBLIC_LINE_NOT_OPERATE(500008, "公海线索不允许操作！", null),
    PARTNER_BASE_INFO_NOT_EXIST(500009, "加盟商信息不存在！", null),
    LINE_STATUS_NOT_ALLOW_OPERATE(500010, "当前线索状态不允许该操作！", null),
    TASK_STATUS_NOT_ALLOW_OPERATE(500011, "当前任务状态不允许该操作！", null),
    DATELINE_BEFORE_NOW(500012, "截止时间不能早于当前时间！", null),
    NO_TRANSFER_REQUIRED(500013, "招商经理现有私海线索无需转让，请检查后重试！", null),
    NO_BATCH_TRANSFER_REQUIRED(500014, "已选线索包含此招商经理现有私海线索，无需转让，请检查后重试!", null),
    PARTNER_MOBILE_EXIST(500010, "手机号码已存在，请核实！", null),
    MOBILE_EXIST(500015, "此手机号码已存在，线索所属列表：{0}，招商经理：{1}，创建日期：{2}", null),
    INVESTMENT_MANAGER_NOT_EXIST(500016, "当前招商经理不存在", null),
    PARTNER_MOBILE_EXIST_0(500017, "手机号码已存在", null),
    TIME_OCCUPIED(500018, "预约时间被占用", null),
    LINE_PAY_IS_NOT_EXIST(500019, "意向金信息不存在！", null),
    INTENT_PASS(500020, "审核已通过，请刷新页面！", null),
    APPOINTMENT_TIME_FAIL(500020, "预约失败，请刷新后再试", null),
    LINE_REGION_NOT_EXIST(500021, "请先补充加盟商所属大区/分公司", null),

    POINT_NOT_COMPLETE(600000, "铺位信息未填写完全，请完善后生成评估报告", null),
    POINT_NOT_EXIST(600001, "铺位信息不存在", null),
    POINT_SIGNED(600002, "操作失败，铺位已签约", null),
    NOT_ALLOW_OPERATE(600003, "当前状态不允许该操作", null),
    POINT_AUDIT_NOT_SETTING(600004, "选址审批未设置", null),
    NO_PERMISSION(600004, "暂无处理审批任务权限", null),
    POINT_AUDIT_NODE_ERROR(600005, "当前审批任务异常", null),
    USER_NOT_TODO_AUDIT(600005, "当前用户没有待审批的任务", null),
    NOT_ALLOW_MODIFY_WANT_SHOP_NUM(600006, "当前阶段不允许直接修改意向开店数量", null),
    USER_NOT_ALLOW_ENTER_ROOM(600007, "当前用户不允许进入面试房间", null),

    SHOP_STAGE_ERROR(600008, "店铺阶段错误", null),
    SHOP_NOT_EXIST(600009, "店铺不存在", null),
    POINT_IS_SELECTED(600010, "该铺位已被其他人选择", null),
    POINT_ALREADY_SELECT(600011, "该铺位已被您选择", null),
    SHOP_IS_SELECTED(600012, "该店铺已选址", null),
    SHOP_STAGE_NOT_OPERATE(600013, "当前店铺所处阶段不允许该操作", null),
    POINT_IS_LOCK(600014, "当前铺位已被锁定,刷新后再试", null),
    POINT_IS_INVALID(600015, "该铺位已失效", null),
    POINT_SELECTED(600016, "该铺位已被选择", null),
    NOT_EXIST_UNSELECT_POINT(600017, "当前没有未选择的铺位", null),
    SELECT_POINT_ERROR(600018, "铺位选中失败", null),
    POINT_NOT_SELECT(600019, "该门店未选址", null),
    SHOP_DECORATION_ATTRIBUTES_IS_NULL(600020,"门店装修属性为空,请到加盟合同签约阶段填写",null),

    OPEN_NEW_SHOP_RECORD_NOT_EXIST(700001, "开店申请记录不存在", null),
    OPEN_NEW_SHOP_RECORD_AUDITED(700002, "开店申请已审核", null),
    OPEN_NEW_SHOP_RECORD_WAIT_AUDIT(700003, "提交失败，您有开店申请正在审核中", null),

    INTERVIEW_ENTER_FAIL(1021101, "进入面审间失败", null),
    DINGDING_USER_NOT_EXIST(1021102, "用户钉钉信息不存在，无法发起资质审核！", null),
    INTERVIEW_NOT_EXIST(1021103, "面审信息不存在！", null),
    INTERVIEW_AND_PARTNER_ID_IS_NULL(1021104, "加盟商用户ID&线索ID和面审官ID不能同时为空！", null),
    INTERVIEW_PLAN_IS_NULL(1021105, "未查询到相关面审安排！", null),
    DATE_PARAMS_IS_ERROR(1021106, "日期参数错误！", null),
    INTERVIEW_PLAN_NOT_EXIST(1021107, "面审计划不存在！", null),
    FEISHU_DELETE_SCHEDULE_ERROR(1021108, "删除原面审安排失败！", null),
    CREATE_CALENDAR_EVENT_FAIL(1021109, "创建面审安排失败！", null),
    FEISHU_UPDATE_SCHEDULE_ERROR(1021110, "开始前10分钟不允许修改时间！", null),
    INTERVIEW_STATUS_ERROR(1021111, "当前面审状态不允许该操作！", null),
    INTERVIEW_PLAN_ALREADY_EXIST(1021112, "面审计划已存在，请勿重复申请！", null),
    INTERVIEW_LINE_ID_IS_NULL(1021113, "线索id为空！", null),
    INTERVIEW_INTERVIEW_TIME_IS_UNUSABLE(1021114, "当前预约时间不可用，请和线索用户协商其他时间后确定预约时间\n面审人：{0} 手机号：{1}", null),
    INTERVIEW_PARTNER_NOT_EXIST(1021115, "线索下的加盟商不存在！", null),
    INTERVIEW_STATUS_NOT_TRANSFER(1021116, "当前面审状态不允许转让！ 面审状态:{0}", null),
    MOBILE_WECHAT_EXIST(1021116, "此号码已绑定其他微信", null),
    INTERVIEW_STATUS_WAS_AUDITED(1021117, "当前面审已审核", null),

    ROOM_STATUS_ERROR(10211156, "当前面审房间状态不允许进行该操作！", null),
    MOBILE_APP_NOT_ONLINE_ERROR(10211157, "呼叫失败，请确认呼出号码正确并检查是否安装并打开呼叫插件", null),
    CALL_RECORD_NOT_EXIST_ERROR(10211158, "通话记录不存在！", null),
    CALL_UP_ERROR(10211159, "拨出电话异常！", null),
    CREATE_CALL_REQUEST_ERROR(10211160, "创建电话请求失败！", null),

    CREATE_APPOINTMENT_TIME_ERROR(10211161, "当前时间不可预约面审，请选择其他时间", null),

    USER_CHANNEL_NOT_EXISTS(10211162, "当前用户渠道不存在", null),
    LINE_ALREADY_EXISTS(10211163, "该线索已存在，跟进人为{0}", null),
    LINE_EXISTS_IN_PUBLIC_SEA(10211164, "该线索已存在，请前往公海认领", null),
    CONTENT_DUPLICATED(10211200, "动态标题重复！", null),
    SIGN_FAIL(600000, "验签失败=>{0}", null),
    GET_ACCESSTOKEN_ERROR(600001, "获取小程序TOKEN错误！", null),
    NEW_MOBILE_HAS_EXIST(600002,"加盟商用户信息已存在",null),
    INSPECTION_USER_OCCUPY(600003,"当前稽核人已经配置其他战区",null),
    INSPECTION_INFO_NOT_EXIST(600005, "稽核信息不存在！", null),
    OPEN_AREA_NULL(600006,"归属地区不能为空",null),
    NOT_IN_PUBLIC_SEA(600007,"当前线索不在公海 不支持分配招商经理",null),

    LABEL_GROUP_IN_USE(120001, "该标签组下存在标签，不可删除；请确保该标签组下标签数量为0后再进行删除", null),
    LABEL_GROUP_EXIST(120002, "该标签组已存在，请重新输入", null),
    LABEL_EXIST(120003, "该标签已存在，请重新输入", null),


    OPEN_AREA_IS_NOT_EXISTS(107006, "意向区域城市不存在", null),

    REGION_NOT_EXIST(108001, "区域不存在",null),
    ONLY_WAR_REGION_CONFIG(108002, "意向省市只能配置到大区",null),

    NOT_APPROVE_NODE(109001, "不是审批节点",null),


    TIME_FALSE(109002, "结束时间不能早于开始时间",null),

    BUSINESS_ID_NOT_EXIST(109003, "kdzBusinessId解析异常,请检查",null),

    VERIFY_MD5_FALSE(109004, "验签失败,请检查",null),

    LINE_PAY_FALSE(109005, "付款信息查询失败",null),

    LICENSE_NOT_EXIST(109006, "证照不存在",null),

    FOOD_BUSINESS_LICENSE_PARSE_FAIL(109007, "食营证照解析失败", null),


    STORE_NUM_NOT_FOUND(109008, "未找到门店编码", null),

    SIGN_FRANCHISE_NOT_FOUND(109009, "加盟合同签约信息为空", null),

    UNISSUED_STATEMENT(109010, "该门店未发布账单，无法付款", null),

    FRANCHISE_AGREEMENT_FALSE(109011, "特许经营合同API调用失败", null),

    NEW_STORE_FALSE(109011, "新店开业流程API调用失败", null),

    AUDIT_RESULT_FALSE(109012, "意向加盟合同API本次调用结果与上一次不一致", null),


    TIME_NULL_FALSE(109013, "完成时间不能为空", null),

    UNISSUED_STATEMENT_2(109014, "该门店已发布账单", null),

    DUPLICATE_SUBMISSION(109015, "重复提交！", null),

    INVOICING_EXIST(109016, "当前门店发票信息已存在！", null),

    SHOP_STATUS_NOT_SUPPORT_HANDLER(109017, "当前门店状态为:{0},不能进行结束跟进操作", null),

    SYSTEM_NAME_NOT__SUPPORT(109018, "请不要使用系统默认店名！", null),


    INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
    INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),
    SHOP_ID_IS_NULL(103003,"验参shopId失败，为空",null),
    ACTIVITY_THEME_LENGTH_FALSE(103004,"活动主题长度大于100",null),
    SURVEYRESULT_LENGTH_FALSE(103005,"调研结果长度大于100",null),
    ID_IS_NULL(103006,"验参Id失败，为空",null),
    UPDATE_AUDIT_PLAN_FALSE(103007,"修改AUDIT_PLAN失败",null),
    UPDATE_PLAN_FALSE(103008,"修改PLAN失败",null),
    UPDATE_SHOP_SUB_STAGE_STATUS_FALSE(103009,"修改开业运营方案阶段状态失败",null),
    SHOP_ID_NOT_EXIST(103010,"shopId不存在",null),
    FIRST_ORDER_PARAM_NULL(103020,"首批订货金参数为空",null),
    USER_NOT_LOGIN(103021,"用户未登录",null),
    XFSG_SERVICE_ERROR(103099,"鲜丰服务调用失败",null),
    GET_FIRST_ORDER(103021,"获取鲜丰首批订货金失败",null),
    YLF_ERROR(110001, "云立方接口异常！异常信息：{0}", null),
    YLF_DATA_IS_NULL(110002, "请联系工程维护云立方系统门店信息!", null),
    //装修
    THREE_ACCEPTANCE(121001,"提交三方验收失败",null),
    CHECK_ITEM(12002,"插入检查项失败",null),
    FITMENT_FAIL(12003,"装修款阶段未完成",null),
    SEE_ACCEPTANCE_ERROR(12004,"获取鲜丰撤场数据失败",null),
    SEE_ACCEPTANCE_AUDIT_NULL(12005,"视觉验收结果为空",null),
    STATUS_NOT_SUPPORT_SUMMIT(121006,"该状态不支持提交",null),
    DESIGN_NO_COMPLETE(121007,"请先完成设计阶段！",null),
    SIGN_COMPLETED(121008,"你已完成验收,无需重复操作！",null),
    SHOP_CODE_EXIST(121009,"存在重复门店编码，请联系CRM工作人员处理",null),
    HQT_SHOP_ID_NOT_EXIST(121010,"红圈通门店id为空，该门店双方系统未互通",null),

    UPDATE_FAIL(131000,"修改失败，表单不存在！",null),
    LICENSE_LEGAL_STAGE_FAIL(131001,"营业执照阶段未上传！",null),
    GET_JURIDICAL_ID_CARD_NO_FAIL(131002,"获取法人身份证信息失败！",null),
    UPDATE_INVESTMENT_MANAGER_FAIL(131005,"当前用户已经为该门店招商经理",null),
    CONFIRM_THE_APPROVER(131006,"您提交的铺位暂时找不到选址审批人，请联系系统管理员配置选址审批权限后再提交铺位审批",null),
    CREATE_PASSWORD_FAIL(131007,"身份证号信息错误",null),
    GET_HOME_TEMPLATE_ERROR(131008,"获取首页模板失败",null),
    THE_DATA_IS_NOT_FILLED(131009,"您有数据还未填写",null),
    QUOTATION_URL_REQUIRED(131010,"请等待报价单提交",null),
    DESIGN_URL_REQUIRED(131011,"请等待设计图提交",null),
    LEGAL_PERSON_NAME_NOT_SAME(131012,"法人姓名与加盟商姓名不一致",null),
    UPDATE_DESIGN_LEADER(131019,"设计阶段状态不支持修改设计组",null),
    UPDATE_DESIGN_USER(131022,"设计阶段状态不支持修改设计师",null),
    TALLY_BOOK_NOT_EXIST(180001, "记账本数据不存在", null),

    THIRD_API_ERROR(151001,"第三方服务异常->{0}",null),
    THIRD_API_SIGN_ERROR(151002,"签名失败->{0}",null),
    THIRD_API_TIME_IS_NULL(151003,"单据⽇期不能为空",null),

    SYSTEM_DATA_ERROR(151004,"平台账号不能为空",null),
    CURRENT_STATUS_NOT_OPERATION(151005,"平台账号当前非审核状态！不能提交审核",null),
    CURRENT_ENTRY_STATUS_NOT_OPERATION(151006,"进件状态未审核！不能执行该操作",null),
    GET_YLS_CODE_FAIL(151006,"系统无云流水编码！无法获取TOKEN！请先维护该编码",null),

    BANK_EXIST(151007,"当前银行已存在，请直接选择！",null),
    EXPORT_LIMIT_5000(151008,"导出数据不能超过5000条，请增加筛选条件，减少导出数量",null),
    EXPORT_LIMIT_100000(151009, "导出数据超过10w条，请增加筛选条件，减少导出数量", null),
    REGION_INTERSECTION_IS_NULL(151011,"所选所属大区/分公司，不在所选集团下",null),
    CHECK_PAYER_ERROR(151012,"缴费人必须是签约人,请重新填写！",null),
    STORE_INFO_INSUFFICIENT(151013,"门店信息不全，无法前往猎聘注册门店！",null),
    USER_ACCOUNT_WAIT_AUDIT(151015, "账号信息等待审核",null),
    SHOP_HAVE_NOT_OVER_ACCORDING(1511014,"该加盟商下有未结束跟进的门店，请先结束门店",null),
    MOBILE_NOT_EXIST(151016,"手机号不存在，请先维护手机号！",null),
    STORE_MOBILE_NOT_EXIST(151016,"门店营业手机号/电话不存在，请先维护手机号！",null),

    IS_EXIST_CLAIM(1511018,"存在已认领的账单，不能删除门店",null),
    API_CALL_ERROR(1511020,"接口调用错误",null),
    ADD_PAY_INFO_FAIL(1511021,"添加缴费信息失败",null),
    UPDATE_ERROR(1511022,"修改信息失败",null),
    CLAIM_STATUS_ERROR(1511023,"当前状态为已认领，不能进行操作",null),
    PAY_USER_NAME_ERROR(1511024,"付款人最多为2人",null),
    DELETE_ERROR(1511025,"删除信息失败",null),
    RECEIPT_NOT_EXIST(1511026,"收款单不存在或已被删除",null),
    XGJ_COLLECTION_STATUS_COMPLETE(1511027,"新管家收费状态已完成，请确认！",null),
    PAY_AMOUNT_ERROR(1511028,"缴费金额不能大于未缴金额",null),


    PRE_FRY_PRODUCT_NOT_EXIST(1511029,"预炸品不存在",null),
    PRE_FRY_RECORD_EXIST(1511030,"当前门店已存在同类型预炸资质申请记录",null),
    PRE_FRY_APPLY_NOT_EXIST(1511030,"预炸资质申请信息不存在",null),
    CURRENT_STAGE_NOT_OPERATION(1511030,"当前有更优选择，请确认!",null),
    PRODUCTS_STATUS(1511031,"包含下架的产品，请重新选择后提交！",null),
    PRODUCTS_CODE_EXIST(1511032,"产品编码已存在！",null),
    PRODUCTS_RECORD_NOT_EXIST(1511033,"预炸记录不存在！",null),
    PRODUCTS_DISCARDED(1511034,"产品已报销，无法操作",null),
    PRODUCTS_SALES_COMPLETED(1511034,"含有销售完成的产品，无法批量报销",null),
    STORE_IS_EXIST(1511035,"该门店已存在",null),
    FEE_NOT_CONSISTENT(1511036,"合同金额与缴费账单金额不一致，请确定！",null),
    OPERATIONS_CONSULTANT_ASSIGNED(1511037,"运营顾问已分配",null),
    NO_OPERATIONS_CONSULTANT(1511037,"你不是当前门店运营顾问！请确认！",null),


    MESSAGE_TEMPLATE_NOT_SUPPORT_EDIT(1610001,"当前消息已发布，不支持编辑！",null),
    MESSAGE_TEMPLATE_NOT_SUPPORT_DELETED(1610002,"只有未发布的消息能删除，请确认！",null),
    STORE_MESSAGE_REVOKE(1610003,"当前门店消息已撤销，请务重复操作",null),
    STORE_MESSAGE_HANDLED(1610004,"当前门店消息已处理，无法撤销！",null),
    MATTER_STORE_OR_USER_IS_NULL(1610005,"当前事项门店或者人员为空，发布失败，请确认！",null),
    CONFIG_NOT_EXIST(1610006,"配置不存在或被禁用，请确认！",null),
    MESSAGE_NOT_EXIST(1610007,"消息模板不存在或已被删除",null),
    MESSAGE_NOT_HANDLED(1610008,"当前消息无需处理，请确认消息处理类型！",null),
    MESSAGE_PUBLISH(1610009,"您选择通知任务正在发布中，请稍后重试！",null),

    NOT_FLAGSHIP_STORE(16100005,"非直营店，无法跳过缴费阶段！",null),
    NOT_FLAGSHIP_STORE_NOT_EXIST(16100006,"当前阶段加盟类型不能变更！",null),

    API_ERROR(1610007,"第三方API请求异常",null),

    JOIN_MODE_NOT_ALLOW_OPERATE(1610012,"加盟部人员只能新建加盟店或联营店，请确认！",null),
    STORE_NOT_FIND(1610013,"门店不存在",null),
    SHOP_NAME_INVALID(1610014, "门店名称包含禁止关键词",null),
    CONTRACT_STAGE_NO_COMPLETE(1610015, "当前阶段无法分配运营顾问！",null),

    CONFIG_OPTION_USED(1610015, "配置选项已被店型使用，无法删除", null),
    STORE_TYPE_OPTION_DEFAULT_DUPLICATE(1610016, "同一配置项下只能设置一个默认选项", null),
    STORE_TYPE_MUST_DISABLE_BEFORE_DELETE(1610017, "店型已启用，无法删除，请先停用", null),
    STORE_ORDER_ITEM_CODE_DUPLICATE(1610018, "同一配置项只能选择一个选项", null),
    CONFIG_OPTION_NAME_EXIST(1610019, "配置选项名称已存在", null),
    THE_OPTION_IS_NOT_PART_OF_THIS_STORE_TYPE(1610022, "选项不属于该店型", null),
    THE_QUANTITY_MUST_BE_GREATER_THAN_0(1610020, "数量必须大于0", null),
    THE_NUMBER_OF_OPTIONS_IS_NOT_MODIFIABLE(1610021, "该选项数量不可修改", null),
    SHOP_HAS_UNFINISHED_ORDER(1610023, "当前门店存在未结束订单，无法新建", null),
    SHOP_HAS_PAID_ORDER(1610024, "当前门店已支付完成，不支持新建订单", null),
    ORDER_PAYING_CANT_ADJUST(1610025,"订单支付中，无法调整", null),
    ORDER_AMOUNT_NOT_DIFF(1610025,"分账明细与订单金额不相等，请确认！", null),
    CODE_EXIST(1610026,"存在相同的编码，请确认！", null),


    STORE_ORDER_NOT_FOUND(1610100, "订单不存在", null),
    STORE_ORDER_STATUS_INVALID(1610101, "订单状态不合法", null),
    STORE_ORDER_UPDATE_FORBIDDEN(1610102, "当前订单状态不允许修改", null),
    STORE_ORDER_WITHDRAW_FORBIDDEN(1610103, "当前订单状态不允许撤回", null),
    STORE_ORDER_CANCEL_FORBIDDEN(1610104, "当前订单状态不允许作废", null),
    CURRENT_STORE_TYPE_EXIST(1610105, "当前店型已存在", null),
    CURRENT_STORE_TYPE_NOT_EXIST(1610106, "当前店型不存在", null),
    PAY_FAIL(1610107, "支付失败", null),
    DUPLICATE_PAYMENTS(1610108, "订单支付中，请勿重复支付！", null),
    CURRENT_ORDER_NOT_SUPPORT(1610109, "当前订单状态不支持审批！", null),
    CURRENT_POINT_BIND_OTHER_WISHLIST(1610110, "当前铺位绑定了其他心愿单！", null),
    CURRENT_ORDER_STATUS_NOT_SUPPORT_CHANGE(1610111, "当前订单状态不支持变换心愿单！", null),
    CURRENT_WISHLIST_BIND_OTHER_POINT(1610112, "当前心愿单绑定了其他铺位！", null),
    ORDER_DATA_EXCEPTION(1610113, "心愿单数据异常！", null),
    CURRENT_WISHLIST_NOT_EXIST(1610114, "当前心愿单不存在！", null),
    AMOUNT_GEN_ZERO(1610115, "分账金额必须大于0！", null),
    AI_NOT_SUPPORT_OPERATION(1610116, "AI标准店不支持退回到缴费阶段！", null),




    //装修
    TEAM_USED(1612001,"该装修团队有门店使用，无法删除，请确认！",null),
    CURRENT_BRAND_SORT_NUMBER_EXIST(1612002,"已存在该排序数字！",null),
    CONTRACT_CONFIG_NOT_EXIST(1612003,"合同配置不存在！",null),


    WALLET_OPEN_ACCOUNT_FAIL(1620001,"钱包开通失败",null),
    WALLET_WITH_DRAWER_FAIL(1620002,"提现失败",null),
    WALLET_API_ERROR(1620003,"{0}",null),
    MINI_PROGRAM_VERSION_TOO_LOW(1620004,"小程序版本过低，请刷新小程序再操作！",null),
    CONTRACT_SIGNED(1620006, "操作失败，合同签约已完成", null),
    ZXJP_AMOUNT_INSTRUCTION_IS_BLANK(1620005, "鸡排价格不为10元，请填写原因", null),


    //分账
    TRANS_ID_NOT_NULL(1621001, "分账单ID不能为空！", null),
    TRANS_NOT_NULL(1621002, "分账单不存在！", null),
    NOT_SUPPORT_OPERATION(1621003, "当前状态不支持该操作！", null),
    CHANGE_ID_NOT_NULL(1621004, "调整单ID不能为空！", null),
    CHANGE_NOT_NULL(1621005, "调整单不存在！", null),
    TRADE_EXIST(1621006, "部分交易流水号已被使用，请检查！", null),
    NOT_COMPLETE_TRANS_SHEET(1621007, "存在关联未分账完成的分账单，请完成之后再操作！", null),
    PENDING_TRANS_AMOUNT(1621008, "分账金额不能大于待分账金额！", null),
    TRANSFER_ERROR(1621009, "分账异常：{0}", null),
    TRANSFER_ING(1621010, "分账中，请勿重复分账！", null),
    WITHDRAW_APPLY_NOT_EXIST(1621011, "提现申请单不存在！", null),
    WITHDRAW_ING(1621012, "提现中，请勿重复分账！", null),
    WALLET_BALANCE_INSUFFICIENT(1621013, "钱包余额不足!", null),






    // 171闭店
    CLOSE_STORE_SUB_STAGE_ERROR(171002, "当前流程状态异常", null),
    STORE_NOT_EXIST(1710003,"门店不存在！",null),
    STORE_NOT_OPEN(1710004,"当前门店状态为已闭店！请确认！",null),
    CLOSE_STORE_INFO_NOT_EXIST(1710005,"闭店申请信息不存在！",null),
    CLOSE_STORE_EXIST_ONGOING_RECORD(1710006,"当前门店有进行中的闭店申请，请确认！",null),
    CLOSE_STORE_HAS_BEEN_COMPLETED(1710007,"该审批已结束",null),
    NO_APPROVAL_AUTHORITY(1710008,"您没有审批权限！",null),
    CLOSE_STORE_AUDIT_RECORD_NOT_EXIST(1710009,"闭店审批记录不存在！",null),
    CLOSE_STORE_CANCEL_ERROR(1710010,"该闭店申请已审批无法取消",null),
    CLOSE_STORE_CANCELED(1710011,"该闭店申请已取消",null),
    CLOSE_STORE_IS_NOT_APPLICANT(1710012, "非申请发起人无法取消！",null),
    CLOSE_STORE_REFUND_INFO_NOT_EXIST(1710013,"退款信息不存在",null),
    CLOSE_STORE_FILE_STATUS_ERROR(1710014, "材料上传状态错误，请检查材料上传情况", null),
    CLOSE_STORE_FILE_NOT_EXIST(1710015, "闭店材料不存在", null),
    CLOSE_STORE_REFUND_MK_USER_NOT_EXIST(1710016, "当前用户不存在每刻权限", null),
    CLOSE_STORE_REFUND_EXIST_EFFECTIVE_RECORD(1710017, "存在生效中的退款申请！", null),
    CLOSE_STORE_REFUND_TYPE_ERROR(1710018, "退款类型错误", null),
    CLOSE_STORE_ONLY_SUPPORT_OPEN(1710019, "仅支持在营或暂停营业的门店发起闭店申请", null),

    /**
     * 181 十二分制
     */
    TP_NOT_EXIST_RULE(1810000, "不存在该规则", null),
    TP_MONTH_EXIST_APPLY(1810001, "该门店一个月内存在相同项目的加分申请", null),
    TP_SCORE_EQUAL_TWELVE(1810002, "该门店已满12分，无法申请加分", null),
    TP_NOT_EXIST_PENDING_AUDIT(1810003, "申请单不存在待审批记录", null),
    TP_NOT_EXIST_APPLY_FORM(1810004, "不存在申请单", null),
    TP_APPLY_AUDIT_COMPLETED(1810005, "该申请单已审批", null),
    TP_EXISTS_PENDING_APPLY(1810006, "存在待审批的申请单", null),
    TP_PENALTY_APPLY_APPEAL_COMPLETED(1810007, "该处罚单已完成复议", null),
    TP_PENALTY_APPLY_EFFECTIVE(1810008, "该处罚单已生效", null),
    TP_PENALTY_APPLY_UNABLE_ACCEPT(1810009, "该处罚单无法认缴", null),
    TP_PENALTY_APPLY_INEFFECTIVE(1810010, "该处罚单未生效无法完成缴费", null),
    TP_PENALTY_APPLY_NO_NEED_PAY(1810011, "该处罚单无需缴费", null),
    TP_EXIST_PENDING_IMPORT_TASK(1810012, "存在导入中的任务，请稍后再试", null),
    TP_NOT_EXIST_FORM_TYPE(1810013, "不存在该表单类型", null),
    TP_FORM_ENABLE_APPEAL(1810014, "该申请单无法复议", null),
    TP_EXISTS_APPEAL_FORM(1810015, "该申请单存在复议申请，无法重复发起", null),

    VISIT_RECORD_NOT_EXIST(1820001, "拜访记录不存在", null),
    VISIT_RECORD_NOT_COMPLETE_EDIT(1820002, "未编辑拜访信息，无法签退", null),
    VISIT_RECORD_INVALID(1820003, "拜访记录已失效", null),
    VISIT_RECORD_NOT_YOUR_OWN(1820004, "非拜访人，无法操作", null),
    VISIT_RECORD_COMPLETE(1820005, "已完成拜访", null),
    EXPORT_TASK_LIMIT(1830006, "导出任务数量达上限，请稍后再试", null),
    CITY_PLANNING_EXISTS(1820001, "同年份同季度同省市已存在规划，不能重复添加", null),

    WALLET_INVEST_TYPE_EXISTS(1830000, "同品牌同费用仅能存在分部或全部", null),
    WALLET_UNIQUE_KEY_EXISTS(1830001, "该加盟品牌、招商分部、费用类型已存在", null),
    BANK_CONFIG_INVEST_TYPE_EXISTS(1830002, "同品牌同付款方式只能配置全部或分部其中一种", null),
    BANK_CONFIG_UNIQUE_KEY_EXISTS(1830003, "该加盟品牌、招商分部、付款方式配置已存在", null),
    FEE_STANDARD_UNIQUE_KEY_EXISTS(1830003, "该加盟品牌、费用类型配置已存在", null),
    NO_PAYMENT_METHOD_IS_SET(1830004, "未设置支付方式", null),
    FRANCHISE_FEE_PAY_TYPE_ERROR(1830005,"缴款方式已选择，不可更改!",null),
    EXIST_PAY_INFO(1830006, "存在缴款，无法修改分账信息", null),
    PAY_TYPE_UNEQUAL_TO_PING_AN_WALLET(1830007, "支付方式不为平安钱包支付", null),
    NONSUPPORT_EXPENSE_TYPE(1830008, "不支持的费用类型", null),
    EXPENSE_TYPE_HAS_PAID(1830009, "{0}已完成支付", null),
    EXPENSE_CHANGED(1830010, "费用发生变化，请刷新页面后重试", null),
    THERE_IS_NO_PAYMENT_INFORMATION(1830011, "不存在缴费信息", null),
    THE_USER_IS_PAYING_UNABLE_UPDATE(1830012, "用户缴费中，无法编辑", null),
    THE_USER_IS_PAYING(1830018, "用户缴费中，请稍后再试", null),
    ALLOCATION_CONFIG_NOT_EXIST(1830013, "不存在分账配置信息", null),
    NOT_EXIST_CALLBACK_RESOLVE(1830014, "不存在回调处理策略", null),
    NOT_EXIST_PING_AN_ACCOUNT(1830015, "不存在平安账户，请开通", null),
    NOT_ENOUGH_BALANCE(1830016, "账户余额不足", null),
    WALLET_TRANS_FAIL(1830017, "钱包交易失败", null),
    WALLET_RE_PAY_FAIL(1830019, "重新支付异常，请联系管理员", null),
    WALLET_PAY_CANNOT_CANCEL(1830020, "该交易无法取消", null),
    TOTAL_FEES_NEED_EQUAL(1830021, "分账总金额需与合计缴费金额一致", null),
    NOT_EXIST_WANG_SHANG_ACCOUNT(1830022, "当前门店未开通网商钱包账户，请先开通！", null),

    IP_LIMIT(1840000, "IP访问次数超限", null),


    CLOSE_UP_CLOSED_DOWN(1840000, "门店已歇业", null),
    CLOSE_UP_ONLY_SUPPORT_OPEN(1840001, "仅支持在营门店发起歇业申请", null),
    CLOSE_UP_EXIST_ONGOING_RECORD(18400002,"该日期下当前门店有进行中的申请，请确认！",null),
    CLOSE_UP_AUDIT_RECORD_NOT_EXIST(1840003, "审批记录不存在", null),
    CLOSE_UP_FORM_NOT_EXIST(1840004, "申请单不存在", null),
    CLOSE_UP_AUDIT_ACCESS_DENIED(1840005, "无权限审批", null),
    CLOSE_UP_STORE_OPEN(1840006, "门店已营业", null),
    CLOSE_UP_ONLY_SUPPORT_CLOSE_UP(1840007, "仅支持歇业门店发起营业申请", null),
    CLOSE_UP_CLOSED_AUDIT_NOT_PASS(1840008, "歇业申请未通过", null),
    CLOSE_UP_EXIST_OPEN_APPLY(1840009, "该歇业申请单已存在开业申请", null),
    CLOSE_UP_APPROVED(1840010, "该申请单已审批", null),
    ;


    protected static final Map<Integer, ErrorCodeEnum> map = Arrays.stream(values()).collect(
            Collectors.toMap(ErrorCodeEnum::getCode, Function.identity(), (a, b)->a));
    private int code;

    private String message;
    private String en;

    ErrorCodeEnum(int code, String message, String en) {
        this.code = code;
        this.message = message;
        this.en=en;
    }


    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static ErrorCodeEnum getByCode(Integer code) {
        return map.get(code);
    }


}
