Browse Source

[fix]Event可以正确订阅

master
贾荣国 3 years ago
parent
commit
04c1cd6fb3
  1. 1
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs
  2. 2
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs
  3. 1
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs
  4. 1
      WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs
  5. 14
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/DbContext/WebApiDbContextModelCreatingExtensions.cs
  6. 0
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/DbContext/WebApiModelBuilderConfigurationOptions.cs
  7. 6
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreWebApiDbSchemaMigrator.cs
  8. 2864
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/20220113030842_Decimal.Designer.cs
  9. 153
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/20220113030842_Decimal.cs
  10. 21
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/WebApiDbContextModelSnapshot.cs
  11. 12
      WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Repositories/PartRepository.cs
  12. 0
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/IV1ScpDbContext.cs
  13. 0
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContext.cs
  14. 0
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContextModelCreatingExtensions.cs
  15. 0
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpModelBuilderConfigurationOptions.cs
  16. 0
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaPartRepository.cs
  17. 0
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaVenderRepository.cs
  18. 0
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbPoRepository.cs
  19. 0
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbReceiptRepository.cs
  20. 0
      WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbRejectRepository.cs
  21. 14
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/PurchaseOrderEventHandler.cs
  22. 15
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/ReceiptEventHandler.cs
  23. 14
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/SupplierEventHandler.cs
  24. 15
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/UnplannedReceiptEventHandler.cs
  25. 4
      WebApiService/src/Win_in.Sfs.Scp.v1.Event/V1ScpEventModule.cs

1
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs

