diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 000000000..b0754f55c Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Products/mes_product.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Products/mes_product.cs index 1e5e69dc1..49cc9042e 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Products/mes_product.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Products/mes_product.cs @@ -86,12 +86,18 @@ public class mes_product : Entity /// public string mes_product_active { get; set; } /// - /// + /// 最小領用倍數 /// - public string mes_product_qad01 { get; set; } - - // public string mes_product_fih_factory { get; set; } - + public decimal mes_product_qad01 { get; set; } + /// + /// 正廠編號 + /// + public string mes_product_fih_factory { get; set; } + /// + /// 标准成本 + /// + /// + public decimal mes_product_price_std { get; set; } public override object[] GetKeys() { return new object[] { mes_product_part_ser }; diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs index cdca95ebf..0d9bc033f 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs @@ -67,7 +67,7 @@ public class PlanReader : IReader foreach (var plan in toBeProcessedPlans) { if (pobillno.Contains(plan.PlanBillNo)) continue; - var price = await _purchasePriceSheetAppService.GetByItemCodeAsync(plan.ERP).ConfigureAwait(false); + var price = await _purchasePriceSheetAppService.GetByItemCodeAsync(plan.ERP,plan.SupplierCode).ConfigureAwait(false); if (price == null) { pobillno.Add(plan.PlanBillNo); diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml index 01d68a873..880561d6c 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml @@ -841,6 +841,41 @@ 明细列表 + + + 零件编号 + + + + + 库位编码 + + + + + MesGuid + + + + + id + + + + + 生效日期 + + + + + 数量 + + + + + 返喷数量 + + 产成品物料号 diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PurchasePrices/DTOs/PurchasePriceSheetDTO.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PurchasePrices/DTOs/PurchasePriceSheetDTO.cs index 307e4ed58..08a19b4a3 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PurchasePrices/DTOs/PurchasePriceSheetDTO.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PurchasePrices/DTOs/PurchasePriceSheetDTO.cs @@ -23,16 +23,18 @@ public class PurchasePriceSheetDTO : SfsBaseDataDTOBase public string ItemCode { get; set; } /// - /// 物料价格 + /// 供应商编号 /// - [Display(Name = "物料价格")] - public decimal MaterialPrice { get; set; } + [Display(Name = "供应商编号")] + [Required(ErrorMessage = "{0}是必填项")] + [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string SupplierCode { get; set; } /// - /// 成品价格 + /// 采购价格 /// - [Display(Name = "成品价格")] - public decimal ProductPrice { get; set; } + [Display(Name = "采购价格")] + public decimal PurchasePrice { get; set; } /// /// 价格单描述 diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PurchasePrices/IPurchasePriceSheetAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PurchasePrices/IPurchasePriceSheetAppService.cs index 2178b0950..12919f44c 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PurchasePrices/IPurchasePriceSheetAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PurchasePrices/IPurchasePriceSheetAppService.cs @@ -1,8 +1,9 @@ using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; namespace Win_in.Sfs.Basedata.Application.Contracts; public interface IPurchasePriceSheetAppService : ISfsBaseDataAppServiceBase { - Task GetByItemCodeAsync(string itemCode); + Task GetByItemCodeAsync(string itemCode,string supplierCode); } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SalePrices/DTOs/SalePriceSheetDTO.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SalePrices/DTOs/SalePriceSheetDTO.cs index 24b4fc2c9..4df127f85 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SalePrices/DTOs/SalePriceSheetDTO.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SalePrices/DTOs/SalePriceSheetDTO.cs @@ -11,56 +11,82 @@ namespace Win_in.Sfs.Basedata.Application.Contracts; /// 销售价格单 /// [Display(Name = "销售价格单")] -public class SalePriceSheetDTO : SfsBaseDataDTOBase, IHasCode, IHasName +public class SalePriceSheetDTO : SfsBaseDataDTOBase { - /// - /// 客户ID + /// 物料代码 /// - [Display(Name = "客户Id")] + [Display(Name = "物料代码")] [Required(ErrorMessage = "{0}是必填项")] - - public Guid CustomerId { get; set; } - - /// - /// 客户名称 - /// - [Display(Name = "客户名称")] - public string CustomerName { get; set; } + [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string ItemCode { get; set; } /// - /// 价格单名称 + /// 客户代码 /// - [Display(Name = "价格单名称")] - public string Name { get; set; } + [Display(Name = "客户代码")] + [Required(ErrorMessage = "{0}是必填项")] + [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string CustomerCode { get; set; } /// - /// 代码 + /// 销售价格 /// - [Display(Name = "代码")] - [Required(ErrorMessage = "{0}是必填项")] - [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] - public string Code { get; set; } + [Display(Name = "销售价格")] + public decimal SalePrice { get; set; } /// /// 价格单描述 /// [Display(Name = "价格单描述")] public string Description { get; set; } + ///// + ///// 客户ID + ///// + //[Display(Name = "客户Id")] + //[Required(ErrorMessage = "{0}是必填项")] - /// - /// 货币ID - /// - [Display(Name = "货币Id")] - [Required(ErrorMessage = "{0}是必填项")] + //public Guid CustomerId { get; set; } - public Guid CurrencyId { get; set; } + ///// + ///// 客户名称 + ///// + //[Display(Name = "客户名称")] + //public string CustomerName { get; set; } - /// - /// 货币名称 - /// - [Display(Name = "货币名称")] - public string CurrencyName { get; set; } + ///// + ///// 价格单名称 + ///// + //[Display(Name = "价格单名称")] + //public string Name { get; set; } + + ///// + ///// 代码 + ///// + //[Display(Name = "代码")] + //[Required(ErrorMessage = "{0}是必填项")] + //[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + //public string Code { get; set; } + + ///// + ///// 价格单描述 + ///// + //[Display(Name = "价格单描述")] + //public string Description { get; set; } + + ///// + ///// 货币ID + ///// + //[Display(Name = "货币Id")] + //[Required(ErrorMessage = "{0}是必填项")] + + //public Guid CurrencyId { get; set; } + + ///// + ///// 货币名称 + ///// + //[Display(Name = "货币名称")] + //public string CurrencyName { get; set; } //[Display(Name = "子表单")] //public virtual List SalePriceDetails { get; set; } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/StdCostPrices/DTOs/StdCostPriceSheetDTO.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/StdCostPrices/DTOs/StdCostPriceSheetDTO.cs index b253237bb..fa1cafb39 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/StdCostPrices/DTOs/StdCostPriceSheetDTO.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/StdCostPrices/DTOs/StdCostPriceSheetDTO.cs @@ -8,51 +8,71 @@ namespace Win_in.Sfs.Basedata.Application.Contracts; /// 标准成本价格单 /// [Display(Name = "标准成本价格单")] -public class StdCostPriceSheetDTO : SfsBaseDataDTOBase, IHasCode, IHasName +public class StdCostPriceSheetDTO : SfsBaseDataDTOBase { /// - /// 供应商Id + /// 价格单编码 /// - [Display(Name = "供应商Id")] + [Display(Name = "物料代码")] [Required(ErrorMessage = "{0}是必填项")] - public Guid SupplierId { get; set; } - /// - /// 供应商名称 - /// - [Display(Name = "供应商名称")] - [Required(ErrorMessage = "{0}是必填项")] - public string SupplierName { get; set; } - /// - /// 价格单名称 - /// - [Display(Name = "价格单名称")] - [Required(ErrorMessage = "{0}是必填项")] - [StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")] - public string Name { get; set; } + [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string ItemCode { get; set; } + /// - /// 代码 + /// 标准成本价格 /// - [Display(Name = "代码")] - [Required(ErrorMessage = "{0}是必填项")] - [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] - public string Code { get; set; } + [Display(Name = "标准成本价格")] + public decimal StdCostPrice { get; set; } + /// /// 价格单描述 /// [Display(Name = "价格单描述")] - [StringLength(SfsEfCorePropertyConst.DescLength, ErrorMessage = "{0}最多输入{1}个字符")] public string Description { get; set; } - /// - /// 货币Id - /// - [Display(Name = "货币Id")] - [StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")] - public Guid CurrencyId { get; set; } - /// - /// 货币名称 - /// - [Display(Name = "货币名称")] - [Required(ErrorMessage = "{0}是必填项")] - public string CurrencyName { get; set; } + + ///// + ///// 供应商Id + ///// + //[Display(Name = "供应商Id")] + //[Required(ErrorMessage = "{0}是必填项")] + //public Guid SupplierId { get; set; } + ///// + ///// 供应商名称 + ///// + //[Display(Name = "供应商名称")] + //[Required(ErrorMessage = "{0}是必填项")] + //public string SupplierName { get; set; } + ///// + ///// 价格单名称 + ///// + //[Display(Name = "价格单名称")] + //[Required(ErrorMessage = "{0}是必填项")] + //[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")] + //public string Name { get; set; } + ///// + ///// 代码 + ///// + //[Display(Name = "代码")] + //[Required(ErrorMessage = "{0}是必填项")] + //[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + //public string Code { get; set; } + ///// + ///// 价格单描述 + ///// + //[Display(Name = "价格单描述")] + //[StringLength(SfsEfCorePropertyConst.DescLength, ErrorMessage = "{0}最多输入{1}个字符")] + //public string Description { get; set; } + ///// + ///// 货币Id + ///// + //[Display(Name = "货币Id")] + //[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")] + //public Guid CurrencyId { get; set; } + ///// + ///// 货币名称 + ///// + //[Display(Name = "货币名称")] + //[Required(ErrorMessage = "{0}是必填项")] + //public string CurrencyName { get; set; } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAppService.cs index e2c9e3bce..afdfae2a4 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAppService.cs @@ -28,9 +28,9 @@ public class PurchasePriceSheetAppService : SfsBaseDataAppServiceBase /// [HttpGet("by-item-code")] - public virtual async Task GetByItemCodeAsync(string itemCode) + public virtual async Task GetByItemCodeAsync(string itemCode,string supplierCode) { - var entity = await _purchasePriceSheetRepository.FindAsync(p => p.ItemCode== itemCode).ConfigureAwait(false); + var entity = await _purchasePriceSheetRepository.FindAsync(p => p.ItemCode== itemCode&&p.SupplierCode== supplierCode).ConfigureAwait(false); var dto = ObjectMapper.Map(entity); return dto; } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs index 87ec4f112..840a4f415 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs @@ -10,8 +10,6 @@ public partial class BasedataApplicationAutoMapperProfile : Profile private void SalePriceSheetAutoMapperProfile() { CreateMap() - .Ignore(x => x.CustomerName) - .Ignore(x => x.CurrencyName) .ReverseMap(); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs index b02916e6c..f99988470 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs @@ -10,8 +10,6 @@ public partial class BasedataApplicationAutoMapperProfile : Profile private void StdCostPriceSheetAutoMapperProfile() { CreateMap() - .Ignore(x => x.SupplierName) - .Ignore(x => x.CurrencyName) .ReverseMap(); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/PurchasePrices/PurchasePriceSheet.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/PurchasePrices/PurchasePriceSheet.cs index c728f2fb4..c0136e6fc 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/PurchasePrices/PurchasePriceSheet.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/PurchasePrices/PurchasePriceSheet.cs @@ -15,21 +15,30 @@ public class PurchasePriceSheet : SfsBaseDataAggregateRootBase [IgnoreUpdate] public string ItemCode { get; set; } /// - /// 价格单描述 - /// - public string Description { get; set; } - /// - /// 货币ID + /// 供应商编号 /// - public Guid CurrencyId { get; set; } + [IgnoreUpdate] + public string SupplierCode { get; set; } /// - /// 物料价格 + /// 价格单描述 /// - public decimal MaterialPrice { get; set; } + public string Description { get; set; } /// - /// 成品价格 + /// 采购价格 /// - public decimal ProductPrice { get; set; } + public decimal PurchasePrice { get; set; } + ///// + ///// 货币ID + ///// + //public Guid CurrencyId { get; set; } + ///// + ///// 物料价格 + ///// + //public decimal MaterialPrice { get; set; } + ///// + ///// 成品价格 + ///// + //public decimal ProductPrice { get; set; } #region details handler //public virtual void AddDetail(IGuidGenerator guidGenerator, PurchasePriceDetail detail) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SalePrices/SalePriceSheet.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SalePrices/SalePriceSheet.cs index 58f356aef..785f7496e 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SalePrices/SalePriceSheet.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SalePrices/SalePriceSheet.cs @@ -7,35 +7,56 @@ namespace Win_in.Sfs.Basedata.Domain; /// /// 销售价格单 /// -public class SalePriceSheet : SfsBaseDataAggregateRootBase, IHasCode, IHasName +public class SalePriceSheet : SfsBaseDataAggregateRootBase { - - // public virtual ICollection SalePriceDetails { get; set; } - /// - /// 客户ID + /// 客户 /// [IgnoreUpdate] - public Guid CustomerId { get; set; } + public string CustomerCode { get; set; } /// - /// 编码 + /// 物料号 /// [IgnoreUpdate] - public string Code { get; set; } + public string ItemCode { get; set; } - /// - /// 价格单名称 - /// - public string Name { get; set; } /// /// 价格单描述 /// public string Description { get; set; } + /// - /// 货币ID + /// 销售价格 + /// + public decimal SalePrice { get; set; } + + // public virtual ICollection SalePriceDetails { get; set; } + + /// + /// 客户ID /// - public Guid CurrencyId { get; set; } + //[IgnoreUpdate] + //public Guid CustomerId { get; set; } + + ///// + ///// 编码 + ///// + //[IgnoreUpdate] + //public string Code { get; set; } + + ///// + ///// 价格单名称 + ///// + //public string Name { get; set; } + ///// + ///// 价格单描述 + ///// + //public string Description { get; set; } + ///// + ///// 货币ID + ///// + //public Guid CurrencyId { get; set; } #region details handler //public virtual void AddDetail(IGuidGenerator guidGenerator, SalePriceDetail detail) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/StdCostPrices/StdCostPriceSheet.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/StdCostPrices/StdCostPriceSheet.cs index 6100cabd5..c3306bbd5 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/StdCostPrices/StdCostPriceSheet.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/StdCostPrices/StdCostPriceSheet.cs @@ -8,33 +8,46 @@ namespace Win_in.Sfs.Basedata.Domain; /// /// 标准成本价格单-主表 /// -public class StdCostPriceSheet : SfsBaseDataAggregateRootBase, IHasCode, IHasName +public class StdCostPriceSheet : SfsBaseDataAggregateRootBase { - [Display(Name = "编码")] - [Required(ErrorMessage = "{0}是必填项")] - [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + /// + /// 物品代码 + /// [IgnoreUpdate] - public string Code { get; set; } + public string ItemCode { get; set; } + /// + /// 价格单描述 + /// + public string Description { get; set; } + /// + /// 标准成本价格 + /// + public decimal StdCostPrice { get; set; } + //[Display(Name = "编码")] + //[Required(ErrorMessage = "{0}是必填项")] + //[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + //[IgnoreUpdate] + //public string Code { get; set; } - [Display(Name = "价格单名称")] - [Required(ErrorMessage = "{0}是必填项")] - [StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")] - [IgnoreUpdate] - public string Name { get; set; } + //[Display(Name = "价格单名称")] + //[Required(ErrorMessage = "{0}是必填项")] + //[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")] + //[IgnoreUpdate] + //public string Name { get; set; } - [Display(Name = "供应商Id")] - [Required(ErrorMessage = "{0}是必填项")] - [IgnoreUpdate] - public Guid SupplierId { get; set; } + //[Display(Name = "供应商Id")] + //[Required(ErrorMessage = "{0}是必填项")] + //[IgnoreUpdate] + //public Guid SupplierId { get; set; } - [Display(Name = "价格单描述")] - [StringLength(SfsEfCorePropertyConst.DescLength, ErrorMessage = "{0}最多输入{1}个字符")] - [IgnoreUpdate] - public string Description { get; set; } + //[Display(Name = "价格单描述")] + //[StringLength(SfsEfCorePropertyConst.DescLength, ErrorMessage = "{0}最多输入{1}个字符")] + //[IgnoreUpdate] + //public string Description { get; set; } - [Display(Name = "货币Id")] - [StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")] - [IgnoreUpdate] - public Guid CurrencyId { get; set; } + //[Display(Name = "货币Id")] + //[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")] + //[IgnoreUpdate] + //public Guid CurrencyId { get; set; } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PurchasePrices/PurchasePriceSheetDbContextModelCreatingExtensions.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PurchasePrices/PurchasePriceSheetDbContextModelCreatingExtensions.cs index c591fa1e0..05f3b5f56 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PurchasePrices/PurchasePriceSheetDbContextModelCreatingExtensions.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PurchasePrices/PurchasePriceSheetDbContextModelCreatingExtensions.cs @@ -21,13 +21,14 @@ public static class PurchasePriceSheetDbContextModelCreatingExtensions //Properties b.Property(q => q.ItemCode).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.SupplierCode).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.Description).HasMaxLength(SfsPropertyConst.DescLength); //Relations //None //Indexes - b.HasIndex(q => new { q.ItemCode }).IsUnique(); + b.HasIndex(q => new { q.ItemCode ,q.SupplierCode}).IsUnique(); }); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/SalePrices/SalePriceSheetDbContextModelCreatingExtensions.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/SalePrices/SalePriceSheetDbContextModelCreatingExtensions.cs index 34269f448..9babd45a6 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/SalePrices/SalePriceSheetDbContextModelCreatingExtensions.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/SalePrices/SalePriceSheetDbContextModelCreatingExtensions.cs @@ -20,17 +20,15 @@ public static class SalePriceSheetDbContextModelCreatingExtensions b.ConfigureSfsBase(); //Properties - b.Property(q => q.Code).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); - b.Property(q => q.Name).HasMaxLength(SfsPropertyConst.NameLength); + b.Property(q => q.ItemCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.CustomerCode).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.Description).HasMaxLength(SfsPropertyConst.DescLength); - b.Property(x => x.CustomerId).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); - b.Property(x => x.CurrencyId).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); //Relations //None //Indexes - b.HasIndex(q => new { q.Code, q.CustomerId }).IsUnique(); + b.HasIndex(q => new { q.CustomerCode, q.ItemCode }).IsUnique(); }); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/StdCostPrices/StdCostPriceSheetDbContextModelCreatingExtensions.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/StdCostPrices/StdCostPriceSheetDbContextModelCreatingExtensions.cs index 2ba5ff3cb..36015bc33 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/StdCostPrices/StdCostPriceSheetDbContextModelCreatingExtensions.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/StdCostPrices/StdCostPriceSheetDbContextModelCreatingExtensions.cs @@ -16,13 +16,12 @@ public static class StdCostPriceSheetDbContextModelCreatingExtensions b.ConfigureByConvention(); b.ConfigureSfsBase(); - b.Property(x => x.SupplierId).IsRequired(); - b.Property(x => x.Code).IsRequired().HasMaxLength(SfsEfCorePropertyConst.CodeLength); - b.Property(x => x.Name).IsRequired().HasMaxLength(SfsEfCorePropertyConst.NameLength); + + b.Property(x => x.ItemCode).IsRequired().HasMaxLength(SfsEfCorePropertyConst.CodeLength); + b.Property(x => x.Description).HasMaxLength(SfsEfCorePropertyConst.DescLength); - b.Property(x => x.CurrencyId).HasMaxLength(SfsEfCorePropertyConst.NameLength); - b.HasIndex(x => new { x.Code, x.SupplierId }).IsUnique(); + b.HasIndex(x => new { x.ItemCode}).IsUnique(); }); } }