| | |
| | | RobotSourceAddressLineCode = stockDTO.SourceLineNo, |
| | | RobotTargetAddressLineCode = stockDTO.TargetLineNo, |
| | | RobotRoadway = stockDTO.Roadway, |
| | | RobotSourceAddress = stockDTO.SourceLineNo, |
| | | RobotTargetAddress = stockDTO.TargetLineNo, |
| | | RobotSourceAddress = taskDTO.SourceAddress, |
| | | RobotTargetAddress = taskDTO.TargetAddress, |
| | | RobotSourceAddressPalletCode = stockDTO.SourcePalletNo, |
| | | RobotTargetAddressPalletCode = stockDTO.TargetPalletNo, |
| | | RobotTaskType = taskDTO.TaskType, |
| | | RobotTaskState = taskDTO.TaskState, |
| | | RobotTaskState = taskDTO.TaskStatus, |
| | | RobotGrade = taskDTO.Grade, |
| | | Creater = "WMS" |
| | | Creater = "WMS", |
| | | RobotTaskTotalNum = 48, |
| | | }; |
| | | |
| | | BaseDal.AddData(task); |
| | |
| | | public Dt_RobotTask? QueryRobotCraneTask(string deviceCode) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.RobotRoadway == deviceCode && x.RobotTaskState != (int)TaskRobotStatusEnum.RobotExecuting, TaskOrderBy); |
| | | } |
| | | |
| | | public Dt_RobotTask? QueryRobotCraneExecutingTask(string deviceCode) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.RobotRoadway == deviceCode && x.RobotTaskState == (int)TaskRobotStatusEnum.RobotExecuting, TaskOrderBy); |
| | | } |
| | | |
| | | public async Task<bool> UpdateRobotTaskAsync(Dt_RobotTask robotTask) |
| | |
| | | /// 将配置任务类型转换为接口配置键。 |
| | | /// 支持值:Split/Group/Change(大小写不敏感) |
| | | /// </summary> |
| | | private string MapRobotTaskTypeToConfigKey(string? taskType) |
| | | public string MapRobotTaskTypeToConfigKey(string? taskType) |
| | | { |
| | | string type = (taskType ?? string.Empty).Trim().ToLowerInvariant(); |
| | | return type switch |
| | |
| | | /// <summary> |
| | | /// 根据接口类型构建机械手任务入参。 |
| | | /// </summary> |
| | | private StockDTO BuildRobotTaskStock(Dt_Task task, string configKey) |
| | | public StockDTO BuildRobotTaskStock(Dt_Task task, string configKey) |
| | | { |
| | | string targetAddress = task.TargetAddress ?? string.Empty; |
| | | string roadway = ResolveRobotRuleValue(targetAddress, "AddressRoadwayMap", task.Roadway); |
| | |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)device; |
| | | |
| | | DeviceProDTO? devicePro = conveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(ConveyorLineDBNameNew.Barcode) && x.DeviceChildCode == sourceLineNo); |
| | | ConveyorLineTaskCommandNew command = conveyorLine.ReadCustomer<ConveyorLineTaskCommandNew>(sourceLineNo); // 测试用 |
| | | //var barcode = conveyorLine.GetValue<ConveyorLineDBNameNew, string>(ConveyorLineDBNameNew.Barcode, sourceLineNo); |
| | | stock.SourcePalletNo = string.IsNullOrEmpty(command.Barcode.Replace("\0", "").ToString()) ? string.Empty : command.Barcode.Replace("\0", "").ToString(); |
| | | //ConveyorLineTaskCommandNew command = conveyorLine.ReadCustomer<ConveyorLineTaskCommandNew>(sourceLineNo); // 测试用 |
| | | var barcode = conveyorLine.GetValue<ConveyorLineDBNameNew, string>(ConveyorLineDBNameNew.Barcode, sourceLineNo); |
| | | stock.SourcePalletNo = string.IsNullOrEmpty(barcode) ? string.Empty : barcode; |
| | | } |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 根据目标地址按「精确 > 回退值」解析规则值。 |
| | | /// </summary> |
| | | private string ResolveRobotRuleValue(string? targetAddress, string addressSectionName, string? fallback) |
| | | public string ResolveRobotRuleValue(string? targetAddress, string addressSectionName, string? fallback) |
| | | { |
| | | string address = (targetAddress ?? string.Empty).Trim(); |
| | | string defaultValue = fallback ?? string.Empty; |