DROP TABLE IF EXISTS `blade_dnc_archive_directory`;
CREATE TABLE `blade_dnc_archive_directory`
(
    `id`          bigint(0) NOT NULL COMMENT '主键',
    `tenant_id`   varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT
        '租户ID',
    `parent_id`   bigint(0) NULL DEFAULT 0 COMMENT '父主键',
    `name`        varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '工艺目录名称',
    `all_path`    varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '全路径(包含自身)',
    `is_deleted`  int(0) NULL DEFAULT NULL,
    `status`      int(0) NULL DEFAULT NULL COMMENT '状态',
    `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
    `create_user` bigint(0) NULL DEFAULT NULL COMMENT '创建人',
    `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
    `update_user` bigint(0) NULL DEFAULT NULL COMMENT '更新人',
    `create_dept` bigint(0) NULL DEFAULT NULL COMMENT '创建部门',
    `dept_id`     bigint(0) NULL DEFAULT NULL COMMENT '职权域id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_general_ci COMMENT = 'dnc 归档目录'
  ROW_FORMAT =
      Dynamic;

DROP TABLE IF EXISTS `blade_dnc_archive_directory_file`;
CREATE TABLE `blade_dnc_archive_directory_file`
(
    `id`                      bigint(0) NOT NULL,
    `remark`                  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
    `create_user`             bigint(0) NULL DEFAULT NULL,
    `create_dept`             bigint(0) NULL DEFAULT NULL,
    `create_time`             datetime(0) NULL DEFAULT NULL,
    `update_user`             bigint(0) NULL DEFAULT NULL,
    `update_time`             datetime(0) NULL DEFAULT NULL,
    `status`                  int(0) NULL DEFAULT NULL,
    `is_deleted`              int(0) NULL DEFAULT NULL,
    `tenant_id`               varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '000000',
    `original_filename`       varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL
        COMMENT '原始文件名称',
    `filename`                varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件名称',
    `content_length`          bigint(0) NULL DEFAULT NULL,
    `content_md5`             varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件md5值',
    `content_type`            varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件类型',
    `object_key`              varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件的objectKey',
    `suffix`                  varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件后缀',
    `is_current`              int(0) NULL DEFAULT NULL COMMENT '是否为当前版本,1是0否',
    `link`                    varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件链接',
    `business_identification` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL
        COMMENT '业务标识',
    `workstation_file_id`     bigint(0) NULL DEFAULT NULL COMMENT '工位文件id',
    `workstation_id`          bigint(0) NULL DEFAULT NULL COMMENT '工位id',
    `archive_directory_id`    bigint(0) NULL DEFAULT NULL COMMENT '归档目录id',
    `version`                 int(0) NULL DEFAULT NULL COMMENT '文件版本',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_general_ci COMMENT = '归档目录文件'
  ROW_FORMAT =
      Dynamic;

DROP TABLE IF EXISTS `blade_dnc_art_bag_log`;
CREATE TABLE `blade_dnc_art_bag_log`
(
    `id`             bigint(0) NOT NULL,
    `file_id`        bigint(0) NULL DEFAULT NULL COMMENT '文件id',
    `file_name`      varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件名称',
    `object_key`     varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT
        '文件存储的key',
    `suffix`         varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件后缀',
    `operator_id`    bigint(0) NULL DEFAULT NULL COMMENT '操作人员id',
    `operator_name`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT
        '操作人员姓名',
    `operation_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
    `source_type`    int(0) NULL DEFAULT NULL COMMENT '源类型：本地文件0 我的文档1 加工程序2 通用文件3 回传文件 4 非通用文件 5 产品 6',
    `remark`         varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
    `create_user`    bigint(0) NULL DEFAULT NULL,
    `create_dept`    bigint(0) NULL DEFAULT NULL,
    `create_time`    datetime(0) NULL DEFAULT NULL,
    `update_user`    bigint(0) NULL DEFAULT NULL,
    `update_time`    datetime(0) NULL DEFAULT NULL,
    `status`         int(0) NULL DEFAULT NULL,
    `is_deleted`     int(0) NULL DEFAULT NULL,
    `tenant_id`      varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '000000',
    `link`           varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件链接',
    `art_bag_id`     bigint(0) NULL DEFAULT NULL COMMENT '工艺包id',
    `art_file_id`    bigint(0) NULL DEFAULT NULL COMMENT '工位报文件id',
    `operation_type` int(0) NULL DEFAULT NULL COMMENT '操作类型：添加1 覆盖2 删除3',
    `file_type`      int(0) UNSIGNED NULL DEFAULT NULL COMMENT '属性 程序1 文档2',
    `file_belong`    int(0) UNSIGNED NULL DEFAULT NULL COMMENT '文件归属 工厂1 工位2',
    `storage`        int(0) NULL DEFAULT NULL COMMENT '存储空间 固定空间1 常规空间2',
    `version`        int(0) NULL DEFAULT NULL COMMENT '版本',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_general_ci COMMENT = '工艺包操作历史'
  ROW_FORMAT =
      Dynamic;

DROP TABLE IF EXISTS `blade_dnc_art_product`;
CREATE TABLE `blade_dnc_art_product`
(
    `id`                bigint(0) NOT NULL,
    `remark`            varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
    `create_user`       bigint(0) NULL DEFAULT NULL,
    `create_dept`       bigint(0) NULL DEFAULT NULL,
    `create_time`       datetime(0) NULL DEFAULT NULL,
    `update_user`       bigint(0) NULL DEFAULT NULL,
    `update_time`       datetime(0) NULL DEFAULT NULL,
    `status`            int(0) NULL DEFAULT NULL,
    `is_deleted`        int(0) NULL DEFAULT NULL,
    `tenant_id`         varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '000000',
    `product_id`        bigint(0) NULL DEFAULT NULL COMMENT '产品id',
    `art_bag_id`        bigint(0) NULL DEFAULT NULL COMMENT '工艺包id',
    `product_type_id`   bigint(0) NULL DEFAULT NULL COMMENT '产品类型id',
    `product_type_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL
        COMMENT '产品类型名称',
    `product_name`      varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '产品名称',
    `product_code`      varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '产品编码',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_general_ci COMMENT = '工艺包关联产品'
  ROW_FORMAT =
      Dynamic;

DROP TABLE IF EXISTS `blade_dnc_craft_file`;
CREATE TABLE `blade_dnc_craft_file`
(
    `id`             bigint(0) NOT NULL,
    `tenant_id`      varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT
        '租户id',
    `display_name`   varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件显示名称',
    `pid`            bigint(0) NULL DEFAULT NULL COMMENT '上级id',
    `all_path`       varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '全路径',
    `content_length` bigint(0) NULL DEFAULT NULL,
    `content_type`   varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件mini类型',
    `suffix`         varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '后缀名',
    `file_type`      int(0) NULL DEFAULT NULL COMMENT '文件类型，1 文件夹 2 文件 3 资源文件',
    `object_key`     varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件key',
    `content_md5`    varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件md5',
    `is_locked`      tinyint(0) NULL DEFAULT NULL COMMENT '是否上锁',
    `owner`          bigint(0) NULL DEFAULT NULL COMMENT '拥有者',
    `create_user`    bigint(0) NULL DEFAULT NULL COMMENT '创建人',
    `create_time`    datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
    `update_user`    bigint(0) NULL DEFAULT NULL COMMENT '更新人',
    `update_time`    datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
    `is_deleted`     int(0) NULL DEFAULT NULL,
    `create_dept`    bigint(0) NULL DEFAULT NULL COMMENT '部门',
    `status`         int(0) NULL DEFAULT NULL COMMENT '状态',
    `link`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件外连接',
    `is_current`     tinyint(0) NOT NULL DEFAULT 0 COMMENT '是否为当前版本,1是0否',
    `cover_time`     datetime(0) NULL DEFAULT NULL COMMENT '覆盖时间',
    `version`        int(0) NULL DEFAULT NULL COMMENT '版本',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_general_ci
  ROW_FORMAT = Dynamic;

DROP TABLE IF EXISTS `blade_dnc_factory_file`;
CREATE TABLE `blade_dnc_factory_file`
(
    `id`                bigint(0) NOT NULL,
    `original_filename` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL
        COMMENT '原始文件名称',
    `filename`          varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件名称',
    `content_length`    bigint(0) NULL DEFAULT NULL,
    `content_md5`       varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件md5值',
    `last_modified`     datetime(0) NULL DEFAULT NULL COMMENT '最后修改时间',
    `content_type`      varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
    `object_key`        varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件的objectKey',
    `suffix`            varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
    `create_user`       bigint(0) NULL DEFAULT NULL COMMENT '创建人',
    `create_time`       datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
    `update_user`       bigint(0) NULL DEFAULT NULL COMMENT '更新人',
    `update_time`       datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
    `is_deleted`        int(0) NULL DEFAULT NULL,
    `create_dept`       bigint(0) NULL DEFAULT NULL COMMENT '创建部门',
    `status`            int(0) NULL DEFAULT NULL COMMENT '业务状态',
    `link`              varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文件地址',
    `is_current`        int(0) NULL DEFAULT NULL COMMENT '是否为当前版本,1是0否',
    `version`           int(0) NULL DEFAULT NULL COMMENT '文件版本',
    `whether_archive`   int(0) NULL DEFAULT 1 COMMENT '文件是否归档：1 未归档 2 已归档',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_general_ci
  ROW_FORMAT = Dynamic;

DROP TABLE IF EXISTS `blade_dnc_operation_log`;
CREATE TABLE `blade_dnc_operation_log`
(
    `id`                 bigint(0) NOT NULL,
    `file_id`            bigint(0) NULL DEFAULT NULL COMMENT '文件id',
    `file_name`          varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件名称',
    `object_key`         varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT
        '文件存储的key',
    `suffix`             varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件后缀',
    `operator_id`        bigint(0) NULL DEFAULT NULL COMMENT '操作人员id',
    `operator_name`      varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT
        '操作人员姓名',
    `operation_type`     int(0) NULL DEFAULT NULL COMMENT '操作类型：上传1 下载2 删除3 更新4 5移动 6复制',
    `operation_response` int(0) NULL DEFAULT NULL COMMENT '操作结果',
    `operation_time`     datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
    `source_type`        int(0) NULL DEFAULT NULL COMMENT '源类型：本地文件0 我的文档1 工位文件-加工程序2 工位文件-工位文件3 FTP 4',
    `source_path_id`     varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT
        '源全路径id',
    `source_path_name`   varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT
        '源全路径名称',
    `target_type`        int(0) NULL DEFAULT NULL COMMENT '源类型：本地文件0 我的文档1 工位文件-加工程序2 工位文件-工位文件3 FTP 4',
    `target_path_id`     varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT
        '目标全路径id：格式，/1/123/456',
    `target_path_name`   varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT
        '目标全路径名称:格式，/我的文档/文件夹1/文件夹2',
    `remark`             varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
    `create_user`        bigint(0) NULL DEFAULT NULL,
    `create_dept`        bigint(0) NULL DEFAULT NULL,
    `create_time`        datetime(0) NULL DEFAULT NULL,
    `update_user`        bigint(0) NULL DEFAULT NULL,
    `update_time`        datetime(0) NULL DEFAULT NULL,
    `status`             int(0) NULL DEFAULT NULL,
    `is_deleted`         int(0) NULL DEFAULT NULL,
    `tenant_id`          varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '000000',
    `link`               varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件链接',
    `workstation_id`     bigint(0) NULL DEFAULT NULL COMMENT '工位id',
    `file_type`          int(0) NULL DEFAULT 0 COMMENT '文件类型 1:代表文件夹 0:代表文件',
    `version`            int(0) NULL DEFAULT NULL COMMENT '版本',
    `storage_space`      int(0) NULL DEFAULT NULL COMMENT '存储位置：1 常规空间 2 固定空间',
    `file_location`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT
        '文件位置：1 内部存储 2 以太网',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_general_ci
  ROW_FORMAT = Dynamic;


-- 初始化菜单脚本
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1481428245788037121, 0, 'dnc', '生产工艺', 'dnc', '/dnc', 'iconfont saber-shengchangongyi', 5, 0, 0, 1, '', 0,
        'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1481428568128688130, 1481428245788037121, 'transfer', '文件传输', 'transfer', '/dnc/transport/index',
        'iconfont iconicon_exchange', 3, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1481429369576296449, 1481428245788037121, 'station_file', '工位文件', 'station_file', '/dnc/station-file/index',
        'iconfont iconicon_doc', 2, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1481429815657304065, 1481428245788037121, 'my_documents', '我的文档', 'my_documents', '/dnc/document/index',
        'iconfont iconicon_subordinate', 1, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1495960929735061505, 1481428245788037121, 'operation_log', '操作日志', 'operation_log', '/dnc/log/index',
        'iconfont icon-biaodan', 7, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1496427333921992705, 1498201919430000641, 'technology_files', '工艺文件', 'technology_files',
        '/dnc/craft/document/index', 'iconfont iconicon_dispose', 1, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1497029135171686401, 1481428245788037121, 'factory_file', '工厂文件', 'factory_file', '/dnc/factory-file/index',
        'iconfont iconicon_doc', 6, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1497030448508932097, 1481428245788037121, 'archive', '文件归档', 'archive', '/dnc/archive',
        'iconfont iconicon_coinpurse_line', 5, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1497129165478219777, 1497030448508932097, 'archived_files', '归档管理', 'archived_files', '/dnc/file/admin/index',
        'iconfont iconicon_dispose', 2, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1497132713708535809, 1497030448508932097, 'archive_catalog', '归档目录', 'archive_catalog',
        '/dnc/file/catalog/index', 'iconfont iconicon_addresslist', 1, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1498201919430000641, 1481428245788037121, 'technology_file', '工艺管理', 'technology_file', '/dnc/process',
        'iconfont iconicon_coinpurse_line', 4, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1498202645019426818, 1498201919430000641, 'technology_catalog', '工艺目录', 'technology_catalog',
        '/dnc/craft/catalog/index', 'iconfont iconicon_addresslist', 2, 1, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1551739877858926594, 1481428245788037121, 'dnc_app_setting', 'dnc应用设置', 'dnc_app_setting', '/dnc/setting/index',
        '', 8, 1, 0, 1, '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552474588642234369, 1551739877858926594, 'ftp_directory_root_add', '创建FTP目录', 'ftp_directory_root_add', '', '',
        1, 2, 0, 1, '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552475927401156610, 1551739877858926594, 'bind_workstation', '关联工位', 'bind_workstation', '', '', 2, 2, 0, 1,
        '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552476695336300545, 1551739877858926594, 'ftp_directory_add', '新增', 'ftp_directory_add', '', '', 4, 2, 0, 1,
        '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552476901159186434, 1551739877858926594, 'ftp_directory_rename', '重命名', 'ftp_directory_rename', '', '', 5, 2,
        0, 1, '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552477030549270530, 1551739877858926594, 'ftp_directory_delete', '删除子目录', 'ftp_directory_delete', '', '', 6, 2,
        0, 1, '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1552477343062667265, 1551739877858926594, 'ftp_directory_root_delete', '删除根目录', 'ftp_directory_root_delete', '',
        '', 3, 2, 0, 1, '', 0, 'cps', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1585554742799319042, 0, 'hmi_dnc', '文件传输', 'hmi_dnc', '/dnc', '', 2, 1, 0, 1, '', 0, 'HMI', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1592786664948154369, 1551739877858926594, 'dnc_filedriectory_save', '文件配置设置', 'dnc_filedriectory_save', '', '',
        10, 2, 0, 1, '', 0, 'CPS', 1);
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark,
                        is_deleted, belong_application, keep_alive)
VALUES (1592786889846734850, 1551739877858926594, 'dnc_filedriectory_switch', '文件配置开关', 'dnc_filedriectory_switch', '',
        '', 11, 2, 0, 1, '', 0, 'CPS', 1);


-- 初始化脚本
INSERT INTO `blade_dnc_archive_directory`(`id`, `tenant_id`, `parent_id`, `name`, `all_path`,
                                          `is_deleted`, `status`, `create_time`, `create_user`, `update_time`,
                                          `update_user`, `create_dept`,
                                          `dept_id`)
VALUES (0, '000000', -1, '默认目录', '0', 0, NULL, NOW(), NULL, NOW(), NULL, NULL, NULL);
INSERT INTO `blade_dnc_process_catalogue`(`id`, `tenant_id`, `parent_id`, `name`, `all_path`,
                                          `is_deleted`, `status`, `create_time`, `create_user`, `update_time`,
                                          `update_user`, `create_dept`,
                                          `dept_id`)
VALUES (0, '000000', -1, '默认目录', '0', 0, 1, NOW(), NULL, NOW(), NULL, NULL, NULL);

INSERT INTO `blade_dnc_craft_file`(`id`, `tenant_id`, `display_name`, `pid`, `all_path`, `content_length`,
                                   `content_type`, `suffix`, `file_type`, `object_key`, `content_md5`, `is_locked`,
                                   `owner`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`,
                                   `create_dept`, `status`, `link`, `is_current`, `cover_time`, `version`)
VALUES (0, '000000', '我的文档', -1, '0', 0, NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 1, NULL,
        1, NULL, 1);

INSERT INTO blade_scope_api (id, menu_id, resource_code, scope_name, scope_path, scope_type, remark, http_method,
                             create_user, create_dept, create_time, update_user, update_time, status, is_deleted)
VALUES (1592793061815402498, 1592786664948154369, 'dnc_directory_settings.update_file_setting_data', '更新文件目录设置',
        '/blade-dnc/dnc-directory-settings/update-setting', NULL, NULL, 'POST', 1123598821738675201,
        1123598813738675201,
        '2022-11-16 16:13:53', 1123598821738675201, '2022-11-16 16:13:53', 1, 0),
       (1592793108263124993, 1592786889846734850, 'dnc_directory_settings.switch_state', '文件设置：开启、关闭',
        '/blade-dnc/dnc-directory-settings/change', NULL, NULL, 'POST', 1123598821738675201, 1123598813738675201,
        '2022-11-16 16:14:04', 1123598821738675201, '2022-11-16 16:14:04', 1, 0);
