Commit 8ec33319 by 陶然

优化

parent da5c105e
...@@ -25,5 +25,14 @@ namespace Kivii.Seeyon ...@@ -25,5 +25,14 @@ namespace Kivii.Seeyon
/// <param name="Message">消息</param> /// <param name="Message">消息</param>
/// <returns></returns> /// <returns></returns>
object OnGetApplyResult(Guid Kvid, object Result, string Message); object OnGetApplyResult(Guid Kvid, object Result, string Message);
/// <summary>
/// OA申请结果调用
/// </summary>
/// <param name="Kvids">对应业务Kvids,如果是Kvids数组的话,说明此OA申请审批是多个业务合并发起的一条申请</param>
/// <param name="Result">OA申请结果</param>
/// <param name="Message">消息</param>
/// <returns></returns>
object OnGetApplyResult(List<Guid> Kvids, object Result, string Message);
} }
} }
...@@ -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.9260")] [assembly: AssemblyVersion("5.4.2023.10160")]
[assembly: AssemblyFileVersion("5.4.2023.9260")] [assembly: AssemblyFileVersion("5.4.2023.10160")]
...@@ -11,6 +11,26 @@ namespace Kivii.Seeyon.Transforms ...@@ -11,6 +11,26 @@ namespace Kivii.Seeyon.Transforms
{ {
[RequiresAnyRole(SystemRoles.Everyone)] [RequiresAnyRole(SystemRoles.Everyone)]
[Api(Description = "提交OA申请表单")] [Api(Description = "提交OA申请表单")]
public class ApplyRequest : RestfulExecutionGeneric<Apply>
{
public string FormType { get; set; }
public Guid Kvid { get; set; }
public override object OnExecutionGeneric<G>(IRequest req, IResponse res)
{
FormType.ThrowIfNull("请传入业务实体FormType");
var type = Kivii.Text.AssemblyUtils.FindType(FormType);
var instance = Activator.CreateInstance(type) as IEntityIsSeeyonApply;
if (instance == null) return null;
var results = instance.OnSubmitApplyForm<G>(Kvid);
return results;
}
}
[RequiresAnyRole(SystemRoles.Everyone)]
[Api(Description = "提交OA申请表单")]
public class ApplyRequest2 : RestfulExecutionGeneric<Apply> public class ApplyRequest2 : RestfulExecutionGeneric<Apply>
{ {
public string FormType { get; set; } public string FormType { get; set; }
...@@ -45,32 +65,35 @@ namespace Kivii.Seeyon.Transforms ...@@ -45,32 +65,35 @@ namespace Kivii.Seeyon.Transforms
} }
} }
[RequiresAnyRole(SystemRoles.Everyone)] [Api(Description = "OA结果调用")]
[Api(Description = "提交OA申请表单")] public class ApplyResult : RestfulExecution<Apply>
public class ApplyRequest : RestfulExecutionGeneric<Apply>
{ {
public string FormType { get; set; } public string FormType { get; set; }
public Guid Kvid { get; set; } public Guid Kvid { get; set; }
public override object OnExecutionGeneric<G>(IRequest req, IResponse res) public object Result { get; set; }
public string Message { get; set; }
public override object OnExecution(IRequest req, IResponse res)
{ {
FormType.ThrowIfNull("请传入业务实体FormType"); FormType.ThrowIfNull("请传入业务实体FormType");
var type = Kivii.Text.AssemblyUtils.FindType(FormType); var type = Kivii.Text.AssemblyUtils.FindType(FormType);
var instance = Activator.CreateInstance(type) as IEntityIsSeeyonApply; var instance = Activator.CreateInstance(type) as IEntityIsSeeyonApply;
if (instance == null) return null; if (instance == null) return null;
var results = instance.OnSubmitApplyForm<G>(Kvid); var results = instance.OnGetApplyResult(Kvid, Result, Message);
return results; return results;
} }
} }
[Api(Description = "OA结果调用")] [Api(Description = "OA结果调用")]
public class ApplyResult : RestfulExecution<Apply> public class ApplyResult2 : RestfulExecution<Apply>
{ {
public string FormType { get; set; } public string FormType { get; set; }
public Guid Kvid { get; set; } public List<Guid> Kvids { get; set; }
public object Result { get; set; } public object Result { get; set; }
...@@ -83,7 +106,7 @@ namespace Kivii.Seeyon.Transforms ...@@ -83,7 +106,7 @@ namespace Kivii.Seeyon.Transforms
var instance = Activator.CreateInstance(type) as IEntityIsSeeyonApply; var instance = Activator.CreateInstance(type) as IEntityIsSeeyonApply;
if (instance == null) return null; if (instance == null) return null;
var results = instance.OnGetApplyResult(Kvid, Result, Message); var results = instance.OnGetApplyResult(Kvids, Result, Message);
return results; return results;
} }
} }
......
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