|
|
@ -199,20 +199,13 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR |
|
|
|
throw new UserFriendlyException($"{item.ItemCode} 物料的需求量必须大于 0"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//检验备料计划是否存在要料请求
|
|
|
|
if (!string.IsNullOrWhiteSpace(input.PreparationPlanNumber)) |
|
|
|
{ |
|
|
|
var exist = await CheckExistByPreparationPlanAsync(input.PreparationPlanNumber).ConfigureAwait(false); |
|
|
|
if (exist.Count > 0) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"{input.PreparationPlanNumber} 备料计划已存在要料申请"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
input.AutoSubmit = true; |
|
|
|
input.AutoAgree = true; |
|
|
|
input.AutoHandle = true; |
|
|
|
input.AutoCompleteJob = false; |
|
|
|
input.DirectCreateNote = false; |
|
|
|
|
|
|
|
foreach (var detailInput in input.Details) |
|
|
|
{ |
|
|
@ -220,6 +213,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR |
|
|
|
CheckLocation(toLocationDto, detailInput.ToLocationCode); |
|
|
|
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false); |
|
|
|
CheckItemBasic(itemBasicDto, detailInput.ItemCode); |
|
|
|
detailInput.ItemDesc1 = itemBasicDto.Desc1; |
|
|
|
|
|
|
|
var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false); |
|
|
|
|
|
|
@ -242,7 +236,7 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR |
|
|
|
detail.ToWarehouseCode= toLocationDto.WarehouseCode; |
|
|
|
} |
|
|
|
|
|
|
|
entity.UseOnTheWayLocation = true; |
|
|
|
entity.UseOnTheWayLocation = false; |
|
|
|
|
|
|
|
var result = await _materialRequestManager.CreateBynNumberAsync(entity).ConfigureAwait(false); |
|
|
|
|
|
|
@ -295,6 +289,8 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase<MaterialR |
|
|
|
input.AutoSubmit = true; |
|
|
|
input.AutoAgree = true; |
|
|
|
input.AutoHandle = true; |
|
|
|
input.AutoCompleteJob = false; |
|
|
|
input.DirectCreateNote = false; |
|
|
|
|
|
|
|
var entity = ObjectMapper.Map<MaterialRequestEditInput, MaterialRequest>(input); |
|
|
|
|
|
|
|