From be14322d1b20857082dd47aeb895bd976dca13e0 Mon Sep 17 00:00:00 2001
From: liuying <1427574514@qq.com>
Date: 周六, 30 11月 2024 17:40:50 +0800
Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/LA24030-LuLI_PackageLine

---
 CC/iWareCC_ASRS/ThreadService/05_BZ30(齐套验证)/DataProcess_ValidateQiTao.cs |   43 +++++++++++++++++++++++++++++++------------
 1 files changed, 31 insertions(+), 12 deletions(-)

diff --git "a/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs" "b/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs"
index adb6ebe..a88ad98 100644
--- "a/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs"
+++ "b/CC/iWareCC_ASRS/ThreadService/05_BZ30\050\351\275\220\345\245\227\351\252\214\350\257\201\051/DataProcess_ValidateQiTao.cs"
@@ -10,6 +10,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.Remoting.Messaging;
 using System.ServiceModel.Configuration;
 using System.Text;
 using System.Threading;
@@ -36,7 +37,7 @@
                 {
                     if (SystemValue.isAllowRuning_DataProcess_ValidateQiTao && SystemValue.isStartedModel)
                     {
-                        var rgvLocation = StationLocationEnum.BZ39.ToString();
+                        var rgvLocation = StationLocationEnum.BZ30.ToString();
 
                         using (WmsDBModel wmsDB = new WmsDBModel())
                         {
@@ -55,32 +56,37 @@
                             var configValues = configValue.Split('|');
                             var packageCode = configValues[0];
                             var qitaoValue = configValues[1];//榻愬  涓嶉綈濂�
-
+                            var _UnlinePerson = configValues[2];
+                            bool iscomplete = false;
+                            if (qitaoValue.Equals("榻愬"))
+                            {
+                                iscomplete = true;
+                            }
                             //TODO:鎺ㄩ�佺粰PLC 鍘诲摢涓柟鍚戯紵
-                            /*
+
                             using (StationServiceClient client = new StationServiceClient())
                             {
-                                var res = await client.ChangeModeAsync((int)EDevice.Station, (int)RbRunModeEnum.鍏ュ簱妯″紡, rgvLocation);
+                                var res = client.WriteQiTaoInfo((int)EDevice.Station, rgvLocation, iscomplete);
                                 if (!res.result)
                                 {
-                                    SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鍒囨崲妯″紡 澶辫触,ChangeModeAsync 杩斿洖:{res.resMsg}";
+                                    SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鏄惁榻愬澶辫触,ChangeModeAsync 杩斿洖:{res.resMsg}";
                                     continue;
                                 }
                                 else
                                 {
-                                    Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鍒囨崲妯″紡 鎴愬姛,ChangeModeAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
+                                    Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-鎺ㄩ�佺粰PLC鏄惁榻愬 鎴愬姛,ChangeModeAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
                                 }
                             }
-                            //*/
+                            //
 
 
                             //鏇存柊鍊�
                             bz30Config.Value = "";
-                            var gahter = wmsDB.mes_package_gather.Where(x => x.PackageCode == packageCode).FirstOrDefault();
-                            if (gahter != null)
+                            var package = wmsDB.mes_package_gather.Where(x => x.PackageCode == packageCode).FirstOrDefault();
+                            if (package != null)
                             {
-                                gahter.UpiStatus = (int)UpiStatusEnum.宸蹭笅绾�;
-                                gahter.AreaCode = (int)AreaCodeEnum.涓嬬嚎鍖哄煙;
+                                package.UpiStatus = (int)UpiStatusEnum.宸蹭笅绾�;
+                                package.AreaCode = (int)AreaCodeEnum.涓嬬嚎鍖哄煙;
                             }
                             var upiList = wmsDB.mes_batchOrderUPI_new.Where(x => x.PackageCode == packageCode).ToList();
                             foreach (var item in upiList)
@@ -95,9 +101,21 @@
                             {
                                 wmsDB.mes_package_linequeue.Remove(lineQueue);
                             }
+
+
+                            //澶勭悊琛�  mes_order_gather
+                            var errmsg = "";
+                            var result = MyExtendHelper.HandlerOrderGather(wmsDB, package, qitaoValue, _UnlinePerson, out errmsg);
+                            if (result == false)
+                            {
+                                SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = errmsg;
+                                continue;
+                            }
+
+
                             //鏂板涓嬬嚎璁板綍
                             mes_package_unline_record record = new mes_package_unline_record();
-                            record = ClassHelper.RotationMapping<mes_package_unline_record, mes_package_gather>(gahter);
+                            record = ClassHelper.RotationMapping<mes_package_unline_record, mes_package_gather>(package);
                             record.Id = Yitter.IdGenerator.YitIdHelper.NextId();
                             record.CreateTime = DateTime.Now;
                             record.UpdateTime = DateTime.Now;
@@ -118,5 +136,6 @@
             }
         }
 
+   
     }
 }

--
Gitblit v1.9.3