Browse Source

添加盘点附属表

dev_DY_CC
lvzb 1 year ago
parent
commit
e416b0653b
  1. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs
  2. 58
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs
  3. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJob.cs
  4. 51
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs
  5. 25
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs
  6. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs

@ -1,6 +1,9 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -51,4 +54,8 @@ public class CountJobDTO : SfsJobDTOBase<CountJobDetailDTO>
[Display(Name = "库位代码")] [Display(Name = "库位代码")]
public string LocationCode { get; set; } public string LocationCode { get; set; }
/// <summary>
/// 任务从表明细(记录每次扫得明细)
/// </summary>
public List<CountJobDependentDetailDTO> DepDetails { get; set; } = new List<CountJobDependentDetailDTO>();
} }

58
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs

@ -0,0 +1,58 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class CountJobDependentDetailDTO : SfsJobDetailDTOBase, IHasCountResult
{
/// <summary>
/// 盘点标签
/// </summary>
[Display(Name = "盘点标签")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string CountLabel { get; set; }
/// <summary>
/// 计量单位
/// </summary>
[Display(Name = "计量单位")]
public string Uom { get; set; }
/// <summary>
/// 库存数量
/// </summary>
[Display(Name = "库存数量")]
public decimal InventoryQty { get; set; }
/// <summary>
/// 库存库位
/// </summary>
[Display(Name = "库存库位")]
public string InventoryLocationCode { get; set; }
/// <summary>
/// 盘点数量
/// </summary>
[Display(Name = "盘点数量")]
public decimal CountQty { get; set; }
/// <summary>
/// 盘点时间
/// </summary>
[Display(Name = "盘点时间")]
public DateTime? CountTime { get; set; }
/// <summary>
/// 盘点操作员
/// </summary>
[Display(Name = "盘点操作员")]
public string CountOperator { get; set; }
/// <summary>
/// 盘点描述
/// </summary>
[Display(Name = "盘点描述")]
public string CountDescription { get; set; }
}

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJob.cs

@ -62,6 +62,11 @@ public class CountJob : SfsJobAggregateRootBase<CountJobDetail>
/// </summary> /// </summary>
[IgnoreUpdate] [IgnoreUpdate]
public override List<CountJobDetail> Details { get; set; } = new List<CountJobDetail>(); public override List<CountJobDetail> Details { get; set; } = new List<CountJobDetail>();
/// <summary>
/// 任务从表明细(记录每次扫得明细)
/// </summary>
[IgnoreUpdate]
public List<CountJobDependentDetail> DepDetails { get; set; } = new List<CountJobDependentDetail>();
/// <summary> /// <summary>
/// 设置任务明细的实际库位和实际数量 /// 设置任务明细的实际库位和实际数量

51
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs

@ -0,0 +1,51 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Domain;
public class CountJobDependentDetail : SfsJobDetailEntityBase, IHasCountResult, IHasInventoryQty
{
/// <summary>
/// 盘点标签
/// </summary>
public string CountLabel { get; set; }
/// <summary>
/// 库存数量
/// </summary>
public decimal InventoryQty { get; set; }
/// <summary>
/// 计量单位
/// </summary>
[Display(Name = "计量单位")]
public string Uom { get; set; }
/// <summary>
/// 库存库位
/// </summary>
public string InventoryLocationCode { get; set; }
/// <summary>
/// 盘点数量(每次扫得数量)
/// </summary>
public decimal CountQty { get; set; }
/// <summary>
/// 盘点时间
/// </summary>
public DateTime? CountTime { get; set; }
/// <summary>
/// 盘点操作员
/// </summary>
public string CountOperator { get; set; }
/// <summary>
/// 盘点描述
/// </summary>
public string CountDescription { get; set; }
}

25
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs

@ -29,6 +29,7 @@ public static class CountJobDbContextModelCreatingExtensions
b.Property(q => q.LocationCode).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.LocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations //Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
b.HasMany(q => q.DepDetails).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
//Indexes //Indexes
b.HasIndex(q => new { q.Number }).IsUnique(); b.HasIndex(q => new { q.Number }).IsUnique();
}); });
@ -55,5 +56,29 @@ public static class CountJobDbContextModelCreatingExtensions
//Indexes //Indexes
//b.HasIndex(q => new { q.PackingCode }).IsUnique(); //b.HasIndex(q => new { q.PackingCode }).IsUnique();
}); });
builder.Entity<CountJobDependentDetail>(b =>
{
//Configure table & schema name
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(CountJobDependentDetail), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsBase();
//Configure Job base properties
b.ConfigureJobDetail();
//Properties
b.Property(q => q.CountLabel).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.InventoryLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.CountOperator).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.CountDescription).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations
//None
//Indexes
//b.HasIndex(q => new { q.PackingCode }).IsUnique();
});
} }
} }

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs

@ -337,7 +337,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule
#region Jobs #region Jobs
options.Entity<CountJob>(orderOptions => options.Entity<CountJob>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details).Include(o => o.DepDetails));
options.Entity<CheckJob>(orderOptions => options.Entity<CheckJob>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<ProductReceiveJob>(orderOptions => options.Entity<ProductReceiveJob>(orderOptions =>

Loading…
Cancel
Save