mirror of
https://gitee.com/270580156/weiyu.git
synced 2025-12-30 10:52:26 +00:00
update
This commit is contained in:
@@ -284,8 +284,8 @@ public class AgentThreadRoutingStrategy extends AbstractThreadRoutingStrategy {
|
||||
log.debug("获取最新线程状态并更新为聊天状态");
|
||||
ThreadEntity thread = getThreadByUid(threadFromRequest.getUid());
|
||||
String tip = getAgentWelcomeMessage(agent);
|
||||
WelcomeContent wc = WelcomeContentUtils.buildAgentWelcomeContent(agent, tip);
|
||||
String jsonWelcome = wc != null ? wc.toJson() : null;
|
||||
WelcomeContent welcomeContent = WelcomeContentUtils.buildAgentWelcomeContent(agent, tip);
|
||||
String jsonWelcome = welcomeContent != null ? welcomeContent.toJson() : null;
|
||||
thread.setChatting().setContent(jsonWelcome);
|
||||
log.debug("线程状态更新完成 - 状态: {}, 欢迎消息长度: {}",
|
||||
thread.getStatus(), jsonWelcome != null ? jsonWelcome.length() : 0);
|
||||
@@ -309,7 +309,7 @@ public class AgentThreadRoutingStrategy extends AbstractThreadRoutingStrategy {
|
||||
// 发送欢迎消息
|
||||
log.debug("开始发送欢迎消息");
|
||||
long msgStartTime = System.currentTimeMillis();
|
||||
MessageProtobuf messageProtobuf = ThreadMessageUtil.getThreadWelcomeMessage(wc, savedThread);
|
||||
MessageProtobuf messageProtobuf = ThreadMessageUtil.getThreadWelcomeMessage(welcomeContent, savedThread);
|
||||
messageSendService.sendProtobufMessage(messageProtobuf);
|
||||
log.info("可用客服处理完成 - threadUid: {}, agentUid: {}, 消息发送耗时: {}ms, 总处理耗时: {}ms",
|
||||
savedThread.getUid(), agent.getUid(), System.currentTimeMillis() - msgStartTime,
|
||||
|
||||
@@ -179,8 +179,8 @@ public class RobotThreadRoutingStrategy extends AbstractThreadRoutingStrategy {
|
||||
|
||||
// 2. 配置线程状态
|
||||
String tip = getRobotWelcomeMessage(robotEntity);
|
||||
WelcomeContent wc = WelcomeContentUtils.buildRobotWelcomeContent(robotEntity, tip);
|
||||
thread.setRoboting().setContent(wc != null ? wc.toJson() : null);
|
||||
WelcomeContent welcomeContent = WelcomeContentUtils.buildRobotWelcomeContent(robotEntity, tip);
|
||||
thread.setRoboting().setContent(welcomeContent != null ? welcomeContent.toJson() : null);
|
||||
|
||||
// 3. 设置机器人信息
|
||||
String robotString = ConvertAiUtils.convertToRobotProtobufString(robotEntity);
|
||||
@@ -196,7 +196,7 @@ public class RobotThreadRoutingStrategy extends AbstractThreadRoutingStrategy {
|
||||
publishRobotThreadEvent(savedThread);
|
||||
|
||||
// 7. 创建并保存欢迎消息
|
||||
return createAndSaveWelcomeMessage(wc, savedThread);
|
||||
return createAndSaveWelcomeMessage(welcomeContent, savedThread);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -497,9 +497,9 @@ public class WorkgroupThreadRoutingStrategy extends AbstractThreadRoutingStrateg
|
||||
ThreadEntity thread = getThreadByUid(threadFromRequest.getUid());
|
||||
|
||||
// 设置欢迎内容和线程状态
|
||||
String welcomeContent = getAgentWelcomeMessage(agentEntity);
|
||||
String welcomeTip = getAgentWelcomeMessage(agentEntity);
|
||||
thread.setUserUid(agentEntity.getUid());
|
||||
thread.setChatting().setContent(welcomeContent);
|
||||
thread.setChatting().setContent(welcomeTip);
|
||||
|
||||
// 设置线程所有者
|
||||
setThreadOwner(thread, agentEntity);
|
||||
@@ -518,8 +518,8 @@ public class WorkgroupThreadRoutingStrategy extends AbstractThreadRoutingStrateg
|
||||
publishWorkgroupThreadEvents(savedThread);
|
||||
|
||||
// 发送欢迎消息(结构化 WelcomeContent)
|
||||
WelcomeContent wc = WelcomeContentUtils.buildAgentWelcomeContent(agentEntity);
|
||||
MessageProtobuf messageProtobuf = ThreadMessageUtil.getThreadWelcomeMessage(wc, savedThread);
|
||||
WelcomeContent welcomeContent = WelcomeContentUtils.buildAgentWelcomeContent(agentEntity);
|
||||
MessageProtobuf messageProtobuf = ThreadMessageUtil.getThreadWelcomeMessage(welcomeContent, savedThread);
|
||||
messageSendService.sendProtobufMessage(messageProtobuf);
|
||||
|
||||
return messageProtobuf;
|
||||
|
||||
Reference in New Issue
Block a user