Browse Source

修改库存事务校验

dev_DY_CC
lvzb 1 year ago
parent
commit
b7410535fd
  1. 3
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain.Acl/ErpLocationItem/IErpLocationItemAclService.cs
  2. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsStoreWithDetailsAppServiceBase.cs
  3. 36
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain.Acl/ErpLocationItem/ErpLocationItemAclService.cs
  4. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain.Acl/ErpLocationItem/IErpLocationItemAclService.cs
  5. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain.Acl/Win_in.Sfs.Wms.Store.Domain.Acl.csproj
  6. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/SfsJobManagerBase.cs
  7. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Bases/StoreEventHandlerBase.cs

3
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain.Acl/ErpLocationItem/IErpLocationItemAclService.cs

@ -1,9 +1,10 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Win_in.Sfs.Basedata.Application.Contracts;
namespace Win_in.Sfs.Wms.Inventory.Domain.Acl.ErpLocationItem;
public interface IErpLocationItemAclService
public interface IErpLocationItemAclService : ITransientDependency
{
Task<ErpLocationItemDTO> GetFirstAsync(string itemCode, string locationCode);
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsStoreWithDetailsAppServiceBase.cs

@ -12,6 +12,7 @@ using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Acl.Balance;
using Win_in.Sfs.Wms.Store.Domain.Acl.DataExportTask;
using Win_in.Sfs.Wms.Store.Domain.Acl.Dict;
using Win_in.Sfs.Wms.Store.Domain.Acl.ErpLocationItem;
using Win_in.Sfs.Wms.Store.Domain.Acl.File;
using Win_in.Sfs.Wms.Store.Domain.Acl.ItemBasic;
using Win_in.Sfs.Wms.Store.Domain.Acl.Location;
@ -54,7 +55,8 @@ public abstract class SfsStoreWithDetailsAppServiceBase<TEntity, TEntityDto, TRe
protected IItemBasicAclService ItemBasicAclService =>
LazyServiceProvider.LazyGetRequiredService<IItemBasicAclService>();
protected IErpLocationItemAclService ErpLocationItemAclService =>
LazyServiceProvider.LazyGetRequiredService<IErpLocationItemAclService>();
protected ILocationAclService LocationAclService =>
LazyServiceProvider.LazyGetRequiredService<ILocationAclService>();

36
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain.Acl/ErpLocationItem/ErpLocationItemAclService.cs

@ -0,0 +1,36 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Caching;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Application;
namespace Win_in.Sfs.Wms.Store.Domain.Acl.ErpLocationItem;
public class ErpLocationItemAclService
: AclServiceBase, IErpLocationItemAclService
{
private readonly IErpLocationItemAppService _appService;
private readonly IDistributedCache<ErpLocationItemDTO> _cache;
public ErpLocationItemAclService(
IErpLocationItemAppService appService
, IDistributedCache<ErpLocationItemDTO> cache
)
{
_appService = appService;
_cache = cache;
}
public virtual async Task<ErpLocationItemDTO> GetFirstAsync(string itemCode, string locationCode)
{
var dto = await _cache.GetOrAddItemAsync(
$"{itemCode}:{locationCode}",
async () => await GetFromAppServiceAsync(itemCode, locationCode).ConfigureAwait(false),
CacheMinutes).ConfigureAwait(false);
return dto;
}
private async Task<ErpLocationItemDTO> GetFromAppServiceAsync(string itemCode, string locationCode)
{
return await _appService.CheckItemErpLocationIsAvailable(itemCode, locationCode).ConfigureAwait(false);
}
}

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain.Acl/ErpLocationItem/IErpLocationItemAclService.cs

@ -0,0 +1,10 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Win_in.Sfs.Basedata.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Domain.Acl.ErpLocationItem;
public interface IErpLocationItemAclService : ITransientDependency
{
Task<ErpLocationItemDTO> GetFirstAsync(string itemCode, string locationCode);
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain.Acl/Win_in.Sfs.Wms.Store.Domain.Acl.csproj

@ -18,5 +18,9 @@
<ProjectReference Include="..\..\..\Shared\src\Win_in.Sfs.Shared.Application\Win_in.Sfs.Shared.Application.csproj" />
<ProjectReference Include="..\Win_in.Sfs.Wms.Store.Domain.Shared\Win_in.Sfs.Wms.Store.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="ErpLocationItem\" />
</ItemGroup>
</Project>

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/SfsJobManagerBase.cs

@ -21,6 +21,7 @@ using Win_in.Sfs.Message.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Store.Domain.Acl.ErpLocationItem;
using Win_in.Sfs.Wms.Store.Domain.Acl.Balance;
using Win_in.Sfs.Wms.Store.Domain.Acl.DocumentSettings;
using Win_in.Sfs.Wms.Store.Domain.Acl.ItemBasic;
@ -52,6 +53,8 @@ public abstract class SfsJobManagerBase<TEntity, TDetailEntity>
protected IItemBasicAclService ItemBasicAclService => LazyServiceProvider.LazyGetRequiredService<IItemBasicAclService>();
protected IErpLocationItemAclService ErpLocationItemAclService => LazyServiceProvider.LazyGetRequiredService<IErpLocationItemAclService>();
protected IBalanceAclService BalanceAclService => LazyServiceProvider.LazyGetRequiredService<IBalanceAclService>();
protected ITransactionTypeAclService TransactionTypeAclService => LazyServiceProvider.LazyGetRequiredService<ITransactionTypeAclService>();

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Bases/StoreEventHandlerBase.cs

@ -10,6 +10,7 @@ using Volo.Abp.Timing;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain.Acl.Balance;
using Win_in.Sfs.Wms.Store.Domain.Acl.ErpLocationItem;
using Win_in.Sfs.Wms.Store.Domain.Acl.ItemBasic;
using Win_in.Sfs.Wms.Store.Domain.Acl.Location;
using Win_in.Sfs.Wms.Store.Domain.Acl.TransactionType;
@ -40,5 +41,7 @@ public abstract class StoreEventHandlerBase : ITransientDependency
protected IItemBasicAclService ItemBasicAclService => LazyServiceProvider.LazyGetRequiredService<IItemBasicAclService>();
protected IErpLocationItemAclService ErpLocationItemAclService => LazyServiceProvider.LazyGetRequiredService<IErpLocationItemAclService>();
protected IDatabase RedisDB;
}

Loading…
Cancel
Save