From e61bb0e26530b2aa9055737fade9e77ccb1feebf Mon Sep 17 00:00:00 2001 From: 肖洋 <cathay_xy@163.com> Date: 星期二, 07 一月 2025 10:06:16 +0800 Subject: [PATCH] 更新多个文件,优化逻辑与配置 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 26 +++++++------------------- 1 files changed, 7 insertions(+), 19 deletions(-) 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 45ce138..5470af5 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs @@ -51,8 +51,7 @@ private static List<string>? userTokenIds; private static List<int>? userIds; - - public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerService stationManagerService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService, IDeviceInfoRepository deviceInfoRepository,ITask_HtyRepository task_HtyRepository) + public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerService stationManagerService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService, IDeviceInfoRepository deviceInfoRepository, ITask_HtyRepository task_HtyRepository) { _taskService = taskService; _taskExecuteDetailService = taskExecuteDetailService; @@ -84,7 +83,6 @@ // 骞惰澶勭悊姣忎釜瀛愯澶� var tasks = childDeviceCodes.Select(childDeviceCode => ProcessDeviceAsync(conveyorLine, childDeviceCode)).ToList(); await Task.WhenAll(tasks); - // 鑾峰彇鎵�鏈夌珯鐐圭鐞嗗櫒 List<Dt_StationManager> stationManagers = _stationManagerService.GetAllStationByDeviceCode(conveyorLine.DeviceCode); @@ -156,7 +154,6 @@ { try { - // 璇诲彇浠诲姟鍛戒护鍜岃澶囧懡浠� ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode); ConveyorLineTaskCommandWrite commandWrite = conveyorLine.ReadCustomer<ConveyorLineTaskCommandWrite>(childDeviceCode, "DeviceCommand"); @@ -245,7 +242,6 @@ } catch (Exception ex) { - } return Task.CompletedTask; } @@ -365,7 +361,6 @@ { try { - ConsoleHelper.WriteWarningLine($"銆恵conveyorLine._deviceName}銆戜换鍔″彿锛氥�恵command.TaskNum}銆�,鎵樼洏鏉$爜锛氥�恵command.Barcode}銆戝凡鍒拌揪銆恵childDeviceCode}銆戣緭閫佺嚎鍏ュ簱瀹屾垚"); var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode); if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish) @@ -401,7 +396,6 @@ } catch (Exception ex) { - } } @@ -420,7 +414,6 @@ { try { - // 鏌ヨ杈撻�佺嚎浠诲姟锛屾牴鎹緭閫佺嚎璁惧鍜屽瓙璁惧浠g爜鑾峰彇浠诲姟淇℃伅 var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); @@ -460,7 +453,6 @@ } catch (Exception ex) { - } } @@ -522,7 +514,6 @@ { try { - // 鎵撳嵃鎴愬姛淇℃伅锛岃〃绀烘墭鐩樺凡鍒拌揪鎸囧畾杈撻�佺嚎骞跺畬鎴愬嚭搴� ConsoleHelper.WriteSuccessLine($"銆恵conveyorLine.DeviceName}銆戜换鍔″彿锛氥�恵command.TaskNum}銆�,鎵樼洏鏉$爜锛氥�恵command.Barcode}銆戝凡鍒拌揪銆恵childDeviceCode}銆戣緭閫佺嚎鍑哄簱瀹屾垚"); @@ -585,7 +576,6 @@ } catch (Exception ex) { - } } @@ -731,7 +721,7 @@ EquipmentCode = stationManager.stationEquipMOM, SessionId = Guid.NewGuid().ToString(), EmployeeNo = "MITest", - SceneType = "2", + SceneType = "4", RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ") }; @@ -762,34 +752,32 @@ ConsoleHelper.WriteWarningLine("1000"); conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTaskNum, 5, stationManager.stationChildCode); conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, 1000, stationManager.stationChildCode); - - ConveyorLineSendFinish(conveyorLine, stationManager.stationChildCode, ProtocalDetailValue, true); } else { ConsoleHelper.WriteWarningLine("2"); ConsoleHelper.WriteWarningLine(stationManager.stationLocation); + conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTaskNum, 5, stationManager.stationChildCode); conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, stationManager.stationLocation, stationManager.stationChildCode); } + ConveyorLineSendFinish(conveyorLine, stationManager.stationChildCode, ProtocalDetailValue, true); } else { if (result1.SerialNos.Count <= 0) { - ConsoleHelper.WriteWarningLine("2"); ConsoleHelper.WriteWarningLine(stationManager.stationLocation); + conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTaskNum, 5, stationManager.stationChildCode); conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, stationManager.stationLocation, stationManager.stationChildCode); - } else { ConsoleHelper.WriteWarningLine("1000"); conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTaskNum, 5, stationManager.stationChildCode); conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, 1000, stationManager.stationChildCode); - - ConveyorLineSendFinish(conveyorLine, stationManager.stationChildCode, ProtocalDetailValue, true); } + ConveyorLineSendFinish(conveyorLine, stationManager.stationChildCode, ProtocalDetailValue, true); } } else @@ -798,6 +786,6 @@ } } - #endregion 鍖栨垚NG鍙e叆搴� + #endregion 璁惧NG鍙e叆搴� } } \ No newline at end of file -- Gitblit v1.9.3