feat(ops): 派单链路全程传递 assigneeName 和 assigneePhone
AssigneeRecommendation、OrderDispatchContext、OrderTransitionRequest 新增 assigneePhone 字段;DispatchEngineImpl 在三条派单路径中传递 phone;EventPublishHandler 将 assigneeName 和 assigneePhone 写入 事件 payload,修复下游监听器取不到 assigneeName 的问题。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -108,6 +108,7 @@ public class DispatchEngineImpl implements DispatchEngine {
|
||||
Long assigneeId = recommendation.getAssigneeId();
|
||||
context.setRecommendedAssigneeId(assigneeId);
|
||||
context.setRecommendedAssigneeName(recommendation.getAssigneeName());
|
||||
context.setRecommendedAssigneePhone(recommendation.getAssigneePhone());
|
||||
|
||||
log.info("分配决策完成: orderId={}, assigneeId={}, assigneeName={}, reason={}",
|
||||
context.getOrderId(), assigneeId, recommendation.getAssigneeName(), recommendation.getReason());
|
||||
@@ -371,6 +372,7 @@ public class DispatchEngineImpl implements DispatchEngine {
|
||||
.targetStatus(WorkOrderStatusEnum.DISPATCHED)
|
||||
.assigneeId(assigneeId)
|
||||
.assigneeName(context.getRecommendedAssigneeName())
|
||||
.assigneePhone(context.getRecommendedAssigneePhone())
|
||||
.queueId(queueDTO != null ? queueDTO.getId() : null)
|
||||
.operatorType(OperatorTypeEnum.SYSTEM)
|
||||
.operatorId(assigneeId)
|
||||
@@ -421,6 +423,7 @@ public class DispatchEngineImpl implements DispatchEngine {
|
||||
.orderId(context.getOrderId())
|
||||
.assigneeId(assigneeId)
|
||||
.assigneeName(context.getRecommendedAssigneeName())
|
||||
.assigneePhone(context.getRecommendedAssigneePhone())
|
||||
.operatorType(OperatorTypeEnum.SYSTEM)
|
||||
.operatorId(assigneeId)
|
||||
.reason("执行人忙碌,任务入队")
|
||||
@@ -451,6 +454,7 @@ public class DispatchEngineImpl implements DispatchEngine {
|
||||
.orderId(context.getOrderId())
|
||||
.assigneeId(assigneeId)
|
||||
.assigneeName(context.getRecommendedAssigneeName())
|
||||
.assigneePhone(context.getRecommendedAssigneePhone())
|
||||
.operatorType(OperatorTypeEnum.SYSTEM)
|
||||
.operatorId(assigneeId)
|
||||
.reason("执行人忙碌,任务入队")
|
||||
|
||||
@@ -28,6 +28,11 @@ public class AssigneeRecommendation {
|
||||
*/
|
||||
private String assigneeName;
|
||||
|
||||
/**
|
||||
* 推荐的执行人手机号
|
||||
*/
|
||||
private String assigneePhone;
|
||||
|
||||
/**
|
||||
* 推荐评分(0-100)
|
||||
* <p>
|
||||
|
||||
@@ -67,6 +67,11 @@ public class OrderDispatchContext {
|
||||
*/
|
||||
private String recommendedAssigneeName;
|
||||
|
||||
/**
|
||||
* 推荐的执行人手机号
|
||||
*/
|
||||
private String recommendedAssigneePhone;
|
||||
|
||||
/**
|
||||
* 分配的设备ID(冗余字段)
|
||||
* <p>
|
||||
|
||||
@@ -41,6 +41,12 @@ public class EventPublishHandler extends TransitionHandler {
|
||||
if (request.getAssigneeId() != null) {
|
||||
payload.put("assigneeId", request.getAssigneeId());
|
||||
}
|
||||
if (request.getAssigneeName() != null) {
|
||||
payload.put("assigneeName", request.getAssigneeName());
|
||||
}
|
||||
if (request.getAssigneePhone() != null) {
|
||||
payload.put("assigneePhone", request.getAssigneePhone());
|
||||
}
|
||||
// 添加 urgentOrderId(P0打断场景)
|
||||
if (request.getUrgentOrderId() != null) {
|
||||
payload.put("urgentOrderId", request.getUrgentOrderId());
|
||||
|
||||
@@ -45,6 +45,11 @@ public class OrderTransitionRequest {
|
||||
*/
|
||||
private String assigneeName;
|
||||
|
||||
/**
|
||||
* 执行人手机号(可选)
|
||||
*/
|
||||
private String assigneePhone;
|
||||
|
||||
/**
|
||||
* 操作人类型(可选)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user