From 58a5a9af83492c5bbb4fba88b4443f08fa4becfc Mon Sep 17 00:00:00 2001 From: 刘磊 <1161824510@qq.com> Date: 星期二, 17 十二月 2024 19:53:14 +0800 Subject: [PATCH] 解决冲突 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs | 63 ++++--------------------------- 1 files changed, 8 insertions(+), 55 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs index 65474d7..0b756c1 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs @@ -148,6 +148,13 @@ private Dt_Task? GetTask(CommonStackerStationCrane commonStackerCrane) { Dt_Task task; + + task = _taskService.QueryRelocationTask(commonStackerCrane.DeviceCode); + if (task != null) + { + return task; + } + if (commonStackerCrane.LastTaskType == null) { task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode); @@ -239,7 +246,7 @@ string[] sourceCodes = task.SourceAddress.Split("-"); if (sourceCodes.Length == 3) { - stackerCraneTaskCommand.StartRow = (short)(Convert.ToInt16(sourceCodes[0]) % 2 == 0 ? 2:1); + stackerCraneTaskCommand.StartRow = (short)(Convert.ToInt16(sourceCodes[0]) % 2 == 0 ? 2 : 1); stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); } @@ -252,27 +259,6 @@ string[] targetCodes = task.TargetAddress.Split("-"); if (targetCodes.Length == 3) { - //if (task.Roadway.Contains("FR")) - //{ - // if(task.Roadway.EndsWith("03")|| task.Roadway.EndsWith("01")) - // { - - // stackerCraneTaskCommand.EndRow = (short)(Convert.ToInt16(targetCodes[0]) % 2 == 0 ? 1 : 2); - // stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); - // stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); - // } - // else - // { - - // stackerCraneTaskCommand.EndRow = (short)(Convert.ToInt16(targetCodes[0]) % 2 == 0 ? 2 : 1); - // stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); - // stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); - // } - //} - //else - //{ - - //} stackerCraneTaskCommand.EndRow = (short)(Convert.ToInt16(targetCodes[0]) % 2 == 0 ? 2 : 1); stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); @@ -286,38 +272,5 @@ return stackerCraneTaskCommand; } - - - /// <summary> - /// 璁惧蹇冭烦 - /// </summary> - /// <param name="commonStackerCrane"></param> - public async void EqptAlive(CommonStackerCrane commonStackerCrane) - { - if (commonStackerCrane.StackerOnline) - { - BasicDto dto = new BasicDto - { - EmployeeNo = "T00001", - EquipmentCode = commonStackerCrane.DeviceCode, - RequestTime = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"), - SessionId = Guid.NewGuid().ToString(), - Software = commonStackerCrane.DeviceName, - }; - var respone = await HttpHelper.PostAsync("http://ts-momapp01:12020/api/MachineIntegration/EqptAlive", dto.ToJsonString()); - if (respone != null) - { - var result = JsonConvert.DeserializeObject<ResponseEqptAliveDto>(respone); - if (result != null && result.Success) - { - if (result.KeyFlag == "99") - commonStackerCrane.StackerOnline = true; - else if (result.KeyFlag == "98") - commonStackerCrane.StackerOnline = false; - } - } - } - } - } } \ No newline at end of file -- Gitblit v1.9.3