huangxiaoqiang
2025-05-19 051aa9a0e7f58af6665fb4526e42cf8060fbaa05
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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; }
    }
}