| | |
| | | private async Task<WebResponseContent> RequestInTask(string palletCode, Dt_StationManager stationManager) |
| | | { |
| | | var wmsIpAddrss = GetWmsIpAddress(SysConfigKeyConst.RequestInTask); |
| | | var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = palletCode, EquiCodeMOM = stationManager.stationEquipMOM, Roadways = stationManager.Roadway, area = stationManager.stationArea, Position = stationManager.stationChildCode }.ToJsonString()); |
| | | var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = palletCode, EquiCodeMOM = stationManager.stationEquipMOM, Roadways = stationManager.Roadway, area = stationManager.stationArea, Position = stationManager.stationChildCode, ProductionLine = stationManager.productLine}.ToJsonString()); |
| | | return JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | } |
| | | |
| | |
| | | public WebResponseContent ReceiveByWMSTask([NotNull] WMSTaskDTO taskDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | ConsoleHelper.WriteSuccessLine($"接收到任务,任务数据:{JsonConvert.SerializeObject(taskDTO, Formatting.Indented)}"); |
| | | try |
| | | { |
| | | if (BaseDal.QueryFirst(x => x.TaskNum == taskDTO.TaskNum || x.PalletCode == taskDTO.PalletCode) != null) |
| | |
| | | task.NextAddress = stationinfo.stationChildCode; |
| | | task.SourceAddress = taskDTO.SourceAddress; |
| | | task.TargetAddress = taskDTO.TargetAddress; |
| | | //if (taskDTO.TaskType == (int)TaskOutboundTypeEnum.InToOut) |
| | | //{ |
| | | // task.TaskState = (int)TaskInStatusEnum.Line_InFinish; |
| | | //} |
| | | } |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | |
| | | var task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) return WebResponseContent.Instance.Error($"未找到该任务信息,任务号:【{taskNum}】"); |
| | | |
| | | //if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) |
| | | //{ |
| | | // //todo |
| | | |
| | | //} |
| | | //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting) |
| | | //{ |
| | | // //todo 同步到WMS |
| | | |
| | | // BaseDal.DeleteData(task); |
| | | |
| | | //} |
| | | //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | //{ |
| | | // //todo 调用WMS移库完成 |
| | | //} |
| | | //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OtherGroup) |
| | | //{ |
| | | //} |
| | | //else |
| | | //{ |
| | | // throw new Exception($"任务类型错误,未找到该任务类型,任务号:【{taskNum}】,任务类型:【{task.TaskType}】"); |
| | | //} |
| | | |
| | | #region WMS同步任务完成 |
| | | |
| | | var keys = new Dictionary<string, object>() |
| | |
| | | BaseDal.DeleteData(task); |
| | | } |
| | | |
| | | #region 更新任务状态 |
| | | |
| | | //var updateTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.UpdateTask)?.ConfigValue; |
| | | //if (wmsBase == null || updateTask == null) |
| | | //{ |
| | | // throw new InvalidOperationException("WMS IP 未配置"); |
| | | //} |
| | | //wmsIpAddress = wmsBase + updateTask; |
| | | |
| | | //result = HttpHelper.PostAsync(wmsIpAddress, new { TaskNum = task.TaskNum, TaskState = task.TaskState }.ToJsonString()).Result; |
| | | //content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | |
| | | #endregion 更新任务状态 |
| | | |
| | | //content = WebResponseContent.Instance.OK(); |
| | | content.OK(data: task); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | return content; |
| | | } |
| | | //public override WebResponseContent DeleteData(Dt_Task entity) |
| | | //{ |
| | | // return base.DeleteData(entity); |
| | | //} |
| | | } |
| | | } |