Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ask_data_ai_admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linyangyang
ask_data_ai_admin
Commits
6d3e0d7c
Commit
6d3e0d7c
authored
Jul 22, 2025
by
林洋洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改分页
parent
234f9289
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
17 deletions
+30
-17
AskVectorStoreController.java
...ain/java/com/ask/controller/AskVectorStoreController.java
+3
-2
ChatConversationController.java
...n/java/com/ask/controller/ChatConversationController.java
+2
-1
ChatConversationDetailController.java
.../com/ask/controller/ChatConversationDetailController.java
+2
-1
KnowledgeBaseController.java
...main/java/com/ask/controller/KnowledgeBaseController.java
+3
-2
KnowledgeDocumentController.java
.../java/com/ask/controller/KnowledgeDocumentController.java
+2
-1
ExcelTools.java
...k-data-ai-biz/src/main/java/com/ask/tools/ExcelTools.java
+2
-2
application.yml
...ta-ai/ask-data-ai-boot/src/main/resources/application.yml
+1
-1
科环集团电力运营日报模板.docx
...-ai/ask-data-ai-boot/src/main/resources/科环集团电力运营日报模板.docx
+0
-0
MybatisPlusConfig.java
...rc/main/java/com/ask/common/config/MybatisPlusConfig.java
+15
-7
No files found.
ask-data-ai/ask-data-ai-biz/src/main/java/com/ask/controller/AskVectorStoreController.java
View file @
6d3e0d7c
...
@@ -15,6 +15,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
...
@@ -15,6 +15,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpServletRequest
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springdoc.core.annotations.ParameterObject
;
import
org.springframework.ai.vectorstore.VectorStore
;
import
org.springframework.ai.vectorstore.VectorStore
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -51,7 +52,7 @@ public class AskVectorStoreController {
...
@@ -51,7 +52,7 @@ public class AskVectorStoreController {
*/
*/
@Operation
(
summary
=
"分页查询向量存储"
,
description
=
"分页查询向量存储数据(不包含向量字段)"
)
@Operation
(
summary
=
"分页查询向量存储"
,
description
=
"分页查询向量存储数据(不包含向量字段)"
)
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
AskVectorStore
>>
getPage
(
Page
page
,
public
R
<
IPage
<
AskVectorStore
>>
getPage
(
@ParameterObject
Page
page
,
@Parameter
(
description
=
"文档ID"
)
@RequestParam
Long
documentId
,
@Parameter
(
description
=
"文档ID"
)
@RequestParam
Long
documentId
,
@Parameter
(
description
=
"内容关键词"
)
@RequestParam
(
required
=
false
)
String
content
,
@Parameter
(
description
=
"内容关键词"
)
@RequestParam
(
required
=
false
)
String
content
,
@Parameter
(
description
=
"标题关键词"
)
@RequestParam
(
required
=
false
)
String
title
@Parameter
(
description
=
"标题关键词"
)
@RequestParam
(
required
=
false
)
String
title
...
@@ -142,7 +143,7 @@ public class AskVectorStoreController {
...
@@ -142,7 +143,7 @@ public class AskVectorStoreController {
return
R
.
failed
(
"ID列表不能为空"
);
return
R
.
failed
(
"ID列表不能为空"
);
}
}
try
{
try
{
vectorStore
.
delete
(
ids
);
vectorStore
.
delete
(
ids
);
return
R
.
ok
(
true
);
return
R
.
ok
(
true
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"批量删除向量存储失败,IDs: {}, 错误: {}"
,
ids
,
e
.
getMessage
(),
e
);
log
.
error
(
"批量删除向量存储失败,IDs: {}, 错误: {}"
,
ids
,
e
.
getMessage
(),
e
);
...
...
ask-data-ai/ask-data-ai-biz/src/main/java/com/ask/controller/ChatConversationController.java
View file @
6d3e0d7c
...
@@ -13,6 +13,7 @@ import jakarta.servlet.http.Cookie;
...
@@ -13,6 +13,7 @@ import jakarta.servlet.http.Cookie;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpServletResponse
;
import
jakarta.servlet.http.HttpServletResponse
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springdoc.core.annotations.ParameterObject
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -80,7 +81,7 @@ public class ChatConversationController {
...
@@ -80,7 +81,7 @@ public class ChatConversationController {
*/
*/
@Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
ChatConversation
>>
getPage
(
@Parameter
(
description
=
"分页对象"
)
Page
page
,
public
R
<
IPage
<
ChatConversation
>>
getPage
(
@Parameter
(
description
=
"分页对象"
)
@ParameterObject
Page
page
,
@Parameter
(
description
=
"智能体Id"
)
@RequestParam
(
required
=
false
)
Integer
agentId
,
@Parameter
(
description
=
"智能体Id"
)
@RequestParam
(
required
=
false
)
Integer
agentId
,
@Parameter
(
description
=
"用户ID"
)
@RequestParam
Long
userId
)
{
@Parameter
(
description
=
"用户ID"
)
@RequestParam
Long
userId
)
{
if
(
Objects
.
isNull
(
userId
)){
if
(
Objects
.
isNull
(
userId
)){
...
...
ask-data-ai/ask-data-ai-biz/src/main/java/com/ask/controller/ChatConversationDetailController.java
View file @
6d3e0d7c
...
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springdoc.core.annotations.ParameterObject
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -39,7 +40,7 @@ public class ChatConversationDetailController {
...
@@ -39,7 +40,7 @@ public class ChatConversationDetailController {
*/
*/
@Operation
(
summary
=
"根据会话ID分页获取对话详情"
,
description
=
"根据会话ID分页获取对话详情"
)
@Operation
(
summary
=
"根据会话ID分页获取对话详情"
,
description
=
"根据会话ID分页获取对话详情"
)
@GetMapping
(
"/page/{conversationId}"
)
@GetMapping
(
"/page/{conversationId}"
)
public
R
<
IPage
<
ChatConversationDetail
>>
pageByConversationId
(
Page
page
,
@PathVariable
String
conversationId
)
{
public
R
<
IPage
<
ChatConversationDetail
>>
pageByConversationId
(
@ParameterObject
Page
page
,
@PathVariable
String
conversationId
)
{
IPage
<
ChatConversationDetail
>
result
=
chatConversationDetailService
.
page
(
page
,
Wrappers
.<
ChatConversationDetail
>
lambdaQuery
()
IPage
<
ChatConversationDetail
>
result
=
chatConversationDetailService
.
page
(
page
,
Wrappers
.<
ChatConversationDetail
>
lambdaQuery
()
.
eq
(
ChatConversationDetail:
:
getConversationId
,
conversationId
)
.
eq
(
ChatConversationDetail:
:
getConversationId
,
conversationId
)
.
orderByAsc
(
ChatConversationDetail:
:
getTimestamp
));
.
orderByAsc
(
ChatConversationDetail:
:
getTimestamp
));
...
...
ask-data-ai/ask-data-ai-biz/src/main/java/com/ask/controller/KnowledgeBaseController.java
View file @
6d3e0d7c
...
@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.Parameter;
...
@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.Parameter;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springdoc.core.annotations.ParameterObject
;
import
org.springframework.ai.document.Document
;
import
org.springframework.ai.document.Document
;
import
org.springframework.ai.vectorstore.SearchRequest
;
import
org.springframework.ai.vectorstore.SearchRequest
;
import
org.springframework.ai.vectorstore.VectorStore
;
import
org.springframework.ai.vectorstore.VectorStore
;
...
@@ -48,8 +49,8 @@ public class KnowledgeBaseController {
...
@@ -48,8 +49,8 @@ public class KnowledgeBaseController {
*/
*/
@Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
KnowledgeBase
>>
getPage
(
@Parameter
(
description
=
"分页对象"
)
Page
page
,
public
R
<
IPage
<
KnowledgeBase
>>
getPage
(
@Parameter
(
description
=
"分页对象"
)
@ParameterObject
Page
page
,
@Parameter
(
description
=
"查询条件"
)
KnowledgeBase
knowledgeBase
)
{
@Parameter
(
description
=
"查询条件"
)
@ParameterObject
KnowledgeBase
knowledgeBase
)
{
return
R
.
ok
(
knowledgeBaseService
.
page
(
page
,
Wrappers
.
query
(
knowledgeBase
)));
return
R
.
ok
(
knowledgeBaseService
.
page
(
page
,
Wrappers
.
query
(
knowledgeBase
)));
}
}
...
...
ask-data-ai/ask-data-ai-biz/src/main/java/com/ask/controller/KnowledgeDocumentController.java
View file @
6d3e0d7c
...
@@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
...
@@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springdoc.core.annotations.ParameterObject
;
import
org.springframework.ai.vectorstore.VectorStore
;
import
org.springframework.ai.vectorstore.VectorStore
;
import
org.springframework.ai.vectorstore.filter.Filter
;
import
org.springframework.ai.vectorstore.filter.Filter
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
...
@@ -63,7 +64,7 @@ public class KnowledgeDocumentController {
...
@@ -63,7 +64,7 @@ public class KnowledgeDocumentController {
*/
*/
@Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
KnowledgeDocument
>>
getPage
(
Page
page
,
public
R
<
IPage
<
KnowledgeDocument
>>
getPage
(
@ParameterObject
Page
page
,
@Parameter
(
description
=
"知识库id"
)
@RequestParam
Long
knowledgeBaseId
,
@Parameter
(
description
=
"知识库id"
)
@RequestParam
Long
knowledgeBaseId
,
@Parameter
(
description
=
"文档名称"
)
@RequestParam
(
required
=
false
)
String
name
)
{
@Parameter
(
description
=
"文档名称"
)
@RequestParam
(
required
=
false
)
String
name
)
{
LambdaQueryWrapper
<
KnowledgeDocument
>
wrapper
=
Wrappers
.
lambdaQuery
();
LambdaQueryWrapper
<
KnowledgeDocument
>
wrapper
=
Wrappers
.
lambdaQuery
();
...
...
ask-data-ai/ask-data-ai-biz/src/main/java/com/ask/tools/ExcelTools.java
View file @
6d3e0d7c
...
@@ -55,13 +55,13 @@ public class ExcelTools {
...
@@ -55,13 +55,13 @@ public class ExcelTools {
paramMap
.
put
(
"year"
,
date
.
getYear
());
paramMap
.
put
(
"year"
,
date
.
getYear
());
paramMap
.
put
(
"month"
,
date
.
getMonthValue
());
paramMap
.
put
(
"month"
,
date
.
getMonthValue
());
paramMap
.
put
(
"day"
,
date
.
getDayOfMonth
());
paramMap
.
put
(
"day"
,
date
.
getDayOfMonth
());
String
bucketName
=
"report
/production
"
;
String
bucketName
=
"report"
;
boolean
result
=
convertUtils
.
fillWordLoop
(
fileName
,
"科环集团电力运营日报模板.docx"
,
paramMap
,
bucketName
);
boolean
result
=
convertUtils
.
fillWordLoop
(
fileName
,
"科环集团电力运营日报模板.docx"
,
paramMap
,
bucketName
);
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
if
(
result
){
if
(
result
){
jsonObject
.
set
(
"success"
,
true
);
jsonObject
.
set
(
"success"
,
true
);
jsonObject
.
set
(
"fileName"
,
fileName
);
jsonObject
.
set
(
"fileName"
,
fileName
);
jsonObject
.
set
(
"filePath"
,
"/admin/"
+
bucketName
+
"/"
+
fileName
);
jsonObject
.
set
(
"filePath"
,
"/admin/
sys-file/
"
+
bucketName
+
"/"
+
fileName
);
}
else
{
}
else
{
jsonObject
.
set
(
"success"
,
false
);
jsonObject
.
set
(
"success"
,
false
);
jsonObject
.
set
(
"fileName"
,
""
);
jsonObject
.
set
(
"fileName"
,
""
);
...
...
ask-data-ai/ask-data-ai-boot/src/main/resources/application.yml
View file @
6d3e0d7c
...
@@ -13,7 +13,7 @@ spring:
...
@@ -13,7 +13,7 @@ spring:
max-request-size
:
500MB
# 请求最大大小
max-request-size
:
500MB
# 请求最大大小
file-size-threshold
:
0
# 文件写入磁盘的阈值
file-size-threshold
:
0
# 文件写入磁盘的阈值
datasource
:
datasource
:
url
:
jdbc:postgresql://8
1.70.183.25:2
5432/ask_data_ai_db?stringtype=unspecified
url
:
jdbc:postgresql://8
.152.98.45:
5432/ask_data_ai_db?stringtype=unspecified
username
:
postgres
username
:
postgres
password
:
postgres123
password
:
postgres123
driver-class-name
:
org.postgresql.Driver
driver-class-name
:
org.postgresql.Driver
...
...
ask-data-ai/ask-data-ai-boot/src/main/resources/科环集团电力运营日报模板.docx
0 → 100644
View file @
6d3e0d7c
File added
ask-data-ai/ask-data-ai-common/src/main/java/com/ask/common/config/MybatisPlusConfig.java
View file @
6d3e0d7c
...
@@ -2,23 +2,31 @@ package com.ask.common.config;
...
@@ -2,23 +2,31 @@ package com.ask.common.config;
import
com.baomidou.mybatisplus.annotation.DbType
;
import
com.baomidou.mybatisplus.annotation.DbType
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
;
import
org.springframework.boot.autoconfigure.AutoConfiguration
;
import
org.springframework.boot.autoconfigure.AutoConfiguration
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
/**
/**
* MybatisPlus配置
* MybatisPlus配置
*/
*/
@AutoConfiguration
@Configuration
public
class
MybatisPlusConfig
{
@EnableTransactionManagement
public
class
MybatisPlusConfig
{
/**
* 分页插件
*/
@Bean
@Bean
public
MybatisPlusInterceptor
mybatisPlusInterceptor
()
{
public
MybatisPlusInterceptor
mybatisPlusInterceptor
()
{
MybatisPlusInterceptor
interceptor
=
new
MybatisPlusInterceptor
();
MybatisPlusInterceptor
interceptor
=
new
MybatisPlusInterceptor
();
interceptor
.
addInnerInterceptor
(
new
PaginationInnerInterceptor
(
DbType
.
POSTGRE_SQL
));
PaginationInnerInterceptor
paginationInnerInterceptor
=
new
PaginationInnerInterceptor
();
paginationInnerInterceptor
.
setOptimizeJoin
(
true
);
paginationInnerInterceptor
.
setDbType
(
DbType
.
POSTGRE_SQL
);
paginationInnerInterceptor
.
setOverflow
(
true
);
interceptor
.
addInnerInterceptor
(
paginationInnerInterceptor
);
OptimisticLockerInnerInterceptor
optimisticLockerInnerInterceptor
=
new
OptimisticLockerInnerInterceptor
();
interceptor
.
addInnerInterceptor
(
optimisticLockerInnerInterceptor
);
return
interceptor
;
return
interceptor
;
}
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment