From 19f73f3d2370c821355d0cc0fa5b0f7cdcb898e8 Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com> Date: 星期一, 23 六月 2025 08:48:32 +0800 Subject: [PATCH] 增强任务处理和更新版本信息在 `TaskController.cs` 中添加了对 `WIDESEAWCS_ITaskInfoRepository` 和 `WIDESEAWCS_ITaskInfoService` 的引用,以提升任务信息处理能力。在 `CommonConveyorLineJob.cs` 中引入 `platformNotusable` 列表,确保查询平台信息时的可用性检查。在 `RequestInbound.cs` 中添加对 并优化 `outJZTask` 的查询条件。修改 `CommonStackerCraneJob.cs` 中静置出库任务的判断逻辑,确保任务执行前的适当检查。 --- CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 95 +++++++++++++++-------------------------------- 1 files changed, 31 insertions(+), 64 deletions(-) diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs index de1b8fb..73763b3 100644 --- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs +++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs @@ -257,63 +257,30 @@ // 鏌ヨ骞冲彴淇℃伅 Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active"); - if (platform != null && !string.IsNullOrEmpty(platform.Location)) + var platformNotusable = new List<string> { "2028", "2024","2032","2036","2040" }; + if (platform != null && !string.IsNullOrEmpty(platform.Location) && !platformNotusable.Contains(platform.PlatCode)) { - if (platform.PlatCode == "1299" || platform.PlatCode == "1295" || platform.PlatCode == "1291" || platform.PlatCode == "1287" || platform.PlatCode == "1283") + var strings = platform.Location.Split(',').ToList(); + foreach (var ite in strings) { - Platform platformJZ = _platFormRepository.QueryFirst(x => x.PlatCode == "10086" && x.Status == "Active"); - if (platformJZ != null) + // 璇诲彇浠诲姟鍛戒护 + ConveyorLineTaskCommand command1 = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(ite); + if (command1.InteractiveSignal != 2) { - var strings = platform.Location.Split(',').ToList(); - foreach (var ite in strings) + command.InteractiveSignal = writeInteractiveSignal; + int count = strings.Count; + // 鑾峰彇澶勭悊鏂规硶 + MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod); + if (method != null) { - // 璇诲彇浠诲姟鍛戒护 - ConveyorLineTaskCommand command1 = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(ite); - if (command1.InteractiveSignal != 2) - { - command.InteractiveSignal = writeInteractiveSignal; - int count = strings.Count; - // 鑾峰彇澶勭悊鏂规硶 - MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod); - if (method != null) - { - command.InteractiveSignal = commandWrite.WriteInteractiveSignal; - // 璋冪敤澶勭悊鏂规硶 - method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform }); - } - - } + command.InteractiveSignal = commandWrite.WriteInteractiveSignal; + // 璋冪敤澶勭悊鏂规硶 + method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform }); } + } } - else - { - var strings = platform.Location.Split(',').ToList(); - foreach (var ite in strings) - { - // 璇诲彇浠诲姟鍛戒护 - ConveyorLineTaskCommand command1 = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(ite); - if (command1.InteractiveSignal != 2) - { - command.InteractiveSignal = writeInteractiveSignal; - int count = strings.Count; - // 鑾峰彇澶勭悊鏂规硶 - MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod); - if (method != null) - { - command.InteractiveSignal = commandWrite.WriteInteractiveSignal; - // 璋冪敤澶勭悊鏂规硶 - method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform }); - } - - } - } - } } - //if (conveyorLine.DeviceCode == "1001") - //{ - // ConsoleHelper.WriteSuccessLine("ProcessDeviceAsync鏂规硶缁撴潫鏃堕棿锛�" + DateTime.Now.ToString("G") + $"鐐逛綅锛歿childDeviceCode}"); - //} } } catch (Exception ex) @@ -365,24 +332,24 @@ { // 鑾峰彇浠诲姟鐨勪笅涓�鐩爣鍦板潃 var next = task.NextAddress; - // 灏嗕换鍔℃槧灏勪负鍛戒护 - var taskCommand = MapTaskCommand(task, command); - // 鎭㈠浠诲姟鐨勪笅涓�鐩爣鍦板潃 - task.NextAddress = next; - // 鍙戦�佸懡浠ゅ埌瀛愯澶� - conveyorLine.SendCommand(taskCommand, childDeviceCode); + // 灏嗕换鍔℃槧灏勪负鍛戒护 + var taskCommand = MapTaskCommand(task, command); + // 鎭㈠浠诲姟鐨勪笅涓�鐩爣鍦板潃 + task.NextAddress = next; + // 鍙戦�佸懡浠ゅ埌瀛愯澶� + conveyorLine.SendCommand(taskCommand, childDeviceCode); - // 杈撳嚭璀﹀憡淇℃伅锛岃〃绀轰换鍔″凡鍒拌揪瀛愯澶囧苟璇锋眰鎵爜鍏ュ簱锛屼笅涓�鐩爣鍦板潃 - var logs = $"銆恵conveyorLine._deviceName}銆戜换鍔″彿锛氥�恵command.TaskNum}銆�,鎵樼洏鏉$爜锛氥�恵command.Barcode}銆戝凡鍒拌揪銆恵childDeviceCode}銆戣姹傛壂鐮佸叆搴�,涓嬩竴鐩爣鍦板潃銆恵taskCommand.TargetAddress}銆�"; - ConsoleHelper.WriteWarningLine(logs); + // 杈撳嚭璀﹀憡淇℃伅锛岃〃绀轰换鍔″凡鍒拌揪瀛愯澶囧苟璇锋眰鎵爜鍏ュ簱锛屼笅涓�鐩爣鍦板潃 + var logs = $"銆恵conveyorLine._deviceName}銆戜换鍔″彿锛氥�恵command.TaskNum}銆�,鎵樼洏鏉$爜锛氥�恵command.Barcode}銆戝凡鍒拌揪銆恵childDeviceCode}銆戣姹傛壂鐮佸叆搴�,涓嬩竴鐩爣鍦板潃銆恵taskCommand.TargetAddress}銆�"; + ConsoleHelper.WriteWarningLine(logs); - await _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = logs, time = DateTime.Now.ToString("G"), color = "red" }); - WriteInfo(conveyorLine.DeviceName, logs); + await _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = logs, time = DateTime.Now.ToString("G"), color = "red" }); + WriteInfo(conveyorLine.DeviceName, logs); - // 鍙戦�佷换鍔″畬鎴愰�氱煡 - ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); - // 鏇存柊浠诲姟鐘舵�佷负涓嬩竴鐘舵�� - _taskService.UpdateTaskStatusToNext(task); + // 鍙戦�佷换鍔″畬鎴愰�氱煡 + ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true); + // 鏇存柊浠诲姟鐘舵�佷负涓嬩竴鐘舵�� + _taskService.UpdateTaskStatusToNext(task); } } } -- Gitblit v1.9.3