Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Biz.Samples.V4.5
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶然
Kivii.Biz.Samples.V4.5
Commits
4029655e
Commit
4029655e
authored
May 08, 2024
by
Neo Turing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
6c1ec19b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
11 deletions
+96
-11
Kivii.Biz.Samples.V4.5.csproj
Src/Kivii.Biz.Samples.V4.5.csproj
+6
-6
AssemblyInfo.cs
Src/Properties/AssemblyInfo.cs
+2
-2
RestfulSample.cs
Src/Transforms/RestfulSample.cs
+84
-0
packages.config
Src/packages.config
+4
-3
No files found.
Src/Kivii.Biz.Samples.V4.5.csproj
View file @
4029655e
...
...
@@ -31,14 +31,14 @@
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"Kivii.Common.V4.5, Version=5.6.202
3.600
0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\
..\JST\local.Jst\packages\Kivii.Common.5.6.2023.600
0\lib\net45\Kivii.Common.V4.5.dll
</HintPath>
<Reference
Include=
"Kivii.Common.V4.5, Version=5.6.202
4.116
0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\
packages\Kivii.Common.5.6.2024.116
0\lib\net45\Kivii.Common.V4.5.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Core.V4.5, Version=5.6.2023.
6
000, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\
..\JST\local.Jst\packages\Kivii.Core.5.6.2023.6
000\lib\net45\Kivii.Core.V4.5.dll
</HintPath>
<Reference
Include=
"Kivii.Core.V4.5, Version=5.6.2023.
9
000, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\
packages\Kivii.Core.5.6.2023.9
000\lib\net45\Kivii.Core.V4.5.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Linq.V4.5, Version=5.6.202
3.42
00, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\
..\JST\local.Jst\packages\Kivii.Linq.5.6.2023.42
00\lib\net45\Kivii.Linq.V4.5.dll
</HintPath>
<Reference
Include=
"Kivii.Linq.V4.5, Version=5.6.202
4.20
00, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\
packages\Kivii.Linq.5.6.2024.20
00\lib\net45\Kivii.Linq.V4.5.dll
</HintPath>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
...
...
Src/Properties/AssemblyInfo.cs
View file @
4029655e
...
...
@@ -37,5 +37,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.
228
0")]
[assembly: AssemblyFileVersion("5.4.2024.
228
0")]
[assembly: AssemblyVersion("5.4.2024.
306
0")]
[assembly: AssemblyFileVersion("5.4.2024.
306
0")]
Src/Transforms/RestfulSample.cs
View file @
4029655e
...
...
@@ -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
;
}
}
}
Src/packages.config
View file @
4029655e
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"Kivii.Common"
version
=
"5.6.202
3.600
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Core"
version
=
"5.6.2023.
6
000"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Linq"
version
=
"5.6.202
3.42
00"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Common"
version
=
"5.6.202
4.116
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Core"
version
=
"5.6.2023.
9
000"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Linq"
version
=
"5.6.202
4.20
00"
targetFramework
=
"net45"
/>
</
packages
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment