From ad16e8351b0ece14ac2c1672dea69b08ef079e88 Mon Sep 17 00:00:00 2001 From: 肖洋 <cathay_xy@163.com> Date: 星期三, 15 一月 2025 18:19:03 +0800 Subject: [PATCH] 优化代码并更新配置文件 --- Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs | 60 ++++++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 42 insertions(+), 18 deletions(-) diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs index 2dce837..16bde53 100644 --- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs +++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs @@ -238,24 +238,48 @@ { if (command.ConveyorLineBarcode != "NoRead") { - var taskDTO = CreateEmptyTrayTaskDto(command.ConveyorLineBarcode, childDeviceCode); - - if (_taskRepository.QueryFirst(x => x.PalletCode == taskDTO.PalletCode) != null) + var config = _sys_ConfigService.GetByConfigKey("SYS_BASE", "ISFRINTRAY"); + if (config.ConfigValue == "1") { - WriteInfo(conveyorLine.DeviceName, "褰撳墠鎵樼洏瀛樺湪浠诲姟"); - return; - } - - var content = CreateAndSendTask(taskDTO); - if (content.Status) - { - var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); - if (task != null) + Random random = new Random(); + var task = new Dt_Task() { - var taskCommand = MapTaskCommand(task, command); - conveyorLine.SendCommand(taskCommand, childDeviceCode); - //ConveyorLineSendFinish(conveyorLine, childDeviceCode, true); - _taskService.UpdateTaskStatusToNext(task); + CurrentAddress = childDeviceCode, + Grade = 1, + NextAddress = "2066", + PalletCode = command.ConveyorLineBarcode, + Roadway = "FR", + SourceAddress = childDeviceCode, + TargetAddress = "2066", + TaskNum = random.Next(1,9999), + TaskType = (int)TaskInboundTypeEnum.InTray, + TaskState = (int)TaskInStatusEnum.Line_InExecuting, + WMSId = 0 + }; + var taskCommand = MapTaskCommand(task, command); + conveyorLine.SendCommand(taskCommand, childDeviceCode); + } + else + { + var taskDTO = CreateEmptyTrayTaskDto(command.ConveyorLineBarcode, childDeviceCode); + + if (_taskRepository.QueryFirst(x => x.PalletCode == taskDTO.PalletCode) != null) + { + WriteInfo(conveyorLine.DeviceName, "褰撳墠鎵樼洏瀛樺湪浠诲姟"); + return; + } + + var content = CreateAndSendTask(taskDTO); + if (content.Status) + { + var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); + if (task != null) + { + var taskCommand = MapTaskCommand(task, command); + conveyorLine.SendCommand(taskCommand, childDeviceCode); + //ConveyorLineSendFinish(conveyorLine, childDeviceCode, true); + _taskService.UpdateTaskStatusToNext(task); + } } } } @@ -369,10 +393,10 @@ } - if( conveyorLine.ReadValue(ConveyorLineDBName_After.InteractiveSignal, childDeviceCode).ObjToInt() == 0) //鎵樼洏姝e弽淇″彿 + if (conveyorLine.ReadValue(ConveyorLineDBName_After.InteractiveSignal, childDeviceCode).ObjToInt() == 0) //鎵樼洏姝e弽淇″彿 { - }; + }; conveyorLine.ReadValue(ConveyorLineDBName_After.InteractiveSignal, childDeviceCode); //鎵樼洏鏈夋棤鐢佃姱淇″彿 -- Gitblit v1.9.3