| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æçå·ãèµ·å§å°ååWMS请æ±ä»»å¡ï¼å
¥åºçæ¬) |
| | | /// </summary> |
| | | /// <param name="palletCode">æçå·</param> |
| | | /// <param name="sourceAddress">èµ·å§å°å</param> |
| | | /// <returns></returns> |
| | | public Dt_Task? InBeforeCheck(int taskNum) |
| | | { |
| | | 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.InTransferCheck)?.ConfigValue; |
| | | if (wmsBase == null || requestTask == null) |
| | | { |
| | | throw new InvalidOperationException("WMS IP æªé
ç½®"); |
| | | } |
| | | var wmsIpAddrss = wmsBase + requestTask; |
| | | |
| | | var result = HttpHelper.Post(wmsIpAddrss, new { taskNum = taskNum }.ToJsonString()); |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | |
| | | if (!content.Status) |
| | | { |
| | | // wms失败 |
| | | throw new Exception(); |
| | | } |
| | | |
| | | |
| | | //todo ä¼å 妿ªæ¥è¯¢å°ä»»å¡åå¤ç |
| | | //if (content.Data != null) |
| | | //{ |
| | | var task = JsonConvert.DeserializeObject<Dt_Task>(content.Data.ToString()); |
| | | |
| | | Dt_Task? Relocationtask = null; |
| | | if (task.TaskNum != taskNum) |
| | | { |
| | | |
| | | BaseDal.AddData(task); |
| | | Relocationtask = BaseDal.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | } |
| | | //} |
| | | |
| | | if (Relocationtask != null) |
| | | { |
| | | return task; |
| | | } |
| | | else |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception($"请æ±å¼å¸¸ï¼{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | #region æ ¹æ®æçå·ãç«å°åWMS请æ±ä»»å¡ |
| | | /// <summary> |
| | | /// æ ¹æ®æçå·ãç«å°åWMS请æ±ä»»å¡ |
| | |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationLocation == taskDTO.TargetAddress && x.Roadway == taskDTO.RoadWay); |
| | | |
| | | task.TaskState = (int)TaskOutStatusEnum.OutNew; |
| | | if (task.SourceAddress == "2009") |
| | | { |
| | | task.TaskState = (int)TaskOutStatusEnum.SC_OutFinish; |
| | | } |
| | | |
| | | task.CurrentAddress = taskDTO.RoadWay; |
| | | task.NextAddress = stationinfo.stationChildCode; |
| | | task.SourceAddress = taskDTO.SourceAddress; |