diff --git a/SlnMesnac.RfidUpload.UI/SelectRouterWindow.xaml.cs b/SlnMesnac.RfidUpload.UI/SelectRouterWindow.xaml.cs
index f8a0d2a..e53de50 100644
--- a/SlnMesnac.RfidUpload.UI/SelectRouterWindow.xaml.cs
+++ b/SlnMesnac.RfidUpload.UI/SelectRouterWindow.xaml.cs
@@ -37,7 +37,7 @@ namespace SlnMesnac.RfidUpload.UI
///
///
///
- public delegate void RefreshSubmitVerifyDelegate(int model, string msg, TransferOrderInfo transferOrderInfo = null);
+ public delegate void RefreshSubmitVerifyDelegate(int model, string msg, TransferOrderInfo transferOrderInfo = null, Institution institution = null);
public static event RefreshSubmitVerifyDelegate RefreshSubmitVerifyEvent;
#endregion
@@ -52,7 +52,7 @@ namespace SlnMesnac.RfidUpload.UI
///
- /// 获取卸交站
+ /// 二、获取卸交站
///
///
///
@@ -107,44 +107,68 @@ namespace SlnMesnac.RfidUpload.UI
///
- /// 封发配发 6.12.容器直连配发-校验发运计划
- /// 可不指定机构直接完成容器封发配发
+ ///
+ /// 三、验证封发计划- 不指定机构
///
///
///
private void HandOutButton_Click(object sender, RoutedEventArgs e)
{
-
- string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20);
- CsbResult res = csbHandleBusiness.tranPlanCheckByCsb(_transferOrderInfo.ffjhNo,opBatch,"","");
- // MessageBox.Show($"封发配发 6.12.容器直连配发-校验发运计划 可不指定机构直接完成容器封发配发 :{res.message}");
- this.PageMessage.Content = "校验发运计划结果:"+res.GetMsg();
- if (res.code == "200")
- {
- RefreshSubmitVerifyEvent?.Invoke(3, res.GetMsg(), _transferOrderInfo);
- this.Close();
- }
+
+ //string opBatch = Guid.NewGuid().ToString("N").Substring(0, 20);
+ //CsbResult res = csbHandleBusiness.tranPlanCheckByCsb(_transferOrderInfo.ffjhNo,opBatch,"","");
+
+ //this.PageMessage.Content = "校验发运计划结果:"+res.GetMsg();
+ //if (res.code == "200")
+ //{
+ // RefreshSubmitVerifyEvent?.Invoke(3, res.GetMsg(), _transferOrderInfo);
+ // this.Close();
+ //}
+
+ FfjhCheck();
+
}
- // 执行配发 6.12.容器直连配发-校验发运计划
- // 容器封发完毕后直接向指定机构进行容器配发
+ // 三、验证封发计划 -指定机构
private void ExecuteCommand_Click(object sender, RoutedEventArgs e)
{
var button = sender as Button;
var institution = button.DataContext as Institution;
if (institution != null)
{
- string opBatch = OpBatchManager.BathNo;
- CsbResult res = csbHandleBusiness.tranPlanCheckByCsb(_transferOrderInfo.ffjhNo, opBatch, institution.stationOrgCode,institution.stationOrgName);
- MessageBox.Show($"执行配发 6.12.容器直连配发-校验发运计划 容器封发完毕后直接向指定机构进行容器配发 :{res.message}");
- if (res.code == "200")
- {
- RefreshSubmitVerifyEvent?.Invoke(3, res.GetMsg(), _transferOrderInfo);
- this.Close();
- }
+ FfjhCheck(institution);
+ // string opBatch = OpBatchManager.BathNo;
+ // CsbResult res = csbHandleBusiness.tranPlanCheckByCsb(_transferOrderInfo.ffjhNo, opBatch, institution.stationOrgCode,institution.stationOrgName);
+ // MessageBox.Show($"执行配发 6.12.容器直连配发-校验发运计划 容器封发完毕后直接向指定机构进行容器配发 :{res.message}");
+ // if (res.code == "200")
+ // {
+ // RefreshSubmitVerifyEvent?.Invoke(3, res.GetMsg(), _transferOrderInfo);
+ // this.Close();
+ // }
}
+
}
+ ///
+ /// 封发计划校验
+ /// 可传递机构机构实体,机构代码、机构名称供后续效验封发计划使用
+ ///
+ private void FfjhCheck(Institution institution = null)
+ {
+ #region 正式启用
+ //6.8 验证封发计划接口
+ CsbResult res = csbHandleBusiness.transferOrderFfjhCheckByCsb(_transferOrderInfo.ffjhNo, _transferOrderInfo.ffjhscrq);
+ this.PageMessage.Content = $"验证封发计划接口:{res.GetMsg()}";
+ if (res.code == "200")
+ { //封发计划正常可封发
+
+ RefreshSubmitVerifyEvent?.Invoke(3, res.GetMsg(), _transferOrderInfo,institution);
+ this.Close();
+
+ }
+
+ #endregion
+ }
diff --git a/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs
index c05e9bd..7e881a3 100644
--- a/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs
+++ b/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs
@@ -18,6 +18,7 @@ using System.Threading.Tasks;
using ApiServer = SlnMesnac.RfidUpload.TouchSocket.ApiServer;
using System.Windows;
using System.Threading;
+using static SlnMesnac.RfidUpload.UI.SelectRouterWindow;
namespace SlnMesnac.RfidUpload.UI.viewModel
{
@@ -37,6 +38,8 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
private AppConfig appConfig = AppConfig.Instance;
private JsonChange jsonChange = JsonChange.Instance;
private int No = 1;
+ //暂存库存容器分发配发机构数据
+ private Institution Institution;
#region 参数定义
///
@@ -403,69 +406,127 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
private void Finish()
{
- if (workModelParam == 1) //新容器入库
+ try
{
- //取出托盘号并调用接口
- var palletInfo= labelItems.FirstOrDefault();
- if (palletInfo == null)
+ if (workModelParam == 1) //新容器入库
{
- MessageBox.Show("请先放包裹读条码!");
- return;
+ //取出托盘号并调用接口
+ var palletInfo = labelItems.FirstOrDefault();
+ if (palletInfo == null)
+ {
+ MessageBox.Show("请先放包裹读条码!");
+ return;
+ }
+ else
+ {
+ CsbResult res = csbHandleBusiness.scanAnyContainerCodeByCsb(palletInfo.result);
+ MessageBox.Show("新容器入库" + res.message);
+ }
}
- else
+ else if (workModelParam == 2) //封发-按调拨单
{
- CsbResult res = csbHandleBusiness.scanAnyContainerCodeByCsb(palletInfo.result);
- MessageBox.Show("新容器入库"+res.message);
+ var info = labelItems.ToList();
+ var strList = info.Select(x => x.result).ToList();
+ int batchNo = 0;
+ string opBatch = System.Guid.NewGuid().ToString("N").Substring(0, 20);
+ ListPage ls = new ListPage(strList, 500);
+ CsbResult res = new CsbResult();
+ foreach (var enumerable in ls.GetPage())
+ {
+ batchNo++;
+ res = csbHandleBusiness.containerScanSealByCsb(TransferOrderInfoItem.ffjhNo,
+ opBatch,
+ TransferOrderInfoItem.ffjhscrq, batchNo.ToString(), enumerable.ToList());
+ }
+
+ // MessageBox.Show($"封发-按调拨单 [{res.GetMsg()}]");
+
+ MainPageTipMessage = $"封发-按调拨单 [{res.GetMsg()}]";
+
+ Task.Run(() =>
+ { //若干秒以后调反馈接口,确认是否和实际相符
+ Thread.Sleep(3000);
+
+ CsbResult res = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
+ // MessageBox.Show($"封发-按调拨单反馈接口,[{res.GetMsg()}]");
+ MainPageTipMessage = $"封发-按调拨单反馈接口,[{res.GetMsg()}]";
+ });
+
+
}
- }
- else if (workModelParam == 2) //封发-按调拨单
- {
- var info = labelItems.ToList();
- var strList = info.Select(x => x.result).ToList();
- int batchNo = 0;
- string opBatch = System.Guid.NewGuid().ToString("N").Substring(0, 20);
- ListPage ls = new ListPage(strList,500);
- CsbResult res = new CsbResult();
- foreach (var enumerable in ls.GetPage())
+ else if (WorkModelParam == 3) //库存容器封发配发 -- 6.13.容器直连配发-开始配发
{
- batchNo++;
- res = csbHandleBusiness.containerScanSealByCsb(TransferOrderInfoItem.ffjhNo,
- opBatch,
- TransferOrderInfoItem.ffjhscrq, batchNo.ToString(), enumerable.ToList());
+ //四、6.9接收容器条码接口
+ var info = labelItems.ToList();
+ var strList = info.Select(x => x.result).ToList();
+ int batchNo = 0;
+ string opBatch = System.Guid.NewGuid().ToString("N").Substring(0, 20);
+ ListPage ls = new ListPage(strList, 500);
+ CsbResult res = new CsbResult();
+ foreach (var enumerable in ls.GetPage())
+ {
+ batchNo++;
+ res = csbHandleBusiness.containerScanSealByCsb(TransferOrderInfoItem.ffjhNo,
+ opBatch,
+ TransferOrderInfoItem.ffjhscrq, batchNo.ToString(), enumerable.ToList());
+ }
+
+ MainPageTipMessage = $"封发-按调拨单 [{res.GetMsg()}]";
+
+ Task.Run(() =>
+ {
+ // 五、6.10反馈接收结果(利用上一步的opBatch)
+ Thread.Sleep(3000);
+ CsbResult res1 = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
+ MainPageTipMessage = $"封发-按调拨单反馈接口,[{res1.GetMsg()}]";
+
+ //六、6.12 效验发运计划(利用上一步的opBatch)
+ string stationOrgCode = Institution != null ? Institution.stationOrgCode : "";
+ string stationOrgName = Institution != null ? Institution.stationOrgName : "";
+ CsbResult res2 = csbHandleBusiness.tranPlanCheckByCsb(_transferOrderInfo.ffjhNo, opBatch, stationOrgCode, stationOrgName);
+ MainPageTipMessage = "校验发运计划结果:" + res2.GetMsg();
+ if (res2.code == "200")
+ {
+ // 七、6.13.容器直连配发-开始配发
+
+ CsbResult res3 = csbHandleBusiness.containerAllotByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
+ MainPageTipMessage = $"库存容器封发配发 -- 6.13.容器直连配发-开始配发 [{res3.GetMsg()}]";
+ Task.Run(() =>
+ {
+ Thread.Sleep(3000);
+ //八、反馈接收接口,确认是否和实际相符
+ CsbResult res4 = csbHandleBusiness.containerAllotResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
+ MainPageTipMessage = $"八、反馈接收接口,确认是否和实际相符[{res4.GetMsg()}]";
+
+ });
+ }
+
+ });
+
+
+
+
+
+ //string opBatch = OpBatchManager.BathNo;
+ //CsbResult res = csbHandleBusiness.containerAllotByCsb(TransferOrderInfoItem.ffjhNo,opBatch);
+ //MessageBox.Show($"库存容器封发配发 -- 6.13.容器直连配发-开始配发 [{res.GetMsg()}]");
+ //Task.Run(() =>
+ //{
+ // Thread.Sleep(3000);
+ // //若干秒以后调反馈接口,确认是否和实际相符
+
+ // CsbResult res = csbHandleBusiness.containerAllotResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
+ // MessageBox.Show($"库存容器封发配发--若干秒以后调反馈接口,确认是否和实际相符[{res.GetMsg()}]");
+
+ //});
}
-
- MessageBox.Show($"封发-按调拨单 [{res.GetMsg()}]");
-
-
-
- Task.Run(() =>
- { //若干秒以后调反馈接口,确认是否和实际相符
- Thread.Sleep(3000);
-
- CsbResult res = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
- MessageBox.Show($"封发-按调拨单--若干秒以后调反馈接口,确认是否和实际相符 [{res.GetMsg()}]");
-
- });
-
-
- }else if(WorkModelParam == 3) //库存容器封发配发 -- 6.13.容器直连配发-开始配发
- {
- string opBatch = OpBatchManager.BathNo;
- CsbResult res = csbHandleBusiness.containerAllotByCsb(TransferOrderInfoItem.ffjhNo,opBatch);
- MessageBox.Show($"库存容器封发配发 -- 6.13.容器直连配发-开始配发 [{res.GetMsg()}]");
- Task.Run(() =>
+ else if (workModelParam == -1)
{
- Thread.Sleep(3000);
- //若干秒以后调反馈接口,确认是否和实际相符
-
- CsbResult res = csbHandleBusiness.containerAllotResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
- MessageBox.Show($"库存容器封发配发--若干秒以后调反馈接口,确认是否和实际相符[{res.GetMsg()}]");
-
- });
- }
- else if(workModelParam == -1)
+ MessageBox.Show("工作模式错误"); return;
+ }
+ }catch(Exception ex)
{
- MessageBox.Show("工作模式错误"); return;
+ MessageBox.Show(ex.Message);
}
}
@@ -646,7 +707,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
///
///
///
- private void RefreshSubmitVerify(int model,string msg,TransferOrderInfo transferOrderInfo=null)
+ private void RefreshSubmitVerify(int model,string msg,TransferOrderInfo transferOrderInfo=null, Institution institution = null)
{
MainPageTipMessage = msg;
appConfig.workModel = model.ToString();
@@ -657,6 +718,10 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
MainPageFfjhNo = transferOrderInfo.ffjhNo;
TransferOrderInfoItem = transferOrderInfo;
}
+ if(institution != null)
+ {
+ Institution = institution;
+ }
}
}
diff --git a/SlnMesnac.RfidUpload.UI/viewModel/TransferOrderViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/TransferOrderViewModel.cs
index da89dfd..0f0c15b 100644
--- a/SlnMesnac.RfidUpload.UI/viewModel/TransferOrderViewModel.cs
+++ b/SlnMesnac.RfidUpload.UI/viewModel/TransferOrderViewModel.cs
@@ -57,7 +57,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
///
///
///
- public delegate void RefreshSubmitVerifyDelegate(int model, string msg, TransferOrderInfo transferOrderInfo = null);
+ public delegate void RefreshSubmitVerifyDelegate(int model, string msg, TransferOrderInfo transferOrderInfo = null, Institution institution = null);
public static event RefreshSubmitVerifyDelegate RefreshSubmitVerifyEvent;
#endregion
diff --git a/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs
index 8c56712..4e58e59 100644
--- a/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs
+++ b/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs
@@ -9,6 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
+using static SlnMesnac.RfidUpload.UI.SelectRouterWindow;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
@@ -48,7 +49,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
///
///
///
- public delegate void RefreshSubmitVerifyDelegate(int model,string msg, TransferOrderInfo transferOrderInfo = null);
+ public delegate void RefreshSubmitVerifyDelegate(int model,string msg, TransferOrderInfo transferOrderInfo = null, Institution institution = null);
public static event RefreshSubmitVerifyDelegate RefreshSubmitVerifyEvent;
#endregion