Browse Source

客户退拆bug修改

dev_DY_CC
lvzb 1 year ago
parent
commit
8bfd625b92
  1. 27
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAppService.cs

27
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductRecycleRequests/ProductRecycleRequestAppService.cs

@ -119,12 +119,6 @@ public class ProductRecycleRequestAppService :
{ {
detail.Status = balance.Status; detail.Status = balance.Status;
} }
// detail.Status = EnumInventoryStatus.OK;
var locationDto = await _locationAppService.GetByCodeAsync(detail.LocationCode)
.ConfigureAwait(false);
CheckLocation(locationDto, detail.LocationCode);
await SetDetailPropertiesAsync(detail).ConfigureAwait(false); await SetDetailPropertiesAsync(detail).ConfigureAwait(false);
} }
} }
@ -132,6 +126,7 @@ public class ProductRecycleRequestAppService :
return dictionary; return dictionary;
} }
#region 校验 #region 校验
private void CheckItemBasic(ItemBasicDTO itemBasicDto, string itemCode) private void CheckItemBasic(ItemBasicDTO itemBasicDto, string itemCode)
{ {
@ -148,6 +143,20 @@ public class ProductRecycleRequestAppService :
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在"); throw new UserFriendlyException($"库位代码为【{locationCode}】不存在");
} }
} }
private void CheckRawLocation(LocationDTO rawlocationDto, string locationCode)
{
if (rawlocationDto == null)
{
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在");
}
else
{
if (rawlocationDto.Type != EnumLocationType.WIP)
{
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在");
}
}
}
#endregion #endregion
private async Task SetRequestAutoPropertiesAsync(ProductRecycleRequest entity) private async Task SetRequestAutoPropertiesAsync(ProductRecycleRequest entity)
@ -177,7 +186,7 @@ public class ProductRecycleRequestAppService :
detail.Qty = detail.Qty; detail.Qty = detail.Qty;
} }
var location = await LocationAclService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); var location = await _locationAppService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false);
CheckLocation(location, detail.LocationCode); CheckLocation(location, detail.LocationCode);
if (location != null) if (location != null)
{ {
@ -187,8 +196,8 @@ public class ProductRecycleRequestAppService :
detail.LocationArea = location.AreaCode; detail.LocationArea = location.AreaCode;
} }
var rawLocation = await LocationAclService.GetByCodeAsync(detail.RawLocationCode).ConfigureAwait(false); var rawLocation = await _locationAppService.GetByCodeAsync(detail.RawLocationCode).ConfigureAwait(false);
CheckLocation(rawLocation, detail.RawLocationCode); CheckRawLocation(rawLocation, detail.RawLocationCode);
if (rawLocation != null) if (rawLocation != null)
{ {
detail.RawLocationErpCode = rawLocation.ErpLocationCode; detail.RawLocationErpCode = rawLocation.ErpLocationCode;

Loading…
Cancel
Save