多人审核任务台不再变更所有权

usertest
嵇文龙 4 months ago
parent b7caa53be4
commit 3ae3233068

@ -31,27 +31,32 @@ public class FlowInstanceService : ServiceBase, IFlowInstanceService
}
/// <summary>
/// 获取工作流的所有执行人;当工作流类型为会签时,仅返回首个执行人
/// 获取当前工作流的所有执行人;当工作流类型为会签时,仅返回首个执行人
/// </summary>
/// <param name="instance">运行实例</param>
/// <returns></returns>
public static string[] GetNextMarkers(FlowInstance instance)
{
if (instance.MakerList.IsNullOrEmpty() || instance.MakerList == "-1")
return [];
string[] markers = instance.MakerList.Split(',', StringSplitOptions.RemoveEmptyEntries);
string[] markers = GetMarkers(instance);
if (instance.ActivityType == 0 && markers.Length > 0)
{
//if (markers.Length > 0 && long.TryParse(markers[0], out long nextUserId))
// return nextUserId.ToString();
return [markers[0]];
}
return markers;
}
/// <summary>
/// 获取当前工作流的所有执行人
/// </summary>
/// <param name="instance">运行实例</param>
/// <returns></returns>
public static string[] GetMarkers(FlowInstance instance)
{
if (instance.MakerList.IsNullOrEmpty() || instance.MakerList == "-1")
return [];
return instance.MakerList.Split(',', StringSplitOptions.RemoveEmptyEntries);
}
public DataResult<List<FlowInstanceRes>> GetListByPage(PageRequest request)
{
//序列化查询条件

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

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NameOfLastUsedPublishProfile>E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>D:\Source\Repos\DS8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup>

Loading…
Cancel
Save