| | |
| | | /// <param name="palletCode">æçå·</param> |
| | | /// <param name="sourceAddress">èµ·å§å°å</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress) |
| | | public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = "") |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | } |
| | | string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); |
| | | string responseStr = ""; |
| | | if (!string.IsNullOrEmpty(materielBoxCode)) |
| | | { |
| | | responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}&materielBoxCode={materielBoxCode}"); |
| | | } |
| | | else |
| | | { |
| | | responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}"); |
| | | } |
| | | WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); |
| | | if (responseContent != null && responseContent.Status && responseContent.Data != null) |
| | | { |
| | |
| | | /// <param name="sourceAddress"></param> |
| | | /// <param name="roadway"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string address = AppSettings.Get("WMSApiAddress"); |
| | | if (string.IsNullOrEmpty(address)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | } |
| | | string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&palletCode={palletCode}"); |
| | | WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); |
| | | if (responseContent != null && responseContent.Status && responseContent.Data != null) |
| | | { |
| | | WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString()); |
| | | if (taskDTO != null) |
| | | { |
| | | content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | } |
| | | } |
| | | //public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway) |
| | | //{ |
| | | // WebResponseContent content = new WebResponseContent(); |
| | | // try |
| | | // { |
| | | // string address = AppSettings.Get("WMSApiAddress"); |
| | | // if (string.IsNullOrEmpty(address)) |
| | | // { |
| | | // return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | // } |
| | | // string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&palletCode={palletCode}"); |
| | | // WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); |
| | | // if (responseContent != null && responseContent.Status && responseContent.Data != null) |
| | | // { |
| | | // WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString()); |
| | | // if (taskDTO != null) |
| | | // { |
| | | // content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // content = WebResponseContent.Instance.Error(ex.Message); |
| | | // } |
| | | // return content; |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// |