Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Pangea-Agent
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
2
Merge Requests
2
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
Gavin-Group
Pangea-Agent
Commits
3b6f5b51
Commit
3b6f5b51
authored
Dec 30, 2025
by
youxiaoji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* [对于新会话返回form表单,旧会话不返回]
parent
7ac2809b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
20 deletions
+31
-20
DefaultReactExecutor.java
...java/pangea/hiagent/agent/react/DefaultReactExecutor.java
+6
-2
VisitorAppointmentTool.java
...java/pangea/hiagent/tool/impl/VisitorAppointmentTool.java
+25
-18
No files found.
backend/src/main/java/pangea/hiagent/agent/react/DefaultReactExecutor.java
View file @
3b6f5b51
...
...
@@ -176,13 +176,17 @@ public class DefaultReactExecutor implements ReactExecutor {
log
.
info
(
"agentTools {}"
,
agentTools
);
if
(
agent
.
getId
().
compareToIgnoreCase
(
"agent-8"
)
==
0
)
{
// if (!chatService.chatExists(tmpUserId, agent.getId())) {
boolean
chatExists
=
chatService
.
chatExists
(
tmpUserId
,
agent
.
getId
());
String
newChat
=
"yes"
;
if
(
chatExists
){
newChat
=
"no"
;
}
// log.info("new chat for {} {} ", userId, agent.getId());
prompt
=
buildPromptWithHistory
(
agent
.
getSystemPrompt
(),
userInput
,
agent
,
tmpUserId
,
true
);
//}
chatClient
.
prompt
(
prompt
)
.
tools
(
agentTools
.
toArray
())
.
toolContext
(
Map
.
of
(
"emitterId"
,
emitterId
,
"userId"
,
sseTokenEmitter
.
getUserId
(),
"agentId"
,
agent
.
getId
()))
.
toolContext
(
Map
.
of
(
"emitterId"
,
emitterId
,
"userId"
,
sseTokenEmitter
.
getUserId
(),
"agentId"
,
agent
.
getId
()
,
"newChat"
,
newChat
))
.
stream
()
.
chatResponse
()
.
subscribe
(
...
...
backend/src/main/java/pangea/hiagent/tool/impl/VisitorAppointmentTool.java
View file @
3b6f5b51
...
...
@@ -75,7 +75,7 @@ public class VisitorAppointmentTool {
// 登录状态有效期(毫秒),设置为30分钟
private
static
final
long
LOGIN_VALIDITY_PERIOD
=
30
*
60
*
1000
;
public
VisitorAppointmentTool
(
UserTokenService
userTokenService
,
AgentService
agentService
,
InfoCollectorService
infoCollectorService
,
UserSseService
userSseService
,
ChatService
chatService
)
{
public
VisitorAppointmentTool
(
UserTokenService
userTokenService
,
AgentService
agentService
,
InfoCollectorService
infoCollectorService
,
UserSseService
userSseService
,
ChatService
chatService
)
{
this
.
agentService
=
agentService
;
this
.
infoCollectorService
=
infoCollectorService
;
this
.
ssoToken
=
"33f667865c395f164d29487c15fe74bf76b463f2941ef6af55d14a35a11d60b1"
;
...
...
@@ -141,10 +141,11 @@ public class VisitorAppointmentTool {
log
.
error
(
"海信SSO认证工具的Playwright资源释放失败: "
,
e
);
}
}
private
String
setAccessToken
(
ToolContext
toolContext
)
{
String
userId
=
toolContext
.
getContext
().
get
(
"userId"
).
toString
();
log
.
info
(
"start set access token for {}"
,
userId
);
UserToken
userToken
=
userTokenService
.
getUserToken
(
userId
,
"pangea"
);
UserToken
userToken
=
userTokenService
.
getUserToken
(
userId
,
"pangea"
);
Cookie
tripCookie
=
new
Cookie
(
"jwtToken"
,
userToken
.
getTokenValue
());
tripCookie
.
setDomain
(
"vrms-proxy.hisense.com"
);
tripCookie
.
setPath
(
"/"
);
...
...
@@ -165,8 +166,6 @@ public class VisitorAppointmentTool {
// .setSources(true));
log
.
info
(
"submit apply info "
);
String
accessToken
=
setAccessToken
(
toolContext
);
JSONArray
jsonArray
=
infoCollectorService
.
getInfo
(
pageId
);
...
...
@@ -197,7 +196,7 @@ public class VisitorAppointmentTool {
String
fieldName
=
obj
.
getString
(
"field_name"
);
String
fieldValue
=
infoCollectorService
.
getValue
(
fieldName
).
toString
();
log
.
info
(
"fieldName {} fieldValue {} "
,
fieldName
,
fieldValue
);
log
.
info
(
"fieldName {} fieldValue {} "
,
fieldName
,
fieldValue
);
if
(
fieldName
.
compareToIgnoreCase
(
"访问园区"
)
==
0
)
{
parkValue
=
fieldValue
;
continue
;
...
...
@@ -234,7 +233,7 @@ public class VisitorAppointmentTool {
for
(
JSONObject
tmp
:
dateJson
)
{
String
fieldName
=
tmp
.
getString
(
"field_name"
);
String
fieldValue
=
infoCollectorService
.
getValue
(
fieldName
).
toString
();
String
fieldValue
=
infoCollectorService
.
getValue
(
fieldName
).
toString
();
String
[]
values
=
fieldValue
.
split
(
"-"
);
page
.
locator
(
".van-cell"
)
...
...
@@ -308,7 +307,7 @@ public class VisitorAppointmentTool {
infoCollectorService
.
saveValue
(
key
,
infos
.
get
(
key
));
});
infoCollectorService
.
saveDefaultValue
(
pageId
);
Map
<
String
,
String
>
keys
=
infoCollectorService
.
findLackInfo
(
pageId
);
Map
<
String
,
String
>
keys
=
infoCollectorService
.
findLackInfo
(
pageId
);
if
(!
keys
.
isEmpty
())
{
JSONArray
jsonArray
=
infoCollectorService
.
getInfo
(
pageId
);
JSONArray
lackJson
=
new
JSONArray
();
...
...
@@ -316,11 +315,11 @@ public class VisitorAppointmentTool {
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
tmp
=
jsonArray
.
getJSONObject
(
i
);
JSONObject
pangeJson
=
tmp
.
getJSONObject
(
"pangea_json"
);
if
(
infoCollectorService
.
getValue
(
tmp
.
getString
(
"field_name"
))
!=
null
)
{
if
(
infoCollectorService
.
getValue
(
tmp
.
getString
(
"field_name"
))
!=
null
)
{
pangeJson
.
getJSONObject
(
"props"
).
put
(
"value"
,
infoCollectorService
.
getValue
(
tmp
.
getString
(
"field_name"
)).
toString
());
}
if
(
tmp
.
getString
(
"field_name"
).
compareToIgnoreCase
(
"接访员工手机号"
)
==
0
||
tmp
.
getString
(
"field_name"
).
compareToIgnoreCase
(
"接访员工姓名"
)
==
0
)
{
if
(
tmp
.
getString
(
"field_name"
).
compareToIgnoreCase
(
"接访员工手机号"
)
==
0
||
tmp
.
getString
(
"field_name"
).
compareToIgnoreCase
(
"接访员工姓名"
)
==
0
)
{
continue
;
}
lackJson
.
add
(
pangeJson
);
...
...
@@ -335,7 +334,7 @@ public class VisitorAppointmentTool {
}
else
{
sb
.
append
(
"用户还有以下信息未提交:"
);
sb
.
append
(
"\n"
);
for
(
Map
.
Entry
<
String
,
String
>
key
:
keys
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
String
>
key
:
keys
.
entrySet
())
{
sb
.
append
(
key
.
getValue
());
sb
.
append
(
","
);
sb
.
append
(
"\n"
);
...
...
@@ -343,7 +342,7 @@ public class VisitorAppointmentTool {
sb
.
append
(
"提示用户继续提交信息"
);
}
log
.
info
(
"notice {}"
,
sb
.
toString
());
log
.
info
(
"notice {}"
,
sb
.
toString
());
return
sb
.
toString
();
}
...
...
@@ -368,14 +367,22 @@ public class VisitorAppointmentTool {
JSONArray
lackJson
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
tmp
=
jsonArray
.
getJSONObject
(
i
);
if
(
tmp
.
getString
(
"field_name"
).
compareToIgnoreCase
(
"接访员工手机号"
)
==
0
||
tmp
.
getString
(
"field_name"
).
compareToIgnoreCase
(
"接访员工姓名"
)
==
0
)
{
continue
;
}
lackJson
.
add
(
tmp
.
getJSONObject
(
"pangea_json"
));
}
JSONObject
formMessage
=
new
JSONObject
();
formMessage
.
put
(
"coms"
,
lackJson
);
try
{
sendFormMessage
(
formMessage
,
toolContext
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
boolean
newChat
=
toolContext
.
getContext
().
get
(
"newChat"
).
toString
().
compareToIgnoreCase
(
"yes"
)
==
0
;
log
.
info
(
"new chat {}"
,
newChat
);
if
(
newChat
)
{
try
{
sendFormMessage
(
formMessage
,
toolContext
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
stringBuilder
.
append
(
formMessage
.
toJSONString
());
stringBuilder
.
append
(
"提示用户以json格式提交信息;如果用户已提供部分信息,需要将这些信息与`props.name`属性的值进行匹配,并将匹配之后的信息以json格式提交到`applyInfoSave`以保存信息"
);
...
...
@@ -421,8 +428,8 @@ public class VisitorAppointmentTool {
JSONArray
result
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
tmp
=
jsonArray
.
getJSONObject
(
i
);
if
(
tmp
.
getString
(
"field_name"
).
compareToIgnoreCase
(
"接访员工手机号"
)
==
0
||
tmp
.
getString
(
"field_name"
).
compareToIgnoreCase
(
"接访员工姓名"
)
==
0
)
{
if
(
tmp
.
getString
(
"field_name"
).
compareToIgnoreCase
(
"接访员工手机号"
)
==
0
||
tmp
.
getString
(
"field_name"
).
compareToIgnoreCase
(
"接访员工姓名"
)
==
0
)
{
continue
;
}
result
.
add
(
tmp
);
...
...
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