Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Seeyon.Addons.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.Seeyon.Addons.V4.5
Commits
da5c105e
Commit
da5c105e
authored
Sep 26, 2023
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化插件功能
parent
e0b8f06c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
19 deletions
+68
-19
SeeyonInterface.cs
Src/Entities/SeeyonInterface.cs
+2
-0
Extension.cs
Src/Extension.cs
+28
-0
Kivii.Seeyon.Addons.V4.5.csproj
Src/Kivii.Seeyon.Addons.V4.5.csproj
+1
-0
AssemblyInfo.cs
Src/Properties/AssemblyInfo.cs
+2
-2
RestfulApply.cs
Src/Transforms/RestfulApply.cs
+35
-17
No files found.
Src/Entities/SeeyonInterface.cs
View file @
da5c105e
...
@@ -15,6 +15,8 @@ namespace Kivii.Seeyon
...
@@ -15,6 +15,8 @@ namespace Kivii.Seeyon
/// <returns></returns>
/// <returns></returns>
object
OnSubmitApplyForm
<
T
>(
Guid
Kvid
);
object
OnSubmitApplyForm
<
T
>(
Guid
Kvid
);
object
OnSubmitApplyForm
<
T
>(
T
form
);
/// <summary>
/// <summary>
/// OA申请结果调用
/// OA申请结果调用
/// </summary>
/// </summary>
...
...
Src/Extension.cs
0 → 100644
View file @
da5c105e
using
Kivii.Text
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
static
System
.
Collections
.
Generic
.
Dictionary
<
string
,
object
>;
namespace
Kivii.Seeyon
{
internal
static
class
Extension
{
public
static
T
ConvertTo
<
T
>(
this
Dictionary
<
string
,
object
>
dic
)
{
Dictionary
<
string
,
object
>
dictionary
=
new
Dictionary
<
string
,
object
>();
using
(
Enumerator
enumerator
=
dic
.
GetEnumerator
())
{
while
(
enumerator
.
MoveNext
())
{
KeyValuePair
<
string
,
object
>
current
=
enumerator
.
Current
;
dictionary
[
current
.
Key
]
=
current
.
Value
;
}
}
return
(
T
)
dictionary
.
FromObjectDictionary
(
typeof
(
T
));
}
}
}
Src/Kivii.Seeyon.Addons.V4.5.csproj
View file @
da5c105e
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
<Compile
Include=
"Entities\SeeyonInterface.cs"
/>
<Compile
Include=
"Entities\SeeyonInterface.cs"
/>
<Compile
Include=
"Entities\Request.Response.cs"
/>
<Compile
Include=
"Entities\Request.Response.cs"
/>
<Compile
Include=
"Entities\SeeyonApply.cs"
/>
<Compile
Include=
"Entities\SeeyonApply.cs"
/>
<Compile
Include=
"Extension.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"Transforms\RestfulApply.cs"
/>
<Compile
Include=
"Transforms\RestfulApply.cs"
/>
</ItemGroup>
</ItemGroup>
...
...
Src/Properties/AssemblyInfo.cs
View file @
da5c105e
...
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
...
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2023.92
0
0")]
[assembly: AssemblyVersion("5.4.2023.92
6
0")]
[assembly: AssemblyFileVersion("5.4.2023.92
0
0")]
[assembly: AssemblyFileVersion("5.4.2023.92
6
0")]
Src/Transforms/RestfulApply.cs
View file @
da5c105e
using
Kivii.Seeyon.Entities
;
using
Kivii.Seeyon.Entities
;
using
Kivii.Text
;
using
Kivii.Web
;
using
Kivii.Web
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -8,24 +9,41 @@ using System.Threading.Tasks;
...
@@ -8,24 +9,41 @@ using System.Threading.Tasks;
namespace
Kivii.Seeyon.Transforms
namespace
Kivii.Seeyon.Transforms
{
{
//[RequiresAnyRole(SystemRoles.Everyone)]
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
//[Api(Description = "提交OA申请表单")]
[
Api
(
Description
=
"提交OA申请表单"
)]
//public class ApplyRequest2 : RestfulExecution<Apply>
public
class
ApplyRequest2
:
RestfulExecutionGeneric
<
Apply
>
//{
{
// public string EntityType { get; set; }
public
string
FormType
{
get
;
set
;
}
// public object Form { get; set; }
public
JsonObject
Form
{
get
;
set
;
}
// public override object OnExecution(IRequest req, IResponse res)
// {
// EntityType.ThrowIfNull("请传入业务实体EntityType");
// var type = Kivii.Text.AssemblyUtils.FindType(EntityType);
// var instance = Activator.CreateInstance(type) as IEntityIsSeeyonApply;
public
override
object
OnExecutionGeneric
<
G
>(
IRequest
req
,
IResponse
res
)
// if (instance == null) return null;
{
// var results = instance.OnSubmitApplyForm(Form);
FormType
.
ThrowIfNull
(
"请传入业务实体FormType"
);
// return results;
var
type
=
Kivii
.
Text
.
AssemblyUtils
.
FindType
(
FormType
);
// }
Dictionary
<
string
,
object
>
form
=
new
Dictionary
<
string
,
object
>();
//}
foreach
(
var
item
in
Form
)
{
if
(
item
.
Key
==
"Metadata"
)
{
var
metadata
=
JsonObject
.
Parse
(
item
.
Value
);
JsonObject
metadata2
=
new
JsonObject
();
foreach
(
var
meta
in
metadata
)
{
var
val
=
metadata
[
meta
.
Key
];
metadata2
[
meta
.
Key
]
=
val
;
}
form
[
item
.
Key
]
=
metadata2
;
continue
;
}
form
[
item
.
Key
]
=
Form
[
item
.
Key
];
}
var
formFormat
=
form
.
ConvertTo
<
G
>();
var
instance
=
Activator
.
CreateInstance
(
type
)
as
IEntityIsSeeyonApply
;
if
(
instance
==
null
)
return
null
;
var
results
=
instance
.
OnSubmitApplyForm
<
G
>(
formFormat
);
return
results
;
}
}
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
[
Api
(
Description
=
"提交OA申请表单"
)]
[
Api
(
Description
=
"提交OA申请表单"
)]
...
...
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