diff --git a/SlnMesnac.RfidUpload.UI/MainWindow.xaml b/SlnMesnac.RfidUpload.UI/MainWindow.xaml
index 06c253e..89ca90c 100644
--- a/SlnMesnac.RfidUpload.UI/MainWindow.xaml
+++ b/SlnMesnac.RfidUpload.UI/MainWindow.xaml
@@ -153,7 +153,9 @@
-
+
+
+
diff --git a/SlnMesnac.RfidUpload.UI/TempData/SysData.cs b/SlnMesnac.RfidUpload.UI/TempData/SysData.cs
new file mode 100644
index 0000000..e78b894
--- /dev/null
+++ b/SlnMesnac.RfidUpload.UI/TempData/SysData.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SlnMesnac.RfidUpload.UI.TempData
+{
+
+ ///
+ /// 存放系统临时数据
+ /// 暂时只存储新容器入库校验界面的送货单号列表数据
+ ///
+ public class SysData
+ {
+ #region 单例实现
+ private static readonly SysData lazy = new SysData();
+ public static SysData Instance
+ {
+ get
+ {
+ return lazy;
+ }
+ }
+ #endregion
+
+
+ public List trackNoList = new List();
+ }
+
+
+ ///
+ /// 新容器入库校验界面的送货单号列表数据
+ ///
+ public class newContainerInCheckData
+ {
+ ///
+ /// 调拨单号
+ ///
+ public string dbdh { get; set; }
+
+ ///
+ /// 送货单号
+ ///
+ public string trackNo { get; set; }
+
+ ///
+ /// 开始号段
+ ///
+ public string rqtmStart { get; set; }
+
+
+ ///
+ /// 结束号段
+ ///
+ public string rqtmEnd { get; set; }
+
+ ///
+ /// 添加时间
+ ///
+ public DateTime time { get; set; }
+
+ }
+
+}
diff --git a/SlnMesnac.RfidUpload.UI/containerStorageQueryByCsb.xaml b/SlnMesnac.RfidUpload.UI/containerStorageQueryByCsb.xaml
index 3475d93..48b4f93 100644
--- a/SlnMesnac.RfidUpload.UI/containerStorageQueryByCsb.xaml
+++ b/SlnMesnac.RfidUpload.UI/containerStorageQueryByCsb.xaml
@@ -5,13 +5,14 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SlnMesnac.RfidUpload.UI"
mc:Ignorable="d"
- Title="新容器入库" Height="450" Width="800">
+ Title="新容器入库" Height="750" Width="800">
+
@@ -52,9 +53,37 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs
index 3d394e3..94b9c47 100644
--- a/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs
+++ b/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs
@@ -20,6 +20,7 @@ using System.Windows;
using System.Threading;
using static SlnMesnac.RfidUpload.UI.SelectRouterWindow;
using static SlnMesnac.RfidUpload.UI.viewModel.containerStorageQueryByCsbViewModel;
+using SlnMesnac.RfidUpload.UI.TempData;
namespace SlnMesnac.RfidUpload.UI.viewModel
{
@@ -39,7 +40,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
private AppConfig appConfig = AppConfig.Instance;
private JsonChange jsonChange = JsonChange.Instance;
private int No = 1;
- private string TrackNo = "";
+ private SysData sysData = SysData.Instance;
//暂存库存容器分发配发机构数据
private Institution Institution;
#region 参数定义
@@ -143,6 +144,16 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
set { _mainPageDbdh = value; RaisePropertyChanged(() => MainPageDbdh); }
}
+ ///
+ /// 主界面当前送货单号
+ ///
+ private string _trackNo = "";
+ public string TrackNo
+ {
+ get { return _trackNo; }
+ set { _trackNo = value; RaisePropertyChanged(() => TrackNo); }
+ }
+
///
/// 主界面当前封发计划
///
@@ -264,7 +275,21 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
FinishCommand = new RelayCommand(Finish);
this.Init();
-
+
+ //测试数据
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "1234567890", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "1234", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "554434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now.AddDays(1) });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = "4434", trackNo = "123", rqtmStart = "123", rqtmEnd = "123", time = DateTime.Now });
+
}
diff --git a/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs
index 93e5309..eb91feb 100644
--- a/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs
+++ b/SlnMesnac.RfidUpload.UI/viewModel/containerStorageQueryByCsbViewModel.cs
@@ -5,13 +5,17 @@ using Newtonsoft.Json.Linq;
using SlnMesnac.RfidUpload.Business;
using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.apiParam;
+using SlnMesnac.RfidUpload.UI.TempData;
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
+using System.Windows.Threading;
using static SlnMesnac.RfidUpload.UI.SelectRouterWindow;
+using static SlnMesnac.RfidUpload.UI.viewModel.containerStorageQueryByCsbViewModel;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
@@ -39,7 +43,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
{
public partial class containerStorageQueryByCsbViewModel : ObservableObject
{
-
+ private SysData sysData = SysData.Instance;
private readonly Window _window;
#region 委托事件
@@ -62,9 +66,29 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
public containerStorageQueryByCsbViewModel(Window window)
{
_window = window;
+ RefreshItems();
+ }
+
+
+ private void RefreshItems()
+ {
+ TrackNoItems.Clear();
+ sysData.trackNoList = sysData.trackNoList.OrderByDescending(x => x.time).ToList();
+ Dispatcher.CurrentDispatcher.BeginInvoke(() =>
+ {
+ sysData.trackNoList.ForEach(x => TrackNoItems.Add(x));
+ });
+ }
+
+ private ObservableCollection _trackNoItems = new ObservableCollection();
+ public ObservableCollection TrackNoItems
+ {
+ get => _trackNoItems;
+ set => SetProperty(ref _trackNoItems, value);
}
+
private CsbHandleBusiness csbHandleBusiness = CsbHandleBusiness.Instance;
public string _dbbh = string.Empty;
@@ -97,33 +121,68 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
[RelayCommand]
private void Submit()
{
- CsbResult res = csbHandleBusiness.containerStorageQueryByCsb(_dbbh, _rqtmStart, _rqtmEnd);
+ Check(_dbbh, _rqtmStart, _rqtmEnd);
+ }
- if (res.code == "200")
+ ///
+ /// 新容器入库-调拨单号验证
+ ///
+ ///
+ ///
+ ///
+ private void Check(string dbbh,string rqtmStart, string rqtmEnd)
+ {
+ try
{
- JObject job = JObject.Parse(res.body);
- string str = job["retBody"]?["object"]?.ToString();
- if (!string.IsNullOrEmpty(str))
- {
- TrackResult trackResult = JsonConvert.DeserializeObject(str);
- MessageBox.Show($"传递trackNo"+ trackResult.trackNo);
- RefreshTrackNoEvent?.Invoke(trackResult.trackNo);
- }
+ CsbResult res = csbHandleBusiness.containerStorageQueryByCsb(dbbh,rqtmStart,rqtmEnd);
- MessageBox.Show($"新容器入库-调拨单号验证通过");
- TransferOrderInfo transferOrderInfo = new TransferOrderInfo() {
- dbdh = _dbbh,
- };
+ if (res.code == "200")
+ {
+ JObject job = JObject.Parse(res.body);
+ string str = job["retBody"]?["object"]?.ToString();
+ if (!string.IsNullOrEmpty(str))
+ {
+ TrackResult trackResult = JsonConvert.DeserializeObject(str);
+ MessageBox.Show($"传递trackNo" + trackResult.trackNo);
+ RefreshTrackNoEvent?.Invoke(trackResult.trackNo);
+ if (sysData.trackNoList.FirstOrDefault(x => x.trackNo == trackResult.trackNo) == null)
+ {
+ sysData.trackNoList.Add(new newContainerInCheckData() { dbdh = _dbbh, trackNo = trackResult.trackNo, rqtmStart = _rqtmStart, rqtmEnd = _rqtmEnd, time = DateTime.Now });
+ }
+
+ RefreshItems();
+ }
+
+ MessageBox.Show($"新容器入库-调拨单号验证通过");
+ TransferOrderInfo transferOrderInfo = new TransferOrderInfo()
+ {
+ dbdh = _dbbh,
+ };
+
+ RefreshSubmitVerifyEvent?.Invoke(1, res.GetMsg(), transferOrderInfo);
+ _window.Close();
- RefreshSubmitVerifyEvent?.Invoke(1, res.GetMsg(), transferOrderInfo);
- _window.Close();
+ }
+ else
+ {
+ MessageBox.Show($"新容器入库-调拨单号验证失败,status:{res.code};msg:{res.GetMsg()};");
+ }
- }
- else
+ }catch (Exception ex)
{
- MessageBox.Show($"新容器入库-调拨单号验证失败,status:{res.code};msg:{res.GetMsg()};");
+ MessageBox.Show("新容器入库-调拨单号验证异常:" + ex.Message);
}
+ }
+
+ ///
+ /// 执行分发 容器封发-验证封发计划
+ ///
+ ///
+ [RelayCommand]
+ private void Execute(newContainerInCheckData newContainerInCheck)
+ {
+ Check(newContainerInCheck.dbdh, newContainerInCheck.rqtmStart, newContainerInCheck.rqtmEnd);
}
public class TrackResult