package com.gz.common;

import java.util.concurrent.TimeUnit;

/**
 * 全局常量
 * @author LiuchangLan
 * @date 2020/7/14 15:00
 */
public class DataGlobalVariable {


    /** ---------------------用户相关 ------------------------*/


    /** 用户激活状态码*/
    public static final Integer USER_STATUS_DISABLE = 1;

    /** ---------------------日志相关 ------------------------*/

    /** 操作日志的code*/
    public static final String OPERATE_LOG_CODE = "OPERATION_LOG";

    /** 错误日志的code*/
    public static final String ERROR_LOG_CODE = "ERROR_LOG";

    /** 登录日志的code*/
    public static final String LOGIN_LOG_CODE = "LOGIN_LOG";

    /** ---------------------档号相关 ------------------------*/
    /** 文书档案 生成档号 FOMAT 全宗号-档案门类代码年度-保管期限-机构代码-件号 */
    public static final String WS_DH_FOMAT = "%s-WS%s-%s-0000-%s";

    /** 会计档案 生成档号 FOMAT 全宗号-（目录号）-档案门类代码年度--核算单位代号-（保管期限）-案卷号*/
    public static final String KU_DH_FOMAT = "%s-（%s）-KU%s-%s-（%s）-%s";

    /** 科技档案 生成档号 FOMAT 全宗号-目录号-档案门类代码·属类代码-保管期限-项目代号/设备代号--案卷号*/
    public static final String KJ_DH_FOMAT = "%s-%s-KJ·%s-%s-%s-%s";

    /** 专业档案 生成档号 FOMAT 全宗号-目录号-档案门类代码·属类代码-保管期限-案卷号*/
    public static final String ZY_DH_FOMAT = "%s-%s-ZY·%s-%s-%s";

    /** 音像档案 生成档号 FOMAT 全宗号-目录号-档案门类代码·属类代码-保管期限-张号/盘号(_段号)*/
    public static final String YX_DH_FOMAT = "%s-%s-YX·%s-%s-%s";

    /** 业务数据档案 生成档号 FOMAT 全宗号-目录号-档案门类代码-保管期限-件号*/
    public static final String SJ_DH_FOMAT = "%s-%s-SJ-%s-%s";

    /** 实物档案 生成档号 FOMAT 全宗号-目录号-档案门类代码·属类代码-保管期限-件号*/
    public static final String SW_DH_FOMAT = "%s-%s-SW·%s-%s-%s";

    /** 融媒体档案 生成档号 FOMAT 全宗号-目录号-档案门类代码·属类代码-保管期限-件号*/
    public static final String MT_DH_FOMAT = "%s-%s-MT·%s-%s-%s";
    /** ---------------------档案导入相关 ------------------------*/

    /** 档案目录导入解析key */
    public static final String IMPORT_ARCHIVE_SESSION_KEY_FOMAT = "ARCHIVE_%s";
    /** 二级目录导入解析Key*/
    public static final String IMPORT_SECONDARY_ARCHIVE_SESSION_KEY_FOMAT = "SECONDARY_ARCHIVE_%s";

    /** ---------------------权限控制相关 ------------------------*/


    /** 菜单权限类型*/
    public static final Integer ROLE_TYPE_MENU = 0;
    /** 档案树权限类型*/
    public static final Integer ROLE_TYPE_ARCHIVE_TREE = 1;
    /** 密集权限*/
    public static final Integer ROLE_TYPE_MIJI = 2;
    /** 文档查看权限*/
    public static final Integer ARCHIVE_SHOW = 3;
    /** 部门查看权限*/
    public static final Integer ARCHIVE_DEPT = 4;

    /** ---------------------消息队列相关 ------------------------*/
    public static final String MQ_SEND_SUCCESS = "0";
    public static final String MQ_SEND_FAILED = "1";
    public static final String MQ_X_DEAD_LETTER_EXCHANGE_KEY = "x-dead-letter-exchange";
    public static final String MQ_X_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
    public static final String MQ_X_MESSAGE_TTL = "x-message-ttl";

    /** ---------------------档案检索相关 ------------------------*/

    public static final String SEARCH_SQL_KEY = "searchArchiveSql";

    /** ---------------------统计相关 ------------------------*/
    public static final String STATISTICS_ML_CODE_KEY_FOMAT = "STATISTICS_CODE_%s";
    /** 统计缓存时间*/
    public static final Long CACHE_EXPIRES = 5L;

    /** 缓存时间单位*/
    public static final TimeUnit TIME_UNIT = TimeUnit.MINUTES;

    /** 缓存key 类名:方法名:参数*/
    public static final String CACHE_KEY_FOMAT = "%s:%s:%s";


}