@ -59,7 +59,6 @@ namespace Win_in.Sfs.Scp.WebApi
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Route("")] [Route("")]
[UnitOfWork]
public virtual async Task<PartDTO> CreateAsync(PartCreateDto partCreateDTO) public virtual async Task<PartDTO> CreateAsync(PartCreateDto partCreateDTO)
{ {

2
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
namespace Win_in.Sfs.Scp.WebApi namespace Win_in.Sfs.Scp.WebApi
{ {
@ -57,6 +58,7 @@ namespace Win_in.Sfs.Scp.WebApi
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Route("")] [Route("")]
public async Task<ReceiptDTO> CreateAsync(ReceiptCreateDTO receiptCreateDTO) public async Task<ReceiptDTO> CreateAsync(ReceiptCreateDTO receiptCreateDTO)
{ {
var entity = ObjectMapper.Map<ReceiptCreateDTO, Receipt>(receiptCreateDTO); var entity = ObjectMapper.Map<ReceiptCreateDTO, Receipt>(receiptCreateDTO);

1
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
namespace Win_in.Sfs.Scp.WebApi namespace Win_in.Sfs.Scp.WebApi

1
WebApiService/src/Win_in.Sfs.Scp.WebApi.Application/UnplannedReceipts/UnplannedReceiptAppService.cs

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
namespace Win_in.Sfs.Scp.WebApi namespace Win_in.Sfs.Scp.WebApi
{ {

14
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs → WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/DbContext/WebApiDbContextModelCreatingExtensions.cs

@ -175,8 +175,8 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.Property(q => q.Lot).IsRequired().HasMaxLength(64); b.Property(q => q.Lot).IsRequired().HasMaxLength(64);
b.Property(q => q.SupplierLot).IsRequired(); b.Property(q => q.SupplierLot).IsRequired();
b.Property(q => q.Uom).IsRequired().HasMaxLength(64); b.Property(q => q.Uom).IsRequired().HasMaxLength(64);
b.Property(q => q.ReceiveQty).IsRequired(); b.Property(q => q.ReceiveQty).IsRequired().HasPrecision(18, 6);
b.Property(q => q.SupplierPackConvertRate).IsRequired(); b.Property(q => q.SupplierPackConvertRate).IsRequired().HasPrecision(18, 6);
b.Property(q => q.Remark).HasMaxLength(4096); b.Property(q => q.Remark).HasMaxLength(4096);
b.Property(q => q.Site).IsRequired().HasMaxLength(64); b.Property(q => q.Site).IsRequired().HasMaxLength(64);
b.Property(q => q.Company).IsRequired().HasMaxLength(64); b.Property(q => q.Company).IsRequired().HasMaxLength(64);
@ -203,7 +203,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.Property(q => q.OrderDate).IsRequired(); b.Property(q => q.OrderDate).IsRequired();
b.Property(q => q.DueDate).IsRequired(); b.Property(q => q.DueDate).IsRequired();
b.Property(q => q.Version).IsRequired().HasMaxLength(64); b.Property(q => q.Version).IsRequired().HasMaxLength(64);
b.Property(q => q.TaxRate).IsRequired(); b.Property(q => q.TaxRate).IsRequired().HasPrecision(18, 6);
b.Property(q => q.Site).IsRequired().HasMaxLength(64); b.Property(q => q.Site).IsRequired().HasMaxLength(64);
b.Property(q => q.Company).IsRequired().HasMaxLength(64); b.Property(q => q.Company).IsRequired().HasMaxLength(64);
b.Property(q => q.ContactName).HasMaxLength(64); b.Property(q => q.ContactName).HasMaxLength(64);
@ -231,9 +231,9 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.Property(q => q.PoLine).IsRequired().HasMaxLength(64); b.Property(q => q.PoLine).IsRequired().HasMaxLength(64);
b.Property(q => q.PartCode).IsRequired().HasMaxLength(64); b.Property(q => q.PartCode).IsRequired().HasMaxLength(64);
b.Property(q => q.Uom).IsRequired().HasMaxLength(64); b.Property(q => q.Uom).IsRequired().HasMaxLength(64);
b.Property(q => q.OrderQty).IsRequired(); b.Property(q => q.OrderQty).IsRequired().HasPrecision(18, 6);
b.Property(q => q.StdPackQty).IsRequired(); b.Property(q => q.StdPackQty).IsRequired().HasPrecision(18, 6);
b.Property(q => q.SupplierPackConvertRate); b.Property(q => q.SupplierPackConvertRate).HasPrecision(18, 6);
b.Property(q => q.IsConsignment).IsRequired(); b.Property(q => q.IsConsignment).IsRequired();
b.Property(q => q.LineStatus).IsRequired(); b.Property(q => q.LineStatus).IsRequired();
b.Property(q => q.Remark).HasMaxLength(4096); b.Property(q => q.Remark).HasMaxLength(4096);
@ -260,7 +260,7 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
b.Property(q => q.PartCode).IsRequired().HasMaxLength(18); b.Property(q => q.PartCode).IsRequired().HasMaxLength(18);
b.Property(q => q.Lot).IsRequired().HasMaxLength(64); b.Property(q => q.Lot).IsRequired().HasMaxLength(64);
b.Property(q => q.Uom).IsRequired().HasMaxLength(8); b.Property(q => q.Uom).IsRequired().HasMaxLength(8);
b.Property(q => q.Qty).IsRequired(); b.Property(q => q.Qty).IsRequired().HasPrecision(18, 6);
b.Property(q => q.SoJob).HasMaxLength(20); b.Property(q => q.SoJob).HasMaxLength(20);
b.Property(q => q.Remark).HasMaxLength(4096); b.Property(q => q.Remark).HasMaxLength(4096);
b.Property(q => q.Site).IsRequired().HasMaxLength(8); b.Property(q => q.Site).IsRequired().HasMaxLength(8);

0
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiModelBuilderConfigurationOptions.cs → WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/DbContext/WebApiModelBuilderConfigurationOptions.cs

6
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreWebApiDbSchemaMigrator.cs

@ -26,12 +26,6 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore
* current scope. * current scope.
*/ */
/*
await _serviceProvider
.GetRequiredService<MainDbContext>()
.Database
.MigrateAsync();
*/
await _serviceProvider await _serviceProvider
.GetRequiredService<WebApiDbContext>() .GetRequiredService<WebApiDbContext>()

2864
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/20220113030842_Decimal.Designer.cs

File diff suppressed because it is too large

153
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/20220113030842_Decimal.cs

@ -0,0 +1,153 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win_in.Sfs.Scp.WebApi.Migrations
{
public partial class Decimal : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "Qty",
table: "WebApi_UnplannedReceipt",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "SupplierPackConvertRate",
table: "WebApi_Receipt",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "ReceiveQty",
table: "WebApi_Receipt",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "SupplierPackConvertRate",
table: "WebApi_PODetail",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "StdPackQty",
table: "WebApi_PODetail",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "OrderQty",
table: "WebApi_PODetail",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
migrationBuilder.AlterColumn<decimal>(
name: "TaxRate",
table: "WebApi_PO",
type: "decimal(18,6)",
precision: 18,
scale: 6,
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,2)");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "Qty",
table: "WebApi_UnplannedReceipt",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)",
oldPrecision: 18,
oldScale: 6);
migrationBuilder.AlterColumn<decimal>(
name: "SupplierPackConvertRate",
table: "WebApi_Receipt",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)",
oldPrecision: 18,
oldScale: 6);
migrationBuilder.AlterColumn<decimal>(
name: "ReceiveQty",
table: "WebApi_Receipt",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)",
oldPrecision: 18,
oldScale: 6);
migrationBuilder.AlterColumn<decimal>(
name: "SupplierPackConvertRate",
table: "WebApi_PODetail",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)",
oldPrecision: 18,
oldScale: 6);
migrationBuilder.AlterColumn<decimal>(
name: "StdPackQty",
table: "WebApi_PODetail",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)",
oldPrecision: 18,
oldScale: 6);
migrationBuilder.AlterColumn<decimal>(
name: "OrderQty",
table: "WebApi_PODetail",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)",
oldPrecision: 18,
oldScale: 6);
migrationBuilder.AlterColumn<decimal>(
name: "TaxRate",
table: "WebApi_PO",
type: "decimal(18,2)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)",
oldPrecision: 18,
oldScale: 6);
}
}
}

