From b5625f1b0cbebed336918b5b34e83b2b1da16aeb Mon Sep 17 00:00:00 2001 From: huangxiaoqiang <1247017146@qq.com> Date: 星期五, 18 四月 2025 16:41:47 +0800 Subject: [PATCH] 1 --- CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile.pubxml.user | 2 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 31 +++++++ CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs | 160 ++++++++++++++++++++------------------- CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs | 18 ++++ 4 files changed, 130 insertions(+), 81 deletions(-) diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile.pubxml.user b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile.pubxml.user index 92ab72e..2732325 100644 --- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -5,7 +5,7 @@ <Project> <PropertyGroup> <_PublishTargetUrl>E:\GET\BaiBuSanLouNew\CodeManagement\WCS\WIDESEAWCS_Server\WIDESEAWCS_Server\bin\Debug\net6.0\publish\</_PublishTargetUrl> - <History>True|2025-04-17T08:04:03.4011403Z||;True|2025-04-17T16:00:41.6595004+08:00||;True|2025-04-17T14:49:41.2104816+08:00||;True|2025-04-17T14:27:37.3613209+08:00||;True|2025-04-17T13:55:36.7316380+08:00||;True|2025-04-17T13:10:06.6039892+08:00||;True|2025-04-17T12:07:35.7350054+08:00||;True|2025-04-17T11:00:00.9151591+08:00||;True|2025-04-17T10:57:57.3417841+08:00||;True|2025-04-17T10:47:23.2976245+08:00||;True|2025-04-17T10:41:39.7210960+08:00||;True|2025-04-17T10:19:33.9192570+08:00||;True|2025-04-17T10:16:34.7379074+08:00||;True|2025-04-17T10:08:53.3641425+08:00||;True|2025-04-17T09:53:51.9356344+08:00||;True|2025-03-27T13:37:49.9939026+08:00||;True|2025-03-27T13:29:20.1926150+08:00||;True|2025-03-26T23:19:20.7301591+08:00||;True|2025-03-26T23:17:14.1194337+08:00||;True|2025-03-26T23:06:39.1521743+08:00||;True|2025-03-26T22:45:13.0771457+08:00||;True|2025-03-26T15:49:56.7831444+08:00||;True|2025-03-26T11:17:59.8156703+08:00||;True|2025-03-25T10:07:06.2413400+08:00||;True|2025-03-24T22:07:19.1662430+08:00||;True|2025-03-24T17:46:50.5366700+08:00||;True|2025-03-23T22:21:52.3680226+08:00||;True|2025-03-23T22:04:03.0344904+08:00||;True|2025-03-23T18:11:25.3235647+08:00||;True|2025-03-23T16:46:42.6441101+08:00||;True|2025-03-22T17:15:44.8475192+08:00||;True|2025-03-22T16:40:56.2937788+08:00||;True|2025-03-22T16:16:19.5470008+08:00||;True|2025-03-22T15:49:39.1178646+08:00||;True|2025-03-22T15:44:56.2071472+08:00||;True|2025-03-22T15:38:57.0439012+08:00||;True|2025-03-22T15:02:20.9416020+08:00||;True|2025-03-22T14:33:13.6730569+08:00||;True|2025-03-21T23:34:47.6039521+08:00||;True|2025-03-21T02:10:54.8314020+08:00||;True|2025-03-18T16:25:46.4649995+08:00||;True|2025-02-19T11:41:36.9348078+08:00||;True|2025-02-18T18:28:41.9967285+08:00||;True|2025-02-18T18:25:36.2264950+08:00||;True|2025-02-18T10:30:56.5234743+08:00||;True|2025-02-15T15:24:40.7310549+08:00||;True|2025-02-15T14:26:13.5854743+08:00||;True|2025-02-15T14:23:09.9103735+08:00||;True|2025-02-15T14:11:58.0255348+08:00||;True|2025-02-15T13:55:31.3438054+08:00||;True|2025-02-15T13:47:31.3307267+08:00||;True|2025-02-15T13:46:24.9001959+08:00||;True|2025-02-15T13:23:47.4161644+08:00||;True|2025-02-15T13:10:20.4988808+08:00||;True|2025-02-15T13:05:10.7619905+08:00||;True|2025-02-15T12:55:42.2397751+08:00||;True|2025-02-15T12:43:42.1819119+08:00||;True|2025-02-15T10:19:42.3871047+08:00||;True|2025-01-03T16:15:25.4007394+08:00||;True|2025-01-03T15:59:55.6586669+08:00||;True|2025-01-03T15:58:54.7953589+08:00||;True|2025-01-03T15:54:46.8938743+08:00||;True|2025-01-03T15:30:32.7439557+08:00||;True|2025-01-03T15:27:53.2337341+08:00||;True|2025-01-03T15:24:30.7045349+08:00||;True|2025-01-02T14:13:36.7820311+08:00||;</History> + <History>True|2025-04-18T02:22:32.9554647Z||;True|2025-04-18T09:51:29.1384947+08:00||;True|2025-04-18T09:46:26.7326043+08:00||;True|2025-04-18T09:43:19.2433438+08:00||;False|2025-04-18T09:42:10.6513617+08:00||;True|2025-04-17T16:04:03.4011403+08:00||;True|2025-04-17T16:00:41.6595004+08:00||;True|2025-04-17T14:49:41.2104816+08:00||;True|2025-04-17T14:27:37.3613209+08:00||;True|2025-04-17T13:55:36.7316380+08:00||;True|2025-04-17T13:10:06.6039892+08:00||;True|2025-04-17T12:07:35.7350054+08:00||;True|2025-04-17T11:00:00.9151591+08:00||;True|2025-04-17T10:57:57.3417841+08:00||;True|2025-04-17T10:47:23.2976245+08:00||;True|2025-04-17T10:41:39.7210960+08:00||;True|2025-04-17T10:19:33.9192570+08:00||;True|2025-04-17T10:16:34.7379074+08:00||;True|2025-04-17T10:08:53.3641425+08:00||;True|2025-04-17T09:53:51.9356344+08:00||;True|2025-03-27T13:37:49.9939026+08:00||;True|2025-03-27T13:29:20.1926150+08:00||;True|2025-03-26T23:19:20.7301591+08:00||;True|2025-03-26T23:17:14.1194337+08:00||;True|2025-03-26T23:06:39.1521743+08:00||;True|2025-03-26T22:45:13.0771457+08:00||;True|2025-03-26T15:49:56.7831444+08:00||;True|2025-03-26T11:17:59.8156703+08:00||;True|2025-03-25T10:07:06.2413400+08:00||;True|2025-03-24T22:07:19.1662430+08:00||;True|2025-03-24T17:46:50.5366700+08:00||;True|2025-03-23T22:21:52.3680226+08:00||;True|2025-03-23T22:04:03.0344904+08:00||;True|2025-03-23T18:11:25.3235647+08:00||;True|2025-03-23T16:46:42.6441101+08:00||;True|2025-03-22T17:15:44.8475192+08:00||;True|2025-03-22T16:40:56.2937788+08:00||;True|2025-03-22T16:16:19.5470008+08:00||;True|2025-03-22T15:49:39.1178646+08:00||;True|2025-03-22T15:44:56.2071472+08:00||;True|2025-03-22T15:38:57.0439012+08:00||;True|2025-03-22T15:02:20.9416020+08:00||;True|2025-03-22T14:33:13.6730569+08:00||;True|2025-03-21T23:34:47.6039521+08:00||;True|2025-03-21T02:10:54.8314020+08:00||;True|2025-03-18T16:25:46.4649995+08:00||;True|2025-02-19T11:41:36.9348078+08:00||;True|2025-02-18T18:28:41.9967285+08:00||;True|2025-02-18T18:25:36.2264950+08:00||;True|2025-02-18T10:30:56.5234743+08:00||;True|2025-02-15T15:24:40.7310549+08:00||;True|2025-02-15T14:26:13.5854743+08:00||;True|2025-02-15T14:23:09.9103735+08:00||;True|2025-02-15T14:11:58.0255348+08:00||;True|2025-02-15T13:55:31.3438054+08:00||;True|2025-02-15T13:47:31.3307267+08:00||;True|2025-02-15T13:46:24.9001959+08:00||;True|2025-02-15T13:23:47.4161644+08:00||;True|2025-02-15T13:10:20.4988808+08:00||;True|2025-02-15T13:05:10.7619905+08:00||;True|2025-02-15T12:55:42.2397751+08:00||;True|2025-02-15T12:43:42.1819119+08:00||;True|2025-02-15T10:19:42.3871047+08:00||;True|2025-01-03T16:15:25.4007394+08:00||;True|2025-01-03T15:59:55.6586669+08:00||;True|2025-01-03T15:58:54.7953589+08:00||;True|2025-01-03T15:54:46.8938743+08:00||;True|2025-01-03T15:30:32.7439557+08:00||;True|2025-01-03T15:27:53.2337341+08:00||;True|2025-01-03T15:24:30.7045349+08:00||;True|2025-01-02T14:13:36.7820311+08:00||;</History> <LastFailureDetails /> </PropertyGroup> </Project> \ No newline at end of file diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs index 76a2a5c..dc8df68 100644 --- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs +++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs @@ -1,6 +1,7 @@ 锘縰sing AutoMapper; using HslCommunication; using Mapster; +using Microsoft.AspNetCore.DataProtection.XmlEncryption; using Newtonsoft.Json; using SqlSugar; using System.Diagnostics.CodeAnalysis; @@ -144,11 +145,26 @@ // 鍒ゆ柇浠诲姟绫诲瀷鏄惁涓哄叆搴撲换鍔� else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) { + var value = _sys_ConfigService.GetByConfigKey(CateGoryConst.CONFIG_SYS_InStation, SysConfigKeyConst.JZNGInBoundStation).ConfigValue; var valueList = value.Split(',').ToList(); // 鍒ゆ柇婧愬湴鍧�鏄惁涓嶇瓑浜�"1359-4" //if (task.SourceAddress != "1359-4" && task.SourceAddress != "1357-4") - if (!valueList.Contains(task.SourceAddress)) + if (task.SourceAddress == "1435" && task.TaskType == (int)TaskInboundTypeEnum.InNG) + { + List<Dt_Router> routers = _routerService.QueryNextRoutes(item.SourceAddress, item.TargetAddress); + if (routers.Count > 0) + { + // 璁剧疆浠诲姟鐘舵�佷负鍏ュ簱鏂板缓 + task.TaskState = (int)TaskInStatusEnum.InNew; + // 璁剧疆褰撳墠鍦板潃涓烘簮鍦板潃 + task.CurrentAddress = item.SourceAddress; + // 璁剧疆涓嬩竴涓湴鍧�涓虹涓�涓瓙浣嶇疆 + task.NextAddress = routers.FirstOrDefault().ChildPosi; + } + task.Remark = "NG"; + } + else if (!valueList.Contains(task.SourceAddress)) { // 鏌ヨ浠庢簮鍦板潃鍒扮洰鏍囧湴鍧�鐨勮矾鐢� List<Dt_Router> routers = _routerService.QueryNextRoutes(item.SourceAddress, item.TargetAddress); diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs index c70398c..e987315 100644 --- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs +++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs @@ -285,59 +285,101 @@ /// </summary> private async Task RequestWmsTask(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue, Dt_StationManager stationManager) { - string isTrue = string.Empty; - - ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); - ResultTrayCellsStatus result = GetResultTrayCellsStatus(command, stationManager); - if (result.SerialNos.Count == 0) + if (childDeviceCode == "1435") { - var Traycontent = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode); - if (Traycontent.Status) - { - ConsoleHelper.WriteSuccessLine("浜屽皝绌烘璇锋眰鍥炴祦"); - ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); - } - } + ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); - List<string> strings = stationManager.Roadway.Split(",").ToList(); - foreach (string item in strings) - { - isTrue = RequestInboundPlatform(item, result.ProductionLine, false); - if (isTrue != null) + var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList(); + + if (serialNosError.Count > 0 || !result.Success || result.SerialNos.Count == 0) { - break; + WMSTaskDTO taskDTO = new WMSTaskDTO + { + TaskNum = _taskRepository.GetTaskNo().Result, + Grade = 1, + PalletCode = command.Barcode, + RoadWay = "CHSC4", + SourceAddress = childDeviceCode, + TargetAddress = "CHSC4", + TaskState = (int)TaskInStatusEnum.InNew, + Id = 2, + TaskType = (int)TaskInboundTypeEnum.InNG, + ProductionLine = result.ProductionLine, + }; + var Taskcontent = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); + if (Taskcontent.Status) + { + ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); + } + ConsoleHelper.WriteSuccessLine($"銆恵stationManager.stationRemark}銆戙�恵stationManager.stationChildCode}銆憑result.MOMMessage}"); + return; } - } - if (isTrue != null && isTrue != string.Empty) - { - WMSTaskDTO taskDTO = new WMSTaskDTO + else { - TaskNum = _taskRepository.GetTaskNo().Result, - Grade = 1, - PalletCode = command.Barcode, - RoadWay = childDeviceCode, - SourceAddress = childDeviceCode, - TargetAddress = isTrue, - TaskState = (int)TaskOutStatusEnum.SC_OutFinish, - Id = 2, - TaskType = (int)TaskOutboundTypeEnum.OutTray, - ProductionLine = result.ProductionLine, - }; - var Taskcontent = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); - if (Taskcontent.Status) - { - ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); + var Taskcontent = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode); + if (Taskcontent.Status) + { + ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); + } } } else { - var Taskcontent = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode); - if (Taskcontent.Status) + string isTrue = string.Empty; + + ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); + + if (result.SerialNos.Count == 0) { - ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); + var Traycontent = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode); + if (Traycontent.Status) + { + ConsoleHelper.WriteSuccessLine("浜屽皝绌烘璇锋眰鍥炴祦"); + ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); + } + } + + List<string> strings = stationManager.Roadway.Split(",").ToList(); + foreach (string item in strings) + { + isTrue = RequestInboundPlatform(item, result.ProductionLine, false); + if (isTrue != null) + { + break; + } + } + if (isTrue != null && isTrue != string.Empty) + { + WMSTaskDTO taskDTO = new WMSTaskDTO + { + TaskNum = _taskRepository.GetTaskNo().Result, + Grade = 1, + PalletCode = command.Barcode, + RoadWay = childDeviceCode, + SourceAddress = childDeviceCode, + TargetAddress = isTrue, + TaskState = (int)TaskOutStatusEnum.SC_OutFinish, + Id = 2, + TaskType = (int)TaskOutboundTypeEnum.OutTray, + ProductionLine = result.ProductionLine, + }; + var Taskcontent = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); + if (Taskcontent.Status) + { + ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); + } + + } + else + { + var Taskcontent = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode); + if (Taskcontent.Status) + { + ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); + } } } } @@ -419,44 +461,6 @@ { ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); } - #region - //if (task != null && task.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting && task.CurrentAddress == "1537") - //{ - // ConveyorLineTaskCommand command1 = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(stationManager.stationLocation); - - // if (command1.InteractiveSignal != 2) - // { - // ConsoleHelper.WriteSuccessLine("鍖栨垚瀹炴墭璇锋眰鍏ラ潤缃�"); - // if (StaticVariable.isStackerRun == true) - // { - // ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); - // } - // return; - // } - // else - // { - // ConsoleHelper.WriteWarningLine("鍑哄簱浠诲姟鏈畬鎴�"); - // return; - // } - //} - //else if (task != null && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) - //{ - // ConsoleHelper.WriteWarningLine("宸插瓨鍦ㄩ潤缃嚭搴撲换鍔�"); - // return; - //} - //else - //{ - // var Task = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode); - // if (Task.Status) - // { - // if (StaticVariable.isStackerRun == true) - // { - // ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode); - // } - // } - // return; - //} - #endregion } else { diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs index e17e153..d74ab47 100644 --- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs +++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs @@ -456,7 +456,36 @@ { var value = _sys_ConfigService.GetByConfigKey(CateGoryConst.CONFIG_SYS_InStation, SysConfigKeyConst.JZNGInBoundStation).ConfigValue; var valueList = value.Split(',').ToList(); - if ((valueList.Contains(task.SourceAddress)) && (task.Roadway.Contains("CH") || task.Roadway.Contains("JZ"))) + if(task.TaskType == (int)TaskInboundTypeEnum.InNG) + { + string[] souredCodes = task.CurrentAddress.Split("-"); + if (souredCodes.Length == 3) + { + stackerCraneTaskCommand.StartRow = Convert.ToInt16(souredCodes[0]); + stackerCraneTaskCommand.StartColumn = Convert.ToInt16(souredCodes[1]); + stackerCraneTaskCommand.StartLayer = Convert.ToInt16(souredCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟璧风偣閿欒锛岃捣鐐癸細銆恵task.CurrentAddress}銆�"); + return null; + } + string[] targetCodes = task.NextAddress.Split("-"); + if (targetCodes.Length == 3) + { + stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]) % 2 != 0 ? (short)1 : (short)2; + stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); + stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); + } + else + { + //鏁版嵁閰嶇疆閿欒 + _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鍏ュ簱浠诲姟缁堢偣閿欒锛岃捣鐐癸細銆恵task.NextAddress}銆�"); + return null; + } + } + else if ((valueList.Contains(task.SourceAddress)) && (task.Roadway.Contains("CH") || task.Roadway.Contains("JZ"))) { string[] souredCodes = task.CurrentAddress.Split("-"); if (souredCodes.Length == 3) -- Gitblit v1.9.3