diff --git a/backend/app/service/FeishuNotificationService.php b/backend/app/service/FeishuNotificationService.php index 9c91239..0cdec49 100644 --- a/backend/app/service/FeishuNotificationService.php +++ b/backend/app/service/FeishuNotificationService.php @@ -688,6 +688,18 @@ class FeishuNotificationService error_log("🔧 updateActorMessageCard 被调用: order_id={$orderId}, node_id={$nodeId}, actorUserId={$actorUserId}, status={$status}"); try { + // 检查是否已经更新过(防止重复更新) + $existingUpdate = \app\model\FeishuMessage::where('order_id', $orderId) + ->where('node_id', $nodeId) + ->where('user_id', $actorUserId) + ->where('status', \app\model\FeishuMessage::STATUS_UPDATED) + ->first(); + + if ($existingUpdate) { + error_log("⚠️ 操作人消息已被更新过,跳过重复更新: message_id={$existingUpdate->message_id}"); + return true; + } + // 获取该操作人的消息 $message = \app\model\FeishuMessage::where('order_id', $orderId) ->where('node_id', $nodeId) @@ -708,7 +720,7 @@ class FeishuNotificationService return false; } - error_log("🔍 准备更新操作人消息: message_id={$message->message_id}, company_id={$companyId}, feishu_app_id={$feishuAppId}"); + error_log("🔍 准备更新操作人消息: message_id={$message->message_id}, company_id={$companyId}, feishu_app_id={$feishu_app_id}"); // 使用该消息对应的飞书应用配置 $this->companyId = $companyId;