using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Values; using Win_in.Sfs.Shared.Domain; namespace Win_in.Sfs.Basedata; #region 枚举及实体 /// /// 标签类别 /// public enum EnumLabelType { /// /// 空枚举 /// [Display(Name = "未定义")] None = 0, /// /// 采购标签 /// [Display(Name = "采购标签")] PurchaseLabel = 1, /// /// 生产标签 /// [Display(Name = "生产标签")] ProductionLabel = 2, /// /// 销售标签 /// [Display(Name = "销售标签")] SaleLabel = 3, /// /// 托盘标签 /// [Display(Name = "托盘标签")] PalletLabel = 4, /// /// 盘点标签 /// [Display(Name = "盘点标签")] CountLabel = 5, } public enum LabelStatus { /// /// 未定义 /// [Display(Name = "未定义")] None = 0, /// /// 有效 /// [Display(Name = "有效")] Enable = 1, /// /// 无效 /// [Display(Name = "无效")] Disable = 2 } /// /// 质量信息 /// public class QualityInfo : ValueObject { /// /// 质量等级 /// [MaxLength(SfsEfCorePropertyConst.CodeLength)] public string QLevel { get; set; } /// /// 质检文件 /// [MaxLength(SfsEfCorePropertyConst.CodeLength)] public string QualityFile { get; set; } protected override IEnumerable GetAtomicValues() { yield return QLevel; yield return QualityFile; } public QualityInfo(string qLevel, string qualityFile) { QLevel = qLevel; QualityFile = qualityFile; } public QualityInfo() { } } /// /// 采购信息 /// [Owned] public class PurchaseInfo : ValueObject { /// /// 供应商代码 /// [MaxLength(SfsEfCorePropertyConst.CodeLength)] public string SupplierCode { get; set; } /// /// 订单号 /// [MaxLength(SfsEfCorePropertyConst.CodeLength)] public string PoNumber { get; set; } /// /// 要货计划号 /// [MaxLength(SfsEfCorePropertyConst.CodeLength)] public string RpNumber { get; set; } /// /// 发货单号 /// [MaxLength(SfsEfCorePropertyConst.CodeLength)] public string AsnNumber { get; set; } protected override IEnumerable GetAtomicValues() { yield return SupplierCode; yield return PoNumber; yield return RpNumber; yield return AsnNumber; } public PurchaseInfo(string supplierCode, string poNumber, string rpNumber, string asnNumber) { SupplierCode = supplierCode; PoNumber = poNumber; RpNumber = rpNumber; AsnNumber = asnNumber; } public PurchaseInfo() { } } /// /// 生产信息 /// public class ProductionInfo : ValueObject { public ProductionInfo() { } public ProductionInfo(string prodLine, string team, string shift) { ProdLine = prodLine; Team = team; Shift = shift; } /// /// 生产线 /// [MaxLength(SfsEfCorePropertyConst.CodeLength)] public string ProdLine { get; set; } /// /// 班组 /// [MaxLength(SfsEfCorePropertyConst.CodeLength)] public string Team { get; set; } /// /// 班次 /// [MaxLength(SfsEfCorePropertyConst.CodeLength)] public string Shift { get; set; } protected override IEnumerable GetAtomicValues() { yield return ProdLine; yield return Team; yield return Shift; } } #endregion #region 接口 public interface IHasPurchaseInfo { /// /// 采购信息 /// public PurchaseInfo PurchaseInfo { get; set; } } public interface IHasProductionInfo { /// /// 生产信息 /// public ProductionInfo ProductionInfo { get; set; } } public interface IHasPurchaseInfoDto { /// /// 供应商编号 /// [Display(Name = "供应商编号")] public string SupplierCode { get; set; } public string PoNumber { get; set; } public string RpNumber { get; set; } public string AsnNumber { get; set; } } public interface IHasProductionInfoDto { public string ProdLine { get; set; } public string Team { get; set; } public string Shift { get; set; } } public interface IHasQualityInfo { /// /// 质量信息 /// public QualityInfo QualityInfo { get; set; } } public interface IHasQualityInfoDto { public string QLevel { get; set; } public string QualityFile { get; set; } } #endregion