From 3106b64087cf6199b5a35aafb0eb583676017aa6 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 07 十一月 2024 16:47:44 +0800
Subject: [PATCH] 暂存

---
 /dev/null                                                                                       |    0 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs |    2 
 .gitignore                                                                                      |    1 
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs        |    2 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs                 |   86 ++++++++++++----------------
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs |   10 ++-
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/ResultTrayCellsStatus.cs                  |   29 +++++++--
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/MOM/RequestEqptRunDto.cs                   |   21 +++++++
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs   |    4 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs                      |    7 +
 10 files changed, 97 insertions(+), 65 deletions(-)

diff --git a/.gitignore b/.gitignore
index 3a3fac0..aa04372 100644
--- a/.gitignore
+++ b/.gitignore
@@ -974,3 +974,4 @@
 /Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessRepository/obj/Debug/net6.0/WIDESEAWCS_ProcessRepository.csproj.CoreCompileInputs.cache
 /Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/obj/Debug/net6.0/WIDESEAWCS_Tasks.csproj.CoreCompileInputs.cache
 *.txt
+/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/obj/Debug/net6.0/WIDESEAWCS_QuartzJob.csproj.AssemblyReference.cache
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
index dd89d76..b4a2b54 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
@@ -41,8 +41,11 @@
                     using HttpClient httpClient = new HttpClient();
                     httpClient.Timeout = new TimeSpan(0, 0, 60);
 
-                    foreach (var header in headers)
-                        httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
+                    if(headers != null)
+                    {
+                        foreach (var header in headers)
+                            httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
+                    }
 
                     result = await httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync();
                 }
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/MOM/RequestEqptRunDto.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/MOM/RequestEqptRunDto.cs
new file mode 100644
index 0000000..d15c463
--- /dev/null
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/MOM/RequestEqptRunDto.cs
@@ -0,0 +1,21 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEAWCS_DTO.MOM
+{
+    public class RequestEqptRunDto : BasicDto
+    {
+        /// <summary>
+        /// 浜哄憳瀵嗙爜
+        /// </summary>
+        public string Password { get; set; }
+
+        /// <summary>
+        /// 璁惧妯″紡
+        /// </summary>
+        public string EquipmentModel { get; set; }
+    }
+}
\ No newline at end of file
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/obj/Debug/net6.0/WIDESEAWCS_QuartzJob.csproj.AssemblyReference.cache b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/obj/Debug/net6.0/WIDESEAWCS_QuartzJob.csproj.AssemblyReference.cache
deleted file mode 100644
index ab3f8b9..0000000
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/obj/Debug/net6.0/WIDESEAWCS_QuartzJob.csproj.AssemblyReference.cache
+++ /dev/null
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
index 63d8ec4..70f9860 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -419,46 +419,46 @@
 
                     if (task.TaskState == (int)TaskInStatusEnum.Line_InFinish)
                     {
-                        if (task.Roadway.Contains("CH"))
-                        {
-                            Random random = new Random();
-                            task.CurrentAddress = task.NextAddress;
-                            task.NextAddress = $"{random.Next(1, 1).ToString().PadLeft(3, '0')}-{random.Next(0, 0).ToString().PadLeft(3, '0')}-{random.Next(1, 1).ToString().PadLeft(3, '0')}";
-                            task.TargetAddress = task.NextAddress;
-                        }
-                        else
-                        {
-                            Random random = new Random();
-                            task.CurrentAddress = task.NextAddress;
-                            task.NextAddress = "002-020-001";
-                            task.TargetAddress = task.NextAddress;
-                        }
+                        //if (task.Roadway.Contains("CH"))
+                        //{
+                        //    Random random = new Random();
+                        //    task.CurrentAddress = task.NextAddress;
+                        //    task.NextAddress = $"{random.Next(1, 1).ToString().PadLeft(3, '0')}-{random.Next(0, 0).ToString().PadLeft(3, '0')}-{random.Next(1, 1).ToString().PadLeft(3, '0')}";
+                        //    task.TargetAddress = task.NextAddress;
+                        //}
+                        //else
+                        //{
+                        //    Random random = new Random();
+                        //    task.CurrentAddress = task.NextAddress;
+                        //    task.NextAddress = "002-020-001";
+                        //    task.TargetAddress = task.NextAddress;
+                        //}
 
                         #region 鐪熷疄鏁版嵁
                         // TODO: 璋冪敤鎺ュ彛鑾峰彇涓嬩竴涓湴鍧�
-                        //// 鍒涘缓璇锋眰瀵硅薄
-                        //RequestTaskDto request = new RequestTaskDto()
-                        //{
-                        //    Position = task.NextAddress,
-                        //    PalletCode = task.PalletCode,
-                        //};
+                        // 鍒涘缓璇锋眰瀵硅薄
+                        RequestTaskDto request = new RequestTaskDto()
+                        {
+                            Position = task.NextAddress,
+                            PalletCode = task.PalletCode,
+                        };
 
-                        //// 鍙戦�佽姹傚苟绛夊緟鍝嶅簲
-                        //var result = HttpHelper.PostAsync("http:127.0.0.1:8098/api/Task/RequestTaskAsync", request.ToJsonString()).Result;
+                        // 鍙戦�佽姹傚苟绛夊緟鍝嶅簲
+                        var result = HttpHelper.PostAsync("http:127.0.0.1:8098/api/Task/RequestTaskAsync", request.ToJsonString()).Result;
 
-                        //// 鍙嶅簭鍒楀寲鍝嶅簲鍐呭
-                        //content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+                        // 鍙嶅簭鍒楀寲鍝嶅簲鍐呭
+                        content = JsonConvert.DeserializeObject<WebResponseContent>(result);
 
-                        //// 妫�鏌ョ姸鎬佸苟杩斿洖
-                        //if (!content.Status)
-                        //    return content;
+                        // 妫�鏌ョ姸鎬佸苟杩斿洖
+                        if (!content.Status)
+                            return content;
 
-                        //// 鍙嶅簭鍒楀寲浠诲姟鏁版嵁
-                        //WMSTaskDTO taskResult = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
+                        // 鍙嶅簭鍒楀寲浠诲姟鏁版嵁
+                        WMSTaskDTO taskResult = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
 
-                        //task.CurrentAddress = task.NextAddress;
-                        //task.NextAddress = taskResult.TargetAddress;
-                        //task.TargetAddress = task.NextAddress;
+                        task.CurrentAddress = task.NextAddress;
+                        task.NextAddress = taskResult.TargetAddress;
+                        task.TargetAddress = task.NextAddress;
                         #endregion
 
                     }
