服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-08-16 eec9f268552af1d0ce8c95312930770669f1cc18
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Tiger.Model.Entitys.MES.Position
{
    public class NewPositionInput
    {
        public string USER_CODE { get; set; }
        public string POST_CODE { get; set; }
    }
    public class ShiftPeriod
    {
        public MES_SHIFT_SYS ShiftSys { get; set; }
        public MES_SHIFT Shift { get; set; }
        public MES_SHIFT_PRD Period { get; set; }
    }
 
    public class WoInput : ApiInput
    {
        public string OrderNo { get; set; }
    }
 
    public class SubmitInput : ApiInput
    {
        /// <summary>
        /// 客户端显示的语言
        /// </summary>
        public string Locale {  get; set; }
        /// <summary>
        /// 当前操作的工步ID,如果未指定则留空
        /// </summary>
        public string CurStepID { get; set; }
        /// <summary>
        /// 当前扫描的内容,不限于条码
        /// </summary>
        public string SN { get; set; }
        /// <summary>
        /// 当前操作提交的不良代码,没有则留空
        /// </summary>
        public string DFT_CODE { get; set; }
        /// <summary>
        /// 当前操作需要提交的数据
        /// </summary>
        public string Data { get; set; }
    }
 
    public class SubmitOutput
    {
        /// <summary>
        /// 整个工序操作是否完成
        /// </summary>
        public bool IsFinished { get; set; } = false;
        /// <summary>
        /// 短消息
        /// </summary>
        public ShortMessage ShortMsg { get; set; }
        /// <summary>
        /// 当前操作的工单对象
        /// </summary>
        public BIZ_MES_WO CurWO { get; set; }
        /// <summary>
        /// 当前操作的工单批次对象
        /// </summary>
        public BIZ_MES_WO_BATCH CurBatch { get; set; }
        /// <summary>
        /// 当前操作的节点名称
        /// </summary>
        public string NodeName { get; set; }
        /// <summary>
        /// 当前操作的行为名称,如果是不是行为,否则留空
        /// </summary>
        public string ActionName { get; set; }
        /// <summary>
        /// 当前操作的行为的类名,如果是不是行为,否则留空
        /// </summary>
        public string ActionType { get; set; }
        /// <summary>
        /// 下一个操作的工步ID
        /// </summary>
        public string NextStepID { get; set; }
        /// <summary>
        /// 当前操作返回的数据
        /// </summary>
        public object Data { get; set; }
        /// <summary>
        /// 工序信息
        /// </summary>
        public OperInfo OperInfo { get; set; }
 
    }
 
    public class DefectOutput
    {
        public string DFTG_CODE { get; set; }
        public string DFTG_NAME { get; set; }
        public string DFT_CODE { get; set; }
        public string DFT_NAME { get; set; }
        public int DFT_LEVEL { get; set; }
    }
 
    public class PackingActionInput
    {
        /// <summary>
        /// 包装行为当前执行的操作代码,包括:<br/>
        /// Scan:扫码,扫描当前包装层级的条码<br/>
        /// Print:打印,打印当前包装层级的标签<br/>
        /// Complete:完成,完成全部包装<br/>
        /// Weighing:称重,完成包装后对整个包装成称重<br/>
        /// </summary>
        public string ExecCode { get; set; }
        /// <summary>
        /// 客户端是否完成当前操作
        /// </summary>
        public bool IsFinish { get; set; }
        /// <summary>
        /// 当前操作的包装层级
        /// </summary>
        public int PkgLevel { get; set; }
        /// <summary>
        /// 当前操作的包装层级的标签条码
        /// </summary>
        public string PkgSN { get; set; }
        /// <summary>
        /// 当前操作的包装层级的重量信息
        /// </summary>
        public WeightInfo WeightInfo { get; set; }
    }
 
    public class PackingActionOutput
    {
        public WipPkg PkgInfo { get; set; }
        /// <summary>
        /// 包装行为当前执行的操作代码,包括:<br/>
        /// Scan:扫码,扫描当前包装层级的条码<br/>
        /// Print:打印,打印当前包装层级的标签<br/>
        /// Complete:完成,已保存包装数据<br/>
        /// Weighing:称重,完成包装后对整个包装成称重<br/>
        /// </summary>
        public string ExecCode { get; set; }
        /// <summary>
        /// 当前操作的包装层级
        /// </summary>
        public int PkgLevel { get; set; }
        /// <summary>
        /// 当前需要打印的包装层级的标签信息
        /// </summary>
        public BAS_LABEL_TEMP PrintLable { get; set; }
    }
 
    /// <summary>
    /// 在线包装
    /// </summary>
    public class WipPkg
    {
        public string RULE_CODE { get; set; }
        public string RULE_NAME { get; set; }
        public WipPkgItem Item { get; set; }
        public bool IsFinished => Item.IsFinished;
    }
 
    /// <summary>
    /// 在线包装明细
    /// </summary>
    public class WipPkgItem
    {
        public string PKG_CODE { get; set; }
        public string PKG_NAME { get; set; }
        public string IS_MIN_PKG { get; set; }
        public int PKG_LEVEL { get; set; }
        public int PKG_QTY { get; set; }
        public string LABEL_CODE { get; set; }
        public MES_WIP_PKG Package { get; set; }
        public bool IsFinished { get; set; } = false;
        public List<WipPkgItem> Items { get; set; } = new List<WipPkgItem>();
        
    }
 
    /// <summary>
    /// 上料设置
    /// </summary>
    public class AssemblySetting
    {
        public string ITEM_CODE { get; set; }
        public string RULE_CODE { get; set; }
        /// <summary>
        /// 是否批次物料
        /// </summary>
        public bool IsBatchItem { get; set; }
        /// <summary>
        /// 上料数量
        /// </summary>
        public int QTY { get; set; }
    }
 
    /// <summary>
    /// 上料信息
    /// </summary>
    public class AssemblyInfo
    {
        public MES_WIP_DATA Product { get; set; }
        public bool IsFinished => !Items.Any(q => !q.IsFinished);
        public List<AssemblyItem> Items { get; set; } = new List<AssemblyItem>();
    }
 
    /// <summary>
    /// 上料信息明细
    /// </summary>
    public class AssemblyItem
    {
        public BAS_ITEM ItemInfo { get; set; }
        public string RuleCode { get; set; }
        public int LoadQty { get; set; }
        /// <summary>
        /// 是否批次物料
        /// </summary>
        public bool IsBatchItem { get; set; }
        public List<MES_WIP_ASSY> Records { get; set; } = new List<MES_WIP_ASSY>();
        public bool IsFinished { get; set; } = false;
    }
 
    /// <summary>
    /// 称重信息
    /// </summary>
    public class WeightInfo
    {
        public double Weight { get; set; }
        public string Unit { get; set; }
    }
 
    /// <summary>
    /// 工序信息
    /// </summary>
    public class OperInfo
    {
        public string NextNode { get; set; } = "   —   ";
        public string CurNode { get; set; } = "   —   ";
        public int InputQty { get; set; } = 0;
    }
}