|
|
@ -249,6 +249,11 @@ public class InjectionIssueRequestEventHandler |
|
|
|
|
|
|
|
var productionLineItemDto = |
|
|
|
productionLineItemDtos.FirstOrDefault(p => p.ItemCode == injectionRequestDetail.ItemCode); |
|
|
|
if (productionLineItemDto == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException( |
|
|
|
$"物品代码【{injectionRequestDetail.ItemCode}】在生产线【{productionLineDto.Code}】中没有对应的【生产线物品关系】"); |
|
|
|
} |
|
|
|
var input = new RecommendBalanceRequestInput |
|
|
|
{ |
|
|
|
ItemCode = injectionRequestDetail.ItemCode, |
|
|
@ -268,20 +273,10 @@ public class InjectionIssueRequestEventHandler |
|
|
|
var detail = |
|
|
|
await BuildInjectionIssueJobDetailWithQtyTypeAsync(injectionRequestDetail, recommend, |
|
|
|
toLocationGroupCode) |
|
|
|
.ConfigureAwait(false); |
|
|
|
if (injectionRequest.UseOnTheWayLocation) |
|
|
|
{ |
|
|
|
//获取在途库
|
|
|
|
var locationDto = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT) |
|
|
|
.ConfigureAwait(false); |
|
|
|
|
|
|
|
detail.OnTheWayLocationCode = locationDto.Code; |
|
|
|
} |
|
|
|
.ConfigureAwait(false); |
|
|
|
|
|
|
|
jobDetails.Add(detail); |
|
|
|
injectionRequestDetail.IssuedQty += recommend.Qty; |
|
|
|
|
|
|
|
//await _injectionRequestManager.UpdateDetailsAsync(injectionRequest).ConfigureAwait(false);
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -298,36 +293,63 @@ public class InjectionIssueRequestEventHandler |
|
|
|
private async Task<InjectionIssueJobDetailInput> BuildInjectionIssueJobDetailWithQtyTypeAsync( |
|
|
|
InjectionIssueRequestDetail injectionRequestDetail, BalanceDTO balance, string toLocationGroupCode) |
|
|
|
{ |
|
|
|
//ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
|
|
|
|
|
|
|
|
var detail = ObjectMapper.Map<BalanceDTO, InjectionIssueJobDetailInput>(balance); |
|
|
|
var detail = new InjectionIssueJobDetailInput(); |
|
|
|
detail.RequestLocationCode = injectionRequestDetail.ToLocationCode; |
|
|
|
detail.RequestLocationGroup=injectionRequestDetail.ToLocationGroup; |
|
|
|
detail.RequestLocationArea = injectionRequestDetail.ToLocationArea; |
|
|
|
detail.RequestLocationErpCode = injectionRequestDetail.ToLocationErpCode; |
|
|
|
detail.RequestWarehouseCode=injectionRequestDetail.ToWarehouseCode; |
|
|
|
|
|
|
|
detail.PositionCode = injectionRequestDetail.PositionCode; |
|
|
|
detail.RecommendType = injectionRequestDetail.RecommendType; |
|
|
|
detail.ProdLine = injectionRequestDetail.ToLocationCode; |
|
|
|
|
|
|
|
detail.ItemCode = injectionRequestDetail.ItemCode; |
|
|
|
detail.ItemName=injectionRequestDetail.ItemName; |
|
|
|
detail.ItemDesc1=injectionRequestDetail.ItemDesc1; |
|
|
|
detail.ItemDesc2 = injectionRequestDetail.ItemDesc2; |
|
|
|
detail.StdPackQty = injectionRequestDetail.StdPackQty; |
|
|
|
detail.RequestQty= injectionRequestDetail.Qty; |
|
|
|
|
|
|
|
detail.Status = EnumInventoryStatus.OK; |
|
|
|
detail.Uom = balance.Uom; |
|
|
|
|
|
|
|
detail.RecommendFromPackingCode = balance.PackingCode; |
|
|
|
detail.RecommendFromContainerCode = balance.ContainerCode; |
|
|
|
detail.RecommendFromLot = balance.Lot; |
|
|
|
|
|
|
|
detail.RecommendFromQty = balance.Qty; |
|
|
|
|
|
|
|
detail.RecommendFromSupplierBatch = balance.SupplierBatch; |
|
|
|
detail.RecommendFromProduceDate = balance.ProduceDate; |
|
|
|
detail.RecommendFromExpireDate = balance.ExpireDate; |
|
|
|
detail.RecommendFromLot = balance.Lot; |
|
|
|
detail.RecommendFromProduceDate = balance.ProduceDate; |
|
|
|
detail.RecommendFromArriveDate = balance.ArriveDate; |
|
|
|
|
|
|
|
detail.RecommendFromLocationArea = balance.LocationArea; |
|
|
|
detail.RecommendFromLocationCode = balance.LocationCode; |
|
|
|
detail.RecommendFromLocationErpCode = balance.LocationErpCode; |
|
|
|
detail.RecommendFromLocationGroup = balance.LocationGroup; |
|
|
|
detail.RecommendFromWarehouseCode = balance.WarehouseCode; |
|
|
|
detail.RecommendFromQty = balance.Qty; |
|
|
|
detail.Uom = balance.Uom; |
|
|
|
|
|
|
|
detail.RecommendToPackingCode = balance.PackingCode; |
|
|
|
detail.RecommendToContainerCode = balance.ContainerCode; |
|
|
|
detail.RecommendToLot = balance.Lot; |
|
|
|
|
|
|
|
detail.RecommendToQty = balance.Qty; |
|
|
|
|
|
|
|
detail.RecommendToSupplierBatch = balance.SupplierBatch; |
|
|
|
detail.RecommendToProduceDate = balance.ProduceDate; |
|
|
|
detail.RecommendToExpireDate = balance.ExpireDate; |
|
|
|
detail.RecommendToProduceDate = balance.ProduceDate; |
|
|
|
detail.RecommendToArriveDate = balance.ArriveDate; |
|
|
|
|
|
|
|
detail.RecommendToLocationCode = injectionRequestDetail.ToLocationCode; |
|
|
|
detail.RecommendToLocationErpCode = injectionRequestDetail.ToLocationErpCode; |
|
|
|
detail.RecommendToLocationArea = injectionRequestDetail.ToLocationArea; |
|
|
|
detail.RecommendToWarehouseCode = injectionRequestDetail.ToWarehouseCode; |
|
|
|
detail.RecommendToLocationGroup = injectionRequestDetail.ToLocationGroup; |
|
|
|
|
|
|
|
//detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
|
|
|
|
detail.ProdLine = toLocationGroupCode; |
|
|
|
await Task.CompletedTask.ConfigureAwait(false); |
|
|
|
return detail; |
|
|
|
} |
|
|
|