Commit d20328e7 by 任天宇

优化

parent 0a4c1d97
...@@ -898,11 +898,10 @@ namespace Kivii.Client.SampleInbounds ...@@ -898,11 +898,10 @@ namespace Kivii.Client.SampleInbounds
if (_currentScanSamples == null) _currentScanSamples = new List<Sample>(); if (_currentScanSamples == null) _currentScanSamples = new List<Sample>();
foreach (var record in resp.Results) foreach (var record in resp.Results)
{ {
outputMessage($"{record.BizId}样品:[{record.Name}]交接至{_currentLocation.Address}完成.");
if (_currentScanSamples.Exists(o => o.Kvid == record.Kvid)) if (_currentScanSamples.Exists(o => o.Kvid == record.Kvid))
{ {
_currentScanSamples.RemoveAll(o => o.Kvid == record.Kvid); _currentScanSamples.RemoveAll(o => o.Kvid == record.Kvid);
outputMessage($"{record.BizId}样品:[{record.Name}]交接至{_currentLocation.Address}完成.");
}
this.Invoke(new Action(delegate this.Invoke(new Action(delegate
{ {
dgvRfidSamples.DataSource = null; dgvRfidSamples.DataSource = null;
...@@ -912,6 +911,7 @@ namespace Kivii.Client.SampleInbounds ...@@ -912,6 +911,7 @@ namespace Kivii.Client.SampleInbounds
dgvRfidSamples.DataSource = _currentScanSamples; dgvRfidSamples.DataSource = _currentScanSamples;
})); }));
} }
}
} }
catch (Exception ex) catch (Exception ex)
...@@ -926,6 +926,7 @@ namespace Kivii.Client.SampleInbounds ...@@ -926,6 +926,7 @@ namespace Kivii.Client.SampleInbounds
var kvids = new List<Guid>(); var kvids = new List<Guid>();
var unPackageKvids = new List<Guid>(); var unPackageKvids = new List<Guid>();
var notCurrentPackageKvids = new List<Guid>(); var notCurrentPackageKvids = new List<Guid>();
if (_currentScanSamples.IsNullOrEmpty()) _currentScanSamples = new List<Sample>();
foreach (var sample in samples)//过滤重复交接的 foreach (var sample in samples)//过滤重复交接的
{ {
if (sample.PackageKvid == Guid.Empty)//扫描的样品并未在设置的包裹里 if (sample.PackageKvid == Guid.Empty)//扫描的样品并未在设置的包裹里
...@@ -940,12 +941,12 @@ namespace Kivii.Client.SampleInbounds ...@@ -940,12 +941,12 @@ namespace Kivii.Client.SampleInbounds
} }
if (sample.CurrentLocation == null) if (sample.CurrentLocation == null)
{ {
outputMessage($"{sample.BizId}样品:[{sample.Name}]无地点信息,已移除交接.");
this.Invoke(new Action(delegate this.Invoke(new Action(delegate
{ {
dgvRfidSamples.DataSource = null; dgvRfidSamples.DataSource = null;
})); }));
_currentScanSamples.RemoveAll(o => o.Kvid == sample.Kvid); _currentScanSamples.RemoveAll(o => o.Kvid == sample.Kvid);
outputMessage($"{sample.BizId}样品:[{sample.Name}]无地点信息,已移除交接.");
this.Invoke(new Action(delegate this.Invoke(new Action(delegate
{ {
...@@ -955,12 +956,12 @@ namespace Kivii.Client.SampleInbounds ...@@ -955,12 +956,12 @@ namespace Kivii.Client.SampleInbounds
} }
if (sample.CurrentLocation.InternalCode == _currentLocation.InternalCode) if (sample.CurrentLocation.InternalCode == _currentLocation.InternalCode)
{ {
outputMessage($"{sample.BizId}样品:[{sample.Name}]已经在仓库,重复交接,已自动移除.");
this.Invoke(new Action(delegate this.Invoke(new Action(delegate
{ {
dgvRfidSamples.DataSource = null; dgvRfidSamples.DataSource = null;
})); }));
_currentScanSamples.RemoveAll(o => o.Kvid == sample.Kvid); _currentScanSamples.RemoveAll(o => o.Kvid == sample.Kvid);
outputMessage($"{sample.BizId}样品:[{sample.Name}]已经在仓库,重复交接,已自动移除.");
this.Invoke(new Action(delegate this.Invoke(new Action(delegate
{ {
...@@ -1003,7 +1004,7 @@ namespace Kivii.Client.SampleInbounds ...@@ -1003,7 +1004,7 @@ namespace Kivii.Client.SampleInbounds
//tbSetCurrentPackage.Enabled = !btnLogin.Enabled; //tbSetCurrentPackage.Enabled = !btnLogin.Enabled;
setDefault(tbxServiceUrl, tbxUserName, tbxPassword); setDefault(tbxServiceUrl, tbxUserName, tbxPassword);
outputMessage($"登录成功,登录人:{resp.DisplayName}", true); outputMessage($"登录成功,登录人:{resp.DisplayName}", true);
//connectReader(); connectReader();
}, true); }, true);
task.Error(err => task.Error(err =>
{ {
...@@ -1302,7 +1303,8 @@ namespace Kivii.Client.SampleInbounds ...@@ -1302,7 +1303,8 @@ namespace Kivii.Client.SampleInbounds
lbPackageSamplesCount.Text = _currentPackageSamples.Count.ToString(); lbPackageSamplesCount.Text = _currentPackageSamples.Count.ToString();
lbPackageSampleMissCount.Text = _currentPackageSamples.Where(o => !o.IsMatched).Count().ToString(); lbPackageSampleMissCount.Text = _currentPackageSamples.Where(o => !o.IsMatched).Count().ToString();
})); }));
sampleAssigning(new List<Guid> { currentRowSample.Kvid }); preSampleAssigning(new List<Sample> { currentRowSample });
//sampleAssigning(new List<Guid> { currentRowSample.Kvid });
} }
} }
} }
...@@ -20,12 +20,13 @@ namespace Kivii.Samples.Transforms ...@@ -20,12 +20,13 @@ namespace Kivii.Samples.Transforms
public SampleType Type { get; set; } public SampleType Type { get; set; }
public Guid? Kvid { get; set; } public Guid? Kvid { get; set; }
//public bool IncludeLocation { get; set; } = true;
} }
[Route(Configs.RouteSampleQuery)] [Route(Configs.RouteSampleQuery)]
public class SampleQuery2 : IReturn<RestfulQueryResponse<Sample>> public class SampleQuery2 : IReturn<RestfulQueryResponse<Sample>>
{ {
//public bool IncludeLocation { get; set; } = true; public bool IncludeLocation { get; set; } = true;
public Guid PackageKvid { get; set; } public Guid PackageKvid { get; set; }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment