From 272ea6040258a7adfc807123036378915860fb90 Mon Sep 17 00:00:00 2001
From: zongzhibin <zongzhibin@weben-smart.com>
Date: 周日, 24 11月 2024 14:23:31 +0800
Subject: [PATCH] add

---
 CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Outbound/3、DataProcess_RobotBuffer_FinishTaskForOutbound.cs |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

diff --git "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/3\343\200\201DataProcess_RobotBuffer_FinishTaskForOutbound.cs" "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/3\343\200\201DataProcess_RobotBuffer_FinishTaskForOutbound.cs"
index 8e05c85..be10ec7 100644
--- "a/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/3\343\200\201DataProcess_RobotBuffer_FinishTaskForOutbound.cs"
+++ "b/CC/iWareCC_ASRS/ThreadService/02_BZ39\345\267\245\344\275\215\357\274\210\350\241\245\346\235\277\345\220\216\345\267\245\344\275\215\357\274\211/Outbound/3\343\200\201DataProcess_RobotBuffer_FinishTaskForOutbound.cs"
@@ -1,4 +1,5 @@
 锘縰sing Admin.NET.Application;
+using iWareCC.StationService;
 using iWareCommon.Common.Globle;
 using iWareCommon.Utils;
 using iWareModel;
@@ -21,7 +22,7 @@
             LogType logType = LogType.DataProcess_RobotBuffer_FinishTaskForOutbound;
             while (true)
             {
-                Thread.Sleep(2000);//浼戠湢2绉掞紝灏嗕紤鐪犲啓鍒板墠闈紝鏄负浜嗕笅闈㈢殑continue鏂规硶鎵ц鍚庝笉鏄剧ず閿欒淇℃伅鐨勬彁绀猴紒锛侊紒銆怑ditBy shaocx,2022-05-24銆�
+                Thread.Sleep(500);//浼戠湢2绉掞紝灏嗕紤鐪犲啓鍒板墠闈紝鏄负浜嗕笅闈㈢殑continue鏂规硶鎵ц鍚庝笉鏄剧ず閿欒淇℃伅鐨勬彁绀猴紒锛侊紒銆怑ditBy shaocx,2022-05-24銆�
                 SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = string.Empty;
                 try
                 {
@@ -31,12 +32,12 @@
                         var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
                         if (obj.R_OutboundFinish)
                         {
-                            var result = obj.R_OutboundNumber;
-                            if (string.IsNullOrEmpty(result))
-                            {
-                                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = $"{rgvLocation.ToString()}- 鍑哄簱搴撲綅鍙锋槸绌虹殑,姝ゆ寰幆缁撴潫";
-                                continue;
-                            }
+                            //var result = obj.R_OutboundNumber;
+                            //if (string.IsNullOrEmpty(result))
+                            //{
+                            //    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = $"{rgvLocation.ToString()}- 鍑哄簱搴撲綅鍙锋槸绌虹殑,姝ゆ寰幆缁撴潫";
+                            //    continue;
+                            //}
 
                             var result2 = obj.R_Outbound_TaskID;
                             if (result2 == 0)
@@ -49,8 +50,8 @@
 
                             using (WmsDBModel wmsDB = new WmsDBModel())
                             {
-                                var task = wmsDB.wms_rbline_task.Where(x => x.PlaceCode == obj.R_OutboundNumber
-                                && x.TaskNo == obj.R_Outbound_TaskID.ToString()
+                                var task = wmsDB.wms_rbline_task.Where(x =>
+                                 x.TaskNo == obj.R_Outbound_TaskID.ToString()
                                 && x.RbTaskType == (int)RbTaskTypeEnum.鍑哄簱浠诲姟
                                 && x.TaskStatus == (int)TaskStatusEnum.宸蹭笅鍙�).FirstOrDefault();
                                 if (task == null)
@@ -77,6 +78,21 @@
                                 var place = StationHandler.GetPlaceByPlaceCode(task.PlaceCode, wmsDB);
                                 place.PlaceStatus = (int)PlaceStatusEnum.姝e父;
 
+                                //缁橮LC鎺ㄩ�佷换鍔″畬鎴愮‘璁や俊鍙�
+                                using (StationServiceClient client = new StationServiceClient())
+                                {
+                                    var res = await client.OutboundFinishConfirmAsync((int)EDevice.Station, true, rgvLocation);
+                                    if (!res.result)
+                                    {
+                                        SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound = $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 澶辫触,OutboundFinishConfirmAsync 杩斿洖:{res.resMsg}";
+                                        continue;
+                                    }
+                                    else
+                                    {
+                                        Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-涓嬪彂鍑哄簱浠诲姟 鎴愬姛,OutboundFinishConfirmAsync锛屽弬鏁�: 绔欑偣{rgvLocation}");
+                                    }
+                                }
+
                                 wmsDB.SaveChanges();
                             }
                         }

--
Gitblit v1.9.3