Browse Source

[add] 增加EventHandler

master
贾荣国 3 years ago
parent
commit
d8c02ed8ed
  1. 7
      WebApiService/Win_in.Sfs.Scp.WebApi.sln
  2. 2
      WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/ITaPartRepository.cs
  3. 2
      WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/ITbPoRepository.cs
  4. 2
      WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/ITbReceiptRepository.cs
  5. 2
      WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/ITbRejectRepository.cs
  6. 2
      WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/ITaVenderRepository.cs
  7. 6
      WebApiService/src/Win_in.Sfs.Scp.v1.Domain/V1ScpDomainModule.cs
  8. 13
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PurchaseOrderRepository.cs
  9. 13
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/ReceiptRepository.cs
  10. 5
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TaPartRepository.cs
  11. 4
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TaVenderRepository.cs
  12. 5
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TbPoRepository.cs
  13. 13
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TbReceiptRepository.cs
  14. 13
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TbRejectRepository.cs
  15. 10
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpEntityFrameworkCoreModule.cs
  16. 26
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/PartEventHandler.cs
  17. 17
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/PurchaseOrderEventHandler.cs
  18. 17
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/ReceiptEventHandler.cs
  19. 17
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/SupplierEventHandler.cs
  20. 17
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/UnplannedReceiptEventHandler.cs
  21. 25
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/V1ScpDomainModule.cs
  22. 17
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/Win_in.Sfs.Scp.v1.Event.csproj

7
WebApiService/Win_in.Sfs.Scp.WebApi.sln

