| | |
| | | if (command.CV_State == 2) |
| | | { |
| | | // 检查该位置是否已有任务 |
| | | var existingTask = _taskService.Db.Queryable<Dt_Task>().First(x => x.TargetAddress == childDeviceCode); |
| | | if (existingTask.IsNullOrEmpty()) |
| | | var existingTask = _taskService.Db.Queryable<Dt_Task>().Count(x => x.TargetAddress == childDeviceCode); |
| | | if (existingTask < 5) |
| | | { |
| | | // 没有任务,向 WMS 请求出库托盘任务 |
| | | var position = checkPalletPositions.FirstOrDefault(x => x.Code == childDeviceCode); |
| | |
| | | ProcessTaskState(conveyorLine, command, task, childDeviceCode); |
| | | continue; |
| | | } |
| | | // Todo: 下面的逻辑主要处理没有查询到任务但有条码的情况,可能是需要生成机械手任务或者调用 WMS 创建入库任务 (临时使用) |
| | | else if (!command.Barcode.IsNullOrEmpty() && childDeviceCode == "11068") |
| | | { |
| | | var isWcsTask = _taskService.Db.Queryable<Dt_Task>().Any(x => x.PalletCode == command.Barcode && (x.TaskStatus == (int)TaskOutStatusEnum.OutNew || x.TaskStatus == (int)TaskInStatusEnum.InNew)); |