Commit 795fb41a by 陶然

优化

parent 630829b4
...@@ -565,6 +565,7 @@ namespace Kivii.Samples ...@@ -565,6 +565,7 @@ namespace Kivii.Samples
foreach (var item in currentSamples) foreach (var item in currentSamples)
{ {
var currentRoute = item.GetCurrentRoute(); var currentRoute = item.GetCurrentRoute();
//if (currentRoute != null) //if (currentRoute != null)
//{ //{
...@@ -589,7 +590,9 @@ namespace Kivii.Samples ...@@ -589,7 +590,9 @@ namespace Kivii.Samples
conn.UpdateOnly(currentRoute); conn.UpdateOnly(currentRoute);
} }
//} //}
string packageNumber = string.Empty;
var packageIndex = item.PackageName.IndexOf('(');
if (packageIndex != -1) packageNumber = item.PackageName.Substring(packageIndex);
//生成新的路由信息 //生成新的路由信息
Route newRoute = new Route(); Route newRoute = new Route();
if (route != null) newRoute.PopulateWith(route); if (route != null) newRoute.PopulateWith(route);
...@@ -600,7 +603,7 @@ namespace Kivii.Samples ...@@ -600,7 +603,7 @@ namespace Kivii.Samples
newRoute.BizId = item.BizId; newRoute.BizId = item.BizId;
newRoute.BizKvid = item.BizKvid; newRoute.BizKvid = item.BizKvid;
newRoute.BizType = item.BizType; newRoute.BizType = item.BizType;
newRoute.Title = newRoute.Title.IsNullOrEmpty() ? $"样品[{item.Name}]从[{(item.PackageName)}]迁移到[{package.Name}]" : newRoute.Title; newRoute.Title = newRoute.Title.IsNullOrEmpty() ? $"样品[{item.Name}]从[{(item.PackageName)}]迁移到[{package.Name}{packageNumber}]" : newRoute.Title;
newRoute.Type = newRoute.Type.IsNullOrEmpty() ? "样品迁移" : newRoute.Type; newRoute.Type = newRoute.Type.IsNullOrEmpty() ? "样品迁移" : newRoute.Type;
newRoute.CurrentLocationKvid = location.Kvid; newRoute.CurrentLocationKvid = location.Kvid;
newRoute.CurrentLocationTitle = location.Title; newRoute.CurrentLocationTitle = location.Title;
...@@ -613,7 +616,7 @@ namespace Kivii.Samples ...@@ -613,7 +616,7 @@ namespace Kivii.Samples
conn.Insert(newRoute); conn.Insert(newRoute);
//更新样品的包裹Kvid //更新样品的包裹Kvid
item.PackageName = $"{package.Name}"; item.PackageName = $"{package.Name}{packageNumber}";
item.AddOnlyProperties(o => o.PackageName); item.AddOnlyProperties(o => o.PackageName);
item.PackageKvid = package.Kvid; item.PackageKvid = package.Kvid;
item.AddOnlyProperties(o => o.PackageKvid); item.AddOnlyProperties(o => o.PackageKvid);
......
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