mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 10:37:55 +08:00
完成加签审批
This commit is contained in:
@@ -7,6 +7,7 @@ using OpenAuth.App.Interface;
|
|||||||
using OpenAuth.App.Request;
|
using OpenAuth.App.Request;
|
||||||
using OpenAuth.App.Response;
|
using OpenAuth.App.Response;
|
||||||
using OpenAuth.Repository.Domain;
|
using OpenAuth.Repository.Domain;
|
||||||
|
using Quartz.Listener;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
|
|
||||||
@@ -109,8 +110,13 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 审批加签节点
|
/// 审批加签节点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Verify(VerifyApproverReq verifyApproverReq)
|
public bool Verify(VerifyApproverReq verifyApproverReq)
|
||||||
{
|
{
|
||||||
|
var approve = Get(verifyApproverReq.Id);
|
||||||
|
if (approve == null)
|
||||||
|
{
|
||||||
|
throw new Exception("加签审批失败,没能找打对应的加签人信息");
|
||||||
|
}
|
||||||
Repository.Update(u => new FlowApprover()
|
Repository.Update(u => new FlowApprover()
|
||||||
{
|
{
|
||||||
Status = verifyApproverReq.Status,
|
Status = verifyApproverReq.Status,
|
||||||
@@ -118,7 +124,16 @@ namespace OpenAuth.App
|
|||||||
VerifyDate = DateTime.Now
|
VerifyDate = DateTime.Now
|
||||||
}, u => u.Id == verifyApproverReq.Id);
|
}, u => u.Id == verifyApproverReq.Id);
|
||||||
|
|
||||||
//TODO:需要判断节点是否已经全部审批通过,如果通过则修改节点状态为通过
|
if (approve.ApproveType == 2)
|
||||||
|
{
|
||||||
|
//如果是并行或,只需要一个审批通过即可
|
||||||
|
return Repository.IsAny(u => u.InstanceId == approve.InstanceId
|
||||||
|
&& u.ActivityId == approve.ActivityId && u.Status == 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//没有未处理的加签信息
|
||||||
|
return !Repository.IsAny(u => u.InstanceId == approve.InstanceId
|
||||||
|
&& u.ActivityId == approve.ActivityId && u.Status == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FlowApproverApp(ISqlSugarClient client, IAuth auth) : base(client, auth)
|
public FlowApproverApp(ISqlSugarClient client, IAuth auth) : base(client, auth)
|
||||||
|
@@ -426,12 +426,16 @@ namespace OpenAuth.App
|
|||||||
if (approverInfo != null)
|
if (approverInfo != null)
|
||||||
{
|
{
|
||||||
//如果是加签,则调整加签状态
|
//如果是加签,则调整加签状态
|
||||||
_flowApproverApp.Verify(new VerifyApproverReq()
|
bool isfinish = _flowApproverApp.Verify(new VerifyApproverReq()
|
||||||
{
|
{
|
||||||
Id = approverInfo.Id,
|
Id = approverInfo.Id,
|
||||||
Status = (int)TagState.Ok,
|
Status = (int)TagState.Ok,
|
||||||
VerifyComment = tag.Description
|
VerifyComment = tag.Description
|
||||||
});
|
});
|
||||||
|
if (!isfinish) //如果没有完成,不能到下一步
|
||||||
|
{
|
||||||
|
canNext = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wfruntime.currentNode.setInfo.NodeDesignate == Setinfo.RUNTIME_MANY_PARENTS)
|
if (wfruntime.currentNode.setInfo.NodeDesignate == Setinfo.RUNTIME_MANY_PARENTS)
|
||||||
|
Reference in New Issue
Block a user