db-创建

This commit is contained in:
tongfei
2023-10-26 15:20:56 +08:00
parent 23b623b52b
commit e8bd8db0dc
5 changed files with 92 additions and 7 deletions

View File

@@ -34,6 +34,11 @@
操作时间
</summary>
</member>
<member name="F:WMS.Web.Domain.Entitys.BackRecord.Details">
<summary>
明细
</summary>
</member>
<member name="T:WMS.Web.Domain.Entitys.BackRecordDetails">
<summary>
wms出入库回退记录表
@@ -94,6 +99,11 @@
仓库ID
</summary>
</member>
<member name="F:WMS.Web.Domain.Entitys.BoxInventory.Details">
<summary>
明细
</summary>
</member>
<member name="T:WMS.Web.Domain.Entitys.BoxInventoryDetails">
<summary>
箱库存明细表
@@ -104,6 +114,11 @@
ID
</summary>
</member>
<member name="P:WMS.Web.Domain.Entitys.BoxInventoryDetails.Fid">
<summary>
上级ID
</summary>
</member>
<member name="P:WMS.Web.Domain.Entitys.BoxInventoryDetails.MaterialId">
<summary>
物料ID
@@ -544,7 +559,7 @@
主键 订单编号
</summary>
</member>
<member name="P:WMS.Web.Domain.Entitys.OutStockDetails.OutStockId">
<member name="P:WMS.Web.Domain.Entitys.OutStockDetails.Fid">
<summary>
单据头Id
</summary>
@@ -634,7 +649,7 @@
主键 订单编号
</summary>
</member>
<member name="P:WMS.Web.Domain.Entitys.OutStockTaskDetails.OutStockTaskId">
<member name="P:WMS.Web.Domain.Entitys.OutStockTaskDetails.Fid">
<summary>
单据头Id
</summary>
@@ -739,7 +754,7 @@
主键 订单编号
</summary>
</member>
<member name="P:WMS.Web.Domain.Entitys.TakeStockDetails.TakeStockId">
<member name="P:WMS.Web.Domain.Entitys.TakeStockDetails.Fid">
<summary>
单据头Id
</summary>

View File

@@ -33,5 +33,11 @@ namespace WMS.Web.Domain.Entitys
/// 操作时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 明细
/// </summary>
[NotMapped]
public List<BackRecordDetails> Details = new List<BackRecordDetails>();
}
}

View File

@@ -28,5 +28,11 @@ namespace WMS.Web.Domain.Entitys
/// 仓库ID
/// </summary>
public int SubStockId { get; set; }
/// <summary>
/// 明细
/// </summary>
[NotMapped]
public List<BoxInventoryDetails> Details = new List<BoxInventoryDetails>();
}
}

View File

@@ -16,6 +16,12 @@ namespace WMS.Web.Domain.Entitys
/// ID
/// </summary>
public int Id { get; set; }
/// <summary>
/// 上级ID
/// </summary>
public int Fid { get; set; }
/// <summary>
/// 物料ID
/// </summary>

View File

@@ -29,7 +29,6 @@ namespace WMS.Web.Repositories.Configuration
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
//改箱
builder.Entity<ChangeBoxRecord>(ent =>
@@ -133,6 +132,57 @@ namespace WMS.Web.Repositories.Configuration
ent.HasKey(x => x.Id);
});
#endregion
#region 退
builder.Entity<BackRecord>(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<BackRecordDetails>(ent =>
{
ent.ToTable("t_wms_back_record_details");
ent.HasKey(x => x.Id);
});
#endregion
#region
builder.Entity<BoxInventory>(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<BoxInventoryDetails>(ent =>
{
ent.ToTable("t_wms_box_inventory_details");
ent.HasKey(x => x.Id);
});
# endregion
#region
builder.Entity<InventoryDetails>(ent =>
{
ent.ToTable("t_wms_inventory_details");
ent.HasKey(x => x.Id);
});
builder.Entity<InventoryInOutDetails>(ent =>
{
ent.ToTable("t_wms_inventory_inout_details");
ent.HasKey(x => x.Id);
});
#endregion
base.OnModelCreating(builder);
}
public DbSet<ChangeBoxRecord> ChangeBoxRecord { get; set; }
@@ -140,9 +190,11 @@ namespace WMS.Web.Repositories.Configuration
public DbSet<OutStock> OutStock { get; set; }
public DbSet<OutStockTask> OutStockTask { get; set; }
public DbSet<TakeStock> TakeStock { get; set; }
public DbSet<InstockOrder> Instock { get; set; }
public DbSet<InstockTask> InstockTask { get; set; }
public DbSet<BackRecord> BackRecord { get; set; }
public DbSet<BoxInventory> BoxInventory { get; set; }
public DbSet<InventoryDetails> InventoryDetails { get; set; }
public DbSet<InventoryInOutDetails> InventoryInOutDetails { get; set; }
}
}