|
@ -7,6 +7,7 @@ using System.Threading.Tasks; |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
|
|
using Volo.Abp; |
|
|
using Volo.Abp.Application.Dtos; |
|
|
using Volo.Abp.Application.Dtos; |
|
|
using Volo.Abp.Domain.Entities; |
|
|
using Volo.Abp.Domain.Entities; |
|
|
using Volo.Abp.ObjectMapping; |
|
|
using Volo.Abp.ObjectMapping; |
|
@ -78,10 +79,15 @@ public class WipWarehouseAdjustRequestAppService : SfsStoreRequestAppServiceBase |
|
|
detail.ToLocationCode = detail.FromLocationCode;//调整库位一致
|
|
|
detail.ToLocationCode = detail.FromLocationCode;//调整库位一致
|
|
|
|
|
|
|
|
|
var itemBasicDto =await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); |
|
|
var itemBasicDto =await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); |
|
|
|
|
|
CheckItemBasic(itemBasicDto, detail.ItemCode); |
|
|
|
|
|
|
|
|
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode) |
|
|
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode) |
|
|
.ConfigureAwait(false); |
|
|
.ConfigureAwait(false); |
|
|
|
|
|
CheckLocation(toLocationDto, detail.ToLocationCode); |
|
|
|
|
|
|
|
|
var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode) |
|
|
var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode) |
|
|
.ConfigureAwait(false); |
|
|
.ConfigureAwait(false); |
|
|
|
|
|
CheckLocation(fromLocationDto, detail.FromLocationCode); |
|
|
|
|
|
|
|
|
detail.ItemCode = itemBasicDto.Code; |
|
|
detail.ItemCode = itemBasicDto.Code; |
|
|
detail.ItemDesc1 = itemBasicDto.Desc1; |
|
|
detail.ItemDesc1 = itemBasicDto.Desc1; |
|
@ -117,6 +123,24 @@ public class WipWarehouseAdjustRequestAppService : SfsStoreRequestAppServiceBase |
|
|
return dictionary; |
|
|
return dictionary; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#region 校验
|
|
|
|
|
|
private void CheckItemBasic(ItemBasicDTO itemBasicDto, string itemCode) |
|
|
|
|
|
{ |
|
|
|
|
|
if (itemBasicDto == null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new UserFriendlyException($"物品代码为【{itemCode}】不存在"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void CheckLocation(LocationDTO locationDto, string locationCode) |
|
|
|
|
|
{ |
|
|
|
|
|
if (locationDto == null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
private async Task SetEntityPropertiesAsync(WipWarehouseAdjustRequest entity, EnumTransSubType subType) |
|
|
private async Task SetEntityPropertiesAsync(WipWarehouseAdjustRequest entity, EnumTransSubType subType) |
|
|
{ |
|
|
{ |
|
|
var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Adjust, subType) |
|
|
var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Adjust, subType) |
|
|