|
|
|
@ -140,7 +140,7 @@ public class FlowInstanceService : IFlowInstanceService
|
|
|
|
|
//流程==4为结束,执行回调URL
|
|
|
|
|
if (wfruntime.GetNextNodeType() == 4 && !instance.CallbackURL.IsNullOrEmpty() && Uri.TryCreate(instance.CallbackURL, UriKind.RelativeOrAbsolute, out Uri? uri))
|
|
|
|
|
{
|
|
|
|
|
RunCallback(instance, uri);
|
|
|
|
|
RunCallback(instance);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var userInfo = db.Queryable<SysUser>().First(x => x.Id == long.Parse(user.UserId));
|
|
|
|
@ -269,7 +269,7 @@ public class FlowInstanceService : IFlowInstanceService
|
|
|
|
|
//流程==4为结束,执行回调URL
|
|
|
|
|
if (wfruntime.GetNextNodeType() == 4 && !instance.CallbackURL.IsNullOrEmpty() && Uri.TryCreate(instance.CallbackURL, UriKind.RelativeOrAbsolute, out Uri? uri))
|
|
|
|
|
{
|
|
|
|
|
RunCallback(instance, uri);
|
|
|
|
|
RunCallback(instance);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var userInfo = db.Queryable<SysUser>().First(x => x.Id == long.Parse(user.UserId));
|
|
|
|
@ -390,11 +390,10 @@ public class FlowInstanceService : IFlowInstanceService
|
|
|
|
|
|
|
|
|
|
//流程==4为结束,执行回调URL
|
|
|
|
|
int nextNodeType = runtime.GetNextNodeType();
|
|
|
|
|
if (runtime.NextNodeType != 5 && (nextNodeType == 4 || nextNodeType == -1) &&
|
|
|
|
|
!instance.CallbackURL.IsNullOrEmpty() && Uri.TryCreate(instance.CallbackURL, UriKind.RelativeOrAbsolute, out Uri? uri))
|
|
|
|
|
if (runtime.NextNodeType != 5 && (nextNodeType == 4 || nextNodeType == -1) && !instance.CallbackURL.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
instance.Note = req.AuditNote;
|
|
|
|
|
RunCallback(instance, uri);
|
|
|
|
|
RunCallback(instance);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var history = new FlowInstanceHistory
|
|
|
|
@ -410,8 +409,15 @@ public class FlowInstanceService : IFlowInstanceService
|
|
|
|
|
return DataResult.Successed("审批成功!", MultiLanguageConst.FlowInstanceAuditSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void RunCallback(FlowInstance instance, Uri uri)
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 对指定的回调URL发起请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="instance">运行实例</param>
|
|
|
|
|
protected virtual void RunCallback(FlowInstance instance)
|
|
|
|
|
{
|
|
|
|
|
if (!Uri.TryCreate(instance.CallbackURL, UriKind.RelativeOrAbsolute, out Uri? uri))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
HttpClient http = new HttpClient();
|
|
|
|
|
http.DefaultRequestHeaders.Add("User-Agent", "X-HttpClient");
|
|
|
|
|
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + user.GetToken());
|
|
|
|
@ -422,7 +428,8 @@ public class FlowInstanceService : IFlowInstanceService
|
|
|
|
|
InstanceId = instance.Id,
|
|
|
|
|
BusinessId = instance.BusinessId,
|
|
|
|
|
AuditType = instance.AuditType,
|
|
|
|
|
FlowStatus = (FlowStatusEnum)instance.FlowStatus
|
|
|
|
|
FlowStatus = (FlowStatusEnum)instance.FlowStatus,
|
|
|
|
|
RejectReason = instance.Note
|
|
|
|
|
};
|
|
|
|
|
var jsonRequest = new StringContent(JsonConvert.SerializeObject(callback), Encoding.UTF8, "application/json");
|
|
|
|
|
try
|
|
|
|
@ -442,7 +449,7 @@ public class FlowInstanceService : IFlowInstanceService
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
ex.Log(db);
|
|
|
|
|
ex.Log(db);
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|