From afe3251dc24cc84cad97e3e7283cfd834b873f9f Mon Sep 17 00:00:00 2001 From: "nodyang@aliyun.com" Date: Sat, 14 Dec 2024 11:16:06 +0800 Subject: [PATCH] 23 --- .../apiParam/CsbResult.cs | 15 ++++++++++++++- .../WebApiClientApp.cs | 1 + .../viewModel/MainWindowViewModel.cs | 18 ++++++++++-------- .../viewModel/TransferOrderViewModel.cs | 4 ++-- .../containerStorageQueryByCsbViewModel.cs | 4 ++-- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs b/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs index 1d8491d..4e5def7 100644 --- a/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs +++ b/SlnMesnac.RfidUpload.Model/apiParam/CsbResult.cs @@ -64,6 +64,19 @@ namespace SlnMesnac.RfidUpload.Model.apiParam return str as JObject; } + public string GetMsg() + { + var job = GetRetBodyJObject(); + if (job != null) + { + var s = job?["msg"]?.ToString(); + var b = job?["status"].ToString(); + return s +" "+ b??""; + } + + return ""; + } + public string GetRetBody() { JObject job = JObject.Parse(body); @@ -73,7 +86,7 @@ namespace SlnMesnac.RfidUpload.Model.apiParam return str; } - return ""; + return message; } public string code { get; set; } diff --git a/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs b/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs index b59cd94..9e00b19 100644 --- a/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs +++ b/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs @@ -102,6 +102,7 @@ namespace SlnMesnac.RfidUpload.TouchSocket logger.Info($"Http请求的:[{reqName}]:[{guid}] => \r\n {str}"); logger.Info($"Http请求ParamStr的:[{reqName}]:[{guid}] => \r\n {paramStr}"); result = client.PostJson(appConfig.localUrl, container); + logger.Info($"Http返回的:[{reqName}]:[{guid}] => \r\n {result}"); } diff --git a/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs index 5a8513a..a9cc9eb 100644 --- a/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs +++ b/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs @@ -424,15 +424,17 @@ namespace SlnMesnac.RfidUpload.UI.viewModel TransferOrderInfoItem.ffjhscrq, batchNo.ToString(), enumerable.ToList()); } - - MessageBox.Show("封发-按调拨单"+res.message); - + MessageBox.Show($"封发-按调拨单 [{res.GetMsg()}]"); + + + Task.Run(() => { //若干秒以后调反馈接口,确认是否和实际相符 Thread.Sleep(3000); - string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20); + CsbResult res = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch); - MessageBox.Show("封发-按调拨单--若干秒以后调反馈接口,确认是否和实际相符" + res.message); + MessageBox.Show($"封发-按调拨单--若干秒以后调反馈接口,确认是否和实际相符 [{res.GetMsg()}]"); + }); @@ -440,14 +442,14 @@ namespace SlnMesnac.RfidUpload.UI.viewModel { string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20); CsbResult res = csbHandleBusiness.containerAllotByCsb(TransferOrderInfoItem.ffjhNo,opBatch); - MessageBox.Show("库存容器封发配发 -- 6.13.容器直连配发-开始配发" + res.message); + MessageBox.Show($"库存容器封发配发 -- 6.13.容器直连配发-开始配发 [{res.GetMsg()}]"); Task.Run(() => { Thread.Sleep(3000); //若干秒以后调反馈接口,确认是否和实际相符 - string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20); + CsbResult res = csbHandleBusiness.containerAllotResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch); - MessageBox.Show("库存容器封发配发--若干秒以后调反馈接口,确认是否和实际相符" + res.message); + MessageBox.Show($"库存容器封发配发--若干秒以后调反馈接口,确认是否和实际相符[{res.GetMsg()}]"); }); } diff --git a/SlnMesnac.RfidUpload.UI/viewModel/TransferOrderViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/TransferOrderViewModel.cs index 4abbdb0..81adf4a 100644 --- a/SlnMesnac.RfidUpload.UI/viewModel/TransferOrderViewModel.cs +++ b/SlnMesnac.RfidUpload.UI/viewModel/TransferOrderViewModel.cs @@ -150,7 +150,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel _endDate = _endDate.Value.AddDays(1); #region 正式启用 CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb(_drj, _startDate.Value.ToString(), _endDate.Value.ToString()); - MessageBox.Show("容器封发-获取调拨单和封发计划:" + res.message); + MessageBox.Show("容器封发-获取调拨单和封发计划:" + res.GetMsg()); if (res.code == "200") { @@ -211,7 +211,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel CsbResult res = csbHandleBusiness.transferOrderFfjhCheckByCsb(transferOrderInfo.ffjhNo, transferOrderInfo.ffjhscrq); if (res.code== "200") { //封发计划正常可封发 - MessageBox.Show($"验证调拨单结果,status:{res.code};msg:{res.message};"); + MessageBox.Show($"验证调拨单结果,[{res.GetMsg()}];"); SuccessEvent?.Invoke(); RefreshSubmitVerifyEvent?.Invoke(2, res.message,transferOrderInfo); diff --git a/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs index 0f5c9d4..8c56712 100644 --- a/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs +++ b/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs @@ -100,13 +100,13 @@ namespace SlnMesnac.RfidUpload.UI.viewModel dbdh = _dbbh, }; - RefreshSubmitVerifyEvent?.Invoke(1, res.message, transferOrderInfo); + RefreshSubmitVerifyEvent?.Invoke(1, res.GetMsg(), transferOrderInfo); _window.Close(); } else { - MessageBox.Show($"新容器入库-调拨单号验证失败,status:{res.code};msg:{res.message};"); + MessageBox.Show($"新容器入库-调拨单号验证失败,status:{res.code};msg:{res.GetMsg()};"); } }