| | |
| | | Dispatchertime = DateTime.Now, |
| | | }; |
| | | Db.Ado.BeginTran(); |
| | | _stockService.StockInfoService.AddStockEmpty(barcode); |
| | | WebResponseContent content = _stockService.StockInfoService.AddStockEmpty(barcode); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | _taskRepository.AddData(task); |
| | | List<WMSTaskDTO> wMSTaskDTOs = _mapper.Map<List<WMSTaskDTO>>(new List<Dt_Task> { task }); |
| | | var ResultData = HttpHelper.PostAsync(WCSInterfaceAddress.ReceiveTask, wMSTaskDTOs.ToJson(), headers: new Dictionary<string, string>()); |
| | | if (ResultData.Result == null) throw new Exception($"åWCSä¸å空æå
¥åºä»»å¡è¶
æ¶"); |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result); |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result); |
| | | if (content == null) throw new Exception($"ä¸å空æå
¥åºä»»å¡WCSæ ååº"); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | Db.Ado.CommitTran(); |
| | | } |
| | | else |
| | | throw new Exception($"æçå·ã{barcode}ãå·²åå¨ä»»å¡"); |
| | | #endregion |
| | | return WebResponseContent.Instance.OK(); |
| | | } |