|
|
|
@ -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<newContainerInCheckData> _trackNoItems = new ObservableCollection<newContainerInCheckData>();
|
|
|
|
|
public ObservableCollection<newContainerInCheckData> 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")
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新容器入库-调拨单号验证
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dbbh"></param>
|
|
|
|
|
/// <param name="rqtmStart"></param>
|
|
|
|
|
/// <param name="rqtmEnd"></param>
|
|
|
|
|
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<TrackResult>(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<TrackResult>(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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 执行分发 容器封发-验证封发计划
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="transferOrderInfo"></param>
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private void Execute(newContainerInCheckData newContainerInCheck)
|
|
|
|
|
{
|
|
|
|
|
Check(newContainerInCheck.dbdh, newContainerInCheck.rqtmStart, newContainerInCheck.rqtmEnd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class TrackResult
|
|
|
|
|