| | |
| | | //var time2 = DateTime.Now;//返回时间 .ToString("yyyy-MM-dd HH:mm:ss") |
| | | |
| | | //////解析返回数据 |
| | | //var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response); |
| | | var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response); |
| | | //if (wcsModel.StatusCode == 0) |
| | | //{ |
| | | // //更改任务的发送返回时间// |
| | |
| | | |
| | | |
| | | //重新下发出库任务 |
| | | public OutCommandDto AgainSendSoTask(string taskNo, int userId, string url) |
| | | public OutCommandDto AgainSendSoTask(string taskNo, string Receiver, int userId, string url) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | //程序正式发布后放开 |
| | | var time1 = DateTime.Now;//发送时间 .ToString("yyyy-MM-dd HH:mm:ss") |
| | | var response = HttpHelper.DoPost(url, jsonData, "下发给WCS出库命令", "WCS"); |
| | | var response = HttpHelper.DoPost(url, jsonData, Receiver == "WCS" ? "下发给WCS出库命令" : "下发给AGV出库命令", "WCS"); |
| | | var time2 = DateTime.Now;//返回时间 .ToString("yyyy-MM-dd HH:mm:ss") |
| | | |
| | | if (Receiver == "WCS") |
| | | { |
| | | ////解析返回数据 |
| | | var wcsModel = JsonConvert.DeserializeObject<WcsModel>(response); |
| | | if (wcsModel.StatusCode == 0) |
| | |
| | | throw new Exception($"wcs返回状态异常:{wcsModel.Msg}"); |
| | | } |
| | | } |
| | | else if (Receiver == "AGV") |
| | | { |
| | | ////解析返回数据 |
| | | var agvModel = JsonConvert.DeserializeObject<OutCommanAgvDto>(response); |
| | | if (agvModel.Code == "0") |
| | | { |
| | | //更改任务的发送返回时间// |
| | | new TaskServer().EditTaskIssueOk(list, time1, time2); |
| | | |
| | | } |
| | | if (agvModel.Code == "1") |
| | | { |
| | | new TaskServer().EditTaskIssueNo(list, time1, time2, agvModel.Message); |
| | | throw new Exception($"agv返回状态异常:{agvModel.Message}"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |