Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pms-dispatch-assistant
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
姜耀祖
pms-dispatch-assistant
Commits
f334acf4
Commit
f334acf4
authored
Apr 23, 2025
by
赵灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改配置
parent
94111bc4
Pipeline
#21078
passed with stages
in 3 minutes and 15 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
6 deletions
+80
-6
LangChainController.java
...chassistant/controller/langchain/LangChainController.java
+14
-2
ChatService.java
.../dispatchassistant/domain/langchain/chat/ChatService.java
+11
-0
IConversationsRepository.java
...nt/domain/langchain/history/IConversationsRepository.java
+5
-1
IMessagesRepository.java
...sistant/domain/langchain/history/IMessagesRepository.java
+6
-0
ConversationsRepository.java
...ant/infractructure/langchain/ConversationsRepository.java
+15
-0
MessagesRepository.java
...ssistant/infractructure/langchain/MessagesRepository.java
+16
-0
ai-chat.html
src/main/resources/static/pages/langchain/ai-chat.html
+2
-2
ai-chat-vue.js
src/main/resources/static/pages/langchain/js/ai-chat-vue.js
+11
-1
No files found.
src/main/java/com/infoepoch/pms/dispatchassistant/controller/langchain/LangChainController.java
View file @
f334acf4
...
@@ -378,9 +378,7 @@ public class LangChainController {
...
@@ -378,9 +378,7 @@ public class LangChainController {
chatService
.
updateMessage
(
messagesContent
);
chatService
.
updateMessage
(
messagesContent
);
if
(
connection
!=
null
)
{
if
(
connection
!=
null
)
{
connection
.
disconnect
();
connection
.
disconnect
();
logger
.
info
(
"关闭成功1"
);
}
}
logger
.
info
(
"关闭成功2"
);
}
}
}).
start
();
}).
start
();
...
@@ -754,4 +752,18 @@ public class LangChainController {
...
@@ -754,4 +752,18 @@ public class LangChainController {
List
<
Messages
>
mapList
=
chatService
.
conversationMessages
(
sessionId
);
List
<
Messages
>
mapList
=
chatService
.
conversationMessages
(
sessionId
);
return
Result
.
successData
(
mapList
);
return
Result
.
successData
(
mapList
);
}
}
//删除历史对话
/**
* 会话记录列表
*
* @param
* @return
*/
@PostMapping
(
"/deleteChat"
)
public
Result
deleteChat
(
@RequestBody
String
sessionId
)
{
chatService
.
deleteChat
(
sessionId
);
return
Result
.
successData
(
"删除成功"
);
}
}
}
src/main/java/com/infoepoch/pms/dispatchassistant/domain/langchain/chat/ChatService.java
View file @
f334acf4
...
@@ -284,6 +284,17 @@ public class ChatService {
...
@@ -284,6 +284,17 @@ public class ChatService {
return
messagesList
;
return
messagesList
;
}
}
//删除会话内容通过会话id
public
void
deleteChat
(
String
sessionId
)
{
try
{
iMessagesRepository
.
deleteBySessionId
(
sessionId
);
iConversationsRepository
.
deleteBySessionId
(
sessionId
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
Date
getToday
()
public
Date
getToday
()
{
{
...
...
src/main/java/com/infoepoch/pms/dispatchassistant/domain/langchain/history/IConversationsRepository.java
View file @
f334acf4
...
@@ -41,7 +41,11 @@ public interface IConversationsRepository {
...
@@ -41,7 +41,11 @@ public interface IConversationsRepository {
* @param: [id]
* @param: [id]
*/
*/
boolean
delete
(
String
id
);
boolean
delete
(
String
id
);
/**
* 删除
* @param: [id]
*/
boolean
deleteBySessionId
(
String
sessionId
);
// region select
// region select
/**
/**
...
...
src/main/java/com/infoepoch/pms/dispatchassistant/domain/langchain/history/IMessagesRepository.java
View file @
f334acf4
...
@@ -41,6 +41,12 @@ public interface IMessagesRepository {
...
@@ -41,6 +41,12 @@ public interface IMessagesRepository {
*/
*/
boolean
delete
(
String
id
);
boolean
delete
(
String
id
);
/**
* 删除
* @param: [id]
*/
boolean
deleteBySessionId
(
String
sessionId
);
// region select
// region select
/**
/**
...
...
src/main/java/com/infoepoch/pms/dispatchassistant/infractructure/langchain/ConversationsRepository.java
View file @
f334acf4
...
@@ -154,6 +154,21 @@ public class ConversationsRepository implements IConversationsRepository {
...
@@ -154,6 +154,21 @@ public class ConversationsRepository implements IConversationsRepository {
return
result
>
0
;
return
result
>
0
;
}
}
/**
* 删除
*/
@Override
public
boolean
deleteBySessionId
(
String
sessionId
)
{
String
sql
=
"DELETE FROM T_CONVERSATIONS WHERE C_SESSION_ID = ?"
;
int
result
=
0
;
try
{
result
=
jdbcTemplate
.
update
(
sql
,
sessionId
);
}
catch
(
Exception
e
)
{
LogHelper
.
info
(
e
.
getMessage
());
//throw new ServiceException("删除 数据 失败。");
}
return
result
>
0
;
}
/**
/**
* 根据Id查询
* 根据Id查询
*/
*/
...
...
src/main/java/com/infoepoch/pms/dispatchassistant/infractructure/langchain/MessagesRepository.java
View file @
f334acf4
...
@@ -151,6 +151,22 @@ public class MessagesRepository implements IMessagesRepository {
...
@@ -151,6 +151,22 @@ public class MessagesRepository implements IMessagesRepository {
return
result
>
0
;
return
result
>
0
;
}
}
/**
* 删除
*/
@Override
public
boolean
deleteBySessionId
(
String
sessionId
)
{
String
sql
=
"DELETE FROM T_MESSAGES WHERE M_SESSION_ID = ?"
;
int
result
=
0
;
try
{
result
=
jdbcTemplate
.
update
(
sql
,
sessionId
);
}
catch
(
Exception
e
)
{
LogHelper
.
info
(
e
.
getMessage
());
//throw new ServiceException("删除 数据 失败。");
}
return
result
>
0
;
}
/**
/**
* 根据Id查询
* 根据Id查询
*/
*/
...
...
src/main/resources/static/pages/langchain/ai-chat.html
View file @
f334acf4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<html
lang=
"zh-CN"
>
<html
lang=
"zh-CN"
>
<head>
<head>
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<title>
AI智能对话
</title>
<title>
推荐专家智能助手
</title>
<link
rel=
"stylesheet"
href=
"style/ai-chat.css"
>
<link
rel=
"stylesheet"
href=
"style/ai-chat.css"
>
<style>
<style>
[
v-cloak
]
{
[
v-cloak
]
{
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<!-- 左侧历史对话列表 -->
<!-- 左侧历史对话列表 -->
<div
class=
"sidebar"
>
<div
class=
"sidebar"
>
<div
class=
"sidebar-header"
>
<div
class=
"sidebar-header"
>
<h1>
专家推荐
智能助手
</h1>
<h1>
推荐专家
智能助手
</h1>
<!-- 添加主题切换按钮 -->
<!-- 添加主题切换按钮 -->
<div
id=
"theme-toggle"
class=
"theme-toggle"
title=
"切换主题"
@
click=
"toggleTheme"
>
<div
id=
"theme-toggle"
class=
"theme-toggle"
title=
"切换主题"
@
click=
"toggleTheme"
>
<svg
id=
"light-icon"
viewBox=
"0 0 24 24"
:style=
"{display: isDarkTheme ? 'block' : 'none'}"
>
<svg
id=
"light-icon"
viewBox=
"0 0 24 24"
:style=
"{display: isDarkTheme ? 'block' : 'none'}"
>
...
...
src/main/resources/static/pages/langchain/js/ai-chat-vue.js
View file @
f334acf4
...
@@ -233,7 +233,7 @@ require(['jquery', 'vue', 'utils','marked','markdown', 'global'], function ($, V
...
@@ -233,7 +233,7 @@ require(['jquery', 'vue', 'utils','marked','markdown', 'global'], function ($, V
const
data
=
JSON
.
parse
(
event
.
data
);
const
data
=
JSON
.
parse
(
event
.
data
);
const
content
=
data
.
dataToSend
[
1
].
data
;
const
content
=
data
.
dataToSend
[
1
].
data
;
if
(
content
!==
"stop"
)
{
if
(
content
!==
"stop"
)
{
const
match
=
content
.
match
(
/SUGGEST
#
\[(
.*
?)\]
#
SUGGEST/
);
const
match
=
content
.
match
(
/SUGGEST
\[(
.*
?)\]
SUGGEST/
);
if
(
match
)
{
if
(
match
)
{
const
suggestionsJson
=
`[
${
match
[
1
]}
]`
;
const
suggestionsJson
=
`[
${
match
[
1
]}
]`
;
const
suggestions
=
JSON
.
parse
(
suggestionsJson
);
const
suggestions
=
JSON
.
parse
(
suggestionsJson
);
...
@@ -372,6 +372,16 @@ require(['jquery', 'vue', 'utils','marked','markdown', 'global'], function ($, V
...
@@ -372,6 +372,16 @@ require(['jquery', 'vue', 'utils','marked','markdown', 'global'], function ($, V
if
(
isActiveChat
)
{
if
(
isActiveChat
)
{
this
.
clearChat
();
this
.
clearChat
();
}
}
$
.
ajax
({
url
:
"../../api/langchain/deleteChat"
,
type
:
"post"
,
dataType
:
"json"
,
contentType
:
"application/json;charset=UTF-8"
,
data
:
chatId
,
async
:
false
,
success
:
function
(
data
)
{
}
});
},
},
// 专家选择相关方法
// 专家选择相关方法
toggleExpertDropdown
()
{
toggleExpertDropdown
()
{
...
...
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