@@ -565,24 +565,12 @@
                     _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄叆搴撳畬鎴�");
 
 
-                    //var x = new { taskNum = taskNum };
-                    //var result = HttpHelper.GetAsync("http:127.0.0.1:8098/api/Task/CompleteTaskAsync", x.ToJsonString()).Result;
-                    //content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+                    #region WMS鍚屾浠诲姟瀹屾垚
+                    var x = new { taskNum = taskNum };
+                    var result = HttpHelper.GetAsync("http:127.0.0.1:8098/api/Task/CompleteTaskAsync", x.ToJsonString()).Result;
+                    content = JsonConvert.DeserializeObject<WebResponseContent>(result);
+                    #endregion
 
-                    //WMSTaskDTO taskDTO = new WMSTaskDTO()
-                    //{
-                    //    TaskNum = Convert.ToInt32(DateTime.Now.ToString("HHmmss")),
-                    //    Grade = 1,
-                    //    PalletCode = task.PalletCode + "S",
-                    //    RoadWay = "SC01",
-                    //    SourceAddress = task.TargetAddress,
-                    //    TargetAddress = "CLOutAreaA",
-                    //    TaskState = (int)TaskOutStatusEnum.OutNew,
-                    //    Id = 0,
-                    //    TaskType = (int)TaskOutboundTypeEnum.Outbound
-                    //};
-
-                    //content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
                 }
                 else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
                 {
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
index ec87b7c..cb46e26 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -183,7 +183,7 @@
             HandleTaskOut(conveyorLine, command, childDeviceCode, ProtocalDetailValue, task);
 
             // 濡傛灉娌℃湁鍑哄簱浠诲姟锛屽鐞嗘柊浠诲姟
-            if (task == null)
+            if (task == null && command.Barcode != "NoRead")
             {
                 HandleNewTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue);
             }
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
index b904bad..6f9ab39 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
@@ -35,7 +35,7 @@
             bool isOutboundAndOutFinish = taskOut.TaskType == (int)TaskOutboundTypeEnum.Outbound && taskOut.TaskState == (int)TaskOutStatusEnum.SC_OutFinish;
             bool isOutboundAndLineOutExecuting = taskOut.TaskType == (int)TaskOutboundTypeEnum.Outbound && taskOut.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting;
 
-            if (isOutTray || isOutboundAndOutFinish || !isOutboundAndLineOutExecuting)
+            if (isOutTray || isOutboundAndOutFinish || isOutboundAndLineOutExecuting)
             {
                 // 鍙戦�佸懡浠ゅ埌杈撻�佺嚎
                 conveyorLine.SendCommand(taskCommand, childDeviceCode);
@@ -44,7 +44,7 @@
                 // 鏇存柊浠诲姟鐘舵��
                 _taskService.UpdateTaskStatusToNext(taskOut);
             }
