| | |
| | | /// </summary> |
| | | private void HandleNewTask(CommonConveyorLine_CW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode) |
| | | { |
| | | try |
| | | { |
| | | |
| | | Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode); |
| | | |
| | | if (stationManager == null) |
| | |
| | | // break; |
| | | } |
| | | |
| | | #region |
| | | //Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode); |
| | | |
| | | //if (stationManager.stationType == 8) |
| | | //{ |
| | | // var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); |
| | | // if (task != null) |
| | | // { |
| | | // RequestInNextAddress(conveyorLine, command, childDeviceCode); |
| | | // } |
| | | //} |
| | | //else if (stationManager.stationType == 9) |
| | | //{ |
| | | // var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); |
| | | // if (task != null) |
| | | // { |
| | | // ConveyorLineInFinish(conveyorLine, command, childDeviceCode); |
| | | // } |
| | | //} |
| | | //else if (stationManager.stationType == 1) |
| | | //{ |
| | | // if (stationManager.stationArea.Contains("GW")) |
| | | // { |
| | | // var taskGW = _taskRepository.QueryFirst(x => x.TargetAddress == childDeviceCode && x.TaskState == (int)TaskOutStatusEnum.OutFinish); |
| | | // if (taskGW != null) |
| | | // { |
| | | // command.ConveyorLineBarcode = taskGW.PalletCode; |
| | | // } |
| | | // } |
| | | // RequestWmsTask(conveyorLine, command, childDeviceCode); |
| | | //} |
| | | //else if (stationManager.stationType == 10) |
| | | //{ |
| | | // var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode); |
| | | // if (task != null) |
| | | // { |
| | | // RequestOutbound(conveyorLine, command, childDeviceCode); |
| | | // } |
| | | //} |
| | | //else if (stationManager.stationType == 11) |
| | | //{ |
| | | // var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); |
| | | // if (task != null) |
| | | // { |
| | | // RequestOutNextAddress(conveyorLine, command, childDeviceCode); |
| | | // } |
| | | //} |
| | | //else if (stationManager.stationType == 12) |
| | | //{ |
| | | // var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode); |
| | | // if (task != null) |
| | | // { |
| | | // ConveyorLineOutFinish(conveyorLine, command, childDeviceCode); |
| | | // } |
| | | //} |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteInfo("HandleNewTask", $"【{ex.Message}】"); |
| | | } |
| | | } |
| | | |
| | | private void ExecuteStationAction(Dt_StationManager stationManager, CommonConveyorLine_CW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode) |
| | |
| | | AbNormalStationBZTask(conveyorLine, command, childDeviceCode); |
| | | break; |
| | | case 1: |
| | | |
| | | RequestWmsTask(conveyorLine, command, childDeviceCode, stationManager); |
| | | break; |
| | | } |