审批工作流执行人任务所有权转交

usertest
嵇文龙 4 months ago
parent eea46a9c77
commit 6384da4ef8

@ -129,7 +129,7 @@ public class FlowInstanceService : ServiceBase, IFlowInstanceService
{
if (!wfruntime.CurrentNode.Users.Contains(User.UserId))
{
return DataResult.Failed("该工作流指定用户非本人!", MultiLanguageConst.FlowInstanceAssignUser);
return DataResult.Failed("该工作流指定用户非本人,没有发起审批的权限", MultiLanguageConst.FlowInstanceAssignUser);
}
}
@ -140,7 +140,7 @@ public class FlowInstanceService : ServiceBase, IFlowInstanceService
var intersectRoles = wfruntime.CurrentNode.Roles.Intersect(userRoles).ToList();
if (intersectRoles.Count == 0)
{
return DataResult.Failed("该工作流指定角色非本人!", MultiLanguageConst.FlowInstanceAssignRole);
return DataResult.Failed("该工作流指定角色非本人,没有发起审批的权限", MultiLanguageConst.FlowInstanceAssignRole);
}
}

@ -79,6 +79,11 @@ public class ClientBankReq
/// </summary>
public long? CountryId { get; set; }
/// <summary>
/// 国家名称
/// </summary>
public string? CountryName { get; set; }
/// <summary>
/// Desc:是否开票默认账户
/// </summary>
@ -92,8 +97,7 @@ public class ClientBankReq
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
public string? Note { get; set; }
}

@ -78,6 +78,11 @@ public class ClientBankRes
/// </summary>
public long? CountryId { get; set; }
/// <summary>
/// 国家名称
/// </summary>
public string? CountryName { get; set; }
/// <summary>
/// Desc:是否开票默认账户
/// </summary>

@ -88,6 +88,12 @@ public class InfoClientBank : BaseModelV2<long>
[SugarColumn(ColumnDescription = "国家Id", IsNullable = true)]
public long? CountryId { get; set; }
/// <summary>
/// 国家名称
/// </summary>
[SugarColumn(ColumnDescription = "国家名称", Length = 50,IsNullable = true)]
public string? CountryName { get; set; }
/// <summary>
/// Desc:是否开票默认账户
/// </summary>

@ -57,10 +57,10 @@ namespace DS.WMS.Core.Op.Interface.TaskInteraction
Task UpdateBusinessAsync(FlowCallback callback);
/// <summary>
/// 通知更新任务接收人
/// 通知审批执行人变更
/// </summary>
/// <param name="callback">回调信息</param>
/// <returns></returns>
Task UpdateReceiverAsync(MarkerChangedCallback callback);
Task MarkerChangedAsync(MarkerChangedCallback callback);
}
}

@ -199,12 +199,12 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
return extArray.Select(x => x["projectName"]?.Value<string>() ?? string.Empty).ToArray();
}
public override async Task UpdateReceiverAsync(MarkerChangedCallback callback)
public override async Task MarkerChangedAsync(MarkerChangedCallback callback)
{
if (callback.Type != AuditType.SeaExport)
return;
await base.UpdateReceiverAsync(callback);
await base.MarkerChangedAsync(callback);
}
/// <summary>

@ -131,7 +131,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
return result;
//创建&启动工作流
result = await Create_StartWorkflow(task);
result = await Create_StartWorkflow(task, false);
if (!result.Succeeded)
return result;
@ -267,10 +267,6 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
try
{
var result = await ManagerService.InitTaskJob(info);
if (!result.Succeeded)
return result;
task = new BusinessTask
{
BusinessId = request.BusinessId,
@ -284,8 +280,12 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
task.NextType = GetNextType(task);
await TenantDb.Insertable(task).ExecuteCommandAsync();
DataResult result = await ManagerService.InitTaskJob(info);
if (!result.Succeeded)
return result;
//待审核,需创建工作流
if (task.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
if (request.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
{
result = await Create_StartWorkflow(task);
if (!result.Succeeded)
@ -343,14 +343,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
{
string[] ids = FlowInstanceService.GetMarkers(instance);
//变更任务接收人为所有审批执行人
await UpdateReceiverAsync(new MarkerChangedCallback
{
BusinessId = task.BusinessId,
BusinessType = task.BusinessType,
InstanceId = instance.Id,
Type = instance.Type,
NextUserId = ids.Select(long.Parse).ToArray()
});
var users = await GetRecvUsers(ids.Select(long.Parse).ToArray());
await ManagerService.TransferTask(task.BusinessId, task.TaskType, users);
}
}
@ -448,17 +442,18 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
}
/// <summary>
/// 通知更新任务接收人
/// 通知审批执行人变更
/// </summary>
/// <param name="callback">回调信息</param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"><paramref name="callback"/>为null时引发</exception>
public virtual async Task UpdateReceiverAsync(MarkerChangedCallback callback)
public virtual async Task MarkerChangedAsync(MarkerChangedCallback callback)
{
ArgumentNullException.ThrowIfNull(callback, nameof(callback));
long userId = long.Parse(User.UserId);
var users = await GetRecvUsers(userId);
await ManagerService.SetTaskUserStatus(
callback.BusinessId,
TaskBaseTypeEnum.WAIT_ORDER_AUDIT,

@ -94,14 +94,14 @@ namespace DS.WMS.OpApi.Controllers
}
/// <summary>
/// 通知更新任务接收人(无需客户端手动调用)
/// 通知审批执行人变更(无需客户端手动调用)
/// </summary>
/// <param name="callback">回调信息</param>
/// <returns></returns>
[HttpPost, Route("UpdateReceiver")]
public virtual async Task<IActionResult> UpdateReceiverAsync([FromBody] MarkerChangedCallback callback)
[HttpPost, Route("MarkerChanged")]
public virtual async Task<IActionResult> MarkerChangedAsync([FromBody] MarkerChangedCallback callback)
{
await taskService.UpdateReceiverAsync(callback);
await taskService.MarkerChangedAsync(callback);
return StatusCode((int)HttpStatusCode.NoContent);
}
}

Loading…
Cancel
Save