From 40ef2cb3dd897dfc74d9576d0973517b24cc9367 Mon Sep 17 00:00:00 2001
From: 陈勇 <竞男@ASUNA>
Date: 星期二, 17 三月 2026 11:21:56 +0800
Subject: [PATCH] 同步

---
 项目代码/WCS/WCSServer/WIDESEAWCS_Tasks/TT/CommonConveyorLineTTJob.cs |   43 ++++++++++++++++++++++++++++++-------------
 1 files changed, 30 insertions(+), 13 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/TT/CommonConveyorLineTTJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/TT/CommonConveyorLineTTJob.cs"
index 9fc8e9d..344a59d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/TT/CommonConveyorLineTTJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServer/WIDESEAWCS_Tasks/TT/CommonConveyorLineTTJob.cs"
@@ -105,11 +105,24 @@
                             Dt_Task task = null;
                             if (station.stationChildCode == "TC05")
                             {
+                                //var executeTaks =  _taskRepository.QueryData(x => (x.Roadway == "SC02" || x.Roadway == "SC04") && x.TaskState <= (int)TaskOutStatusEnum.SC_OutFinish).OrderBy(x => x.CreateDate).FirstOrDefault();
+
                                 var leftTask = _taskRepository.QueryData(x => (x.Roadway == "SC02" || x.Roadway == "SC04") && x.TaskState <= (int)TaskOutStatusEnum.SC_OutFinish).OrderBy(x => x.CreateDate).FirstOrDefault();
 
                                 if (leftTask != null && leftTask.TaskState == (int)TaskOutStatusEnum.SC_OutFinish)
                                 {
                                     task = leftTask;
+                                }
+
+                                if (task != null)
+                                {
+                                    _taskService.UpdateTaskStatusToNext(task.TaskNum, (int)TaskOutStatusEnum.SC_OutFinish);
+
+                                    var sattion = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.CurrentAddress);
+                                    WriteDebug("CommonConveyorLineTTJob浠诲姟", $"浠诲姟锛歿task.Serialize()}锛岀珯鍙颁俊鎭細{sattion.Serialize()}");
+                                    conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.GetConvNo, Convert.ToInt16(sattion.stationTCLocation), station.stationChildCode);
+                                    conveyorLine.SetValue<ConveyorLineDBName, string>(ConveyorLineDBName.PVI_W, task.PVI, station.stationChildCode);
+                                    //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
                                 }
                             }
                             else if (station.stationChildCode == "TC06")
@@ -120,18 +133,18 @@
                                 {
                                     task = rightTask;
                                 }
-                            }
 
-                            //var task = _taskRepository.QueryData(X => X.NextAddress == station.stationChildCode).OrderBy(x => x.CreateDate).FirstOrDefault();
-                            if (task != null)
-                            {
-                                _taskService.UpdateTaskStatusToNext(task.TaskNum);
-                                var sattion = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.CurrentAddress);
-                                conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.GetConvNo, Convert.ToInt16(sattion.stationTCLocation), station.stationChildCode);
-                                conveyorLine.SetValue<ConveyorLineDBName, string>(ConveyorLineDBName.PVI_W, task.PVI, station.stationChildCode);
-                                //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
+                                if (task != null)
+                                {
+                                    _taskService.UpdateTaskStatusToNext(task.TaskNum, (int)TaskOutStatusEnum.SC_OutFinish);
+
+                                    var sattion = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.CurrentAddress);
+                                    WriteDebug("CommonConveyorLineTTJob浠诲姟", $"浠诲姟锛歿task.Serialize()}锛岀珯鍙颁俊鎭細{sattion.Serialize()}");
+                                    conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.GetConvNo, Convert.ToInt16(sattion.stationTCLocation), station.stationChildCode);
+                                    conveyorLine.SetValue<ConveyorLineDBName, string>(ConveyorLineDBName.PVI_W, task.PVI, station.stationChildCode);
+                                    //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
+                                }
                             }
-                            //;
                         }
 
                         var Putrequest = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.Spare2, station.stationChildCode);//妯Щ鏈鸿浇璐ф斁杞︿俊鍙�
@@ -144,9 +157,13 @@
                             {
                                 if (station.stationChildCode == "TC05")
                                 {
-                                    var task = _taskRepository.QueryData(X => X.TargetAddress == "RB043" && (X.NextAddress == station.stationChildCode /*|| X.CurrentAddress == station.stationChildCode*/)).OrderBy(x => x.CreateDate).FirstOrDefault();
-                                    _taskService.UpdatePosition(task.TaskNum, station.stationChildCode);
-                                    conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
+                                    var task = _taskRepository.QueryData(X => X.TargetAddress == "RB043" && (X.NextAddress == station.stationChildCode && X.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting/*|| X.CurrentAddress == station.stationChildCode*/)).OrderBy(x => x.CreateDate).FirstOrDefault();
+
+                                    if (task != null)
+                                    {
+                                        _taskService.UpdatePosition(task.TaskNum, station.stationChildCode);
+                                        conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
+                                    }
                                 }
                                 else
                                 {

--
Gitblit v1.9.3