Browse Source

wms添加采购价格表,销售价格表、标准成本价格表以及相关服务

dev_DY_CC
lvzb 1 year ago
parent
commit
3db81f6a95
  1. BIN
      .vs/slnx.sqlite
  2. 16
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Products/mes_product.cs
  3. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs
  4. 35
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml
  5. 14
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PurchasePrices/DTOs/PurchasePriceSheetDTO.cs
  6. 3
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PurchasePrices/IPurchasePriceSheetAppService.cs
  7. 88
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/SalePrices/DTOs/SalePriceSheetDTO.cs
  8. 90
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/StdCostPrices/DTOs/StdCostPriceSheetDTO.cs
  9. 4
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAppService.cs
  10. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs
  11. 2
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs
  12. 29
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/PurchasePrices/PurchasePriceSheet.cs
  13. 49
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SalePrices/SalePriceSheet.cs
  14. 57
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/StdCostPrices/StdCostPriceSheet.cs
  15. 3
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PurchasePrices/PurchasePriceSheetDbContextModelCreatingExtensions.cs
  16. 8
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/SalePrices/SalePriceSheetDbContextModelCreatingExtensions.cs
  17. 9
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/StdCostPrices/StdCostPriceSheetDbContextModelCreatingExtensions.cs

BIN
.vs/slnx.sqlite

Binary file not shown.

16
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp/Products/mes_product.cs

@ -86,12 +86,18 @@ public class mes_product : Entity
/// </summary>
public string mes_product_active { get; set; }
/// <summary>
///
/// 最小領用倍數
/// </summary>
public string mes_product_qad01 { get; set; }
// public string mes_product_fih_factory { get; set; }
public decimal mes_product_qad01 { get; set; }
/// <summary>
/// 正廠編號
/// </summary>
public string mes_product_fih_factory { get; set; }
/// <summary>
/// 标准成本
/// </summary>
/// <returns></returns>
public decimal mes_product_price_std { get; set; }
public override object[] GetKeys()
{
return new object[] { mes_product_part_ser };

2
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);

35
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml

@ -841,6 +841,41 @@
明细列表
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteSumDetailExchangeDto.itemCode">
<summary>
零件编号
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteSumDetailExchangeDto.locationCode">
<summary>
库位编码
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteSumDetailExchangeDto.MesGuid">
<summary>
MesGuid
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteSumDetailExchangeDto.Memo">
<summary>
id
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteSumDetailExchangeDto.CreatDate">
<summary>
生效日期
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteSumDetailExchangeDto.Qty">
<summary>
数量
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote.ProductReceiptNoteSumDetailExchangeDto.BadQty">
<summary>
返喷数量
</summary>
</member>
<member name="P:Win_in.Sfs.Wms.DataExchange.WMS.ProductRecycleNote.ProductRecycleMaterialDetailExchangeDto.ProductItemCode">
<summary>
产成品物料号

