package com.muchinfo.mtp3common.enumtype;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * 公共静态变量
 *
 * @author Administrator
 */
public class Constants {

    public static final String SYS_DEFAULT_PASSWORD = "d99999999";//系统默认登录密码
    public static final String SYS_DEFAULT_TRADE_PASSWORD = "d66668888";//系统默认支付密码

    public static final Integer OPERATE_SUCCESS = 0; // 操作成功
    public static final Integer OPERATE_FAILURE = 1; // 操作失败

    public static final String SESSION_LOGIN_KEY = "user_key";
    public static final String SESSION_LOGIN_KEY_MEMBER = "member_key";
    public static final String SESSION_ROLE_KEY = "role";

    /**
     * RabbitMQ 公告通知编辑保存的  路由key
     */
    public static final String ROUTING_KEY_NOTICE_SAVE = "notice.db.send";
    /**
     * RabbitMQ 公告通知推送的  路由key
     */
    public static final String ROUTING_KEY_NOTICE_PUBLISH = "notice.im.send";


    public static final String DEFAULT_CHARSET = "UTF-8";

    /**
     * redis key： 数据字典KEY前缀
     */
    public static final String REDIS_HEADER_DICT = "manage:dict_";

    public static final String REDIS_HEADER_SYSPARAM = "manage:SYS_PARAM";

    public static final String REDIS_HEADER_VCODE = "onlineopen:vcode:";

    public static final String REDIS_HEADER_TABLETITLE = "manage:TABLETITLE_";

    public static final String REDIS_HEADER_TABLEDEFINE = "manage:TABLEDEFINE_";

    public static final String SYSPARAM_ID_DICT = "020";
    public static final String SYSPARAM_ID_ERROR = "021";
    public static final String SYSPARAM_ID_MARKET = "022";
    public static final String SYSPARAM_ID_GOODS = "023";
    public static final String SYSPARAM_ID_CONFIG = "024";
    public static final String SYSPARAM_ID_FENGX = "025";
    public static final String SYSPARAM_ID_DATE = "026";
    public static final String SYSPARAM_ID_MENU = "027";
    public static final String SYSPARAM_ID_DELIVERYGOODS = "028";

    public static final String SYSPARAM_ID_IMG = "093";

    // 机构开户证件号码是否唯一
    public static final String SYSPARAM_CARD_NO = "991";

    //交易商开户证件号码是否唯一
    public static final String SYSPARAM_CARD_NOTWO = "992";

    public static final String SYSPARAM_OPEN_AUDIT_MARKET = "999";


    /**
     * 交易端查询项
     **/
    public static final String QUERY_ACCOUNTINFO = "1";
    public static final String QUERY_TAACCOUNTALL = "2";
    public static final String QUERY_GOODSRULEANDFEE = "3";
    public static final String QUERY_SERVERLASTNOTICEID = "4";
    public static final String QUERY_PARAMVALUE = "5";


    public static final Integer SPEICAL_MARKET_SYSTEM = 0;  // 系统
    public static final Integer SPEICAL_MARKET_DELIVERY = 1;  // 交割
    public static final Integer SPEICAL_MARKET_ACCOUNT = 2;  // 账户
    public static final Integer SPEICAL_MARKET_PERFORMANCE = 3;  // 履约
    public static final Integer SPEICAL_MARKET_WR = 4;  // 仓单
    public static final Integer SPEICAL_MARKET_SCORE = 5;  // 积分
    public static final Integer SPEICAL_MARKET_BANK = 6;  // 银行
    public static final Integer SPEICAL_MARKET_SCF = 7;  // 供应链金融
    public static final Integer SPEICAL_MARKET_REPORT = 8;  // 报表
    public static final Integer SPEICAL_MARKET_MARKETING = 9;  // 扩展
    public static final Integer SPEICAL_MARKET_AUTOQUOTE = 10;  // 自动报价
    public static final Integer SPEICAL_MARKET_MALL = 11;  // 商城
    public static final Integer SPEICAL_MARKET_OUTERACCOUNT = 12;  // 外盘账户
    public static final Integer SPEICAL_MARKET_UNTRADE_TEST_BANK = 13;  // 非交易日银行测试服务
    public static final Integer SPEICAL_MARKET_BANK_SETTLE = 14;  // 银行服务(清算)
    public static final Integer SPEICAL_MARKET_RECKON = 15;  // 结算服务
    public static final Integer SPEICAL_MARKET_SUM = 16;  // 统计服务
    public static final Integer SPEICAL_MARKET_COUPON = 17;  // 优惠券服务
    public static final Integer SPEICAL_MARKET_CHANGE = 18;  //企业风险管理
    public static final Integer SPEICAL_MARKET_QUOTE_SOURCE = 100;  // 行情接入
    public static final Integer SPEICAL_MARKET_QUOTE_PRICE = 101;  // 行情处理
    public static final Integer SPEICAL_MARKET_QUOTE_PUBLISH = 102;  // 行情发布
    public static final Integer SPEICAL_MARKET_SCORE_SZ_JDP = 200; // 积分-尚志金点拍


