wanshenmean
2 天以前 05999b9c77f009ac9a7e98366bc3d23fbb8e83e7
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
@@ -169,6 +169,9 @@
                bool isFlowA = task.RobotSourceAddressLineCode is "11001" or "11010";
                await _taskProcessor.SendSocketRobotNumAsync(task, state, false);
                Thread.Sleep(500);
                // ==================== Phase 2: 放正常电芯到目标托盘(两流向相同)====================
                // PickFinished 到达:Phase 1 的 Pick 命令完成,现在下发 Put 命令放正常电芯
                if (state?.ChangePalletPhase == 2)
@@ -239,8 +242,6 @@
                    return;
                }
                // 非批次模式或其他阶段不下发指令
                return;
            }
            // 非换盘任务:使用原有格式
@@ -273,7 +274,7 @@
                    if (_stateManager.TryUpdateStateSafely(ipAddress, stateToUpdate))
                    {
                        await _robotTaskService.UpdateRobotTaskAsync(task);
                        //await _robotTaskService.UpdateRobotTaskAsync(task);
                    }
                }
            }
@@ -337,15 +338,15 @@
                // 如果条码生成成功
                if (!string.IsNullOrEmpty(trayBarcode1) && !string.IsNullOrEmpty(trayBarcode2))
                {
                    if (stateForUpdate.CellBarcode.Contains(trayBarcode1) || stateForUpdate.CellBarcode.Contains(trayBarcode2))
                    {
                        QuartzLogHelper.LogInfo(_logger, $"HandlePutFinishedStateAsync:读取的电芯条码已存在,可能存在重复,任务号: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress);
                    //if (stateForUpdate.CellBarcode.Contains(trayBarcode1) || stateForUpdate.CellBarcode.Contains(trayBarcode2))
                    //{
                    //    QuartzLogHelper.LogInfo(_logger, $"HandlePutFinishedStateAsync:读取的电芯条码已存在,可能存在重复,任务号: {task.RobotTaskNum}", stateForUpdate?.RobotCrane?.DeviceName ?? ipAddress);
                        // 发送取货指令 标记扫码NG,放货时不使用这些条码,并放入NG口
                        //await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true);
                        return;
                    }
                    else
                    //    // 发送取货指令 标记扫码NG,放货时不使用这些条码,并放入NG口
                    //    //await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true);
                    //    return;
                    //}
                    //else
                    {
                        if (trayBarcode1.Length < 13 || trayBarcode2.Length < 13)
                        {
@@ -389,8 +390,11 @@
                // 判断流向(null-safe)
                bool isFlowA = task.RobotSourceAddressLineCode is "11001" or "11010";
                await _taskProcessor.SendSocketRobotNumAsync(task, stateForUpdate);
                Thread.Sleep(500);
                // 目标数量为48:直接走原有逻辑,不进入批次模式
                if (targetNormalCount == targetTotal)
                if (targetNormalCount + currentCompletedCount == targetTotal)
                {
                    await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate);
                    return;