mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 18:22:11 +08:00
fix #I3SKUV 增加API和EF执行效率的监控
新增流程修改接口 增加启动及撤销判定
This commit is contained in:
@@ -146,6 +146,29 @@ namespace OpenAuth.App
|
||||
UnitWork.Save();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新流程
|
||||
/// <para>更新时可以修改表单内容,可以修改流程基本信息,但不能更换表单模版</para>
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
public void Update(UpdateFlowInstanceReq req)
|
||||
{
|
||||
var flowinstance = Get(req.Id);
|
||||
|
||||
if (flowinstance.IsFinish != FlowInstanceStatus.Draft &&
|
||||
flowinstance.IsFinish != FlowInstanceStatus.Rejected)
|
||||
{
|
||||
throw new Exception("只能修改【草稿】和【驳回】状态的流程");
|
||||
}
|
||||
|
||||
flowinstance.Description = req.Description;
|
||||
flowinstance.Code = req.Code;
|
||||
flowinstance.FrmData = req.FrmData;
|
||||
flowinstance.DbName = req.DbName;
|
||||
flowinstance.CustomName = req.CustomName;
|
||||
Repository.Update(flowinstance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 节点审核
|
||||
@@ -551,11 +574,6 @@ namespace OpenAuth.App
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(FlowInstance flowScheme)
|
||||
{
|
||||
Repository.Update(flowScheme);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回用于处理流程节点
|
||||
/// </summary>
|
||||
@@ -667,6 +685,11 @@ namespace OpenAuth.App
|
||||
{
|
||||
var user = _auth.GetCurrentUser().User;
|
||||
FlowInstance flowInstance = Get(request.FlowInstanceId);
|
||||
if (flowInstance.IsFinish == FlowInstanceStatus.Draft
|
||||
|| flowInstance.IsFinish == FlowInstanceStatus.Finished)
|
||||
{
|
||||
throw new Exception("当前流程状态不能召回");
|
||||
}
|
||||
|
||||
FlowRuntime wfruntime = new FlowRuntime(flowInstance);
|
||||
|
||||
@@ -702,6 +725,10 @@ namespace OpenAuth.App
|
||||
public void Start(StartFlowInstanceReq request)
|
||||
{
|
||||
FlowInstance flowInstance = Get(request.FlowInstanceId);
|
||||
if (flowInstance.IsFinish != FlowInstanceStatus.Draft)
|
||||
{
|
||||
throw new Exception("当前流程不是草稿状态,不能启动");
|
||||
}
|
||||
var wfruntime = new FlowRuntime(flowInstance);
|
||||
var user = _auth.GetCurrentUser();
|
||||
|
||||
|
63
OpenAuth.App/FlowInstance/Request/UpdateFlowInstanceReq.cs
Normal file
63
OpenAuth.App/FlowInstance/Request/UpdateFlowInstanceReq.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a CodeSmith Template.
|
||||
//
|
||||
// DO NOT MODIFY contents of this file. Changes to this
|
||||
// file will be lost if the code is regenerated.
|
||||
// Author:Yubao Li
|
||||
// </autogenerated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace OpenAuth.App.Request
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建工作流请求
|
||||
/// </summary>
|
||||
public class UpdateFlowInstanceReq : NodeDesignateReq
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 待更改的流程实例ID
|
||||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实例编号
|
||||
/// </summary>
|
||||
[Description("实例编号")]
|
||||
public string Code { get; set; }
|
||||
/// <summary>
|
||||
/// 自定义名称
|
||||
/// </summary>
|
||||
[Description("自定义名称")]
|
||||
public string CustomName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据库名称
|
||||
/// </summary>
|
||||
[Description("数据库名称")]
|
||||
public string DbName { get; set; }
|
||||
/// <summary>
|
||||
/// 表单数据
|
||||
/// </summary>
|
||||
[Description("表单数据")]
|
||||
public string FrmData { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 所属部门
|
||||
/// </summary>
|
||||
[Description("所属部门")]
|
||||
public string OrgId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实例备注
|
||||
/// </summary>
|
||||
[Description("实例备注")]
|
||||
public string Description { get; set; }
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user