| | |
| | | ConveyorLineSignal conveyorLineSignalRead = conveyorLineInfoRead.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | |
| | | ConveyorLineSignal conveyorLineSignalWrite = conveyorLineInfoWrite.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | //满ææè½½åº |
| | | if (item.StationType == StationTypeEnum.StationType_PakcPallet.ObjToInt()) |
| | | { |
| | | if (conveyorLineSignalRead.STB && !conveyorLineSignalWrite.ACK) |
| | |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) /*&& x.DeviceCode == item.StationDeviceCode*/ && (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.WarehouseId == warehouseDevice.WarehouseId); |
| | | if (task != null && conveyorLineInfoWrite.Spare2 == 0 && conveyorLineStatus.Goods) |
| | | { |
| | | //List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList(); |
| | | ////åé
å··é |
| | | //WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2); |
| | | //if (responseContent.Status) |
| | | //{ |
| | | // device.SetValue(W_ConveyorLineDB.Spare2, 1, item.StationCode); |
| | | // _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode, roadwayNo: responseContent.Data.ToString() ?? ""); |
| | | //} |
| | | device.SetValue(W_ConveyorLineDB.Spare2, 1, item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode); |
| | | } |
| | |
| | | { |
| | | if (conveyorLineInfoRead.TaskNum == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//éè´å
¥åº |
| | | { |
| | | #region ä»»å¡å·ä¸º0ï¼ä¸ææçå·ï¼åæ¯éè´å
¥åº |
| | | #region ä»»å¡å·ä¸º0ï¼ä¸ææçå·ï¼åæ¯äººå·¥æ¾è´§å
¥åº |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && (x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()) && x.PalletCode == conveyorLineInfoRead.Barcode && x.WarehouseId == warehouseDevice.WarehouseId); |
| | | if (task != null) |
| | | { |
| | |
| | | else//ç产éåº //æ¢å··éå
¥åº |
| | | { |
| | | #region ç产éåº,带任å¡å·æ¥è¯¢ä»»å¡ |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()); // 带任å¡å·æ¥è¯¢ä»»å¡ |
| | | Dt_Task taskIn = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); // 带任å¡å·æ¥è¯¢ä»»å¡ |
| | | if (task != null) |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()); // 带任å¡å·æ¥è¯¢ä»»å¡ éæä»»å¡ |
| | | Dt_Task taskIn = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); // 带任å¡å·æ¥è¯¢ä»»å¡ å
¥åº |
| | | if (task != null) //éæä»»å¡ èµ·ç¹å
¥åºç«å° |
| | | { |
| | | List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList(); |
| | | WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2); |
| | | if (responseContent.Status) |
| | | { |
| | | //string currentAddress = task.CurrentAddress; |
| | | //string nextAddress = task.NextAddress; |
| | | //string targetAddress = task.TargetAddress; |
| | | string roadwayNo = task.Roadway; |
| | | |
| | | string currentAddress = task.CurrentAddress; |
| | | string nextAddress = task.NextAddress; |
| | | string targetAddress = task.TargetAddress; |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (router.IsEnd) |
| | | if (router.IsEnd) //å½åèµ·ç¹å
¥åºç«å°ç´æ¥å
¥åº |
| | | { |
| | | string? targetLoca = _taskService.RequestAssignLocationByHeight(task.TaskNum, responseContent.Data.ToString(), conveyorLineInfoRead.Spare2); |
| | | if (!string.IsNullOrEmpty(targetLoca)) |
| | |
| | | continue; |
| | | } |
| | | } |
| | | else |
| | | else //æ¢å··éåé
å
¶ä»å··éçå
¥åºç«å° |
| | | { |
| | | //task.NextAddresså¯è½æ¯router.NextPosi |
| | | roadwayNo = responseContent.Data.ToString(); |
| | |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | } |
| | | //else //è°æ¨ä½¿ç¨ |
| | | //{ |
| | | // device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | //} |
| | | //{ |
| | | // task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && string.IsNullOrEmpty(x.DeviceCode) && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.WarehouseId == warehouseDevice.WarehouseId); |
| | | // if (task != null) |
| | | // { |
| | | // Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.CurrentAddress); |
| | | // if (stationManger != null) |
| | | // { |
| | | // _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: stationManger.StackerCraneCode, currentAddress: stationManger.StackerCraneStationCode, nextAddress: task.TargetAddress); |
| | | // } |
| | | // } |
| | | //} |
| | | //else |
| | | } |
| | | else if (!conveyorLineSignalRead.STB && conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); |
| | | } |
| | | } |
| | | //else if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt()) |
| | | //{ |
| | | // if (!conveyorLineSignalWrite.ACK && conveyorLineSignalRead.STB && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm) |
| | | // { |
| | | // if (conveyorLineInfoRead.TaskNum == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//éæå
¥åº |
| | | // { |
| | | |
| | | // } |
| | | // else//åºåºå®æ |
| | | // { |
| | | |
| | | // } |
| | | // } |
| | | // else if (conveyorLineSignalWrite.STB && conveyorLineSignalRead.ACK && !conveyorLineStatus.Alarm) |
| | | // { |
| | | // device.SetValue(W_ConveyorLineDB.STB, false, item.StationCode); |
| | | // } |
| | | // else if (!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK && !conveyorLineStatus.Alarm) |
| | | // { |
| | | // device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); |
| | | // } |
| | | //} |
| | | } |
| | | else |
| | | { |