|
@ -1,6 +1,7 @@ |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
|
|
|
using Volo.Abp; |
|
|
using Volo.Abp.EventBus; |
|
|
using Volo.Abp.EventBus; |
|
|
using Volo.Abp.Uow; |
|
|
using Volo.Abp.Uow; |
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
@ -76,15 +77,27 @@ public class ProductReceiptNoteEventHandler |
|
|
var transaction = ObjectMapper.Map<ProductReceiptNoteDetail, TransactionEditInput>(detail); |
|
|
var transaction = ObjectMapper.Map<ProductReceiptNoteDetail, TransactionEditInput>(detail); |
|
|
|
|
|
|
|
|
var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); |
|
|
var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); |
|
|
; |
|
|
var locationDtos = await _locationAppService.GetListByTypesAndErpCodeAsync( |
|
|
|
|
|
new List<EnumLocationType> { EnumLocationType.WIP }, |
|
|
|
|
|
detail.LocationErpCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
|
|
if (locationDtos == null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new UserFriendlyException( |
|
|
|
|
|
$"Erp储位为【{detail.LocationErpCode}】,库位类型为{EnumLocationType.WIP.GetDisplayName()}的库位不存在。"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (itemBasicDto == null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new UserFriendlyException( |
|
|
|
|
|
$"物品编号为【{detail.ItemCode}】不存在。"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
detail.ItemDesc1 = itemBasicDto.Desc1; |
|
|
detail.ItemDesc1 = itemBasicDto.Desc1; |
|
|
detail.ItemDesc2 = itemBasicDto.Desc2; |
|
|
detail.ItemDesc2 = itemBasicDto.Desc2; |
|
|
detail.ItemName=itemBasicDto.Name; |
|
|
detail.ItemName=itemBasicDto.Name; |
|
|
detail.StdPackQty=itemBasicDto.StdPackQty; |
|
|
detail.StdPackQty=itemBasicDto.StdPackQty; |
|
|
|
|
|
var erpLocationDto = locationDtos.First(); |
|
|
var erpLocationDtos= await _locationAppService.GetListByTypesAndErpCodeAsync(new List<EnumLocationType> { EnumLocationType.WIP }, |
|
|
|
|
|
detail.LocationErpCode).ConfigureAwait(false); |
|
|
|
|
|
var erpLocationDto = erpLocationDtos.First(); |
|
|
|
|
|
detail.LocationArea = erpLocationDto.Code; |
|
|
detail.LocationArea = erpLocationDto.Code; |
|
|
detail.LocationGroup = erpLocationDto.LocationGroupCode; |
|
|
detail.LocationGroup = erpLocationDto.LocationGroupCode; |
|
|
detail.LocationErpCode= erpLocationDto.Code; |
|
|
detail.LocationErpCode= erpLocationDto.Code; |
|
|