ams
cjs
2025-05-28 1fb5bbbd57fcc62e5dfb38a058a0aeca0118d643
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
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
using Hanhe.iWCS.Common;
using Hanhe.iWCS.MData;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Hanhe.iWCS.IndonesiaGLMProtocol
{
    public class MESHelper
    {
        private static string mesurl = Settings.MESUrl;
        private static string timeurl = Settings.TimeCuo;
        private static WebApiHelper helper = new WebApiHelper();
        /// <summary>
        /// 时间戳数据计数
        /// </summary>
        public static int total;
 
        /// <summary>
        /// 包装机下线任务调用的MES接口——GlmTonBagFillInfo
        /// </summary>
        /// <param name="device">设备号</param>
        /// <returns></returns>
        internal static MachineInfoCache GetPackingMachineInfo(string location)
        {
 
            //mes 地址读配置文件
            MachineInfoCache result = new MachineInfoCache();
            //需要进一步确认MES接口传输的数据
            var param = new { machineNo = location };
            CMMLog.Info($"向MES发送数据{JsonConvert.SerializeObject(param)},接口地址为:{mesurl}");
            var res = helper.WebPost(mesurl, JsonConvert.SerializeObject(param));
            if (!string.IsNullOrEmpty(res))
            {
                CMMLog.Info($"MES获取到数据:{JsonConvert.DeserializeObject(res)}");
                var req = JsonConvert.DeserializeObject<MachineInfoCache>(res);
                if (req != null)
                {
                    if (location == req.machineNo)
                    {
                        CMMLog.Info($"转换后MES数据{req}");
                        var machine = MongoDBSingleton.Instance.FindOne<MachineInfo>(Query.EQ("machineNo", req.machineNo), "MachineInfo");
                        if (machine == null)
                        {
                            MongoDBSingleton.Instance.Insert<MachineInfo>(new MachineInfo
                            {
                                machineNo = req.machineNo,
                                lotNo = req.lotNo,
                                bagNo = req.bagNo,
                                productType = req.productType,
                                palletLayers = req.palletLayers,
                                materialCode = req.materialCode,
                                overlappingLayers = req.overlappingLayers
                            });
                        }
                        else
                        {
                            CMMLog.Info($"当前<MachineInfo>中间表有当前包装机点位的信息存在,请检查MST主表是否有任务正在执行!");
                            Console.WriteLine($"当前<MachineInfo>中间表有当前包装机点位的信息存在,请检查MST主表是否有任务正在执行!");
                        }
                        CMMLog.Info($"MES接口传输数据信息:machineNo:{req.machineNo},lotNo:{req.lotNo},bagNo:{req.bagNo},productType:{req.productType},materialCode:{req.materialCode},overlappingLayers:{req.overlappingLayers}");
                        Console.WriteLine($"MES接口传输数据信息:machineNo:{req.machineNo},lotNo:{req.lotNo},bagNo:{req.bagNo},productType:{req.productType},materialCode:{req.materialCode},overlappingLayers:{req.overlappingLayers}");
                        result = req;
                    }
                    else CMMLog.Info($"MES传输的包装机号与当前包装机号不符合:当前包装机号:{location},MES传输的包装机号:{req.machineNo}");
                }
                else CMMLog.Info($"MES接口:Json返回数据为空值!接受的数据为:{req}");
            }
            else CMMLog.Info($"MES接口:返回数据为空值!接受的数据为:{res}");
            return result;
        }
 
        /// <summary>
        /// 3楼打包下线口到1楼成品货架口——调用打包线下线口接受传输的照相机接口数据
        /// </summary>
        /// <param name="timeStamp">时间戳</param>
        /// <returns></returns>
        internal static TimeChuoInfo TimeCuo(string timeStamp, ref string deviceNo)
        {
            //时间戳 地址读配置文件
            TimeChuoInfo result = new TimeChuoInfo();
 
            var param = new { machineNo = timeStamp };
            CMMLog.Info($"TimeCuo-01:SendMsg:{JsonConvert.SerializeObject(param)},url:{timeurl}");
            //var res = helper.WebGet(timeurl, JsonConvert.SerializeObject(param));
            var res = helper.WebGet(timeurl + "?timeStamp=" + timeStamp);
            CMMLog.Info($"TimeCuo-02:ReqMsg:{JsonConvert.SerializeObject(res)},url:{timeurl}");
            try
            {
                if (!string.IsNullOrEmpty(res))
                {
                    CMMLog.Info("time 02");
                    var req = JsonConvert.DeserializeObject<TimeChuoInfo>(res);
                    if (req != null)
                    {
                        CMMLog.Info("time 03");
                        //req.info = TransUTF8(req.info);//MES传输的UTF-8格式参数,C#默认UniCode格式,出现解析错误,但是此字段无意义,看情况更新
                        //var time = req.data[req.data.Count];
                        var timeReq = req.data.Where(a => a.timeStamp == int.Parse(timeStamp)).FirstOrDefault();
                        CMMLog.Info("需要处理的参数:" + JsonConvert.SerializeObject(timeReq));
                        if (timeReq != null && req.count == 1)
                        {
                            CMMLog.Info("time 04");
                            total = timeReq.totalCount;
 
                            if (timeReq.batchNumber.Length % 2 == 0 && timeReq.batchNumber.Substring(0, 1) == "0")
                                timeReq.batchNumber = timeReq.batchNumber.Substring(1, timeReq.batchNumber.Length - 1);
                            if (timeReq.productModel.Length % 2 == 0 && timeReq.productModel.Substring(0, 1) == "0")
                                timeReq.productModel = timeReq.batchNumber.Substring(1, timeReq.productModel.Length - 1);
 
                            CMMLog.Info("time 05");
                            var timeCuo = MongoDBSingleton.Instance.FindOne<TimeCuoInfoCom>(Query.EQ("packingMachineNumber", timeReq.packingMachineNumber_1), "TimeCuoInfoCom");
                            if (timeCuo == null)
                            {
                                MongoDBSingleton.Instance.Insert<TimeCuoInfoCom>(new TimeCuoInfoCom
                                {
                                    isFold = timeReq.isFold,
                                    packingMachineNumber = timeReq.packingMachineNumber_1,
                                    employeeId = timeReq.employeeID1,
                                    bagNumber = timeReq.bagNumber_1,
                                    needWeight = timeReq.needWeight_1,
                                    realWeight = timeReq.realWeight_1,
 
                                    totalWeight = timeReq.totalWeight,
                                    batchNumber = timeReq.batchNumber,
                                    productModel = timeReq.productModel,
                                    timeStamp = timeReq.timeStamp,
                                    photoURL = timeReq.photoURL,
 
                                    totalCount = timeReq.totalCount,
                                    isNeedTray = timeReq.isNeedTray,
                                    // ERP变更-照相机新增字段
                                    materialCode = timeReq.materialCode,
                                    materialName = timeReq.materialName,
                                    measurementUnit = timeReq.measurementUnit,
                                    createOrganization = timeReq.createOrganization,
                                    count = timeReq.count,
                                    WarehouseCode = timeReq.WarehouseCode,
                                    workshopCode = timeReq.workshopCode,
                                    BusinessDate = timeReq.BusinessDate,
                                    barcode = timeReq.barcode,
                                    codeRules = timeReq.codeRules,
 
                                    
                                    //employeeID2 = timeReq.employeeID2,
                                    //employeeID3 = timeReq.employeeID3,
                                    //employeeID4 = timeReq.employeeID4
                                });
                            }
                            else
                            {
                                var query = Query.EQ("packingMachineNumber", timeReq.packingMachineNumber_1);
                                UpdateBuilder update = Update.Set("isFold", timeReq.isFold).Set("totalWeight", timeReq.totalWeight)
                                    .Set("employeeId", timeReq.employeeID1).Set("bagNumber", timeReq.bagNumber_1).Set("needWeight", timeReq.needWeight_1)
                                    .Set("realWeight", timeReq.realWeight_1)
                                    .Set("batchNumber", timeReq.batchNumber).Set("productModel", timeReq.productModel).Set("isNeedTray", timeReq.isNeedTray)
                                    .Set("totalCount", timeReq.totalCount).Set("timeStamp", timeReq.timeStamp).Set("photoURL", timeReq.photoURL)
                                    .Set("materialCode", timeReq.materialCode).Set("materialName", timeReq.materialName).Set("measurementUnit", timeReq.measurementUnit)
                                    .Set("createOrganization", timeReq.createOrganization).Set("count", timeReq.count).Set("WarehouseCode", timeReq.WarehouseCode)
                                    .Set("workshopCode", timeReq.workshopCode).Set("BusinessDate", timeReq.BusinessDate).Set("barcode", timeReq.barcode)
                                    .Set("codeRules", timeReq.codeRules);
                                MongoDBSingleton.Instance.Update<TimeCuoInfoCom>(query, update, UpdateFlags.None);
                            }
 
                            CMMLog.Info($"获取到的时间戳接口数据:包装机号packingMachineNumber:{timeReq.packingMachineNumber_1},叠托后的实际重量totalWeight:{timeReq.totalWeight},产品批次号batchNumber:{timeReq.batchNumber}" +
                                $",产品型号productModel:{timeReq.productModel},totalCount:{timeReq.totalCount},timeStamp:{timeReq.timeStamp},photoURL:{timeReq.photoURL}");
                            #region   判断叠包层数
 
                            if (timeReq.isFold == 1 || timeReq.isFold == 2 || timeReq.isFold == 3)
                            {
                                var query = Query.EQ("packingMachineNumber", timeReq.packingMachineNumber_1);
                                UpdateBuilder update = null;
                                if (timeReq.isFold == 1) update = Update.Set("bagNumber", timeReq.bagNumber_1).Set("realWeight", (timeReq.realWeight_1 / 100).ToString().Trim());
                                else if (timeReq.isFold == 2) update = Update.Set("bagNumber", timeReq.bagNumber_1 + "," + timeReq.bagNumber_2);
                                else if (timeReq.isFold == 3) update = Update.Set("bagNumber", timeReq.bagNumber_1 + "," + timeReq.bagNumber_2 + "," + timeReq.bagNumber_3);
 
                                if (update != null)
                                    MongoDBSingleton.Instance.Update<TimeCuoInfoCom>(query, update, "TimeCuoInfoCom", UpdateFlags.None);
                            }
                            else CMMLog.Error($"isFold:{timeReq.isFold}");
 
                            #region
                            // if (timeReq.isFold == 1)
                            //     MongoDBSingleton.Instance.Update<TimeCuoInfoCom>(Query.EQ("packingMachineNumber", timeReq.packingMachineNumber_1), Update.Set("bagNumber", timeReq.bagNumber_1).Set("realWeight", (timeReq.realWeight_1 / 100).ToString().Trim()), UpdateFlags.None);
                            // else if (timeReq.isFold == 2)
                            //     //MongoDBSingleton.Instance.Update<TimeCuoInfoCom>(Query.EQ("packingMachineNumber", timeReq.packingMachineNumber_1), Update.Set("bagNumber", timeReq.bagNumber_1 + "," + timeReq.bagNumber_2).Set("realWeight", (timeReq.realWeight_1 / 100).ToString().Trim()+","+ (timeReq.realWeight_2 / 100).ToString().Trim()), UpdateFlags.None);
                            //     MongoDBSingleton.Instance.Update<TimeCuoInfoCom>(Query.EQ("packingMachineNumber", timeReq.packingMachineNumber_1), Update.Set("bagNumber", timeReq.bagNumber_1 + "," + timeReq.bagNumber_2), UpdateFlags.None);
                            // else if (timeReq.isFold == 3)
                            //     //MongoDBSingleton.Instance.Update<TimeCuoInfoCom>(Query.EQ("packingMachineNumber", timeReq.packingMachineNumber_1), Update.Set("bagNumber", timeReq.bagNumber_1 + "," + timeReq.bagNumber_2 + "," + timeReq.bagNumber_3).Set("realWeight", (timeReq.realWeight_1 / 100).ToString().Trim() + "," + (timeReq.realWeight_2 / 100).ToString().Trim()+","+ (timeReq.realWeight_3 / 100).ToString().Trim()), UpdateFlags.None);
                            //     MongoDBSingleton.Instance.Update<TimeCuoInfoCom>(Query.EQ("packingMachineNumber", timeReq.packingMachineNumber_1), Update.Set("bagNumber", timeReq.bagNumber_1 + "," + timeReq.bagNumber_2 + "," + timeReq.bagNumber_3), UpdateFlags.None);
                            // else CMMLog.Error($"isFold:{timeReq.isFold}");
                            #endregion
 
                            #endregion
                            //判断是否叠底托
                            deviceNo = timeReq.isNeedTray == 2 ? "7" : "10";
                            result = req;
                        }
                        else result = null;
                    }
                    else result = null;
                    CMMLog.Info($"code:{req.code},count:{req.count},info:{req.info},info:{req.msg},info:{req.status}");
                }
                CMMLog.Info("time over!");
            }
            catch (Exception ex)
            {
                CMMLog.Error($"TimeCuo Error:{ex.Message}");
            }
 
            return result;
        }
 
        public static string TransUTF8(string text)
        {
            //声明字符集   
            System.Text.Encoding utf8, gb2312;
            //utf8   
            utf8 = System.Text.Encoding.GetEncoding("utf-8");
            //gb2312   
            gb2312 = System.Text.Encoding.GetEncoding("gb2312");
            byte[] utf;
            utf = gb2312.GetBytes(text);
            utf = System.Text.Encoding.Convert(gb2312, utf8, utf);
            //返回转换后的字符   
            return utf8.GetString(utf);
        }
        /// <summary>
        /// 存放从MES接受的数据和设备通道里面读取的数据(包括转换后的数据)
        /// </summary>
        public class MachineInfo
        {
            public ObjectId _id { get; set; }
            /// <summary>
            /// mes返回的包装机号(T1,T2,......,T9)
            /// </summary>
            public string machineNo { get; set; }
            /// <summary>
            /// mes返回的成品批次号
            /// </summary>
            public string lotNo { get; set; } = "0";
            /// <summary>
            /// mes返回的袋号
            /// </summary>
            public string bagNo { get; set; } = "0";
            /// <summary>
            /// mes返回的产品型号
            /// </summary>
            public string productType { get; set; } = "0";
            /// <summary>
            /// MES返回的是否叠底托(1-不叠底托  2-叠底托)
            /// </summary>
            public string palletLayers { get; set; } = "0";
            /// <summary>
            /// mes返回的物料编码
            /// </summary>
            public string materialCode { get; set; } = "0";
            /// <summary>
            /// mes返回的物料名称
            /// </summary>
            public string materialName { get; set; } = "0";
            /// <summary>
            /// mes返回的计量单位
            /// </summary>
            public string measurementUnit { get; set; } = "0";
            /// <summary>
            /// mes返回的组织代码
            /// </summary>
            public string organizeCode { get; set; } = "0";
            /// <summary>
            /// mes返回的叠包层数  (例1,2,3:1代表不叠包,2代表叠2层,3代表叠3层)
            /// </summary>
            public string overlappingLayers { get; set; } = "0";
            /// <summary>
            /// 设备通道数据3——托盘码          
            /// </summary>
            public string trayCode { get; set; } = "0";
            /// <summary>
            /// 设备通道数据1——包装机号        
            /// </summary>
            public string location { get; set; } = "0";
            /// <summary>
            /// 设备通道数据2——产品需求重量:32位整数
            /// </summary>
            public string productWeight { get; set; } = "0";
            /// <summary>
            /// 设备通道数据2——单拖毛重:32位整数
            /// </summary>
            public string trayCodeWeight { get; set; } = "0";
            /// <summary>
            /// 设备通道数据2——单托净重:32位整数
            /// </summary>
            public string oneTrayWeight { get; set; } = "0";
            /// <summary>
            /// 设备通道数据1——是否需要叠托盘:1:不叠托;2:叠托
            /// </summary>
            public int addTray { get; set; } = 0;
            /// <summary>
            /// 设备通道数据1——是否需要叠包:1:叠包,2:不叠包
            /// </summary>
            public int addState { get; set; } = 0;
            /// <summary>
            /// 设备通道数据1——袋号(001,002,003…999)
            /// </summary>
            public string packageCode { get; set; } = "0";
            /// <summary>
            /// 设备通道数据5——员工编号(G0200424)字符串
            /// </summary>
            public string empNum { get; set; }
            /// <summary>
            /// 设备通道数据2——生产日期:32位整数
            /// </summary>
            public string productTime { get; set; } = "0";
            /// <summary>
            /// 设备通道数据1——复称口称重结果:1:OK,2:NG
            /// </summary>
            public int secondNg { get; set; } = 1;
            /// <summary>
            /// 设备通道数据——全91位short
            /// </summary>
            public int[] machinedown = new int[91];
            /// <summary>
            /// 设备通道数据——数据库JSON
            /// </summary>
            public string jsonData { get; set; } = "0";
            public string occupy { get; set; } = "1";
            public DateTime modify { get; set; }
        }
 
 
        public class MachineInfoTwo
        {
            public ObjectId _id { get; set; }
            /// <summary>
            /// mes返回的包装机号(T1,T2,......,T9)
            /// </summary>
            public string machineNo { get; set; }
            /// <summary>
            /// mes返回的成品批次号
            /// </summary>
            public string lotNo { get; set; } = "0";
            /// <summary>
            /// mes返回的袋号
            /// </summary>
            public string bagNo { get; set; } = "0";
            /// <summary>
            /// mes返回的产品型号
            /// </summary>
            public string productType { get; set; } = "0";
            /// <summary>
            /// MES返回的是否叠底托(1-不叠底托  2-叠底托)
            /// </summary>
            public string palletLayers { get; set; } = "0";
            /// <summary>
            /// mes返回的物料编码
            /// </summary>
            public string materialCode { get; set; } = "0";
            /// <summary>
            /// mes返回的物料名称
            /// </summary>
            public string materialName { get; set; } = "0";
            /// <summary>
            /// mes返回的计量单位
            /// </summary>
            public string measurementUnit { get; set; } = "0";
            /// <summary>
            /// mes返回的组织代码
            /// </summary>
            public string organizeCode { get; set; } = "0";
            /// <summary>
            /// mes返回的叠包层数  (例1,2,3:1代表不叠包,2代表叠2层,3代表叠3层)
            /// </summary>
            public string overlappingLayers { get; set; } = "0";
            /// <summary>
            /// 设备通道数据3——托盘码          
            /// </summary>
            public string trayCode { get; set; } = "0";
            /// <summary>
            /// 设备通道数据1——包装机号        
            /// </summary>
            public string location { get; set; } = "0";
            /// <summary>
            /// 设备通道数据2——产品需求重量:32位整数
            /// </summary>
            public string productWeight { get; set; } = "0";
            /// <summary>
            /// 设备通道数据2——单拖毛重:32位整数
            /// </summary>
            public string trayCodeWeight { get; set; } = "0";
            /// <summary>
            /// 设备通道数据2——单托净重:32位整数
            /// </summary>
            public string oneTrayWeight { get; set; } = "0";
            /// <summary>
            /// 设备通道数据1——是否需要叠托盘:1:不叠托;2:叠托
            /// </summary>
            public int addTray { get; set; } = 0;
            /// <summary>
            /// 设备通道数据1——是否需要叠包:1:叠包,2:不叠包
            /// </summary>
            public int addState { get; set; } = 0;
            /// <summary>
            /// 设备通道数据1——袋号(001,002,003…999)
            /// </summary>
            public string packageCode { get; set; } = "0";
            /// <summary>
            /// 设备通道数据5——员工编号(G0200424)字符串
            /// </summary>
            public string empNum { get; set; }
            /// <summary>
            /// 设备通道数据2——生产日期:32位整数
            /// </summary>
            public string productTime { get; set; } = "0";
            /// <summary>
            /// 设备通道数据1——复称口称重结果:1:OK,2:NG
            /// </summary>
            public int secondNg { get; set; } = 1;
            /// <summary>
            /// 设备通道数据2——复称毛重:32位整数
            /// </summary>
            public string oneTrayWeightFC { get; set; } = "0,0";
            /// <summary>
            /// 设备通道数据——全91位short
            /// </summary>
            public int[] machinedown = new int[91];
            /// <summary>
            /// 设备通道数据——数据库JSON
            /// </summary>
            public string jsonData { get; set; } = "0";
            public string occupy { get; set; } = "1";
            public DateTime modify { get; set; }
        }
 
        public class MachineInfoCache
        {
            /// <summary>
            /// mes返回的包装机号(T1,T2,......,T9)
            /// </summary>
            public string machineNo { get; set; }
            /// <summary>
            /// mes返回的成品批次号
            /// </summary>
            public string lotNo { get; set; }
            /// <summary>
            /// mes返回的袋号
            /// </summary>
            public string bagNo { get; set; }
            /// <summary>
            /// mes返回的产品型号
            /// </summary>
            public string productType { get; set; }
            /// <summary>
            /// mes返回的是否叠底托信号
            /// </summary>
            public string palletLayers { get; set; }
            /// <summary>
            /// mes返回的物料编码
            /// </summary>
            public string materialCode { get; set; }
            /// <summary>
            /// mes返回的叠包层数  (例1,2,3:1代表不叠包,2代表叠2层,3代表叠3层)
            /// </summary>
            public string overlappingLayers { get; set; }
        }
 
        /// <summary>
        /// 时间戳——调用照相机设备获取的返回信息
        /// </summary>
        public class TimeChuoInfo
        {
            public int code { get; set; }
            public int count { get; set; }
            public string info { get; set; }
            public string msg { get; set; }
            public int status { get; set; }
            public List<TimeCuoInfo> data { get; set; }
            public class TimeCuoInfo
            {
                public string bagNumber_1 { get; set; }
                public string bagNumber_2 { get; set; }
                public string bagNumber_3 { get; set; }
                public string batchNumber { get; set; }
                public int isFold { get; set; }
                public string master { get; set; }
                public int needWeight_1 { get; set; }
                public int needWeight_2 { get; set; }
                public int needWeight_3 { get; set; }
                public string newComeInFlag { get; set; }
                public int packingMachineNumber_1 { get; set; }
                public int packingMachineNumber_2 { get; set; }
                public int packingMachineNumber_3 { get; set; }
                public string photoFlag { get; set; }
                public string photoURL { get; set; }
                public string printFlag { get; set; }
                public string printMsg { get; set; }
                public string productModel { get; set; }
                public int realWeight_1 { get; set; }
                public int realWeight_2 { get; set; }
                public int realWeight_3 { get; set; }
                public int timeStamp { get; set; }
                public int totalCount { get; set; }
                public int totalWeight { get; set; }
 
 
 
                /// <summary>
                /// 员工编号1
                /// </summary>
                public string employeeID1 { get; set; }
                /// <summary>
                /// 员工编号2
                /// </summary>
                public string employeeID2 { get; set; }
                /// <summary>
                /// 员工编号3
                /// </summary>
                public string employeeID3 { get; set; }
                /// <summary>
                /// 员工编号4
                /// </summary>
                public string employeeID4 { get; set; }
                /// <summary>
                /// 是否叠底托(ERP变更功能之后不再使用此字段)
                /// </summary>
                public int isNeedTray { get; set; }
 
                /// <summary>
                /// 物料编码
                /// </summary>
                public string materialCode { get; set; } = "1";
                /// <summary>
                /// 物料名称
                /// </summary>
                public string materialName { get; set; }
                /// <summary>
                /// 计量单位
                /// </summary>
                public string measurementUnit { get; set; }
                /// <summary>
                /// 创建组织
                /// </summary>
                public string createOrganization { get; set; }
                /// <summary>
                /// 数量
                /// </summary>
                public int count { get; set; }
                /// <summary>
                /// 仓库编码
                /// </summary>
                public string WarehouseCode { get; set; }
                /// <summary>
                /// 车间编码
                /// </summary>
                public string workshopCode { get; set; }
                /// <summary>
                /// 业务日期
                /// </summary>
                public string BusinessDate { get; set; }
                /// <summary>
                /// 条形码
                /// </summary>
                public string barcode { get; set; }
                /// <summary>
                /// 条码规则
                /// </summary>
                public string codeRules { get; set; }
 
            }
        }
        public class TimeCuoInfoCom
        {
            public ObjectId _id { get; set; }
            /// <summary>
            /// 是否叠包(1,2,3)
            /// </summary>
            public int isFold { get; set; }
            /// <summary>
            /// 包装机号
            /// </summary>
            public int packingMachineNumber { get; set; }
            /// <summary>
            /// 袋号(001,002,003…999)1
            /// </summary>
            public string bagNumber { get; set; }
            /// <summary>
            /// 产品需求重量1:32位整数
            /// </summary>
            public int needWeight { get; set; }
            /// <summary>
            /// 单托实际重量1:32位整数
            /// </summary>
            public int realWeight { get; set; }
            /// <summary>
            /// 叠托后的实际重量:32位整数
            /// </summary>
            public int totalWeight { get; set; }
            /// <summary>
            /// 产品批次号
            /// </summary>
            public string batchNumber { get; set; }
            /// <summary>
            /// 产品型号
            /// </summary>
            public string productModel { get; set; }
            /// <summary>
            /// 是否叠底托(1-不叠底托    2-叠底托)
            /// </summary>
            public int isNeedTray { get; set; }
            /// <summary>
            /// 计数(只在数据库)
            /// </summary>
            public int totalCount { get; set; }
            /// <summary>
            /// 时间戳
            /// </summary>
            public int timeStamp { get; set; }
            /// <summary>
            /// 照片url
            /// </summary>
            public string photoURL { get; set; }
 
 
 
            /// <summary>
            /// 物料编码
            /// </summary>
            public string materialCode { get; set; }
            /// <summary>
            /// 物料名称
            /// </summary>
            public string materialName { get; set; }
            /// <summary>
            /// 计量单位
            /// </summary>
            public string measurementUnit { get; set; }
            /// <summary>
            /// 创建组织
            /// </summary>
            public string createOrganization { get; set; }
            /// <summary>
            /// 数量
            /// </summary>
            public int count { get; set; }
            /// <summary>
            /// 仓库编码
            /// </summary>
            public string WarehouseCode { get; set; }
            /// <summary>
            /// 车间编码
            /// </summary>
            public string workshopCode { get; set; }
            /// <summary>
            /// 业务日期
            /// </summary>
            public string BusinessDate { get; set; }
            /// <summary>
            /// 条形码
            /// </summary>
            public string barcode { get; set; }
            /// <summary>
            /// 条码规则
            /// </summary>
            public string codeRules { get; set; }
 
 
            /// <summary>
            /// 员工编号
            /// </summary>
            public string employeeId { get; set; }
            /// <summary>
            /// 员工编号2
            /// </summary>
            public string employeeID2 { get; set; }
            /// <summary>
            /// 员工编号3
            /// </summary>
            public string employeeID3 { get; set; }
            /// <summary>
            /// 员工编号4
            /// </summary>
            public string employeeID4 { get; set; }
        }
 
        /// <summary>
        /// 物料表
        /// </summary>
        public class T_JY_MATERIALSync
        {
            /// <summary>
            /// 流水号
            /// </summary>
            public int FID { get; set; }
            /// <summary>
            /// 名称
            /// </summary>
            public string FName { get; set; }
            /// <summary>
            /// 编码
            /// </summary>
            public string FNumber { get; set; }
            /// <summary>
            /// 规格型号
            /// </summary>
            public string FSpecification { get; set; }
            /// <summary>
            /// 使用组织编码
            /// </summary>
            public string FUseOrgNumber { get; set; }
            /// <summary>
            /// 车间名称
            /// </summary>
            public string FWorkShopNumber { get; set; }
            /// <summary>
            /// 保质期
            /// </summary>
            public int FExpPeriod { get; set; }
            /// <summary>
            /// 保质期单位
            /// </summary>
            public string FExpUnit { get; set; }
            /// <summary>
            /// 库存单位
            /// </summary>
            public string FStoreUnit { get; set; }
            /// <summary>
            /// 物料分组名称
            /// </summary>
            public string FMaterialGroupName { get; set; }
            /// <summary>
            /// 物料分组编码
            /// </summary>
            public string FMaterialGroupNumber { get; set; }
        }
 
        /// <summary>
        /// 员工表
        /// </summary>
        public class T_JY_EMPINFOSync
        {
            /// <summary>
            /// 流水号
            /// </summary>
            public int FID { get; set; }
            /// <summary>
            /// 编码
            /// </summary>
            public string FNumber { get; set; }
            /// <summary>
            /// 名称
            /// </summary>
            public string FName { get; set; }
            /// <summary>
            /// 员工编号
            /// </summary>
            public string FStaffNumber { get; set; }
        }
 
        /// <summary>
        /// 条码表
        /// </summary>
        public class T_JY_BARCODESync
        {
            /// <summary>
            /// 流水号
            /// </summary>
            public int FID { get; set; }
            /// <summary>
            /// 条形码
            /// </summary>
            public string FBarCode { get; set; }
            /// <summary>
            /// 条码规则
            /// </summary>
            public string FBarCodeRule { get; set; }
            /// <summary>
            /// 物料编码
            /// </summary>
            public string FMaterialNumber { get; set; }
            /// <summary>
            /// 创建组织
            /// </summary>
            public string FCreateOrgNumber { get; set; }
            /// <summary>
            /// 批号主档
            /// </summary>
            public string FLot { get; set; }
            /// <summary>
            /// 计量单位
            /// </summary>
            public string FUnit { get; set; }
            /// <summary>
            /// 数量(重量)
            /// </summary>
            public float FQty { get; set; }
            /// <summary>
            /// 仓库编码
            /// </summary>
            public string FStockNumber { get; set; }
            /// <summary>
            /// 部门编码
            /// </summary>
            public string FDept { get; set; }
            /// <summary>
            /// 业务日期
            /// </summary>
            public DateTime FBillDate { get; set; }
            /// <summary>
            /// 操作人编码
            /// </summary>
            public string F_JY_CZZ { get; set; }
        }
    }
}