mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-21 02:57:54 +08:00
feat: 业务单据可以正常送审
This commit is contained in:
@@ -120,6 +120,9 @@ namespace OpenAuth.App.Flow
|
|||||||
throw new Exception("无法寻找到下一个节点");
|
throw new Exception("无法寻找到下一个节点");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//URL表单暂时不支持URL表单
|
||||||
|
if(flowInstance.FrmType == Define.FORM_TYPE_URL) return lines[0].to;
|
||||||
|
|
||||||
if (FrmData == "" || FrmData == "{}") return lines[0].to;
|
if (FrmData == "" || FrmData == "{}") return lines[0].to;
|
||||||
|
|
||||||
FrmData = FrmData.ToLower(); //统一转小写
|
FrmData = FrmData.ToLower(); //统一转小写
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* @Author: yubaolee <yubaolee@163.com> | ahfu~ <954478625@qq.com>
|
* @Author: yubaolee <yubaolee@163.com> | ahfu~ <954478625@qq.com>
|
||||||
* @Date: 2024-12-13 16:55:17
|
* @Date: 2024-12-13 16:55:17
|
||||||
* @Description: 工作流实例表操作
|
* @Description: 工作流实例表操作
|
||||||
* @LastEditTime: 2025-04-05 15:22:30
|
* @LastEditTime: 2025-04-06 02:25:02
|
||||||
* Copyright (c) 2024 by yubaolee | ahfu~ , All Rights Reserved.
|
* Copyright (c) 2024 by yubaolee | ahfu~ , All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -51,6 +51,14 @@ namespace OpenAuth.App
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public string CreateInstance(AddFlowInstanceReq addFlowInstanceReq)
|
public string CreateInstance(AddFlowInstanceReq addFlowInstanceReq)
|
||||||
{
|
{
|
||||||
|
//如果业务ID不为空,则需要检查该业务ID对应的审批是否存在
|
||||||
|
if(!string.IsNullOrEmpty(addFlowInstanceReq.BusinessId)){
|
||||||
|
//如果业务ID不为空,则需要检查业务ID是否存在
|
||||||
|
var business = Repository.GetFirst(u => u.BusinessId == addFlowInstanceReq.BusinessId && u.SchemeId == addFlowInstanceReq.SchemeId);
|
||||||
|
if(business != null){
|
||||||
|
throw new Exception("该业务ID已经送审过该类型的流程,请不要重复送审");
|
||||||
|
}
|
||||||
|
}
|
||||||
CheckNodeDesignate(addFlowInstanceReq);
|
CheckNodeDesignate(addFlowInstanceReq);
|
||||||
FlowScheme scheme = null;
|
FlowScheme scheme = null;
|
||||||
if (!string.IsNullOrEmpty(addFlowInstanceReq.SchemeId))
|
if (!string.IsNullOrEmpty(addFlowInstanceReq.SchemeId))
|
||||||
@@ -69,6 +77,7 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
|
|
||||||
addFlowInstanceReq.SchemeContent = scheme.SchemeContent;
|
addFlowInstanceReq.SchemeContent = scheme.SchemeContent;
|
||||||
|
addFlowInstanceReq.FrmType = scheme.FrmType;
|
||||||
|
|
||||||
FormResp form = null;
|
FormResp form = null;
|
||||||
if (scheme.FrmType != Define.FORM_TYPE_URL)
|
if (scheme.FrmType != Define.FORM_TYPE_URL)
|
||||||
@@ -83,6 +92,17 @@ namespace OpenAuth.App
|
|||||||
addFlowInstanceReq.FrmType = form.FrmType;
|
addFlowInstanceReq.FrmType = form.FrmType;
|
||||||
addFlowInstanceReq.FrmId = form.Id;
|
addFlowInstanceReq.FrmId = form.Id;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
if(string.IsNullOrEmpty(scheme.FrmUrlTemplate)){ //流程设计的时候没有URL表单模板
|
||||||
|
if(addFlowInstanceReq.FrmData.IsNullOrEmpty()){
|
||||||
|
throw new Exception("该流程使用的是URL表单,但流程设计时没有指定URL表单模板,需要修改流程模板或前端调用时直接传业务详情的URL地址");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
//流程设计的时候有URL表单模板,则使用URL表单模板,并替换模板中的{id}为业务详情的ID
|
||||||
|
addFlowInstanceReq.FrmData = scheme.FrmUrlTemplate.Replace("{id}", addFlowInstanceReq.BusinessId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var flowInstance = addFlowInstanceReq.MapTo<FlowInstance>();
|
var flowInstance = addFlowInstanceReq.MapTo<FlowInstance>();
|
||||||
|
|
||||||
|
@@ -24,29 +24,29 @@ namespace OpenAuth.Repository.Domain
|
|||||||
{
|
{
|
||||||
public FlowInstance()
|
public FlowInstance()
|
||||||
{
|
{
|
||||||
this.InstanceSchemeId= string.Empty;
|
this.InstanceSchemeId = string.Empty;
|
||||||
this.Code= string.Empty;
|
this.Code = string.Empty;
|
||||||
this.CustomName= string.Empty;
|
this.CustomName = string.Empty;
|
||||||
this.ActivityId= string.Empty;
|
this.ActivityId = string.Empty;
|
||||||
this.ActivityName= string.Empty;
|
this.ActivityName = string.Empty;
|
||||||
this.PreviousId= string.Empty;
|
this.PreviousId = string.Empty;
|
||||||
this.SchemeContent= string.Empty;
|
this.SchemeContent = string.Empty;
|
||||||
this.SchemeId= string.Empty;
|
this.SchemeId = string.Empty;
|
||||||
this.DbName= string.Empty;
|
this.DbName = string.Empty;
|
||||||
this.FrmData= string.Empty;
|
this.FrmData = string.Empty;
|
||||||
this.FrmType= 0;
|
this.FrmType = 0;
|
||||||
this.FrmContentData= string.Empty;
|
this.FrmContentData = string.Empty;
|
||||||
this.FrmContentParse= string.Empty;
|
this.FrmContentParse = string.Empty;
|
||||||
this.FrmId= string.Empty;
|
this.FrmId = string.Empty;
|
||||||
this.SchemeType= string.Empty;
|
this.SchemeType = string.Empty;
|
||||||
this.Disabled= 0;
|
this.Disabled = 0;
|
||||||
this.CreateDate= DateTime.Now;
|
this.CreateDate = DateTime.Now;
|
||||||
this.CreateUserId= string.Empty;
|
this.CreateUserId = string.Empty;
|
||||||
this.CreateUserName= string.Empty;
|
this.CreateUserName = string.Empty;
|
||||||
this.FlowLevel= 0;
|
this.FlowLevel = 0;
|
||||||
this.Description= string.Empty;
|
this.Description = string.Empty;
|
||||||
this.IsFinish= FlowInstanceStatus.Running;
|
this.IsFinish = FlowInstanceStatus.Running;
|
||||||
this.MakerList= string.Empty;
|
this.MakerList = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -131,6 +131,13 @@ namespace OpenAuth.Repository.Domain
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("流程类型")]
|
[Description("流程类型")]
|
||||||
public string SchemeType { get; set; }
|
public string SchemeType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 业务ID
|
||||||
|
/// 当流程实例与业务单据关联时,记录关联的业务ID
|
||||||
|
/// </summary>
|
||||||
|
[Description("业务ID")]
|
||||||
|
public string BusinessId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 有效标志
|
/// 有效标志
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Reference in New Issue
Block a user