| | |
| | | using Newtonsoft.Json; |
| | | using Quartz; |
| | | using SqlSugar; |
| | | using System.Text; |
| | | using System.Text.Json; |
| | | using WIDESEA_Core; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | |
| | | { |
| | | _logger.LogDebug("Execute:子设备 {ChildDeviceCode} 命令为空,跳过", childDeviceCode); |
| | | QuartzLogger.Debug($"子设备 {childDeviceCode} 命令为空,跳过", conveyorLine.DeviceCode); |
| | | return Task.CompletedTask; |
| | | continue; |
| | | } |
| | | |
| | | // 如果 WCS_ACK 为 1,先清除(表示处理过上一次请求) |
| | |
| | | if (checkPalletPositions.Any(x => x.Code == childDeviceCode)) |
| | | { |
| | | // 检查输送线状态(是否有托盘) |
| | | if (command.CV_State == 1) |
| | | if (command.CV_State == 2) |
| | | { |
| | | // 检查该位置是否已有任务 |
| | | var existingTask = _taskService.Db.Queryable<Dt_Task>().First(x => x.TargetAddress == childDeviceCode); |
| | |
| | | // 只有当 PLC_STB 为 1 时才处理任务 |
| | | if (command.PLC_STB != 1) |
| | | { |
| | | //_logger.LogDebug("Execute:子设备 {ChildDeviceCode} PLC_STB 不为1,跳过", childDeviceCode); |
| | | //QuartzLogger.Debug($"子设备 {childDeviceCode} PLC_STB 不为1,跳过", conveyorLine.DeviceCode); |
| | | return Task.CompletedTask; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // ========== 处理已有任务号的情况 ========== |
| | | if (command.TaskNo > 0) |
| | | if (command.TaskNo > 0 && !command.Barcode.IsNullOrEmpty()) |
| | | { |
| | | // 查询正在执行的任务 |
| | | Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNo, childDeviceCode); |