|
|
@ -6,6 +6,8 @@ using DS.WMS.Core.Fee.Method;
|
|
|
|
using DS.WMS.Core.Flow.Dtos;
|
|
|
|
using DS.WMS.Core.Flow.Dtos;
|
|
|
|
using DS.WMS.Core.Flow.Entity;
|
|
|
|
using DS.WMS.Core.Flow.Entity;
|
|
|
|
using DS.WMS.Core.Flow.Interface;
|
|
|
|
using DS.WMS.Core.Flow.Interface;
|
|
|
|
|
|
|
|
using DS.WMS.Core.Op.Dtos.TaskInteraction;
|
|
|
|
|
|
|
|
using DS.WMS.Core.Op.Interface.TaskInteraction;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Application.Method
|
|
|
|
namespace DS.WMS.Core.Application.Method
|
|
|
@ -22,6 +24,7 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
public abstract TaskBaseTypeEnum AuditType { get; }
|
|
|
|
public abstract TaskBaseTypeEnum AuditType { get; }
|
|
|
|
|
|
|
|
|
|
|
|
readonly IClientFlowInstanceService flowService;
|
|
|
|
readonly IClientFlowInstanceService flowService;
|
|
|
|
|
|
|
|
readonly ITaskService taskService;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 初始化
|
|
|
|
/// 初始化
|
|
|
@ -30,6 +33,7 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
public ApplicationAuditService(IServiceProvider serviceProvider) : base(serviceProvider)
|
|
|
|
public ApplicationAuditService(IServiceProvider serviceProvider) : base(serviceProvider)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
flowService = serviceProvider.GetRequiredService<IClientFlowInstanceService>();
|
|
|
|
flowService = serviceProvider.GetRequiredService<IClientFlowInstanceService>();
|
|
|
|
|
|
|
|
taskService = serviceProvider.GetRequiredService<ITaskService>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -69,6 +73,22 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
if (!result.Succeeded)
|
|
|
|
if (!result.Succeeded)
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool hasAuthorized = await taskService.HasAuthorizedAsync();
|
|
|
|
|
|
|
|
if (hasAuthorized)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result = await taskService.AuditAsync(new TaskAuditRequest
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Ids = request.Ids,
|
|
|
|
|
|
|
|
Remark = request.Remark,
|
|
|
|
|
|
|
|
Result = request.Result,
|
|
|
|
|
|
|
|
TaskTypeName = AuditType.ToString()
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
var flows = await flowService.GetInstanceByBSIdAsync(AuditType, null, request.Ids);
|
|
|
|
var flows = await flowService.GetInstanceByBSIdAsync(AuditType, null, request.Ids);
|
|
|
|
if (flows.Count != request.Ids.Length)
|
|
|
|
if (flows.Count != request.Ids.Length)
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FlowNotFound));
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FlowNotFound));
|
|
|
@ -86,6 +106,8 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
if (!result.Succeeded)
|
|
|
|
if (!result.Succeeded)
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Success;
|
|
|
|
return DataResult.Success;
|
|
|
|
}
|
|
|
|
}
|
|
|
|