Browse Source

添加 预计出库存操作

master
郑勃旭 1 year ago
parent
commit
012a43d0b3
  1. 15
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs
  2. 33
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs
  3. 13
      be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs
  4. 10
      be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAutoMapperProfile.cs

15
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs

@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Inventory.Application.Contracts;
@ -14,4 +15,18 @@ public interface IExpectOutAppService
Task<List<ExpectOutDTO>> GetListByItemAsync(string itemCode);
Task<List<ExpectOutDTO>> GetListByLocationAsync(string locationCode);
Task<List<ExpectOutDTO>> GetListByPackingCodeAsync(string packingCode);
Task<List<ExpectOutDTO>> GetListByItemCodeAndStatusAndPackingCodeAsync(
string itemCode,
string locationCode,
string packingCode,
EnumInventoryStatus enumInventoryStatus,
string lot);
Task RemoveListByItemCodeAndStatusAndPackingCodeAsync(
string itemCode,
string locationCode,
string packingCode,
EnumInventoryStatus enumInventoryStatus,
string lot);
}

33
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs

@ -5,7 +5,9 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Inventory.Domain;
using Win_in.Sfs.Wms.Inventory.Domain.Shared;
@ -139,12 +141,35 @@ public class ExpectOutAppService
}
[HttpGet("list/by-itemcode-status-packingcode")]
public virtual async Task<List<ExpectOutDTO>> GetListByItemCodeAndStatusAndPackingCode()
public virtual async Task<List<ExpectOutDTO>> GetListByItemCodeAndStatusAndPackingCodeAsync(
string itemCode,
string locationCode,
string packingCode,
EnumInventoryStatus enumInventoryStatus,
string lot)
{
await Task.CompletedTask.ConfigureAwait(false);
var list= await _repository.GetListAsync(p =>
p.ItemCode == itemCode &&
p.Status == enumInventoryStatus &&
p.PackingCode == packingCode &&
p.Lot == lot).ConfigureAwait(false);
//TODO
throw new UserFriendlyException("");
return ObjectMapper.Map<List<ExpectOut>, List<ExpectOutDTO>>(list);
}
[HttpDelete("remove/by-itemcode-status-packingcode")]
public virtual async Task RemoveListByItemCodeAndStatusAndPackingCodeAsync(
string itemCode,
string locationCode,
string packingCode,
EnumInventoryStatus enumInventoryStatus,
string lot)
{
await _repository.DeleteAsync(p =>
p.ItemCode == itemCode &&
p.Status == enumInventoryStatus &&
p.PackingCode == packingCode &&
p.Lot == lot).ConfigureAwait(false);
}
[HttpGet("list/by-packing/{packingCode}")]

13
be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs

@ -15,6 +15,7 @@ using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Label.Domain;
using Win_in.Sfs.Label.Domain.Shared;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
@ -172,7 +173,17 @@ public class InventoryLabelAppService
{
var createInput = ObjectMapper.Map<InventoryLabelWithoutCodeCreateInput, InventoryLabelEditInput>(input);
createInput.Code = numbers[i];
var dto = await base.CreateAsync(createInput).ConfigureAwait(false);
await CheckCreatePolicyAsync().ConfigureAwait(continueOnCapturedContext: false);
var createEntity=ObjectMapper.Map<InventoryLabelEditInput, InventoryLabel>(createInput);
SetIdForGuids(createEntity);
TryToSetTenantId(createEntity);
var result=await Repository.InsertAsync(createEntity, autoSave: true).ConfigureAwait(continueOnCapturedContext: false);
var dto = ObjectMapper.Map<InventoryLabel, InventoryLabelDto>(result);
await Cache.SetItemAsync(dto.Id.ToString(), dto, SfsCacheConst.SeveralMinutes).ConfigureAwait(false);
//var dto = await base.CreateAsync(createInput).ConfigureAwait(false);
dto.SupplierCode = input.SupplierCode;
dto.PoNumber = input.PoNumber;

10
be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAutoMapperProfile.cs

@ -31,7 +31,6 @@ public class InventoryLabelAutoMapperProfile : Profile
.Ignore(x => x.ConcurrencyStamp)
;
CreateMap<InventoryLabelImportInput, InventoryLabel>()
.IgnoreAuditedObjectProperties()
.MapPurchaseInfoDto()
@ -52,13 +51,6 @@ public class InventoryLabelAutoMapperProfile : Profile
.Ignore(x => x.StdPackQty)
.Ignore(x => x.Uom);
CreateMap<InventoryLabelEditInput, InventoryLabel>()
.IgnoreAuditedObjectProperties()
//.MapItemBatchQtyStdPackDto()
.MapPurchaseInfoDto()
.MapProductionInfoDto()
.MapQualityInfoDto()
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Id);
}
}

Loading…
Cancel
Save