|
|
|
@ -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,
|
|
|
|
|