|
|
@ -68,6 +68,10 @@ public class MaterialRequestEventHandler |
|
|
|
{ |
|
|
|
await _materialRequestManager.SubmitAsync(entity).ConfigureAwait(false); |
|
|
|
} |
|
|
|
if (entity.Type == EnumMaterialRequestType.Issue_WIP.ToString()) |
|
|
|
{ |
|
|
|
await _materialRequestManager.SubmitAsync(entity).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -110,6 +114,8 @@ public class MaterialRequestEventHandler |
|
|
|
await Task.CompletedTask.ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
#region 私有
|
|
|
|
|
|
|
|
private async Task<List<IssueJobEditInput>> BuildIssueJobAsync |
|
|
|
(MaterialRequest materialRequest) |
|
|
|
{ |
|
|
@ -119,7 +125,7 @@ public class MaterialRequestEventHandler |
|
|
|
var toLocationCodes = materialRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList(); |
|
|
|
var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false); |
|
|
|
|
|
|
|
foreach (var materialRequestDetail in materialRequest.Details.Where(p => p.ToBeIssuedQty > 0)) |
|
|
|
foreach (var materialRequestDetail in materialRequest.Details.Where(p => p.ToBeIssuedQty > 0))//如果有还有剩余未叫料的数量 则创建新的任务
|
|
|
|
{ |
|
|
|
var toLocation = toLocations.FirstOrDefault(p => p.Code == materialRequestDetail.ToLocationCode); |
|
|
|
Check.NotNull(toLocation, "库位代码", $"库位 {materialRequestDetail.ToLocationCode} 不存在"); |
|
|
@ -240,7 +246,6 @@ public class MaterialRequestEventHandler |
|
|
|
detail.RecommendFromLocationErpCode= balance.LocationErpCode; |
|
|
|
detail.RecommendFromLocationGroup= balance.LocationGroup; |
|
|
|
detail.RecommendFromWarehouseCode= balance.WarehouseCode; |
|
|
|
detail.RecommendQty = balance.Qty; |
|
|
|
detail.Uom = balance.Uom; |
|
|
|
|
|
|
|
detail.ToLocationCode = materialRequestDetail.ToLocationCode; |
|
|
@ -279,5 +284,5 @@ public class MaterialRequestEventHandler |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
} |
|
|
|