@ -39,6 +39,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Win_in.Sfs.Scp.v1.Domain",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Win_in.Sfs.Scp.v1.EntityFrameworkCore", "src\Win_in.Sfs.Scp.v1.EntityFrameworkCore\Win_in.Sfs.Scp.v1.EntityFrameworkCore.csproj", "{77D1D3F8-A04C-4688-AC67-C8372BD268A2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Win_in.Sfs.Scp.v1.Event", "src\Win_in.Sfs.Scp.v1.Event\Win_in.Sfs.Scp.v1.Event.csproj", "{45EED43B-B235-4C24-9176-3B7992DA4D6E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -109,6 +111,10 @@ Global
{77D1D3F8-A04C-4688-AC67-C8372BD268A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{77D1D3F8-A04C-4688-AC67-C8372BD268A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{77D1D3F8-A04C-4688-AC67-C8372BD268A2}.Release|Any CPU.Build.0 = Release|Any CPU
{45EED43B-B235-4C24-9176-3B7992DA4D6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{45EED43B-B235-4C24-9176-3B7992DA4D6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{45EED43B-B235-4C24-9176-3B7992DA4D6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{45EED43B-B235-4C24-9176-3B7992DA4D6E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -130,6 +136,7 @@ Global
{748584B1-BA69-4F6A-81AA-F4BDE6BCE29D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{3EE98133-3E7A-4B14-A515-12CB039A9EED} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{77D1D3F8-A04C-4688-AC67-C8372BD268A2} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{45EED43B-B235-4C24-9176-3B7992DA4D6E} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}

2
WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/IReceiptRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/ITaPartRepository.cs

@ -2,7 +2,7 @@
namespace Win_in.Sfs.Scp.v1.Domain
{
public interface IRejectRepository : IRepository<TB_REJECT>
public interface ITaPartRepository : IRepository<TA_PART>
{
}

2
WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Parts/IPartRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/ITbPoRepository.cs

@ -2,7 +2,7 @@
namespace Win_in.Sfs.Scp.v1.Domain
{
public interface IPartRepository : IRepository<TA_PART>
public interface ITbPoRepository : IRepository<TB_PO>
{
}

2
WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/IReceiptRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Receipts/ITbReceiptRepository.cs

@ -2,7 +2,7 @@
namespace Win_in.Sfs.Scp.v1.Domain
{
public interface IReceiptRepository : IRepository<TB_RECEIVE_QAD>
public interface ITbReceiptRepository : IRepository<TB_RECEIVE_QAD>
{
}

2
WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/ISupplierRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Rejects/ITbRejectRepository.cs

@ -2,7 +2,7 @@
namespace Win_in.Sfs.Scp.v1.Domain
{
public interface ISupplierRepository : IRepository<TA_VENDER>
public interface ITbRejectRepository : IRepository<TB_REJECT>
{
}

2
WebApiService/src/Win_in.Sfs.Scp.v1.Domain/PurchaseOrders/IPurchaseOrderRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.Domain/Suppliers/ITaVenderRepository.cs

@ -2,7 +2,7 @@
namespace Win_in.Sfs.Scp.v1.Domain
{
public interface IPurchaseOrderRepository : IRepository<TB_PO>
public interface ITaVenderRepository : IRepository<TA_VENDER>
{
}

6
WebApiService/src/Win_in.Sfs.Scp.v1.Domain/V1ScpDomainModule.cs

@ -1,8 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp.Modularity;
using Volo.Abp.Modularity;
namespace Win_in.Sfs.Scp.WebApi
namespace Win_in.Sfs.Scp.v1.Domain
{
[DependsOn()]
public class V1ScpDomainModule : AbpModule

13
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PurchaseOrderRepository.cs

@ -1,13 +0,0 @@
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Scp.v1.Domain;
namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
{
public class PurchaseOrderRepository : EfCoreRepository<V1ScpDbContext, TB_PO>, IPurchaseOrderRepository
{
public PurchaseOrderRepository(IDbContextProvider<V1ScpDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}
}

13
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/ReceiptRepository.cs

@ -1,13 +0,0 @@
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Scp.v1.Domain;
namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
{
public class ReceiptRepository : EfCoreRepository<V1ScpDbContext, TB_RECEIVE_QAD>, IReceiptRepository
{
public ReceiptRepository(IDbContextProvider<V1ScpDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}
}

5
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/RejectRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TaPartRepository.cs

@ -4,9 +4,10 @@ using Win_in.Sfs.Scp.v1.Domain;
namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
{
public class RejectRepository : EfCoreRepository<V1ScpDbContext, TB_REJECT>, IRejectRepository
public class TaPartRepository : EfCoreRepository<V1ScpDbContext, TA_PART>, ITaPartRepository
{
public RejectRepository(IDbContextProvider<V1ScpDbContext> dbContextProvider) : base(dbContextProvider)
public TaPartRepository(IDbContextProvider<V1ScpDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}

4
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/SupplierRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TaVenderRepository.cs

@ -4,9 +4,9 @@ using Win_in.Sfs.Scp.v1.Domain;
namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
{
public class SupplierRepository : EfCoreRepository<V1ScpDbContext, TA_VENDER>, ISupplierRepository
public class TaVenderRepository : EfCoreRepository<V1ScpDbContext, TA_VENDER>, ITaVenderRepository
{
public SupplierRepository(IDbContextProvider<V1ScpDbContext> dbContextProvider) : base(dbContextProvider)
public TaVenderRepository(IDbContextProvider<V1ScpDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}

5
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/PartRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TbPoRepository.cs

@ -4,10 +4,9 @@ using Win_in.Sfs.Scp.v1.Domain;
namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
{
public class PartRepository : EfCoreRepository<V1ScpDbContext, TA_PART>, IPartRepository
public class TbPoRepository : EfCoreRepository<V1ScpDbContext, TB_PO>, ITbPoRepository
{
public PartRepository(IDbContextProvider<V1ScpDbContext> dbContextProvider) : base(dbContextProvider)
public TbPoRepository(IDbContextProvider<V1ScpDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}

13
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TbReceiptRepository.cs

@ -0,0 +1,13 @@
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Scp.v1.Domain;
namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
{
public class TbReceiptRepository : EfCoreRepository<V1ScpDbContext, TB_RECEIVE_QAD>, ITbReceiptRepository
{
public TbReceiptRepository(IDbContextProvider<V1ScpDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}
}

13
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TbRejectRepository.cs

@ -0,0 +1,13 @@
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Scp.v1.Domain;
namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
{
public class TbRejectRepository : EfCoreRepository<V1ScpDbContext, TB_REJECT>, ITbRejectRepository
{
public TbRejectRepository(IDbContextProvider<V1ScpDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}
}

10
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpEntityFrameworkCoreModule.cs

@ -23,11 +23,11 @@ namespace Win_in.Sfs.Scp.v1.EntityFrameworkCore
// options.AddDefaultRepositories(includeAllEntities: true);
options.AddRepository<TA_PART, PartRepository>();
options.AddRepository<TA_VENDER, SupplierRepository>();
options.AddRepository<TB_RECEIVE_QAD, ReceiptRepository>();
options.AddRepository<TB_PO, PurchaseOrderRepository>();
options.AddRepository<TB_REJECT, RejectRepository>();
options.AddRepository<TA_PART, TaPartRepository>();
options.AddRepository<TA_VENDER, TaVenderRepository>();
options.AddRepository<TB_RECEIVE_QAD, TbReceiptRepository>();
options.AddRepository<TB_PO, TbPoRepository>();
options.AddRepository<TB_REJECT, TbRejectRepository>();
// Configure<AbpEntityOptions>(o =>
// {

26
WebApiService/src/Win_in.Sfs.Scp.v1.Event/PartEventHandler.cs

@ -0,0 +1,26 @@
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Win_in.Sfs.Scp.v1.Domain;
using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event
{
public class PartEventHandler:ILocalEventHandler<EntityCreatedEto<Part>>
{
private readonly ITaPartRepository _taPartRepository;
public PartEventHandler(ITaPartRepository taPartRepository)
{
_taPartRepository = taPartRepository;
}
public Task HandleEventAsync(EntityCreatedEto<Part> eventData)
{
throw new System.NotImplementedException();
//TODO 根据传入数据新增或修改TA_PART
}
}
}

17
WebApiService/src/Win_in.Sfs.Scp.v1.Event/PurchaseOrderEventHandler.cs

@ -0,0 +1,17 @@
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event
{
public class PurchaseOrderEventHandler:ILocalEventHandler<EntityCreatedEto<PurchaseOrder>>
{
public Task HandleEventAsync(EntityCreatedEto<PurchaseOrder> eventData)
{
throw new System.NotImplementedException();
//TODO 新增或修改TB_PO
}
}
}

17
WebApiService/src/Win_in.Sfs.Scp.v1.Event/ReceiptEventHandler.cs

@ -0,0 +1,17 @@
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event
{
public class ReceiptEventHandler:ILocalEventHandler<EntityCreatedEto<Receipt>>
{
public Task HandleEventAsync(EntityCreatedEto<Receipt> eventData)
{
throw new System.NotImplementedException();
//TODO 新增 TB_RECEIPT 或 TB_REJECT
}
}
}

17
WebApiService/src/Win_in.Sfs.Scp.v1.Event/SupplierEventHandler.cs

@ -0,0 +1,17 @@
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event
{
public class SupplierEventHandler:ILocalEventHandler<EntityCreatedEto<Supplier>>
{
public Task HandleEventAsync(EntityCreatedEto<Supplier> eventData)
{
throw new System.NotImplementedException();
//TODO 根据传入数据新增或修改TA_VENDER
}
}
}

17
WebApiService/src/Win_in.Sfs.Scp.v1.Event/UnplannedReceiptEventHandler.cs

@ -0,0 +1,17 @@
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event
{
public class UnplannedReceiptEventHandler:ILocalEventHandler<EntityCreatedEto<UnplannedReceipt>>
{
public Task HandleEventAsync(EntityCreatedEto<UnplannedReceipt> eventData)
{
throw new System.NotImplementedException();
//TODO 新增无订单的TB_RECEIPT
}
}
}

25
WebApiService/src/Win_in.Sfs.Scp.v1.Event/V1ScpDomainModule.cs

@ -0,0 +1,25 @@
using Volo.Abp.Autofac;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Modularity;
using Win_in.Sfs.Scp.v1.Domain;
using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event
{
[DependsOn(
typeof(AbpAutofacModule),
typeof(V1ScpDomainModule),
typeof(WebApiDomainModule)
)]
public class V1ScpEventModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpDistributedEntityEventOptions>(options =>
{
options.AutoEventSelectors.AddAll();
});
}
}
}

17
WebApiService/src/Win_in.Sfs.Scp.v1.Event/Win_in.Sfs.Scp.v1.Event.csproj

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="4.4.2" />
<PackageReference Include="Volo.Abp.Core" Version="4.4.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Win_in.Sfs.Scp.v1.Domain\Win_in.Sfs.Scp.v1.Domain.csproj" />
<ProjectReference Include="..\Win_in.Sfs.Scp.WebApi.Domain\Win_in.Sfs.Scp.WebApi.Domain.csproj" />
</ItemGroup>
</Project>
Loading…
Cancel
Save