diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml index dc1a1d94..95d606db 100644 --- a/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml +++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Domain.xml @@ -34,6 +34,11 @@ 操作时间 + + + 明细 + + wms出入库回退记录表 @@ -94,6 +99,11 @@ 仓库ID + + + 明细 + + 箱库存明细表 @@ -104,6 +114,11 @@ ID + + + 上级ID + + 物料ID @@ -544,7 +559,7 @@ 主键 订单编号 - + 单据头Id @@ -634,7 +649,7 @@ 主键 订单编号 - + 单据头Id @@ -739,7 +754,7 @@ 主键 订单编号 - + 单据头Id diff --git a/src/WMS.Web.Domain/Entitys/BackRecord.cs b/src/WMS.Web.Domain/Entitys/BackRecord.cs index 160a29ba..a8c4065f 100644 --- a/src/WMS.Web.Domain/Entitys/BackRecord.cs +++ b/src/WMS.Web.Domain/Entitys/BackRecord.cs @@ -33,5 +33,11 @@ namespace WMS.Web.Domain.Entitys /// 操作时间 /// public DateTime CreateTime { get; set; } + + /// + /// 明细 + /// + [NotMapped] + public List Details = new List(); } } diff --git a/src/WMS.Web.Domain/Entitys/BoxInventory.cs b/src/WMS.Web.Domain/Entitys/BoxInventory.cs index 7e4a0b66..cc4cd380 100644 --- a/src/WMS.Web.Domain/Entitys/BoxInventory.cs +++ b/src/WMS.Web.Domain/Entitys/BoxInventory.cs @@ -28,5 +28,11 @@ namespace WMS.Web.Domain.Entitys /// 仓库ID /// public int SubStockId { get; set; } + + /// + /// 明细 + /// + [NotMapped] + public List Details = new List(); } } diff --git a/src/WMS.Web.Domain/Entitys/BoxInventoryDetails.cs b/src/WMS.Web.Domain/Entitys/BoxInventoryDetails.cs index b3a09cca..820b7622 100644 --- a/src/WMS.Web.Domain/Entitys/BoxInventoryDetails.cs +++ b/src/WMS.Web.Domain/Entitys/BoxInventoryDetails.cs @@ -16,6 +16,12 @@ namespace WMS.Web.Domain.Entitys /// ID /// public int Id { get; set; } + + /// + /// 上级ID + /// + public int Fid { get; set; } + /// /// 物料ID /// diff --git a/src/WMS.Web.Repositories/Configuration/RepositoryDbContext.cs b/src/WMS.Web.Repositories/Configuration/RepositoryDbContext.cs index c69ce16f..26f96cbf 100644 --- a/src/WMS.Web.Repositories/Configuration/RepositoryDbContext.cs +++ b/src/WMS.Web.Repositories/Configuration/RepositoryDbContext.cs @@ -28,8 +28,7 @@ namespace WMS.Web.Repositories.Configuration } protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); + { //改箱 builder.Entity(ent => @@ -132,7 +131,58 @@ namespace WMS.Web.Repositories.Configuration ent.ToTable("t_erp_outstock_task_details"); ent.HasKey(x => x.Id); }); + #endregion + + #region 出入库回退记录 + builder.Entity(ent => + { + ent.ToTable("t_wms_back_record"); + ent.HasKey(x => x.Id); + + ent.HasMany(p => p.Details) + .WithOne() + .HasForeignKey(p => p.Fid) + .OnDelete(DeleteBehavior.Cascade); + }); + builder.Entity(ent => + { + ent.ToTable("t_wms_back_record_details"); + ent.HasKey(x => x.Id); + }); + #endregion + + #region 箱库存 + builder.Entity(ent => + { + ent.ToTable("t_wms_box_inventory"); + ent.HasKey(x => x.Id); + + ent.HasMany(p => p.Details) + .WithOne() + .HasForeignKey(p => p.Fid) + .OnDelete(DeleteBehavior.Cascade); + }); + builder.Entity(ent => + { + ent.ToTable("t_wms_box_inventory_details"); + ent.HasKey(x => x.Id); + }); # endregion + + #region 即时库存相关 + builder.Entity(ent => + { + ent.ToTable("t_wms_inventory_details"); + ent.HasKey(x => x.Id); + }); + builder.Entity(ent => + { + ent.ToTable("t_wms_inventory_inout_details"); + ent.HasKey(x => x.Id); + }); + #endregion + + base.OnModelCreating(builder); } public DbSet ChangeBoxRecord { get; set; } @@ -140,9 +190,11 @@ namespace WMS.Web.Repositories.Configuration public DbSet OutStock { get; set; } public DbSet OutStockTask { get; set; } public DbSet TakeStock { get; set; } - public DbSet Instock { get; set; } - public DbSet InstockTask { get; set; } + public DbSet BackRecord { get; set; } + public DbSet BoxInventory { get; set; } + public DbSet InventoryDetails { get; set; } + public DbSet InventoryInOutDetails { get; set; } } }