change-修改库存容器分发入库流程

master
liuwf 1 month ago
parent 49e61409fb
commit 3765abdf93

@ -37,7 +37,7 @@ namespace SlnMesnac.RfidUpload.UI
/// </summary>
/// <param name="status"></param>
/// <param name="dbdh"></param>
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
/// <summary>
/// 获取卸交站
/// 二、获取卸交站
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
@ -107,44 +107,68 @@ namespace SlnMesnac.RfidUpload.UI
/// <summary>
/// 封发配发 6.12.容器直连配发-校验发运计划
/// 可不指定机构直接完成容器封发配发
///
/// 三、验证封发计划- 不指定机构
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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();
// }
}
}
/// <summary>
/// 封发计划校验
/// 可传递机构机构实体,机构代码、机构名称供后续效验封发计划使用
/// </summary>
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
}

@ -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 参数定义
/// <summary>
@ -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<string> ls = new ListPage<string>(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<string> ls = new ListPage<string>(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<string> ls = new ListPage<string>(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
/// <param name="model"></param>
/// <param name="msg"></param>
/// <param name="dbdh"></param>
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;
}
}
}

@ -57,7 +57,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
/// </summary>
/// <param name="status"></param>
/// <param name="dbdh"></param>
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

@ -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
/// </summary>
/// <param name="status"></param>
/// <param name="dbdh"></param>
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

Loading…
Cancel
Save