using Admin.NET.Plugin.AiDOP.Entity.S0.Supply;
namespace Admin.NET.Plugin.AiDOP.Dto.S0.Supply;
/// 供应商主数据启停(SuppMaster / IsActive)
public class AdoS0SuppMasterToggleActiveDto
{
public bool IsActive { get; set; }
}
public class AdoS0SuppMasterQueryDto
{
public long? CompanyRefId { get; set; }
public long? FactoryRefId { get; set; }
public string? DomainCode { get; set; }
/// 同时匹配供应商编码、简称
public string? Keyword { get; set; }
public string? Supp { get; set; }
public string? SortName { get; set; }
public string? Address { get; set; }
public string? Contact { get; set; }
public string? Position { get; set; }
public string? ContactInfo { get; set; }
public string? CertificationLevel { get; set; }
public string? CrTerms { get; set; }
public string? Curr { get; set; }
public string? Type { get; set; }
public bool? TaxIn { get; set; }
public string? TaxClass { get; set; }
public string? PurContact { get; set; }
public bool? IsActive { get; set; }
public int Page { get; set; } = 1;
public int PageSize { get; set; } = 20;
}
public class AdoS0SuppMasterUpsertDto
{
[Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
public long CompanyRefId { get; set; }
[Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
public long FactoryRefId { get; set; }
[MaxLength(50)]
public string? DomainCode { get; set; }
[Required(ErrorMessage = "供应商编码不能为空")]
[MaxLength(100)]
public string Supp { get; set; } = string.Empty;
[MaxLength(200)]
public string? SortName { get; set; }
[MaxLength(500)]
public string? Address { get; set; }
[MaxLength(200)]
public string? Contact { get; set; }
[MaxLength(200)]
public string? Position { get; set; }
[MaxLength(200)]
public string? ContactInfo { get; set; }
[MaxLength(100)]
public string? CertificationLevel { get; set; }
[MaxLength(100)]
public string? PurContact { get; set; }
[MaxLength(50)]
public string? CrTerms { get; set; }
[MaxLength(20)]
public string? Curr { get; set; }
[MaxLength(50)]
public string? Type { get; set; }
public bool TaxIn { get; set; } = true;
[MaxLength(50)]
public string? TaxClass { get; set; }
public int? APStartDay1 { get; set; }
public int? APEndDay1 { get; set; }
public int? APStartDay2 { get; set; }
public int? APEndDay2 { get; set; }
[MaxLength(1000)]
public string? Remark { get; set; }
public bool IsActive { get; set; } = true;
[MaxLength(100)]
public string? CreateUser { get; set; }
[MaxLength(100)]
public string? UpdateUser { get; set; }
}
public class AdoS0CategoryLeadTimeQueryDto
{
public long? CompanyRefId { get; set; }
public long? FactoryRefId { get; set; }
public string? DomainCode { get; set; }
public string? CategoryCode { get; set; }
public string? OwnerApplication { get; set; }
public string? Keyword { get; set; }
public bool? IsActive { get; set; }
public int Page { get; set; } = 1;
public int PageSize { get; set; } = 20;
}
public class AdoS0CategoryLeadTimeUpsertDto
{
[Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
public long CompanyRefId { get; set; }
[Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
public long FactoryRefId { get; set; }
[MaxLength(50)]
public string? DomainCode { get; set; }
[Required(ErrorMessage = "品类编码不能为空")]
[MaxLength(100)]
public string CategoryCode { get; set; } = string.Empty;
[MaxLength(200)]
public string? CategoryName { get; set; }
[Required(ErrorMessage = "物料属性不能为空")]
[MaxLength(100)]
public string OwnerApplication { get; set; } = string.Empty;
[Range(0, int.MaxValue, ErrorMessage = "采购前置期不能为负")]
public int LeadTimeDays { get; set; }
[MaxLength(500)]
public string? Remarks { get; set; }
public bool IsActive { get; set; } = true;
[MaxLength(100)]
public string? CreateUser { get; set; }
[MaxLength(100)]
public string? UpdateUser { get; set; }
}
public class AdoS0CategoryLeadTimeToggleActiveDto
{
public bool IsActive { get; set; }
}
public class AdoS0SrmPurchaseQueryDto
{
public long? CompanyRefId { get; set; }
public long? FactoryRefId { get; set; }
public string? DomainCode { get; set; }
/// 物料编码 / 名称关键字
public string? Keyword { get; set; }
public string? SupplierType { get; set; }
/// 启用筛选:true=启用集合 / false=停用集合 / null=不过滤。对外统一 bool?,与 DB varchar 口径由转换层桥接。
public bool? IsActive { get; set; }
public string? SupplierName { get; set; }
public string? SupplierNumber { get; set; }
public long? CurrencyType { get; set; }
public int Page { get; set; } = 1;
public int PageSize { get; set; } = 20;
}
public class AdoS0SrmPurchaseUpsertDto
{
// 放宽 1→0:srm_purchase 历史货源记录存在 company/factory=0(未组织化)数据,编辑保存需放行 0;
// 如后续要求强制组织维度,改回 Range(1, long.MaxValue) 即可。
[Range(0, long.MaxValue, ErrorMessage = "公司不能为空")]
public long CompanyRefId { get; set; }
[Range(0, long.MaxValue, ErrorMessage = "工厂不能为空")]
public long FactoryRefId { get; set; }
[MaxLength(50)]
public string? DomainCode { get; set; }
[Range(1, long.MaxValue, ErrorMessage = "物料不能为空")]
public long IcitemId { get; set; }
[MaxLength(200)]
public string? IcitemName { get; set; }
[MaxLength(50)]
public string? SupplierType { get; set; }
/// 启用状态:对外 bool?(true/false/null),落库经转换层编码为“是/否”/null。
public bool? IsActive { get; set; }
[Range(1, long.MaxValue, ErrorMessage = "供应商不能为空")]
public long SupplierId { get; set; }
[MaxLength(200)]
public string? SupplierName { get; set; }
[MaxLength(100)]
public string? SupplierNumber { get; set; }
public decimal? OrderPrice { get; set; }
public long? CurrencyType { get; set; }
public decimal? Taxrate { get; set; }
public decimal? Tariff { get; set; }
public decimal? Freight { get; set; }
[MaxLength(200)]
public string? PriceTerms { get; set; }
public DateTime? EffectiveDate { get; set; }
public DateTime? ExpiringDate { get; set; }
public decimal? QuotaRate { get; set; }
public decimal? LeadTime { get; set; }
public decimal? QtyMin { get; set; }
public decimal? PackagingQty { get; set; }
[MaxLength(100)]
public string? OrderRectorName { get; set; }
[MaxLength(100)]
public string? OrderRectorNum { get; set; }
public int IsRequireGoods { get; set; }
[MaxLength(100)]
public string? CreateUser { get; set; }
[MaxLength(100)]
public string? UpdateUser { get; set; }
}
///
/// 货源清单对外输出 DTO(列表/详情/写入回执)。isActive 显式归一为 bool?,
/// 禁止把实体 is_active 字符串直接暴露给前端;字段集合对齐前端 S0SrmPurchaseRow。
///
public class AdoS0SrmPurchaseDto
{
public long Id { get; set; }
public long CompanyRefId { get; set; }
public long FactoryRefId { get; set; }
public string? DomainCode { get; set; }
public long IcitemId { get; set; }
public string? IcitemName { get; set; }
public string? SupplierType { get; set; }
/// 启用状态:true=启用 / false=停用 / null=未知(源字符串无法判定)。
public bool? IsActive { get; set; }
public long SupplierId { get; set; }
public string? SupplierName { get; set; }
public string? SupplierNumber { get; set; }
public decimal? OrderPrice { get; set; }
public long? CurrencyType { get; set; }
public decimal? Taxrate { get; set; }
public decimal? Tariff { get; set; }
public decimal? Freight { get; set; }
public string? PriceTerms { get; set; }
public DateTime? EffectiveDate { get; set; }
public DateTime? ExpiringDate { get; set; }
public decimal? QuotaRate { get; set; }
public decimal? LeadTime { get; set; }
public decimal? QtyMin { get; set; }
public decimal? PackagingQty { get; set; }
public string? OrderRectorName { get; set; }
public string? OrderRectorNum { get; set; }
public int IsRequireGoods { get; set; }
// 列表展示派生字段(由 Controller 左联物料主数据补齐)
public string? MaterialCode { get; set; }
public string? Model { get; set; }
public string? Unit { get; set; }
public string? ItemTypeLabel { get; set; }
public string? Icitem { get; set; }
public string? Supplier { get; set; }
public string? CreateUser { get; set; }
public DateTime CreateTime { get; set; }
public string? UpdateUser { get; set; }
public DateTime? UpdateTime { get; set; }
/// 由实体映射为输出 DTO(is_active 字符串经 归一)。
public static AdoS0SrmPurchaseDto FromEntity(AdoS0SrmPurchase e) => new()
{
Id = e.Id,
CompanyRefId = e.CompanyRefId,
FactoryRefId = e.FactoryRefId,
DomainCode = e.DomainCode,
IcitemId = e.IcitemId,
IcitemName = e.IcitemName,
SupplierType = e.SupplierType,
IsActive = AdoS0SrmPurchaseIsActive.Parse(e.IsActive),
SupplierId = e.SupplierId,
SupplierName = e.SupplierName,
SupplierNumber = e.SupplierNumber,
OrderPrice = e.OrderPrice,
CurrencyType = e.CurrencyType,
Taxrate = e.Taxrate,
Tariff = e.Tariff,
Freight = e.Freight,
PriceTerms = e.PriceTerms,
EffectiveDate = e.EffectiveDate,
ExpiringDate = e.ExpiringDate,
QuotaRate = e.QuotaRate,
LeadTime = e.LeadTime,
QtyMin = e.QtyMin,
PackagingQty = e.PackagingQty,
OrderRectorName = e.OrderRectorName,
OrderRectorNum = e.OrderRectorNum,
IsRequireGoods = e.IsRequireGoods,
MaterialCode = e.MaterialCode,
Model = e.Model,
Unit = e.Unit,
ItemTypeLabel = e.ItemTypeLabel,
Icitem = e.Icitem,
Supplier = e.Supplier,
CreateUser = e.CreateUser,
CreateTime = e.CreateTime,
UpdateUser = e.UpdateUser,
UpdateTime = e.UpdateTime,
};
}
public class AdoS0MaterialPlanCycleQueryDto
{
public long? CompanyRefId { get; set; }
public long? FactoryRefId { get; set; }
public string? DomainCode { get; set; }
public string? OrderType { get; set; }
public string? Keyword { get; set; }
public bool? IsActive { get; set; }
public int Page { get; set; } = 1;
public int PageSize { get; set; } = 20;
}
public class AdoS0MaterialPlanCycleUpsertDto
{
[Range(1, long.MaxValue, ErrorMessage = "公司不能为空")]
public long CompanyRefId { get; set; }
[Range(1, long.MaxValue, ErrorMessage = "工厂不能为空")]
public long FactoryRefId { get; set; }
[MaxLength(50)]
public string? DomainCode { get; set; }
/// 订单类型;留空表示默认/不限。
[MaxLength(100)]
public string? OrderType { get; set; }
[Range(0, int.MaxValue, ErrorMessage = "标准时长不能为负")]
public int StdHours { get; set; }
[MaxLength(500)]
public string? Remarks { get; set; }
public bool IsActive { get; set; } = true;
[MaxLength(100)]
public string? CreateUser { get; set; }
[MaxLength(100)]
public string? UpdateUser { get; set; }
}
public class AdoS0MaterialPlanCycleToggleActiveDto
{
public bool IsActive { get; set; }
}