Commit 92f1a9b9 by Neo Turing

优化

parent 31788b16
......@@ -37,5 +37,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.10180")]
[assembly: AssemblyFileVersion("5.4.2024.10180")]
[assembly: AssemblyVersion("5.4.2025.4210")]
[assembly: AssemblyFileVersion("5.4.2025.4210")]
......@@ -122,7 +122,12 @@ namespace Kivii.Samples
existSample.ThrowIfNull("未找到此样品信息!");
//找出当前样品所在路由地点,根据Next为空说明就在此地
var currentRoute = existSample.GetCurrentRoute();//conn.Single<Route>(o => o.SampleKvid == existSample.Kvid && o.NextLocationKvid == Guid.Empty);
//Console.WriteLine($"---------------------currentRouteIsNull:{(currentRoute==null?true:false)}----------------------------");
//if (currentRoute != null)
//{
// Console.WriteLine($"---------------------{currentRoute.Kvid}----------------------------");
//}
IDbTransaction trans = null;//事务,如果外部来了Connection,不生成事务
if (useTransaction)
{
......@@ -854,7 +859,7 @@ namespace Kivii.Samples
//routes.ThrowIfNullOrEmpty("未找到指定样品当前所在地点!");
//(routes.Count() > 1).ThrowIfTrue("所在地点不唯一!");
if (routes.Count() > 1) return null;
var route = routes[0];
var route = routes.OrderByDescending(o => o.CreateTime).FirstOrDefault();
sample.CurrentRoute = route;
var rtns = conn.SingleById<Location>(route.CurrentLocationKvid);
if (rtns == null) return null;
......@@ -878,8 +883,8 @@ namespace Kivii.Samples
if (routes.IsNullOrEmpty()) return null;
//routes.ThrowIfNullOrEmpty("未找到指定样品当前所在地点!");
//(routes.Count() > 1).ThrowIfTrue("所在地点不唯一!");
if (routes.Count() > 1) return null;
var rtns = routes[0];
//if (routes.Count() > 1) return null;
var rtns = routes.OrderByDescending(o => o.CreateTime).FirstOrDefault();
sample.CurrentRoute = rtns;
return rtns;
}
......@@ -900,7 +905,7 @@ namespace Kivii.Samples
var rtns = conn.Select(queryRoute);
if (rtns.IsNullOrEmpty()) return null;
sample.Routes = rtns;
var currentRoute = rtns.FirstOrDefault(o => o.NextLocationKvid == Guid.Empty);
var currentRoute = rtns.OrderByDescending(o => o.CreateTime).FirstOrDefault();
if (currentRoute != null) sample.CurrentRoute = currentRoute;
return rtns;
}
......
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