21
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Migrations/WebApiDbContextModelSnapshot.cs

@ -2100,7 +2100,8 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasColumnType("nvarchar(64)"); .HasColumnType("nvarchar(64)");
b.Property<decimal>("TaxRate") b.Property<decimal>("TaxRate")
.HasColumnType("decimal(18,2)"); .HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<Guid>("TraceId") b.Property<Guid>("TraceId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
@ -2135,7 +2136,8 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasColumnType("int"); .HasColumnType("int");
b.Property<decimal>("OrderQty") b.Property<decimal>("OrderQty")
.HasColumnType("decimal(18,2)"); .HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<string>("PartCode") b.Property<string>("PartCode")
.IsRequired() .IsRequired()
@ -2157,13 +2159,15 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<decimal>("StdPackQty") b.Property<decimal>("StdPackQty")
.HasColumnType("decimal(18,2)"); .HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<string>("StdPackUom") b.Property<string>("StdPackUom")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<decimal>("SupplierPackConvertRate") b.Property<decimal>("SupplierPackConvertRate")
.HasColumnType("decimal(18,2)"); .HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<string>("Uom") b.Property<string>("Uom")
.IsRequired() .IsRequired()
@ -2244,7 +2248,8 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<decimal>("ReceiveQty") b.Property<decimal>("ReceiveQty")
.HasColumnType("decimal(18,2)"); .HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<DateTime>("ReceiveTime") b.Property<DateTime>("ReceiveTime")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
@ -2268,7 +2273,8 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<decimal>("SupplierPackConvertRate") b.Property<decimal>("SupplierPackConvertRate")
.HasColumnType("decimal(18,2)"); .HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<Guid>("TraceId") b.Property<Guid>("TraceId")
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
@ -2434,7 +2440,8 @@ namespace Win_in.Sfs.Scp.WebApi.Migrations
.HasColumnType("nvarchar(18)"); .HasColumnType("nvarchar(18)");
b.Property<decimal>("Qty") b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)"); .HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasMaxLength(4096) .HasMaxLength(4096)

12
WebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Repositories/PartRepository.cs

@ -8,21 +8,9 @@ namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore;
public class PartRepository:EfCoreRepository<WebApiDbContext,Part,Guid> ,IPartRepository public class PartRepository:EfCoreRepository<WebApiDbContext,Part,Guid> ,IPartRepository
{ {
private readonly IDbContextProvider<WebApiDbContext> _dbContextProvider;
private WebApiDbContext db;
public PartRepository(IDbContextProvider<WebApiDbContext> dbContextProvider) : base(dbContextProvider) public PartRepository(IDbContextProvider<WebApiDbContext> dbContextProvider) : base(dbContextProvider)
{ {
_dbContextProvider = dbContextProvider;
} }
/*
public override async Task<Part> InsertAsync(Part entity, bool autoSave = false, CancellationToken cancellationToken = new CancellationToken())
{
db = _dbContextProvider.GetDbContextAsync().Result;
await db.Parts.AddAsync(entity, cancellationToken);
await db.SaveChangesAsync(cancellationToken);
return entity;
// return base.InsertAsync(entity, autoSave, cancellationToken);
}*/
} }

0
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/IV1ScpDbContext.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/IV1ScpDbContext.cs

0
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpDbContext.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContext.cs

0
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpDbContextModelCreatingExtensions.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpDbContextModelCreatingExtensions.cs

0
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/V1ScpModelBuilderConfigurationOptions.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/DbContext/V1ScpModelBuilderConfigurationOptions.cs

0
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TaPartRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaPartRepository.cs

0
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TaVenderRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TaVenderRepository.cs

0
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TbPoRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbPoRepository.cs

0
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TbReceiptRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbReceiptRepository.cs

0
WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/TbRejectRepository.cs → WebApiService/src/Win_in.Sfs.Scp.v1.EntityFrameworkCore/Repositories/TbRejectRepository.cs

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

