.change-新容器入库

master
liuwf 1 month ago
parent b9af570d89
commit a69ee1594f

@ -181,36 +181,40 @@ namespace SlnMesnac.RfidUpload.Business
/// <summary>
/// 新容器入库-按送货单接收容器接口
/// </summary>
public void containerStorageBatchQueryByCsb(string trackNo, string batchNo, string rqtmList, string rqtmEnd)
public CsbResult containerStorageBatchQueryByCsb(string trackNo, string batchNo, List<string> rqtmList)
{
CsbResult res = new CsbResult();
try
{
var jsonObject = new JObject
{
["opOrgCode"] = appConfig.opOrgCode,
["trackNo"] = trackNo,
["devicedId"] = appConfig.devicedId,
["batchNo"] = batchNo,
["rqtmList"] = rqtmList,
["rqtmEnd"] = rqtmEnd,
["devicedId"] = appConfig.devicedId,
["rqtmList"] = JArray.FromObject(rqtmList),
// ["rqtmEnd"] = rqtmEnd,
};
string jsonString = jsonObject.ToString();
var str = webApiClientApp.UploadAsync("containerStorageBatchQueryByCsb",
"newContainerStorageBatchQuery", jsonString, "新容器入库-按送货单接收容器接口");
CsbResult res = JsonConvert.DeserializeObject<CsbResult>(str);
res = JsonConvert.DeserializeObject<CsbResult>(str);
return res;
}
catch (Exception ex)
{
logHelper.Error($"新容器入库-按送货单接收容器接口处理异常:{ex.Message}", ex);
return res;
}
}
/// <summary>
/// 6.6.新容器入库-按送货单反馈接收结果接口
/// </summary>
public void receContainerStorageByCsb(string trackNo, string msgType)
public CsbResult receContainerStorageByCsb(string trackNo, string msgType)
{
CsbResult res = new CsbResult();
try
{
var jsonObject = new JObject
@ -222,12 +226,13 @@ namespace SlnMesnac.RfidUpload.Business
string jsonString = jsonObject.ToString();
var str = webApiClientApp.UploadAsync("receContainerStorageByCsb", "newContainerStorageQuery",
jsonString, "新容器入库-按送货单反馈接收结果接口");
CsbResult res = JsonConvert.DeserializeObject<CsbResult>(str);
res = JsonConvert.DeserializeObject<CsbResult>(str);
return res;
}
catch (Exception ex)
{
logHelper.Error($"新容器入库-按送货单反馈接收结果接口处理异常:{ex.Message}", ex);
return res;
}
}
/// <summary>

@ -19,6 +19,7 @@ using ApiServer = SlnMesnac.RfidUpload.TouchSocket.ApiServer;
using System.Windows;
using System.Threading;
using static SlnMesnac.RfidUpload.UI.SelectRouterWindow;
using static SlnMesnac.RfidUpload.UI.viewModel.containerStorageQueryByCsbViewModel;
namespace SlnMesnac.RfidUpload.UI.viewModel
{
@ -38,6 +39,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
private AppConfig appConfig = AppConfig.Instance;
private JsonChange jsonChange = JsonChange.Instance;
private int No = 1;
private string TrackNo = "";
//暂存库存容器分发配发机构数据
private Institution Institution;
#region 参数定义
@ -249,6 +251,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
public MainWindowViewModel()
{
containerStorageQueryByCsbViewModel.RefreshSubmitVerifyEvent += RefreshSubmitVerify;
containerStorageQueryByCsbViewModel.RefreshTrackNoEvent += RefreshTrackNo;
TransferOrderViewModel.RefreshSubmitVerifyEvent += RefreshSubmitVerify;
SelectRouterWindow.RefreshSubmitVerifyEvent += RefreshSubmitVerify;
logger.Info("程序启动");
@ -410,18 +413,44 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
{
if (workModelParam == 1) //新容器入库
{
//取出托盘号并调用接口
var palletInfo = labelItems.FirstOrDefault();
if (palletInfo == null)
{
MessageBox.Show("请先放包裹读条码!");
return;
}
else
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())
{
CsbResult res = csbHandleBusiness.scanAnyContainerCodeByCsb(palletInfo.result);
MessageBox.Show("新容器入库" + res.message);
batchNo++;
res = csbHandleBusiness.containerStorageBatchQueryByCsb(TrackNo,batchNo.ToString(), enumerable.ToList());
}
MainPageTipMessage = $"新容器入库 [{res.GetMsg()}]";
Task.Run(() =>
{
Thread.Sleep(3000);
CsbResult res = csbHandleBusiness.receContainerStorageByCsb(TrackNo, "1");
Application.Current.Dispatcher.Invoke(() =>
{
MainPageTipMessage = $"新容器入库反馈接口,[{res.GetMsg()}]";
});
});
////取出托盘号并调用接口
//var palletInfo = labelItems.FirstOrDefault();
//if (palletInfo == null)
//{
// MessageBox.Show("请先放包裹读条码!");
// return;
//}
//else
//{
// CsbResult res = csbHandleBusiness.scanAnyContainerCodeByCsb(palletInfo.result);
// MessageBox.Show("新容器入库" + res.message);
//}
}
else if (workModelParam == 2) //封发-按调拨单
{
@ -752,6 +781,13 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
}
}
private void RefreshTrackNo(string trackNo)
{
MainPageTipMessage = "trackNo:" + trackNo;
TrackNo = trackNo;
}
}
}

@ -1,5 +1,7 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SlnMesnac.RfidUpload.Business;
using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.apiParam;
@ -51,6 +53,9 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
/// <param name="dbdh"></param>
public delegate void RefreshSubmitVerifyDelegate(int model,string msg, TransferOrderInfo transferOrderInfo = null, Institution institution = null);
public static event RefreshSubmitVerifyDelegate RefreshSubmitVerifyEvent;
public delegate void RefreshTrackNo(string trackNo);
public static event RefreshTrackNo RefreshTrackNoEvent;
#endregion
@ -96,6 +101,15 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
if (res.code == "200")
{
JObject job = JObject.Parse(res.body);
string str = job["retBody"]?["object"]?.ToString();
if (!string.IsNullOrEmpty(str))
{
TrackResult trackResult = JsonConvert.DeserializeObject<TrackResult>(str);
MessageBox.Show($"传递trackNo"+ trackResult.trackNo);
RefreshTrackNoEvent?.Invoke(trackResult.trackNo);
}
MessageBox.Show($"新容器入库-调拨单号验证通过");
TransferOrderInfo transferOrderInfo = new TransferOrderInfo() {
dbdh = _dbbh,
@ -109,7 +123,28 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
{
MessageBox.Show($"新容器入库-调拨单号验证失败,status:{res.code};msg:{res.GetMsg()};");
}
}
public class TrackResult
{
public String trackNo { get; set; }
public List<rqtmSerialDto> rqtmSerialList { get; set; }
}
public class rqtmSerialDto
{
public String rqzlmc { get; set; }
public String rqxhmc { get; set; }
public String rqtmStart { get; set; }
public String rqtmEnd { get; set; }
}
}
}

Loading…
Cancel
Save