mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-10 18:27:07 +00:00
pdf文件解析成异步处理
This commit is contained in:
@@ -3,6 +3,7 @@ package org.ruoyi;
|
|||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动程序
|
* 启动程序
|
||||||
@@ -10,6 +11,7 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt
|
|||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
public class RuoYiAIApplication {
|
public class RuoYiAIApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.ruoyi.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Date: 2025/5/14 下午2:04
|
||||||
|
*/
|
||||||
|
public class DealStatus {
|
||||||
|
//未开始
|
||||||
|
public static final Integer STATUS_10 = 10;
|
||||||
|
//进行中
|
||||||
|
public static final Integer STATUS_20 = 20;
|
||||||
|
//已结束
|
||||||
|
public static final Integer STATUS_30 = 30;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -18,44 +18,66 @@ import java.io.Serial;
|
|||||||
@TableName("knowledge_attach")
|
@TableName("knowledge_attach")
|
||||||
public class KnowledgeAttach extends BaseEntity {
|
public class KnowledgeAttach extends BaseEntity {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@TableId(value = "id")
|
@TableId(value = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 知识库ID
|
* 知识库ID
|
||||||
*/
|
*/
|
||||||
private String kid;
|
private String kid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档ID
|
* 文档ID
|
||||||
*/
|
*/
|
||||||
private String docId;
|
private String docId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档名称
|
* 文档名称
|
||||||
*/
|
*/
|
||||||
private String docName;
|
private String docName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档类型
|
* 文档类型
|
||||||
*/
|
*/
|
||||||
private String docType;
|
private String docType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档内容
|
* 文档内容
|
||||||
*/
|
*/
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象存储主键
|
||||||
|
*/
|
||||||
|
private Long ossId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拆解图片状态10未开始,20进行中,30已完成
|
||||||
|
*/
|
||||||
|
private Integer picStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分析图片状态10未开始,20进行中,30已完成
|
||||||
|
*/
|
||||||
|
private Integer picAnysStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 写入向量数据库状态10未开始,20进行中,30已完成
|
||||||
|
*/
|
||||||
|
private Integer vectorStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,47 +20,72 @@ import jakarta.validation.constraints.*;
|
|||||||
@AutoMapper(target = KnowledgeAttach.class, reverseConvertGenerate = false)
|
@AutoMapper(target = KnowledgeAttach.class, reverseConvertGenerate = false)
|
||||||
public class KnowledgeAttachBo extends BaseEntity {
|
public class KnowledgeAttachBo extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
@NotNull(message = "不能为空", groups = {EditGroup.class})
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 知识库ID
|
* 知识库ID
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "知识库ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "知识库ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String kid;
|
private String kid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档ID
|
* 文档ID
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "文档ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "文档ID不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String docId;
|
private String docId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档名称
|
* 文档名称
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "文档名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "文档名称不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String docName;
|
private String docName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档类型
|
* 文档类型
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "文档类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "文档类型不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String docType;
|
private String docType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档内容
|
* 文档内容
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "文档内容不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "文档内容不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "备注不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象存储主键
|
||||||
|
*/
|
||||||
|
@NotNull(message = "对象存储主键不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private Long ossId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拆解图片状态10未开始,20进行中,30已完成
|
||||||
|
*/
|
||||||
|
@NotNull(message = "拆解图片状态10未开始,20进行中,30已完成不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Integer picStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分析图片状态10未开始,20进行中,30已完成
|
||||||
|
*/
|
||||||
|
@NotNull(message = "分析图片状态10未开始,20进行中,30已完成不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Integer picAnysStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 写入向量数据库状态10未开始,20进行中,30已完成
|
||||||
|
*/
|
||||||
|
@NotNull(message = "写入向量数据库状态10未开始,20进行中,30已完成不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Integer vectorStatus;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import java.io.Serial;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 知识库附件视图对象 knowledge_attach
|
* 知识库附件视图对象 knowledge_attach
|
||||||
*
|
*
|
||||||
@@ -23,50 +21,74 @@ import java.io.Serializable;
|
|||||||
@AutoMapper(target = KnowledgeAttach.class)
|
@AutoMapper(target = KnowledgeAttach.class)
|
||||||
public class KnowledgeAttachVo implements Serializable {
|
public class KnowledgeAttachVo implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "")
|
@ExcelProperty(value = "")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 知识库ID
|
* 知识库ID
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "知识库ID")
|
@ExcelProperty(value = "知识库ID")
|
||||||
private String kid;
|
private String kid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档ID
|
* 文档ID
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "文档ID")
|
@ExcelProperty(value = "文档ID")
|
||||||
private String docId;
|
private String docId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档名称
|
* 文档名称
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "文档名称")
|
@ExcelProperty(value = "文档名称")
|
||||||
private String docName;
|
private String docName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档类型
|
* 文档类型
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "文档类型")
|
@ExcelProperty(value = "文档类型")
|
||||||
private String docType;
|
private String docType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文档内容
|
* 文档内容
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "文档内容")
|
@ExcelProperty(value = "文档内容")
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "备注")
|
@ExcelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象存储主键
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "对象存储主键")
|
||||||
|
private Long ossId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拆解图片状态10未开始,20进行中,30已完成
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "拆解图片状态10未开始,20进行中,30已完成")
|
||||||
|
private Integer picStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分析图片状态10未开始,20进行中,30已完成
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "分析图片状态10未开始,20进行中,30已完成")
|
||||||
|
private Integer picAnysStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 写入向量数据库状态10未开始,20进行中,30已完成
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "写入向量数据库状态10未开始,20进行中,30已完成")
|
||||||
|
private Integer vectorStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,5 +61,5 @@ public interface IKnowledgeInfoService {
|
|||||||
/**
|
/**
|
||||||
* 上传附件
|
* 上传附件
|
||||||
*/
|
*/
|
||||||
void upload(KnowledgeInfoUploadBo bo);
|
void upload(KnowledgeInfoUploadBo bo) throws Exception;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class KnowledgeController extends BaseController {
|
|||||||
* 上传知识库附件
|
* 上传知识库附件
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/attach/upload")
|
@PostMapping(value = "/attach/upload")
|
||||||
public R<String> upload(KnowledgeInfoUploadBo bo) {
|
public R<String> upload(KnowledgeInfoUploadBo bo) throws Exception {
|
||||||
knowledgeInfoService.upload(bo);
|
knowledgeInfoService.upload(bo);
|
||||||
return R.ok("上传知识库附件成功!");
|
return R.ok("上传知识库附件成功!");
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
6
script/sql/update/202505141010.sql
Normal file
6
script/sql/update/202505141010.sql
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
ALTER TABLE `knowledge_attach`
|
||||||
|
ADD COLUMN `pic_status` tinyint(1) NOT NULL DEFAULT 10 COMMENT '拆解图片状态10未开始,20进行中,30已完成' AFTER `oss_id`,
|
||||||
|
ADD COLUMN `pic_anys_status` tinyint(1) NOT NULL DEFAULT 10 COMMENT '分析图片状态10未开始,20进行中,30已完成' AFTER `pic_status`,
|
||||||
|
ADD COLUMN `vector_status` tinyint(1) NOT NULL DEFAULT 10 COMMENT '写入向量数据库状态10未开始,20进行中,30已完成' AFTER `pic_anys_status`,
|
||||||
|
DROP PRIMARY KEY,
|
||||||
|
ADD PRIMARY KEY (`id`) USING BTREE;
|
||||||
Reference in New Issue
Block a user