|
|
@ -22,9 +22,14 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
/// 申请单基础实现
|
|
|
|
/// 申请单基础实现
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="TEntity">实体的类型声明</typeparam>
|
|
|
|
/// <typeparam name="TEntity">实体的类型声明</typeparam>
|
|
|
|
public class ApplicationService<TEntity> : FeeServiceBase, IApplicationService<TEntity>
|
|
|
|
public abstract class ApplicationService<TEntity> : FeeServiceBase, IApplicationService<TEntity>
|
|
|
|
where TEntity : ApplicationForm, new()
|
|
|
|
where TEntity : ApplicationForm, new()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 适用于当前申请单的审核类型
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public abstract TaskBaseTypeEnum AuditType { get; }
|
|
|
|
|
|
|
|
|
|
|
|
readonly IClientFlowInstanceService flowService;
|
|
|
|
readonly IClientFlowInstanceService flowService;
|
|
|
|
readonly Lazy<ICommonService> commonService;
|
|
|
|
readonly Lazy<ICommonService> commonService;
|
|
|
|
readonly ITaskService taskService;
|
|
|
|
readonly ITaskService taskService;
|
|
|
@ -515,15 +520,32 @@ namespace DS.WMS.Core.Application.Method
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
|
|
|
|
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
|
|
|
|
|
|
|
|
|
|
|
|
DataResult result;
|
|
|
|
DataResult result;
|
|
|
|
|
|
|
|
bool hasAuthorized = await taskService.HasAuthorizedAsync();
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
result = await flowService.WithdrawAsync(ids);
|
|
|
|
if (hasAuthorized)
|
|
|
|
if (!result.Succeeded)
|
|
|
|
{
|
|
|
|
return result;
|
|
|
|
foreach (var item in list)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result = await taskService.WithdrawAsync(new TaskRequest
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BusinessId = item.Id,
|
|
|
|
|
|
|
|
TaskTypeName = AuditType.ToString()
|
|
|
|
|
|
|
|
}, false);
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
OnWithdraw(item);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
OnWithdraw(item);
|
|
|
|
result = await flowService.WithdrawAsync(ids);
|
|
|
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
OnWithdraw(item);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await TenantDb.Updateable(list).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync();
|
|
|
|
await TenantDb.Updateable(list).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync();
|
|
|
|