From 047e8be481b2b626a5dbcc613b5f2e77323239be Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 20 三月 2025 14:27:36 +0800
Subject: [PATCH] 更新配置和任务处理逻辑

---
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs |   78 ++++++++++----------------------------
 1 files changed, 21 insertions(+), 57 deletions(-)

diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
index b3773a2..4638dac 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -2,6 +2,7 @@
 using Mapster;
 using Newtonsoft.Json;
 using System.Diagnostics.CodeAnalysis;
+using WIDESEAWCS_BasicInfoRepository;
 using WIDESEAWCS_Common;
 using WIDESEAWCS_Common.TaskEnum;
 using WIDESEAWCS_Core;
@@ -214,7 +215,6 @@
             WebResponseContent content = new WebResponseContent();
             try
             {
-                StaticVariable.isLineRun = false;
 
                 // 妫�鏌ュ綋鍓嶆墭鐩樻槸鍚﹀瓨鍦ㄤ换鍔�
                 if (await HasTask(palletCode))
@@ -228,25 +228,22 @@
                     return content.Error($"銆恵stationManager.stationChildCode}銆戝凡瀛樺湪鐩存帴鍑哄簱浠诲姟浠诲姟");
                 }
 
-                if (StaticVariable.isStackerRun)
-                {
-                    if (stationManager.stationType == 7)
-                    {
-                        var result = await HandleStationType7(palletCode, stationManager);
-                        if (result != null)
-                        {
-                            return result;
-                        }
-                    }
-                    else if (stationManager.stationType == 6)
-                    {
-                        var result = await HandleStationType6(palletCode, stationManager);
-                        if (result != null)
-                        {
-                            return result;
-                        }
-                    }
-                }
+                //if (stationManager.stationType == 7)
+                //{
+                //    var result = await HandleStationType7(palletCode, stationManager);
+                //    if (result != null)
+                //    {
+                //        return result;
+                //    }
+                //}
+                //else if (stationManager.stationType == 6)
+                //{
+                //    var result = await HandleStationType6(palletCode, stationManager);
+                //    if (result != null)
+                //    {
+                //        return result;
+                //    }
+                //}
 
                 // 鍙戣捣璇锋眰鑾峰彇鍏ュ簱浠诲姟
                 content = await RequestInTask(palletCode, stationManager);
@@ -264,10 +261,6 @@
             catch (Exception ex)
             {
                 return WebResponseContent.Instance.Error(ex.Message);
-            }
-            finally
-            {
-                StaticVariable.isLineRun = true;
             }
         }
 
@@ -287,38 +280,9 @@
         }
 
         // 澶勭悊 stationType 涓� 7 鐨勬儏鍐�
-        private async Task<WebResponseContent> HandleStationType7(string palletCode, Dt_StationManager stationManager)
+        private async Task<WebResponseContent> HandleStationType7(Dt_StationManager stationManager)
         {
-            var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea);
-            var runTask = await BaseDal.QueryFirstAsync(x => x.CurrentAddress == station.stationChildCode && x.TaskState == (int)TaskInStatusEnum.Line_InFinish && x.TaskType == (int)TaskInboundTypeEnum.InTray);
-
-            if (runTask != null)
-            {
-                runTask.TargetAddress = stationManager.stationLocation;
-                runTask.NextAddress = stationManager.stationChildCode;
-                runTask.Grade = 3;
-                runTask.TaskType = (int)TaskOutboundTypeEnum.InToOut;
-                runTask.TaskState = (int)TaskOutStatusEnum.OutNew;
-
-                var wmsIpAddrss = GetWmsIpAddress(SysConfigKeyConst.SetEmptyOutbyInToOutAsync);
-                var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = runTask.PalletCode, EquiCodeMOM = stationManager.stationEquipMOM, Roadways = stationManager.Roadway, area = stationManager.stationArea, Position = station.stationChildCode }.ToJsonString());
-                var content = JsonConvert.DeserializeObject<WebResponseContent>(result);
-
-                if (content.Status)
-                {
-                    await BaseDal.UpdateDataAsync(runTask);
-                    ConsoleHelper.WriteSuccessLine($"銆恵runTask.PalletCode}鐩存帴鍑哄簱鑷充簩灏併��");
-                    return content.OK("鎴愬姛");
-                }
-                else
-                {
-                    ConsoleHelper.WriteErrorLine(content.Message);
-                }
-            }
-            else
-            {
-                ConsoleHelper.WriteErrorLine($"銆恵station.stationChildCode}銆戞湭鎵惧埌绌烘墭鐩樺叆搴撲换鍔�");
-            }
+            var station = await _taskNeedBarcodeRepository.QueryFirstAsync(x => x.toArea == stationManager.stationChildCode && x.productLine == stationManager.productLine);
 
             return null;
         }
@@ -406,9 +370,9 @@
 
                 var task = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
                 ConsoleHelper.WriteSuccessLine(content.Data.ToString());
-                
+
                 content = ReceiveWMSTask(new List<WMSTaskDTO> { task });
-                
+
                 return content;
             }
             catch (Exception ex)

--
Gitblit v1.9.3