-            else if (taskOut.TaskType == (int)TaskOutboundTypeEnum.Outbound && taskOut.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting)
+            else if (taskOut.TaskType == (int)TaskOutboundTypeEnum.OutTray && taskOut.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting)
             {
                 // 瀹屾垚WMS浠诲姟
                 CompleteWmsTask(taskOut, command, conveyorLine, childDeviceCode, ProtocalDetailValue);
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 0335a14..99582b3 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -309,28 +309,30 @@
         {
             if (!commonStackerCrane.StackerOnline)
             {
-                BasicDto dto = new BasicDto
+                RequestEqptRunDto request = new RequestEqptRunDto()
                 {
                     EmployeeNo = "T00001",
                     EquipmentCode = commonStackerCrane.DeviceCode,
                     RequestTime = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"),
                     SessionId = Guid.NewGuid().ToString(),
                     Software = commonStackerCrane.DeviceName,
+                    Password = "12345",
+                    EquipmentModel = "1"
                 };
-                var respone = await HttpHelper.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/EqptRun", dto.ToJsonString());
+                var respone = await HttpHelper.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/EqptRun", request.ToJsonString());
                 if (respone != null)
                 {
                     var result = JsonConvert.DeserializeObject<ResponseEqptRunDto>(respone);
                     if (result != null && result.Success)
                     {
-                        var process = _processRepository.QueryData(x => x.EquipmentName == commonStackerCrane.DeviceName).FirstOrDefault();
+                        var process = _processRepository.QueryData(x => x.EquipmentName == commonStackerCrane.DeviceCode).FirstOrDefault();
                         if (process == null)
                         {
                             ResponeRunDto runDto = JsonConvert.DeserializeObject<ResponeRunDto>(respone);
                             process = new Dt_EquipmentProcess()
                             {
                                 EquipmentName = commonStackerCrane.DeviceCode,
-                                EquipmentType = commonStackerCrane.DeviceName.Substring(commonStackerCrane.DeviceCode.IndexOf("鍫嗗灈鏈�")),
+                                EquipmentType = new string(commonStackerCrane.DeviceName.TakeWhile(c => !char.IsDigit(c)).ToArray()),
                                 WipOrderNo = runDto.WipOrderNo,
                                 ProductDesc = runDto.ProductDesc,
                                 ProcessValue = JsonConvert.SerializeObject(result)
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/ResultTrayCellsStatus.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/ResultTrayCellsStatus.cs
index 841ba73..0f1ba4f 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/ResultTrayCellsStatus.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MOM/ResultTrayCellsStatus.cs
@@ -12,11 +12,7 @@
         /// </summary>
         public List<SerialNoDto> SerialNos { get; set; } = new List<SerialNoDto>();
 
-        /// <summary>
-        /// 缁戝畾浠g爜
-        /// </summary>
-        public string BindCode { get; set; }
-
+        public string TrayStatus { get; set; }
         /// <summary>
         /// 鏂欐灞炴�у垪琛�
         /// </summary>
@@ -38,6 +34,8 @@
         /// </summary>
         public int PositionNo { get; set; }
 
+        public string BindCode { get; set; }
+
         /// <summary>
         /// 鐢佃姱鐘舵��
         /// </summary>
@@ -57,11 +55,30 @@
         /// <summary>
         /// 宸ュ簭
         /// </summary>
-        public string ProcessCode { get; set; }
+        public List<ProcessCodes> ProcessCodes { get; set; } = new List<ProcessCodes>();
+
+        public double Capacity { get; set; }
+
 
         /// <summary>
         /// 閫傜敤鐗╂枡缂栫爜/宸ヨ壓鍨嬪彿
         /// </summary>
+        public List<ProductTypes> ProductType { get; set; } = new List<ProductTypes>();
+    }
+
+    public class ProcessCodes
+    {
+
+        /// <summary>
+        /// 宸ュ簭
+        /// </summary>
+        public string ProcessCode { get; set; }
+    }
+
+    public class ProductTypes
+    {
+
         public string ProductType { get; set; }
+
     }
 }
\ No newline at end of file
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
index 4529a37..e383309 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -659,7 +659,7 @@
                 SerialNumber = serialNoObj.SerialNo,
                 OrderNo = serialNoObj.PositionNo.ToString(),
                 Status = serialNoObj.SerialNoStatus,
-                MaterielCode = result.BindCode,
+                MaterielCode = serialNoObj.BindCode,
                 Remark = result.TrayBarcodePropertys.ToJsonString(),
             }).ToList()
         };

--
Gitblit v1.9.3