| | |
| | | |
| | | var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = palletCode, EquiCodeMOM = stationManager.stationEquipMOM, Roadways = stationManager.Roadway, area = stationManager.stationArea, Position = stationManager.stationChildCode }.ToJsonString()); |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | |
| | | if (!content.Status) |
| | | { |
| | | // wms失败返回去NG口任务 |
| | | |
| | | |
| | | //if (stationManager.stationChildCode != stationManager.stationNGChildCode) |
| | | //{ |
| | | // WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | // { |
| | | // Grade = 8, |
| | | // PalletCode = palletCode, |
| | | // SourceAddress = stationManager.stationLocation, |
| | | // TargetAddress = stationManager.stationNGLocation, |
| | | // RoadWay = stationManager.Roadway, |
| | | // TaskNum = 1000, |
| | | // TaskState = (int)TaskOutStatusEnum.OutNew, |
| | | // TaskType = (int)TaskOutboundTypeEnum.InToOut |
| | | // }; |
| | | //} |
| | | return content; |
| | | } |
| | | |
| | | var task = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString()); |
| | | ConsoleHelper.WriteSuccessLine(content.Data.ToString()); |
| | | return ReceiveByWMSTask(task); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | } |
| | | |
| | | public async Task<WebResponseContent> RequestOutTaskToBZAsync(Dt_StationManager stationManager) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); |
| | | var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue; |
| | | var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.RequestOutTaskToBZ)?.ConfigValue; |
| | | if (wmsBase == null || requestTask == null) |
| | | { |
| | | throw new InvalidOperationException("WMS IP 未配置"); |
| | | } |
| | | var wmsIpAddrss = wmsBase + requestTask; |
| | | |
| | | var result = await HttpHelper.PostAsync(wmsIpAddrss, new { }.ToJsonString()); |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | if (!content.Status) |
| | | { |
| | | //无满足条件可出库至包装的库存 |
| | | return content; |
| | | } |
| | | |
| | | var task = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString()); |
| | | ConsoleHelper.WriteSuccessLine(content.Data.ToString()); |
| | | content = ReceiveByWMSTask(task); |
| | | //if (content.Status) |
| | | //{ |
| | | // //相应的在途数据+1 |
| | | // // _taskNeedBarcodeRepository.UpdateData(); |
| | | //} |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 接收WMS任务信息 |
| | | /// </summary> |