SServerManager.cs
27.5 KB
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
namespace OnlineStore.DeviceLibrary
{
public class SServerManager
{
#region 存储机构使用的API
private static string api_communication = "service/store/communication"; //流水线状态通信接口
public static string GetPostApi(string host)
{
if (host == "")
{
host = ConfigAppSettings.GetValue(Setting_Init.http_server);
}
if (!host.StartsWith("http://"))
{
host = "http://" + host;
}
if (!host.EndsWith("/"))
{
host = host + "/";
}
return host + api_communication;
}
internal static string GetShelfIDByLoc(int rfidLoc, List<string> shelfPosList)
{
string shelfId = "";
if (rfidLoc.Equals(-1))
{
shelfId = shelfPosList[0];
}
if (rfidLoc >= 1 && rfidLoc <= 8 && rfidLoc <= shelfPosList.Count)
{
shelfId = shelfPosList[rfidLoc - 1];
}
return shelfId;
}
#endregion
//http://localhost/myproject/service/store/emptyPosForPutin
private static string Addr_PosForPutin = "/service/store/emptyPosForPutin";
/// <summary>
/// 屏蔽库位接口
/// </summary>
private static string Addr_disabledPos = "/service/store/disabledPos";
/// <summary>
/// 屏蔽库位
/// </summary>
/// <param name="deviceName"></param>
/// <param name="barcode"></param>
/// <param name="poid"></param>
/// <returns></returns>
public static string DisablePos(string deviceName, string barcode, string poid)
{
string msg = "";
try
{
if (String.IsNullOrEmpty(barcode))
{
return msg;
}
if (string.IsNullOrEmpty(serverAddr))
{
LogUtil.error(deviceName + "DisablePos [" + barcode + "] [" + poid + "] :未找到服务器地址");
return msg;
}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("posId", poid);//posId:库位号
paramMap.Add("barcode", barcode); // barcode = 料盘的条码
string server = GetAddr(Addr_disabledPos, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("DisablePos " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
// 返回: { "code": 0, "msg":"ok", "data":""}
ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr);
if (serverResult == null)
{
msg = deviceName + "DisablePos【 " + barcode + "】【" + poid + "】没有收到服务器反馈";
}
else if (serverResult.code.Equals(0).Equals(false))
{
// code: 0为正常,其他为异常, msg: 消息, data: 为空
msg = deviceName + " DisablePos【 " + barcode + "】【" + poid + "】:" + "[" + serverResult.code + "]" + serverResult.msg;
}
if (!msg.Equals(""))
{
LogUtil.error(msg);
}
}
catch (Exception ex)
{
LogUtil.error(deviceName + " ", ex);
}
return msg;
}
/// <summary>
/// 1 皮带线扫码后调用,用于获取尺寸后升起气缸
/// 地址: /rest/api/qisda/device/getSize
/// </summary>
// private static string Addr_getSize = "/rest/api/qisda/device/getSize";
/// <summary>
/// 2 料盘流转位置信息更新
/// 地址: /rest/api/qisda/device/updateLocInfo
/// </summary>
private static string Addr_updateLocInfo = "/rest/api/qisda/device/updateLocInfo";
///// <summary>
///// 3 放入料架(A,B,C,D)后调用,根据返回值决定当前料架是否放满,以及后续是否还有任务
//// 地址: /rest/api/qisda/device/putShelfFinished
///// </summary>
//private static string Addr_putShelfFinished = "/rest/api/qisda/device/putShelfFinished";
private static string serverAddr = ConfigAppSettings.GetValue(Setting_Init.http_server);
private static string GetAddr(string addr, Dictionary<string, string> paramsMap)
{
if (serverAddr.EndsWith("/"))
{
serverAddr = serverAddr.Substring(0, serverAddr.Length - 1);
}
string path = serverAddr + addr.Trim() + "?";
foreach (string paramName in paramsMap.Keys)
{
string par = System.Web.HttpUtility.UrlEncode(paramsMap[paramName], System.Text.Encoding.UTF8);
path += paramName + "=" + par + "&";
}
path = path.Substring(0, path.Length - 1);
return path;
}
//## 100 循环获取库位。服务器超时:循环获取库位
private static string spiltStr = "##";
public static string ProcessCodeList(List<string> codeList)
{
string codeStr = "";
List<string> list = new List<string>();
foreach (string str in codeList)
{
if (list.Contains(str.Trim()) || String.IsNullOrEmpty(str.Trim()))
{
continue;
}
codeStr = codeStr + str.Trim() + spiltStr;
}
return codeStr;
}
private static string Addr_cancelPutInTask = "/service/store/cancelPutInTask";
public static string cancelPutInTask(string deviceName, string barcode)
{
string msg = "";
try
{
if (string.IsNullOrEmpty(serverAddr))
{
LogUtil.error(deviceName + "cancelPutInTask [" + barcode + "] :未找到服务器地址");
return msg;
}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("barcode", barcode);
string server = GetAddr(Addr_cancelPutInTask, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info(deviceName + "cancelPutInTask " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
CancelData data = JsonHelper.DeserializeJsonToObject<CancelData>(resultStr);
if (data == null)
{
return msg = deviceName + " cancelPutInTask【 " + barcode + "】 没有收到服务器反馈";
}
else if (data.code.Equals(0).Equals(false))
{
return msg = deviceName + " cancelPutInTask【 " + barcode + "】 :" + data.msg;
}
return "";
}
catch (Exception ex)
{
LogUtil.error(deviceName + " " + ex.ToString());
}
return msg;
}
public static GetPosResult GetPosId(string deviceName, List<string> codeList, int height, int width, string rfid, string lastPosId,int totalHeight)
{
GetPosResult result = new GetPosResult();
try
{
string codeStr = "";
List<string> list = new List<string>();
foreach (string str in codeList)
{
if (list.Contains(str.Trim()) || String.IsNullOrEmpty(str.Trim()))
{
continue;
}
list.Add(str.Trim());
string code = "=" + width + "x" + height + "=" + str.Trim();
codeStr = codeStr + code + spiltStr;
}
codeStr = CodeManager.ReplaceCode(codeStr);
//判断是否不连接服务器
if (string.IsNullOrEmpty(serverAddr))
{
LogUtil.error(deviceName + "GetPosId[" + codeStr + "][" + width + "][" + height + "]:未找到服务器地址 ");
result.Msg = "未找到服务器地址";
result.Param = InOutPosInfo.NewNgPos(codeStr, "", width, height, "");
return result;
}
string addHeight = totalHeight.ToString();
//http://localhost/myproject/service/store/emptyPosForPutin
// 参数:cids: 多个 cid
//code: 条码内容
Dictionary<string, string> paramMap = new Dictionary<string, string>
{
{ "cids", StoreManager.Config.CID },
{ "code", codeStr },
{ "addHeight", addHeight },
{ ParamDefine.rfid, rfid },
{ ParamDefine.lastPosId, lastPosId }
};
string server = GetAddr(Addr_PosForPutin, paramMap);
DateTime startTime = DateTime.Now;
LogUtil.info(deviceName + "【" + rfid + "】【 " + codeStr + $"】【{addHeight}】【" + lastPosId + "】 ,获取入库库位:");
string resultStr = HttpHelper.Post(server, "", Encoding.UTF8, 10000, out result.IsTimeOut);
LogUtil.info(deviceName + "CodeReceived " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
if (result.IsTimeOut)
{
return result;
}
//{"result":"0","msg":"","pos":"11#AC1_18_4_28","barcode":"R506072019102200414","cid":"line-ac-11"}
ForPutinData serverResult = JsonHelper.DeserializeJsonToObject<ForPutinData>(resultStr);
if (serverResult == null)
{
result.Msg = deviceName + " 【" + codeStr + "】结果:没有收到服务器反馈,调用 cancelPutInTask ";
cancelPutInTask(deviceName, codeStr);
result.Param = InOutPosInfo.NewNgPos(codeStr, "", width, height, "没有收到服务器反馈");
result.Param.rfid = rfid;
result.Param.IsNG = true;
return result;
}
else if ((!string.IsNullOrEmpty(serverResult.msg)) && serverResult.result.Equals(98))
{
result.Result = serverResult.result;
result.Msg = "";
bool cutReel = serverResult.cutReel.ToLower().Equals("true");
bool urgentReel = serverResult.urgentReel.ToLower().Equals("true");
bool smallReel = serverResult.smallReel.ToLower().Equals("true");
int rfidloc = FormUtil.GetIntValue(serverResult.rfidLoc);
int pH = FormUtil.GetIntValue(serverResult.plateH);
int pW = FormUtil.GetIntValue(serverResult.plateW);
result.Param = new InOutPosInfo(serverResult.barcode, serverResult.posId, pW, pH, urgentReel, cutReel, smallReel, serverResult.rfid, rfidloc);
LogUtil.error(deviceName + " 【" + codeStr + "】结果入库NG:收到出库信息: " + result.Param.ToStr() + " ");
result.Msg = "收到出库信息[" + serverResult.barcode + "][" + serverResult.posId + "] ";
cancelPutInTask(deviceName, codeStr);
result.Param = InOutPosInfo.NewNgPos(codeStr, "", width, height, "收到出库信息[" + serverResult.barcode + "][" + serverResult.posId + "]");
result.Param.rfid = rfid;
result.Param.IsNG = true;
return result;
}
else if ((!string.IsNullOrEmpty(serverResult.msg)) || serverResult.result.Equals(0).Equals(false))
{
result.Result = serverResult.result;
//result.Msg = deviceName + " 【" + codeStr + "】结果:" + serverResult.msg;
result.Msg = serverResult.msg;
result.Param = InOutPosInfo.NewNgPos(codeStr, "", width, height, serverResult.msg);
result.Param.rfid = rfid;
return result;
}
result.Result = serverResult.result;
if (!serverResult.pos.Equals(""))
{
// 库位号格式:
//例:05AA03040102
//05:第1和第2位表示料仓编号,01 - 08
//AA:第3和第4位存储机构A面或B面,AA或者BB
//03:第5和第6位表示抽屉在第几行
//04:第7和第8位表示抽屉在第几列
//01:第9和第10位表示在抽屉中的第几行
//02:第11和第12位表示在抽屉中的第几列
string posId = serverResult.pos;
//根据库位号查找移栽
// 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败
result.Param = new InOutPosInfo(serverResult.barcode, posId, width, height);
result.Param.rfid = rfid;
BoxPosition position = CSVPositionReader<BoxPosition>.GetPositon(posId);
if (position == null)
{
result.Param.IsNG = true;
result.Param.NgMsg = "未找到库位[" + position + "]";
result.Msg = "未找到库位: " + result.Param.ToStr() + " ,入库失败";
LogUtil.error(deviceName + ("收到服务器入库命令 " + ",未找到库位: " + result.Param.ToStr() + " ,入库失败!"));
return result;
}
else
{
LogUtil.info(deviceName + "收到入库命令: " + result.Param.ToStr() + " ");
return result;
}
}
}
catch (Exception ex)
{
LogUtil.error(deviceName + " ", ex);
}
return result;
}
public static int GetOutTaskCount(string hSerial)
{
try
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("cid", StoreManager.Config.CID);
paramMap.Add("hSerial", hSerial);
string server = GetAddr("/service/store/outTaskCount", paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "", Encoding.UTF8, 10000, out bool IsTimeOut);
LogUtil.info("GetoutTaskCount " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
if (IsTimeOut)
{
return 998;
}
if (int.TryParse(resultStr, out int r))
return r;
}
catch (Exception ex)
{
LogUtil.error("GetoutTaskCount error ", ex);
return 997;
}
return 999;
}
private static string Addr_InstorePosCheck = "/service/store/posQuery";
/// <summary>
/// 查询入库是否完成
/// </summary>
/// <param name="posName"></param>
/// <param name="barcode"></param>
/// <returns></returns>
public static bool InstorePosCheck(string posName, string barcode)
{
try
{
if (string.IsNullOrEmpty(serverAddr))
{
LogUtil.error("InstorePosCheck [" + barcode + "] :未找到服务器地址");
return false;
}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("posName", posName);
paramMap.Add("barcode", barcode);
string server = GetAddr(Addr_InstorePosCheck, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("InstorePosCheck " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
if (data == null)
{
LogUtil.error(" InstorePosCheck【 " + barcode + "】 没有收到服务器反馈");
return false;
}
else if (data.code.Equals(0).Equals(true))
{
return true;
}
}
catch (Exception ex)
{
LogUtil.error($"InstorePosCheck:{posName},{barcode}", ex);
}
return false;
}
//14.异常看板
// > 地址:
//>>/ rest / api / qisda / device / updateDeviceAlarmMsg
// >
// > 参数:
//>> deviceAlarmList : 异常列表Json字符串 `[{"name":"移栽5", "msgKey":"line.move5.timeOut", "msgValue":"运动超时"},{"name":"移栽4", "msgKey":"line.move4.timeOut", "msgValue":"误差过大"}]`
//>>>name : 异常位置名称
//>>>msgKey : 异常信息唯一标识
//>>>msgValue : 异常信息
//>
//> 返回:
//>>` {"code":0,"msg":"ok","data":""}`
//>>
//>> - code: 0为正常,其他为异常,
// >> - msg:消息,
// >> - data:
private static string Addr_updateDeviceAlarmMsg = "/rest/api/qisda/device/updateDeviceAlarmMsg";
public static string updateDeviceAlarmMsg(List<AlarmMsg> msgList)
{
string msg = "";
try
{
if (string.IsNullOrEmpty(serverAddr))
{
return msg;
}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
string msgListStr = JsonHelper.SerializeObject(msgList);
paramMap.Add("deviceAlarmList", msgListStr);
string server = GetAddr(Addr_updateDeviceAlarmMsg, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "", 5000);
LogUtil.debug("updateDeviceAlarmMsg " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
RfidData data = JsonHelper.DeserializeJsonToObject<RfidData>(resultStr);
if (data == null)
{
return msg = " updateDeviceAlarmMsg 没有收到服务器反馈";
}
else if (data.code.Equals(0).Equals(false))
{
return msg = " updateDeviceAlarmMsg 【" + server + "】【" + resultStr + "】" + data.msg;
}
return "";
}
catch (Exception ex)
{
LogUtil.error(" updateDeviceAlarmMsg Error: " + ex.ToString());
}
return msg;
}
private static string Addr_ShelfFinish = "/rest/api/qisda/device/putShelfFinished";
public static ShelfTaskInfo ShelfFinish(string rfid, string barcode = "", string rfidLoc = "0", string robotIndex = "1")
{
LogUtil.info($"ShelfFinish rifd【{rfid}】barcode【{barcode}】rfidLoc【{rfidLoc}】robotIndex【{robotIndex}】");
//SetBoxStatus(DeviceStatus.OutStoreEnd, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId, MoveInfo.MoveParam.PosInfo.barcode);
ShelfTaskInfo task = new ShelfTaskInfo();
task.rfid = rfid;
return task;
// DateTime startTime = DateTime.Now;
// try
// {
// string api = Addr_ShelfFinish;
// Dictionary<string, string> paramMap = new Dictionary<string, string>();
// paramMap.Add("barcode", barcode);
// paramMap.Add("rfid", rfid);
// paramMap.Add("rfidLoc", rfidLoc);
// paramMap.Add("robotIndex", robotIndex);
// //string url = httpAddr + api + "?barcode=" + barcode + "&rfid=" + rfid + "&rfidLoc=" + rfidLoc + "&robotIndex=" + robotIndex;
// string url = GetAddr(api, paramMap);
// LogUtil.debug("http :URL:" + url);
// string json = HttpHelper.Post(url, "", 10000);
// if (barcode != "")
// {
// LogUtil.info("http :URL:" + url + " :Response:" + json + " 耗时[" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "]");
// }
// else
// {
// LogUtil.debug("http :URL:" + url + " :Response:" + json);
// }
// if (string.IsNullOrWhiteSpace(json)) return task;
// //行 2234: [2021 - 04 - 07 15:09:31,412][9]INFO - http :URL:
// //http://192.168.100.14/myproject/rest/api/qisda/device/putShelfFinished?barcode=640253A*34005600000309*QG00006*5000*23C4&rfid=F103&rfidLoc=8&robotIndex=1 :
// //Response:{"code":0,"msg":"ok","data":{"smallTask":"0","cutPackageTask":"0","packageTask":"0","bigTask":"0","smallEmpty":"0","bigEmpty":"5","packageEmpty":"0","rfid":"F103","usedRfidList":"F106,F105,F103","barcode":"640253A*34005600000309*QG00006*5000*23C4","cutTask":"0"}} 耗时[00:00:00.1]
// JavaScriptSerializer serializer = new JavaScriptSerializer();
// Dictionary<string, object> obj = (Dictionary<string, object>)serializer.DeserializeObject(json);
// if (!obj.TryGetValue("code", out object value)) return task;
// if (value.ToString() != "0")
// {
// if (obj.TryGetValue("msg", out value))
// LogUtil.error("http" + api + ": " + value.ToString());
// return task;
// }
// if (!obj.TryGetValue("data", out value)) return task;
// Dictionary<string, object> dict = (Dictionary<string, object>)value;
// if (dict == null)
// {
// LogUtil.info("http" + api + ": data=null");
// return task;
// }
// if (dict.TryGetValue("bigEmpty", out value))
// int.TryParse(value.ToString(), out task.bigEmpty);
// if (dict.TryGetValue("smallEmpty", out value))
// int.TryParse(value.ToString(), out task.smallEmpty);
// if (dict.TryGetValue("usedRfidList", out value))
// task.usedRfidList = value.ToString();
// }
// catch (Exception ex)
// {
// LogUtil.error("http error : " + ex.ToString());
// }
// return task;
}
}
public class ShelfTaskInfo
{
public string rfid = "";
public int bigEmpty = -1;
public int smallEmpty = -1;
//public int packageEmpty = -1;
public string usedRfidList = "";
public bool IsValid()
{
if (bigEmpty != -1 && smallEmpty != -1)
{
return true;
}
return false;
}
public string ToStr()
{
return " " + rfid + "剩余位置: 小料=" + smallEmpty + ",大料=" + bigEmpty + ",已使用料架=" + usedRfidList + " ";
}
}
public class AlarmMsg
{
//>>>name : 异常位置名称
public string name = "";
//>>>msgKey : 异常信息唯一标识
public string msgKey = "";
//>>>msgValue : 异常信息
public string msgValue = "";
public AlarmMsg(string n, string key, string value)
{
this.name = n;
this.msgKey = key;
this.msgValue = value;
}
}
public class GetPosResult
{
public string Msg = "";
/// <summary>
/// 0=成功,98=此盘为出库盘。99:暂时不能入库,需要重新获取库位。100:服务器需要更新,需要重新获取库位
/// </summary>
public int Result = 0;
/// <summary>
/// 获取超时,需要重新获取库位
/// </summary>
public bool IsTimeOut = false;
public InOutPosInfo Param = null;
}
public class RfidData
{
//{"code":0,"msg":"ok","data":"7"}
public int code { get; set; }
public string msg { get; set; }
public Dictionary<string, string> data { get; set; }
}
public class CancelData
{
//{"code":0,"msg":"ok","data":"7"}
public int code { get; set; }
public string msg { get; set; }
public object data { get; set; }
}
public class ServerData
{
//{"code":0,"msg":"ok","data":"7"}
public int code { get; set; }
public string msg { get; set; }
public string data { get; set; }
}
public class AfterPutData
{
//>>` {"code": 0, "msg":"ok", "data":{"cutPackageTask":"0","urgentPackageTask":"20","cutTask":"21","urgentTask":"22"}} `
//>>
//>> - code: 0为正常,其他为异常,
//>> - msg:消息,
//>> - data:为包装料仓的空闲仓位数(key为与客户端一致的料仓标识, value为空闲仓位)
//>> - cutPackageTask: 表示当前包装仓的分盘任务数
//>> - urgentPackageTask: 表示当前包装仓的紧急料任务数
//>> - cutTask: 表示流水线分盘任务数
//>> - urgentTask: 表示流水线紧急料任务数
public int code { get; set; }
public string msg { get; set; }
public TaskData data { get; set; }
}
public class TaskData
{
/// <summary>
/// urgentPackageTask: 表示当前包装仓的紧急料任务数
/// </summary>
public int urgentPackageTask { get; set; }
/// <summary>
/// cutPackageTask: 表示当前包装仓的分盘任务数
/// </summary>
public int cutPackageTask { get; set; }
/// <summary>
/// cutTask: 表示流水线分盘任务数
/// </summary>
public int cutTask { get; set; }
/// <summary>
/// urgentTask: 表示流水线紧急料任务数
/// </summary>
public int urgentTask { get; set; }
public string ToStr()
{
return "[分盘料=" + cutTask + "][紧急料=" + urgentTask + "]";
}
}
}