From 942e47f8987bd8c266e58863bed3895d9cb4ded0 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 23 十二月 2024 20:51:38 +0800
Subject: [PATCH] 增加任务类型枚举,增加测试出库上报

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/油墨仓/StackerCraneJob_YM.cs |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/StackerCraneJob_YM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/StackerCraneJob_YM.cs"
index 0b1a496..53ed581 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/StackerCraneJob_YM.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\262\271\345\242\250\344\273\223/StackerCraneJob_YM.cs"
@@ -7,7 +7,9 @@
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.Enums;
+using WIDESEAWCS_Core.Helper;
 using WIDESEAWCS_IBasicInfoRepository;
 using WIDESEAWCS_ITaskInfoRepository;
 using WIDESEAWCS_ITaskInfoService;
@@ -23,6 +25,9 @@
 
 namespace WIDESEAWCS_Tasks
 {
+    /// <summary>
+    /// 娌瑰ⅷ浠撳爢鍨涙満
+    /// </summary>
     [DisallowConcurrentExecution]
     public class StackerCraneJob_YM : JobBase, IJob
     {
@@ -69,7 +74,17 @@
                                     if (sendFlag)
                                     {
                                         commonStackerCrane.LastTaskType = task.TaskType;
-                                        _taskService.UpdateTaskStatusToNext(task.TaskNum);
+                                        int oldState = task.TaskState;
+                                        if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
+                                        {
+                                            task.TaskState = TaskInStatusEnum.SC_InExecuting.ObjToInt();
+                                        }
+                                        else
+                                        {
+                                            task.TaskState = TaskOutStatusEnum.SC_OutExecuting.ObjToInt();
+                                        }
+                                        _taskRepository.UpdateData(task);
+                                        _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"绯荤粺鑷姩娴佺▼锛屼换鍔$姸鎬佷粠銆恵oldState}銆戣浆鍒般�恵task.TaskState}銆�");
                                     }
                                 }
                             }
@@ -94,10 +109,18 @@
             CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane;
             if (commonStackerCrane != null)
             {
+                WriteInfo(commonStackerCrane.DeviceName, $"璇诲彇鍒颁换鍔″畬鎴愪俊鍙�,{e.TaskNum}");
                 if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
                 {
-                    Console.Out.WriteLine("TaskCompleted" + e.TaskNum);
-                    _taskService.StackCraneTaskCompleted(e.TaskNum);
+                    Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum);
+                    if (task != null)
+                    {
+
+                    }
+                    else
+                    {
+                        WriteInfo(commonStackerCrane.DeviceName, $"璇诲彇鍒颁换鍔″畬鎴愪俊鍙�,鏈壘鍒板搴旂殑浠诲姟淇℃伅,{e.TaskNum}");
+                    }
                     commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                 }
             }

--
Gitblit v1.9.3