14
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; }
/// <summary>
/// 物料价格
/// 供应商编号
/// </summary>
[Display(Name = "物料价格")]
public decimal MaterialPrice { get; set; }
[Display(Name = "供应商编号")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string SupplierCode { get; set; }
/// <summary>
/// 成品价格
/// 采购价格
/// </summary>
[Display(Name = "成品价格")]
public decimal ProductPrice { get; set; }
[Display(Name = "采购价格")]
public decimal PurchasePrice { get; set; }
/// <summary>
/// 价格单描述

3
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<PurchasePriceSheetDTO, SfsBaseDataRequestInputBase, PurchasePriceSheetEditInput>
{
Task<PurchasePriceSheetDTO> GetByItemCodeAsync(string itemCode);
Task<PurchasePriceSheetDTO> GetByItemCodeAsync(string itemCode,string supplierCode);
}

88
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;
/// 销售价格单
/// </summary>
[Display(Name = "销售价格单")]
public class SalePriceSheetDTO : SfsBaseDataDTOBase, IHasCode, IHasName
public class SalePriceSheetDTO : SfsBaseDataDTOBase
{
/// <summary>
/// 客户ID
/// 物料代码
/// </summary>
[Display(Name = "客户Id")]
[Display(Name = "物料代码")]
[Required(ErrorMessage = "{0}是必填项")]
public Guid CustomerId { get; set; }
/// <summary>
/// 客户名称
/// </summary>
[Display(Name = "客户名称")]
public string CustomerName { get; set; }
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ItemCode { get; set; }
/// <summary>
/// 价格单名称
/// 客户代码
/// </summary>
[Display(Name = "价格单名称")]
public string Name { get; set; }
[Display(Name = "客户代码")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string CustomerCode { get; set; }
/// <summary>
/// 代码
/// 销售价格
/// </summary>
[Display(Name = "代码")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Code { get; set; }
[Display(Name = "销售价格")]
public decimal SalePrice { get; set; }
/// <summary>
/// 价格单描述
/// </summary>
[Display(Name = "价格单描述")]
public string Description { get; set; }
///// <summary>
///// 客户ID
///// </summary>
//[Display(Name = "客户Id")]
//[Required(ErrorMessage = "{0}是必填项")]
/// <summary>
/// 货币ID
/// </summary>
[Display(Name = "货币Id")]
[Required(ErrorMessage = "{0}是必填项")]
//public Guid CustomerId { get; set; }
public Guid CurrencyId { get; set; }
///// <summary>
///// 客户名称
///// </summary>
//[Display(Name = "客户名称")]
//public string CustomerName { get; set; }
/// <summary>
/// 货币名称
/// </summary>
[Display(Name = "货币名称")]
public string CurrencyName { get; set; }
///// <summary>
///// 价格单名称
///// </summary>
//[Display(Name = "价格单名称")]
//public string Name { get; set; }
///// <summary>
///// 代码
///// </summary>
//[Display(Name = "代码")]
//[Required(ErrorMessage = "{0}是必填项")]
//[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
//public string Code { get; set; }
///// <summary>
///// 价格单描述
///// </summary>
//[Display(Name = "价格单描述")]
//public string Description { get; set; }
///// <summary>
///// 货币ID
///// </summary>
//[Display(Name = "货币Id")]
//[Required(ErrorMessage = "{0}是必填项")]
//public Guid CurrencyId { get; set; }
///// <summary>
///// 货币名称
///// </summary>
//[Display(Name = "货币名称")]
//public string CurrencyName { get; set; }
//[Display(Name = "子表单")]
//public virtual List<SalePriceDetailDTO> SalePriceDetails { get; set; }

90
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;
/// 标准成本价格单
/// </summary>
[Display(Name = "标准成本价格单")]
public class StdCostPriceSheetDTO : SfsBaseDataDTOBase, IHasCode, IHasName
public class StdCostPriceSheetDTO : SfsBaseDataDTOBase
{
/// <summary>
/// 供应商Id
/// 价格单编码
/// </summary>
[Display(Name = "供应商Id")]
[Display(Name = "物料代码")]
[Required(ErrorMessage = "{0}是必填项")]
public Guid SupplierId { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
[Display(Name = "供应商名称")]
[Required(ErrorMessage = "{0}是必填项")]
public string SupplierName { get; set; }
/// <summary>
/// 价格单名称
/// </summary>
[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; }
/// <summary>
/// 代码
/// 标准成本价格
/// </summary>
[Display(Name = "代码")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Code { get; set; }
[Display(Name = "标准成本价格")]
public decimal StdCostPrice { get; set; }
/// <summary>
/// 价格单描述
/// </summary>
[Display(Name = "价格单描述")]
[StringLength(SfsEfCorePropertyConst.DescLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Description { get; set; }
/// <summary>
/// 货币Id
/// </summary>
[Display(Name = "货币Id")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public Guid CurrencyId { get; set; }
/// <summary>
/// 货币名称
/// </summary>
[Display(Name = "货币名称")]
[Required(ErrorMessage = "{0}是必填项")]
public string CurrencyName { get; set; }
///// <summary>
///// 供应商Id
///// </summary>
//[Display(Name = "供应商Id")]
//[Required(ErrorMessage = "{0}是必填项")]
//public Guid SupplierId { get; set; }
///// <summary>
///// 供应商名称
///// </summary>
//[Display(Name = "供应商名称")]
//[Required(ErrorMessage = "{0}是必填项")]
//public string SupplierName { get; set; }
///// <summary>
///// 价格单名称
///// </summary>
//[Display(Name = "价格单名称")]
//[Required(ErrorMessage = "{0}是必填项")]
//[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
//public string Name { get; set; }
///// <summary>
///// 代码
///// </summary>
//[Display(Name = "代码")]
//[Required(ErrorMessage = "{0}是必填项")]
//[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
//public string Code { get; set; }
///// <summary>
///// 价格单描述
///// </summary>
//[Display(Name = "价格单描述")]
//[StringLength(SfsEfCorePropertyConst.DescLength, ErrorMessage = "{0}最多输入{1}个字符")]
//public string Description { get; set; }
///// <summary>
///// 货币Id
///// </summary>
//[Display(Name = "货币Id")]
//[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
//public Guid CurrencyId { get; set; }
///// <summary>
///// 货币名称
///// </summary>
//[Display(Name = "货币名称")]
//[Required(ErrorMessage = "{0}是必填项")]
//public string CurrencyName { get; set; }
}

4
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAppService.cs

@ -28,9 +28,9 @@ public class PurchasePriceSheetAppService : SfsBaseDataAppServiceBase<PurchasePr
/// <param name="itemCode"></param>
/// <returns></returns>
[HttpGet("by-item-code")]
public virtual async Task<PurchasePriceSheetDTO> GetByItemCodeAsync(string itemCode)
public virtual async Task<PurchasePriceSheetDTO> 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<PurchasePriceSheet, PurchasePriceSheetDTO>(entity);
return dto;
}

2
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<SalePriceSheet, SalePriceSheetDTO>()
.Ignore(x => x.CustomerName)
.Ignore(x => x.CurrencyName)
.ReverseMap();
}
}

2
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<StdCostPriceSheet, StdCostPriceSheetDTO>()
.Ignore(x => x.SupplierName)
.Ignore(x => x.CurrencyName)
.ReverseMap();
}
}

29
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; }
/// <summary>
/// 价格单描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 货币ID
/// 供应商编号
/// </summary>
public Guid CurrencyId { get; set; }
[IgnoreUpdate]
public string SupplierCode { get; set; }
/// <summary>
/// 物料价格
/// 价格单描述
/// </summary>
public decimal MaterialPrice { get; set; }
public string Description { get; set; }
/// <summary>
/// 成品价格
/// 采购价格
/// </summary>
public decimal ProductPrice { get; set; }
public decimal PurchasePrice { get; set; }
///// <summary>
///// 货币ID
///// </summary>
//public Guid CurrencyId { get; set; }
///// <summary>
///// 物料价格
///// </summary>
//public decimal MaterialPrice { get; set; }
///// <summary>
///// 成品价格
///// </summary>
//public decimal ProductPrice { get; set; }
#region details handler
//public virtual void AddDetail(IGuidGenerator guidGenerator, PurchasePriceDetail detail)

49
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SalePrices/SalePriceSheet.cs

@ -7,35 +7,56 @@ namespace Win_in.Sfs.Basedata.Domain;
/// <summary>
/// 销售价格单
/// </summary>
public class SalePriceSheet : SfsBaseDataAggregateRootBase, IHasCode, IHasName
public class SalePriceSheet : SfsBaseDataAggregateRootBase
{
// public virtual ICollection<SalePriceDetail> SalePriceDetails { get; set; }
/// <summary>
/// 客户ID
/// 客户
/// </summary>
[IgnoreUpdate]
public Guid CustomerId { get; set; }
public string CustomerCode { get; set; }
/// <summary>
/// 编码
/// 物料号
/// </summary>
[IgnoreUpdate]
public string Code { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 价格单名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 价格单描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 货币ID
/// 销售价格
/// </summary>
public decimal SalePrice { get; set; }
// public virtual ICollection<SalePriceDetail> SalePriceDetails { get; set; }
/// <summary>
/// 客户ID
/// </summary>
public Guid CurrencyId { get; set; }
//[IgnoreUpdate]
//public Guid CustomerId { get; set; }
///// <summary>
///// 编码
///// </summary>
//[IgnoreUpdate]
//public string Code { get; set; }
///// <summary>
///// 价格单名称
///// </summary>
//public string Name { get; set; }
///// <summary>
///// 价格单描述
///// </summary>
//public string Description { get; set; }
///// <summary>
///// 货币ID
///// </summary>
//public Guid CurrencyId { get; set; }
#region details handler
//public virtual void AddDetail(IGuidGenerator guidGenerator, SalePriceDetail detail)

57
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/StdCostPrices/StdCostPriceSheet.cs

@ -8,33 +8,46 @@ namespace Win_in.Sfs.Basedata.Domain;
/// <summary>
/// 标准成本价格单-主表
/// </summary>
public class StdCostPriceSheet : SfsBaseDataAggregateRootBase, IHasCode, IHasName
public class StdCostPriceSheet : SfsBaseDataAggregateRootBase
{
[Display(Name = "编码")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
/// <summary>
/// 物品代码
/// </summary>
[IgnoreUpdate]
public string Code { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 价格单描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 标准成本价格
/// </summary>
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; }
}

3
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();
});
}
}

8
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();
});
}
}

9
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();
});
}
}

Loading…
Cancel
Save