|
@ -47,9 +47,11 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir |
|
|
private readonly ITransactionTypeAppService _transactionTypeAppService; |
|
|
private readonly ITransactionTypeAppService _transactionTypeAppService; |
|
|
private readonly IExpectOutAppService _expectOutAppService; |
|
|
private readonly IExpectOutAppService _expectOutAppService; |
|
|
private readonly IBalanceAppService _balanceAppService; |
|
|
private readonly IBalanceAppService _balanceAppService; |
|
|
|
|
|
private readonly IThirdLocationJobAppService _thirdLocationJobAppService; |
|
|
|
|
|
|
|
|
public ThirdLocationRequestAppService( |
|
|
public ThirdLocationRequestAppService( |
|
|
IThirdLocationRequestRepository repository, |
|
|
IThirdLocationRequestRepository repository, |
|
|
|
|
|
IThirdLocationJobAppService thirdLocationJobAppService, |
|
|
IThirdLocationRequestManager thirdLocationRequestManager, |
|
|
IThirdLocationRequestManager thirdLocationRequestManager, |
|
|
IPreparationPlanManager preparationPlanManager, |
|
|
IPreparationPlanManager preparationPlanManager, |
|
|
IItemStoreRelationAppService itemStoreRelationApp, |
|
|
IItemStoreRelationAppService itemStoreRelationApp, |
|
@ -73,6 +75,7 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir |
|
|
_transactionTypeAppService = transactionTypeAppService; |
|
|
_transactionTypeAppService = transactionTypeAppService; |
|
|
_expectOutAppService= expectOutAppService; |
|
|
_expectOutAppService= expectOutAppService; |
|
|
_balanceAppService= balanceAppService; |
|
|
_balanceAppService= balanceAppService; |
|
|
|
|
|
_thirdLocationJobAppService= thirdLocationJobAppService; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -191,6 +194,44 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir |
|
|
return dto; |
|
|
return dto; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用来重写 取消请求
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public override async Task<ThirdLocationRequestDTO> CancelAsync(Guid id) |
|
|
|
|
|
{ |
|
|
|
|
|
var request = await _repository.GetAsync(id).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
|
|
var list = await _thirdLocationJobAppService.GetByRequestNumberAsync(request.Number).ConfigureAwait(false); |
|
|
|
|
|
if (list.Any()) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var thirdLocationJobDto in list) |
|
|
|
|
|
{ |
|
|
|
|
|
if (thirdLocationJobDto.JobStatus == EnumJobStatus.Open || |
|
|
|
|
|
thirdLocationJobDto.JobStatus == EnumJobStatus.Partial || |
|
|
|
|
|
thirdLocationJobDto.JobStatus == EnumJobStatus.Doing || |
|
|
|
|
|
thirdLocationJobDto.JobStatus == EnumJobStatus.Wait) |
|
|
|
|
|
{ |
|
|
|
|
|
await _thirdLocationJobAppService.CancelAsync(thirdLocationJobDto.Id).ConfigureAwait(false); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (request.RequestStatus == EnumRequestStatus.Partial || request.RequestStatus == EnumRequestStatus.Handling || |
|
|
|
|
|
request.RequestStatus == EnumRequestStatus.New) |
|
|
|
|
|
{ |
|
|
|
|
|
request.RequestStatus = EnumRequestStatus.Cancelled; |
|
|
|
|
|
await _repository.UpdateAsync(request).ConfigureAwait(false); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
throw new UserFriendlyException($"【{request.RequestStatus.GetDisplayName()}】状态不允许取消"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ObjectMapper.Map<ThirdLocationRequest, ThirdLocationRequestDTO>(request); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 赋值Request业务属性
|
|
|
/// 赋值Request业务属性
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|