|
|
|
@ -120,14 +120,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
var instance = result.Data as FlowInstance;
|
|
|
|
|
var markers = FlowInstanceService.GetNextMarkers(instance);
|
|
|
|
|
|
|
|
|
|
await TenantDb.Updateable<BusinessTask>()
|
|
|
|
|
.SetColumns(x => x.TaskStatus == TaskStatusEnum.Create)
|
|
|
|
|
.SetColumns(x => x.RecvUsers == string.Join(',', markers))
|
|
|
|
|
.Where(x => x.BusinessId == request.BusinessId &&
|
|
|
|
|
x.BusinessType == request.BusinessType && x.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
|
|
|
|
|
await TenantDb.Updateable<BusinessTask>().SetColumns(x => x.TaskStatus == TaskStatusEnum.Create)
|
|
|
|
|
.Where(x => x.BusinessId == request.BusinessId && x.BusinessType == request.BusinessType && x.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
|
|
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
@ -323,8 +317,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
|
|
|
|
|
if (result.Succeeded)
|
|
|
|
|
{
|
|
|
|
|
string[] ids = FlowInstanceService.GetNextMarkers(instance);
|
|
|
|
|
//变更任务接收人为审批执行人
|
|
|
|
|
string[] ids = FlowInstanceService.GetMarkers(instance);
|
|
|
|
|
//变更任务接收人为所有审批执行人
|
|
|
|
|
await UpdateReceiverAsync(new MakerChangedCallback
|
|
|
|
|
{
|
|
|
|
|
BusinessId = task.BusinessId,
|
|
|
|
@ -435,26 +429,28 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
/// <param name="callback">回调信息</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
/// <exception cref="ArgumentNullException"><paramref name="callback"/>为null时引发</exception>
|
|
|
|
|
public virtual async Task UpdateReceiverAsync(MakerChangedCallback callback)
|
|
|
|
|
public virtual Task UpdateReceiverAsync(MakerChangedCallback callback)
|
|
|
|
|
{
|
|
|
|
|
ArgumentNullException.ThrowIfNull(callback, nameof(callback));
|
|
|
|
|
//ArgumentNullException.ThrowIfNull(callback, nameof(callback));
|
|
|
|
|
|
|
|
|
|
if (callback.NextUserId == null)
|
|
|
|
|
return;
|
|
|
|
|
//if (callback.NextUserId == null)
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
|
|
var users = await GetRecvUsers(callback.NextUserId);
|
|
|
|
|
var result = await ManagerService.TransferTask(callback.BusinessId, TaskBaseTypeEnum.WAIT_ORDER_AUDIT, users);
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
|
{
|
|
|
|
|
await new ApplicationException($"任务API({nameof(ManagerService.TransferTask)})调用失败:" + result.Message).LogAsync(Db);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//var users = await GetRecvUsers(callback.NextUserId);
|
|
|
|
|
//var result = await ManagerService.TransferTask(callback.BusinessId, TaskBaseTypeEnum.WAIT_ORDER_AUDIT, users);
|
|
|
|
|
//if (!result.Succeeded)
|
|
|
|
|
//{
|
|
|
|
|
// await new ApplicationException($"任务API({nameof(ManagerService.TransferTask)})调用失败:" + result.Message).LogAsync(Db);
|
|
|
|
|
// return;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//string recvUser = string.Join(',', callback.NextUserId);
|
|
|
|
|
//await TenantDb.Updateable<BusinessTask>().Where(x => x.BusinessId == callback.BusinessId &&
|
|
|
|
|
// x.BusinessType == callback.BusinessType && x.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
|
|
|
|
|
// .SetColumns(x => x.RecvUsers == recvUser)
|
|
|
|
|
// .ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
string recvUser = string.Join(',', callback.NextUserId);
|
|
|
|
|
await TenantDb.Updateable<BusinessTask>().Where(x => x.BusinessId == callback.BusinessId &&
|
|
|
|
|
x.BusinessType == callback.BusinessType && x.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
|
|
|
|
|
.SetColumns(x => x.RecvUsers == recvUser)
|
|
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
return Task.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|