@ -1,15 +1,21 @@
using System.Threading.Tasks; using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Win_in.Sfs.Scp.WebApi; using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event namespace Win_in.Sfs.Scp.v1.Event
{ {
public class PurchaseOrderEventHandler:ILocalEventHandler<EntityCreatedEto<PurchaseOrder>> public class PurchaseOrderEventHandler:ILocalEventHandler<EntityCreatedEventData<PurchaseOrder>>,ITransientDependency
{ {
public Task HandleEventAsync(EntityCreatedEto<PurchaseOrder> eventData) public Task HandleEventAsync(EntityCreatedEventData<PurchaseOrder> eventData)
{ {
throw new System.NotImplementedException(); Console.WriteLine("Local Event:" + eventData.Entity.Id);
return Task.CompletedTask;
//TODO 新增或修改TB_PO //TODO 新增或修改TB_PO
} }

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

@ -1,15 +1,22 @@
using System.Threading.Tasks; using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Win_in.Sfs.Scp.WebApi; using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event namespace Win_in.Sfs.Scp.v1.Event
{ {
public class ReceiptEventHandler:ILocalEventHandler<EntityCreatedEto<Receipt>> public class ReceiptEventHandler:ILocalEventHandler<EntityCreatedEventData<Receipt>>, ITransientDependency
{ {
public Task HandleEventAsync(EntityCreatedEto<Receipt> eventData) public Task HandleEventAsync(EntityCreatedEventData<Receipt> eventData)
{ {
throw new System.NotImplementedException(); Console.WriteLine("Local Event:" + eventData.Entity.Id);
return Task.CompletedTask;
//TODO 新增 TB_RECEIPT 或 TB_REJECT //TODO 新增 TB_RECEIPT 或 TB_REJECT
} }

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

@ -1,15 +1,21 @@
using System.Threading.Tasks; using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Win_in.Sfs.Scp.WebApi; using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event namespace Win_in.Sfs.Scp.v1.Event
{ {
public class SupplierEventHandler:ILocalEventHandler<EntityCreatedEto<Supplier>> public class SupplierEventHandler:ILocalEventHandler<EntityCreatedEventData<Supplier>>, ITransientDependency
{ {
public Task HandleEventAsync(EntityCreatedEto<Supplier> eventData) public Task HandleEventAsync(EntityCreatedEventData<Supplier> eventData)
{ {
throw new System.NotImplementedException(); Console.WriteLine("Local Event:" + eventData.Entity.Id);
return Task.CompletedTask;
//TODO 根据传入数据新增或修改TA_VENDER //TODO 根据传入数据新增或修改TA_VENDER
} }

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

@ -1,15 +1,22 @@
using System.Threading.Tasks; using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Win_in.Sfs.Scp.WebApi; using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event namespace Win_in.Sfs.Scp.v1.Event
{ {
public class UnplannedReceiptEventHandler:ILocalEventHandler<EntityCreatedEto<UnplannedReceipt>> public class UnplannedReceiptEventHandler:ILocalEventHandler<EntityCreatedEventData<UnplannedReceipt>>, ITransientDependency
{ {
public Task HandleEventAsync(EntityCreatedEto<UnplannedReceipt> eventData) public Task HandleEventAsync(EntityCreatedEventData<UnplannedReceipt> eventData)
{ {
throw new System.NotImplementedException(); Console.WriteLine("Local Event:" + eventData.Entity.Id);
return Task.CompletedTask;
//TODO 新增无订单的TB_RECEIPT //TODO 新增无订单的TB_RECEIPT
} }

4
WebApiService/src/Win_in.Sfs.Scp.v1.Event/V1ScpEventModule.cs

@ -2,6 +2,7 @@
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Win_in.Sfs.Scp.v1.Domain; using Win_in.Sfs.Scp.v1.Domain;
using Win_in.Sfs.Scp.v1.EntityFrameworkCore;
using Win_in.Sfs.Scp.WebApi; using Win_in.Sfs.Scp.WebApi;
namespace Win_in.Sfs.Scp.v1.Event namespace Win_in.Sfs.Scp.v1.Event
@ -9,7 +10,8 @@ namespace Win_in.Sfs.Scp.v1.Event
[DependsOn( [DependsOn(
typeof(AbpAutofacModule), typeof(AbpAutofacModule),
typeof(V1ScpDomainModule), typeof(V1ScpDomainModule),
typeof(WebApiDomainModule) typeof(WebApiDomainModule),
typeof(V1ScpEntityFrameworkCoreModule)
)] )]
public class V1ScpEventModule : AbpModule public class V1ScpEventModule : AbpModule
{ {

Loading…
Cancel
Save