|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|