Commit 4029655e by Neo Turing

优化

parent 6c1ec19b
......@@ -31,14 +31,14 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Kivii.Common.V4.5, Version=5.6.2023.6000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\JST\local.Jst\packages\Kivii.Common.5.6.2023.6000\lib\net45\Kivii.Common.V4.5.dll</HintPath>
<Reference Include="Kivii.Common.V4.5, Version=5.6.2024.1160, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Common.5.6.2024.1160\lib\net45\Kivii.Common.V4.5.dll</HintPath>
</Reference>
<Reference Include="Kivii.Core.V4.5, Version=5.6.2023.6000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\JST\local.Jst\packages\Kivii.Core.5.6.2023.6000\lib\net45\Kivii.Core.V4.5.dll</HintPath>
<Reference Include="Kivii.Core.V4.5, Version=5.6.2023.9000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Core.5.6.2023.9000\lib\net45\Kivii.Core.V4.5.dll</HintPath>
</Reference>
<Reference Include="Kivii.Linq.V4.5, Version=5.6.2023.4200, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\JST\local.Jst\packages\Kivii.Linq.5.6.2023.4200\lib\net45\Kivii.Linq.V4.5.dll</HintPath>
<Reference Include="Kivii.Linq.V4.5, Version=5.6.2024.2000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Linq.5.6.2024.2000\lib\net45\Kivii.Linq.V4.5.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
......
......@@ -37,5 +37,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.2280")]
[assembly: AssemblyFileVersion("5.4.2024.2280")]
[assembly: AssemblyVersion("5.4.2024.3060")]
[assembly: AssemblyFileVersion("5.4.2024.3060")]
......@@ -886,4 +886,88 @@ namespace Kivii.Samples.Transforms
return rtns;
}
}
[RequiresAnyRole(SystemRoles.Everyone)]
[Api(Description = "未入库样品查询")]
public class SampleUnBoundQuery : RestfulExecution<Sample>
{
#region QueryArgs
//public virtual int? Skip { get; set; }
//public virtual int? Take { get; set; }
public virtual string OrderBy { get; set; }
public string OrderByDesc { get; set; }
public virtual string Include { get; set; }
public virtual string Fields { get; set; }
public string QueryKeys { get; set; }
public string QueryValues { get; set; }
#endregion
public List<Guid> LocationKvids { get; set; }
public List<string> LocationInternalCodes { get; set; }
//public DateTime BeginTime { get; set; }
//public DateTime EndTime { get; set; }
public override object OnExecution(IRequest req, IResponse res)
{
//int monthDay = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month);
//if (BeginTime == DateTime.MinValue) BeginTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
//if (EndTime == DateTime.MinValue) EndTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, monthDay);
//var beginTime = DateTime.Parse(BeginTime.ToString("yyyy-MM-dd"));
//var endTime = DateTime.Parse(EndTime.ToString("yyyy-MM-dd"));
//if (endTime < beginTime) throw new Exception("查询结束日期不可小于开始日期!");
var conn = KiviiContext.GetOpenedDbConnection<Sample>();
List<Location> locations = null;
if (!LocationKvids.IsNullOrEmpty()) locations = conn.SelectByIds<Location>(LocationKvids);
if (locations.IsNullOrEmpty())
{
if (!LocationInternalCodes.IsNullOrEmpty()) locations = conn.Select<Location>(o => Sql.In(o.InternalCode, LocationInternalCodes));
//location.ThrowIfNull("未找到指定的地点信息!");
}
var dynamicParams = Request.GetRequestParams();
var autoQuery = Request.TryResolve<IAutoQueryDb>();
autoQuery.IncludeTotal = true;
var request = new RestfulQuery<Sample>();
request = request.PopulateWith(this);
var sqlExpress = autoQuery.CreateQuery(Request, conn, request, dynamicParams);
if (!locations.IsNullOrEmpty())
{
sqlExpress.Rows = null;
var kvids = locations.ConvertAll(o => o.Kvid);
var queryRoutes = conn.From<Route>();
queryRoutes.Where(o => o.BizId != null && o.BizId != string.Empty && Sql.In(o.CurrentLocationKvid, kvids));
queryRoutes.Select(o => o.BizId);
sqlExpress.Where(o => !Sql.In(o.BizId, queryRoutes));
sqlExpress.Select(o => new
{
o.BizId,
o.Category,
o.DealTime,
o.DeadTime,
o.Name,
o.PackageName,
o.OperateTime,
o.Kvid
});
}
var rtns = autoQuery.Execute(Request, conn, request, sqlExpress);
return rtns;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Kivii.Common" version="5.6.2023.6000" targetFramework="net45" />
<package id="Kivii.Core" version="5.6.2023.6000" targetFramework="net45" />
<package id="Kivii.Linq" version="5.6.2023.4200" targetFramework="net45" />
<package id="Kivii.Common" version="5.6.2024.1160" targetFramework="net45" />
<package id="Kivii.Core" version="5.6.2023.9000" targetFramework="net45" />
<package id="Kivii.Linq" version="5.6.2024.2000" targetFramework="net45" />
</packages>
\ No newline at end of file
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