using Newtonsoft.Json;
|
using SqlSugar;
|
using WIDESEA_Core.DB.Models;
|
|
namespace WIDESEA_Model.Models
|
{
|
/// <summary>
|
/// 表示生产过程中的料框属性和相关工序信息的模型。
|
/// </summary>
|
[SugarTable("ProductionModel", "料框属性")]
|
public class ProductionModel : BaseEntity
|
{
|
/// <summary>
|
/// 备 注:主键,自动增长
|
/// </summary>
|
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键,自动增长")]
|
public int Id { get; set; }
|
|
/// <summary>
|
/// 料框属性,用于标识料框的唯一属性。
|
/// </summary>
|
[SugarColumn(ColumnName = "TrayBarcodeProperty", ColumnDescription = "料框属性", IsNullable = false)]
|
public string TrayBarcodeProperty { get; set; }
|
|
/// <summary>
|
/// 工序集合,包含所有相关的工序代码。
|
/// </summary>
|
[SugarColumn(ColumnName = "ProcessCodes", ColumnDescription = "工序集合", IsNullable = false, Length = int.MaxValue)]
|
public string ProcessCodes { get; set; }
|
|
/// <summary>
|
/// 适用物料编码/工艺型号集合,包含所有相关的物料编码或工艺型号。
|
/// </summary>
|
[SugarColumn(ColumnName = "ProductTypes", ColumnDescription = "适用物料编码", IsNullable = false, Length = int.MaxValue)]
|
public string ProductTypes { get; set; }
|
|
/// <summary>
|
/// 托盘容量,表示料框可以承载的最大物品数量。
|
/// </summary>
|
[SugarColumn(ColumnName = "Capacity", ColumnDescription = "托盘容量", IsNullable = false)]
|
public int Capacity { get; set; }
|
|
/// <summary>
|
/// 获取或设置工序集合,反序列化JSON字符串为List<ProcessCodes>。
|
/// </summary>
|
[SugarColumn(IsIgnore = true)]
|
public List<ProcessCodesDTO> GetProcessCodes
|
{
|
get { return JsonConvert.DeserializeObject<List<ProcessCodesDTO>>(ProcessCodes); }
|
set { ProcessCodes = JsonConvert.SerializeObject(value); }
|
}
|
|
/// <summary>
|
/// 获取或设置适用物料编码/工艺型号集合,反序列化JSON字符串为List<string>。
|
/// </summary>
|
[SugarColumn(IsIgnore = true)]
|
public List<ProductTypesDTO> GetProductTypes
|
{
|
get { return JsonConvert.DeserializeObject<List<ProductTypesDTO>>(ProductTypes); }
|
set { ProductTypes = JsonConvert.SerializeObject(value); }
|
}
|
}
|
|
public class ProcessCodesDTO
|
{
|
/// <summary>
|
/// 工序
|
/// </summary>
|
public string ProcessCode { get; set; }
|
}
|
|
public class ProductTypesDTO
|
{
|
/// <summary>
|
/// 适用物料编码/工艺型号
|
/// </summary>
|
public string ProductType { get; set; }
|
}
|
}
|