    public static final Integer THREADSIZE = 10;

    /**
     * 代码提示式返回
     */
    public static final Map<String, Object> RESULT_EXPIRE_SUCCESS = new HashMap<String, Object>();

    static {
        RESULT_EXPIRE_SUCCESS.put("code", 0);
        RESULT_EXPIRE_SUCCESS.put("msg", "到期确认成功");
    }

    public static final Map<String, Object> RESULT_SUCCESS = new HashMap<String, Object>();

    static {
        RESULT_SUCCESS.put("code", 0);
        RESULT_SUCCESS.put("msg", "操作成功");
    }

    public static final Map<String, Object> RESULT_PARAM_ERROR = new HashMap<String, Object>();

    static {
        RESULT_PARAM_ERROR.put("code", -1);
        RESULT_PARAM_ERROR.put("msg", "参数错误");
    }

    public static final Map<String, Object> RESULT_FAILE = new HashMap<String, Object>();

    static {
        RESULT_FAILE.put("code", 500);
        RESULT_FAILE.put("msg", "操作失败");
    }


    public static final Map<String, Object> RESULT_ADD_SUCCESS = new HashMap<String, Object>();

    static {
        RESULT_ADD_SUCCESS.put("code", 0);
        RESULT_ADD_SUCCESS.put("msg", "新增成功");
    }

    public static final Map<String, Object> RESULT_EDIT_SUCCESS = new HashMap<String, Object>();

    static {
        RESULT_EDIT_SUCCESS.put("code", 0);
        RESULT_EDIT_SUCCESS.put("msg", "修改成功");
    }

    public static final Map<String, Object> RESULT_DEL_SUCCESS = new HashMap<String, Object>();

    static {
        RESULT_DEL_SUCCESS.put("code", 0);
        RESULT_DEL_SUCCESS.put("msg", "删除成功");
    }


    public static final Map<String, Object> RESULT_DELETE_SUCCESS = new HashMap<String, Object>();

    static {
        RESULT_DELETE_SUCCESS.put("code", 0);
        RESULT_DELETE_SUCCESS.put("msg", "注销成功");
    }

    /**
     * @param code
     * @param msg
     * @return java.util.Map<java.lang.String, java.lang.Object>
     * @Description : 自定义响应信息
     * @author : he.jian
     * @date : 2020/7/23 11:45
     */
    public static Map<String, Object> resultInfo(Integer code, String msg) {
        return resultInfo(code, msg, null);
    }

    /**
     * @param code
     * @param msg
     * @param infoMap
     * @return java.util.Map<java.lang.String, java.lang.Object>
     * @Description : 自定义响应信息
     * @author : he.jian
     * @date : 2020/7/23 11:45
     */
    public static Map<String, Object> resultInfo(Integer code, String msg, Map<String, Object> infoMap) {
        Map<String, Object> map = new HashMap<>();
        map.put("code", code);
        map.put("msg", msg);
        if (infoMap != null) {
            map.putAll(infoMap);
        }
        return map;
    }

    /**
     * 账户锁定
     */
    public static int userlock = 4001;
    public static String userlock_msg = "账户已锁定";
    public static String loginlock_msg = "登录锁定";

    public static int unOk = 4005;    //用户未启用
    /**
     * 用户名/密码为空
     */
    public static String loginStop_msg = "账户已停用,请联系管理员";//"登录失败";

    public static String loginPWDFail_msg = "还剩{#1}次错误机会,账号或密码不匹配达到{#2}次,登录账号将锁定{#3}分钟";//"登录失败";
    //还剩{#1}次错误机会，账号或密码不匹配达到{#2}次，登录账号将锁定{#3}时间

    /**
     * 修改密码
     */
    public static int loginChange = 4003;

    /**
     * ip黑名单
     */
    public static int loginCountError = 4007;
    public static String loginCountError_msg = "未经允许，不可访问！请联系管理员处理！";

    /**
     * 交易员账号登录
     */
    public static int loginTradeManage = 4008;
    public static String loginTradeManage_msg = "账户或密码错误";


    public static int Token_failure_code = 4009;

    /**
     * 系统异常错误枚举
     */
    public static Integer Error_Code_Design = 500;
    /**
     * 系统操作成功枚举
     */
    public static Integer Success_Code_Design = 200;
}
