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
e947c846
Commit
e947c846
authored
Jun 29, 2023
by
任天宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
11ae59fd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
14 deletions
+105
-14
.gitignore
.gitignore
+1
-0
Kivii.Biz.Samples.V4.5.csproj
Src/Kivii.Biz.Samples.V4.5.csproj
+6
-9
AssemblyInfo.cs
Src/Properties/AssemblyInfo.cs
+2
-2
RestfulSample.cs
Src/Transforms/RestfulSample.cs
+92
-0
packages.config
Src/packages.config
+4
-3
No files found.
.gitignore
View file @
e947c846
...
...
@@ -4,3 +4,4 @@
/Src/obj
/.vs
/Src/packages
Src/Kivii.Biz.Samples.V4.5.csproj
View file @
e947c846
...
...
@@ -31,17 +31,14 @@
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"Kivii.Common.V4.5, Version=5.6.2023.2150, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\..\k5-local\packages\Kivii.Common.5.6.2023.2150\lib\net45\Kivii.Common.V4.5.dll
</HintPath>
<Private>
False
</Private>
<Reference
Include=
"Kivii.Common.V4.5, Version=5.6.2023.4000, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
packages\Kivii.Common.5.6.2023.4000\lib\net45\Kivii.Common.V4.5.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Core.V4.5, Version=5.6.2023.1310, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\..\k5-local\packages\Kivii.Core.5.6.2023.1310\lib\net45\Kivii.Core.V4.5.dll
</HintPath>
<Private>
False
</Private>
<Reference
Include=
"Kivii.Core.V4.5, Version=5.6.2023.4200, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
packages\Kivii.Core.5.6.2023.4200\lib\net45\Kivii.Core.V4.5.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Linq.V4.5, Version=5.6.2022.12200, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\..\k5-local\packages\Kivii.Linq.5.6.2022.12200\lib\net45\Kivii.Linq.V4.5.dll
</HintPath>
<Private>
False
</Private>
<Reference
Include=
"Kivii.Linq.V4.5, Version=5.6.2023.4200, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
packages\Kivii.Linq.5.6.2023.4200\lib\net45\Kivii.Linq.V4.5.dll
</HintPath>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
...
...
Src/Properties/AssemblyInfo.cs
View file @
e947c846
...
...
@@ -36,5 +36,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2023.6
05
0")]
[assembly: AssemblyFileVersion("5.4.2023.6
05
0")]
[assembly: AssemblyVersion("5.4.2023.6
26
0")]
[assembly: AssemblyFileVersion("5.4.2023.6
26
0")]
Src/Transforms/RestfulSample.cs
View file @
e947c846
...
...
@@ -387,6 +387,98 @@ namespace Kivii.Samples.Transforms
}
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
[
Api
(
Description
=
"已打包样查找"
)]
public
class
SamplePackaged
:
RestfulExecution
<
Sample
>
{
public
string
BizId
{
get
;
set
;
}
//传入样品的业务BizId或BiziKvid或者对应Rfid的Tid号 结合OwnerKvid查找对应的样品,包含查询子样品
public
Guid
BizKvid
{
get
;
set
;
}
//三者不能都为空
public
string
Tid
{
get
;
set
;
}
public
bool
IncludeLocation
{
get
;
set
;
}
public
bool
IncludeChildrens
{
get
;
set
;
}
public
bool
IncludeRoutes
{
get
;
set
;
}
public
bool
IncludePackage
{
get
;
set
;
}
public
override
object
OnExecution
(
IRequest
req
,
IResponse
res
)
{
if
(
BizId
.
IsNullOrEmpty
()
&&
Tid
.
IsNullOrEmpty
()
&&
BizKvid
==
Guid
.
Empty
)
throw
new
Exception
(
"请传入要查询的样品业务信息!"
);
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Sample
>();
Sample
rootSample
=
null
;
//Guid sampleRootKvid = Guid.Empty;
if
(
BizKvid
!=
Guid
.
Empty
)
{
var
queryRootSample
=
conn
.
From
<
Sample
>();
queryRootSample
.
Where
(
o
=>
o
.
BizKvid
==
BizKvid
);
rootSample
=
conn
.
Single
(
queryRootSample
);
if
(
rootSample
!=
null
)
{
BizId
=
rootSample
.
BizId
;
}
}
if
(
rootSample
==
null
)
{
if
(!
Tid
.
IsNullOrEmpty
())
{
var
tidKvid
=
Tid
.
GetKvidByTid
();
if
(
tidKvid
!=
Guid
.
Empty
)
{
var
queryRootSample
=
conn
.
From
<
Sample
>();
queryRootSample
.
Where
(
o
=>
o
.
BizKvid
==
tidKvid
);
rootSample
=
conn
.
Single
(
queryRootSample
);
if
(
rootSample
!=
null
)
{
BizId
=
rootSample
.
BizId
;
}
}
}
else
if
(!
BizId
.
IsNullOrEmpty
())
{
var
queryRootSample
=
conn
.
From
<
Sample
>();
queryRootSample
.
Where
(
o
=>
o
.
BizId
==
BizId
);
rootSample
=
conn
.
Single
(
queryRootSample
);
//var querySampleRootKvid = conn.From<Sample>();
//querySampleRootKvid.Where(o => o.BizId == BizId);
//querySampleRootKvid.Select(o => o.RootKvid);
//sampleRootKvid = conn.Single<Guid>(querySampleRootKvid);
}
}
if
(
rootSample
==
null
)
throw
new
Exception
(
"未找到指定样品信息!"
);
var
rtns
=
new
RestfulExecutionResponse
<
Sample
>();
rtns
.
Results
=
new
List
<
Sample
>();
var
querySample
=
conn
.
From
<
Sample
>();
querySample
.
Where
(
o
=>
o
.
PackageKvid
!=
Guid
.
Empty
&&
o
.
RootKvid
==
rootSample
.
RootKvid
&&
o
.
BizId
==
BizId
);
var
sample
=
conn
.
Single
(
querySample
);
if
(
sample
!=
null
)
{
if
(
IncludeLocation
)
{
sample
.
CurrentLocation
=
sample
.
GetCurrentLocation
();
}
if
(
IncludeChildrens
)
{
sample
.
Childrens
=
sample
.
GetChildrens
();
}
if
(
IncludeRoutes
)
{
sample
.
Routes
=
sample
.
GetRoutes
();
}
if
(
IncludePackage
)
{
sample
.
CurrentPackage
=
sample
.
GetCurrentPackage
();
}
rtns
.
Results
.
Add
(
sample
);
}
return
rtns
;
}
}
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
[
Api
(
Description
=
"样品打包"
)]
public
class
SamplePackaging
:
RestfulExecution
<
Sample
>
{
...
...
Src/packages.config
View file @
e947c846
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"Kivii.Common"
version
=
"5.6.2023.
215
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Core"
version
=
"5.6.2023.
131
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Linq"
version
=
"5.6.202
2.12
200"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Common"
version
=
"5.6.2023.
400
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Core"
version
=
"5.6.2023.
420
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Linq"
version
=
"5.6.202
3.4
200"
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