From c357c0bc14d89635da4e59222571be547eaf47e9 Mon Sep 17 00:00:00 2001 From: luyie Date: Sun, 29 Sep 2024 17:24:23 +0800 Subject: [PATCH] =?UTF-8?q?add:=E5=A4=A7=E6=A8=A1=E5=9E=8B=E6=96=B0?= =?UTF-8?q?=E5=A2=9Esql=E3=80=81operational=E6=96=B0=E5=A2=9Esql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/common/utils/FileUtil.java | 7 +- .../gglm-big-model/src/main/resources/db/2.0.2.sql | 140 ++++++++++++++++++--- .../operational/src/main/resources/db/3.0.5.sql | 3 + 3 files changed, 127 insertions(+), 23 deletions(-) create mode 100644 hzims-service/operational/src/main/resources/db/3.0.5.sql diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/FileUtil.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/FileUtil.java index f376ac3..21c2583 100644 --- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/FileUtil.java +++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/FileUtil.java @@ -134,13 +134,8 @@ public class FileUtil { } public static ByteArrayMultipartFile getMultipartFileFromUrl(String urlStr) throws IOException { - String pureUrl = getPureUrl(urlStr); - return getMultipartFileFromPureUrl(pureUrl); - } - - public static ByteArrayMultipartFile getMultipartFileFromPureUrl(String pureUrlStr) throws IOException { ByteArrayMultipartFile result = null; - URL url = new URL(pureUrlStr); + URL url = new URL(urlStr); byte[] bytes = getUrlByte(url); String name = url.getPath(); String originalName = getOriginalFilename(name); diff --git a/hzims-service/gglm-big-model/src/main/resources/db/2.0.2.sql b/hzims-service/gglm-big-model/src/main/resources/db/2.0.2.sql index b4d7a4c..f5e72cf 100644 --- a/hzims-service/gglm-big-model/src/main/resources/db/2.0.2.sql +++ b/hzims-service/gglm-big-model/src/main/resources/db/2.0.2.sql @@ -1,17 +1,123 @@ -CREATE TABLE `HZIMS_VECTOR_PARAM` ( - `ID` bigint(20) NOT NULL COMMENT '主键ID', - `NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '名称', - `URL` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'URL', - `PROJECT_PREFIX` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目前缀', - `TABLE_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '数据库表名', - `ATTRIBUTE_MAP` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '向量键值对', - `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID', - `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态', - `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', - `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', - `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', - `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '向量键值对信息' ROW_FORMAT = Dynamic; \ No newline at end of file +CREATE TABLE IF NOT EXISTS `gglm_vector_param` ( + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '名称', + `URL` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'URL', + `PROJECT_PREFIX` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目前缀', + `TABLE_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '数据库表名', + `ATTRIBUTE_MAP` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '向量键值对', + `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '备注', + `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', + `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + `SYNCHRONIZATION_TIME` datetime(0) NULL DEFAULT NULL COMMENT '同步时间', + `SYNCHRONIZATION_REMARK` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '同步说明', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '向量库配置信息' ROW_FORMAT = Dynamic; + +CREATE TABLE IF NOT EXISTS `gglm_vector_param_log` ( + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `VECTOR_PARAM_ID` bigint(20) NOT NULL COMMENT '参数id', + `CONTENT` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '日志内容', + `TYPE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '日志类型', + `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', + `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '向量数据库操作日志' ROW_FORMAT = Dynamic; + +CREATE TABLE IF NOT EXISTS `gglm_agent_log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `chat_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '每轮对话的id', + `q_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '问题ID', + `model_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'hx自用', + `agent` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'hx自用', + `q` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '问题', + `prompt` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '问题提示', + `system` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, + `a` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '答案', + `a_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '答案类型,0直接回答、1参数提取、2意图分类', + `user_conclusion` tinyint(4) NULL DEFAULT NULL COMMENT '用户结论,0为错误,1为正确', + `label_status` tinyint(4) NULL DEFAULT 0 COMMENT '标注状态,0为错误,1为正确', + `label_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '标注内容,json字符串', + `label_result` tinyint(4) NULL DEFAULT NULL COMMENT '标注结果,0为错误,1为正确', + `label_operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标注人名称', + `label_time` datetime(0) NULL DEFAULT NULL COMMENT '标注时间', + `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', + `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1833310958482192892 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; + +CREATE TABLE IF NOT EXISTS `knowledge_file_info` ( + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '名称', + `URL` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'URL', + `SIZE` bigint(18) NULL DEFAULT NULL COMMENT '文件大小', + `BRIEFS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '简介', + `TAGS` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '标签', + `DOMAIN` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '业务领域', + `AUTHORITY_CLASS` tinyint(4) NULL DEFAULT NULL COMMENT '权限等级,5个等级', + `VISIBLE` tinyint(4) NULL DEFAULT 1 COMMENT '是否可见,0为不可见,1为可见', + `FILE_STATUS` tinyint(4) NULL DEFAULT 0 COMMENT '文件状态,0为未入库,1为已入库,2为入库中', + `REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '备注', + `CREATE_USER_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建人名称', + `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', + `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '知识库文件信息表' ROW_FORMAT = Dynamic; + +CREATE TABLE IF NOT EXISTS `knowledge_file_segment` ( + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', + `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + `DOC_QS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL, + `DOC_CONTENT` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL, + `DOC_PAGE_INDEX` int(11) NULL DEFAULT NULL, + `DOC_ID` bigint(20) NULL DEFAULT NULL, + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '知识库文件分段表' ROW_FORMAT = Dynamic; + +CREATE TABLE IF NOT EXISTS `question_answer_comment` ( + `ID` bigint(20) NOT NULL COMMENT '主键ID', + `CHAT_ID` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '对话id', + `QUESTION_ID` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '问题id', + `USER_ID` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户id', + `PRAISE` tinyint(4) NULL DEFAULT 0 COMMENT '点赞', + `CONTENT` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL, + `TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID', + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位', + `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '问题评价' ROW_FORMAT = Dynamic; \ No newline at end of file diff --git a/hzims-service/operational/src/main/resources/db/3.0.5.sql b/hzims-service/operational/src/main/resources/db/3.0.5.sql new file mode 100644 index 0000000..49708e0 --- /dev/null +++ b/hzims-service/operational/src/main/resources/db/3.0.5.sql @@ -0,0 +1,3 @@ +-- 月报告添加结论修改和评价 +ALTER TABLE `hzims_run_month_report` ADD COLUMN `CONCLUSION` text NULL COMMENT '重新判定的结论'; +ALTER TABLE `hzims_run_month_report` ADD COLUMN `EVALUATION` text NULL COMMENT '评价'; \ No newline at end of file