From a89f1faab22c204627d49d6731be9c94d8160184 Mon Sep 17 00:00:00 2001
From: duyongjia <adu_555@163.com>
Date: 星期五, 22 十一月 2024 11:23:47 +0800
Subject: [PATCH] 优化修改提交

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   66 +++++++++++++++++---------------
 1 files changed, 35 insertions(+), 31 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index a9fbbb3..64dd609 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -468,7 +468,7 @@
             }
             catch (Exception ex)
             {
-                ServiceLogger.WriteDebug("ReceiveTask", $"浠诲姟鎺ユ敹閿欒,閿欒淇℃伅:{ex.Message}");
+                ServiceLogger.WriteDebug("ReceiveTask", $"浠诲姟鎺ユ敹閿欒,閿欒淇℃伅:{ex.StackTrace}");
                 content = WebResponseContent.Instance.Error($"浠诲姟鎺ユ敹閿欒,閿欒淇℃伅:{ex.Message}");
             }
             return content;
@@ -884,6 +884,7 @@
                     catch (Exception ex)
                     {
                         _unitOfWorkManage.RollbackTran();
+                        //浠诲姟鎵ц澶辫触锛岃揣浣嶇姸鎬佽繕鍘�
                         ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"澶у爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
                         content = WebResponseContent.Instance.Error($"澶у爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
                     }
@@ -982,7 +983,7 @@
                 {
                     try
                     {
-                        Dt_LocationInfo srcLocation = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+                        //Dt_LocationInfo srcLocation = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress);
                         //srcLocation.LocationStatus = (int)LocationStatusEnum.Free;
                         
 
@@ -1002,44 +1003,45 @@
                         MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
                         if (res != null && res.code != 0)
                         {
+                            ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�");
                             content = WebResponseContent.Instance.Error($"灏忓爢鍨涙満瀹屾垚鍑哄簱浠诲姟鍚庡洖浼燤ES澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵res.message}銆�");
                         }
-                        else
-                        {
-                            //鍒ゆ柇鏄惁瀹屾垚鐨勬渶鍚庝竴灞傦紝鑷姩鐢熸垚绌鸿溅鍑哄簱浠诲姟
-                            string[] Levels = task.Remark.Split("-");
-                            if (Levels.Length == 2)
-                            {
-                                if (!string.IsNullOrEmpty(Levels[0])&& !string.IsNullOrEmpty(Levels[1]))
-                                {
-                                    //濡傛灉褰撳墠鎻愬彇灞傛暟绛変簬鎬诲眰鏂欙紝鍒欒〃绀烘枡杞︽墍鏈夌殑灞傛暟鍙栧畬
-                                    if(Convert.ToInt16(Levels[0])== Convert.ToInt16(Levels[1]))
-                                    {
-                                        string[] SourceCodes = task.SourceAddress.Split("-");
-                                        string startPlan = "";
-                                        if (SourceCodes.Length == 4)
-                                        {
-                                            startPlan= "101"+ SourceCodes[2].Substring(1,2);
-                                        }
-                                        DeliveryPlan send = new DeliveryPlan { startPlan = startPlan, isQuit = false, CarId = task.PalletCode };
-                                        string inparam2 = JsonConvert.SerializeObject(send);
-                                        ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟鍥炰紶MES鍏ュ弬{inparam2}");
-                                        ApiInvoke.DeliveryPlanCMD(send);//鍥炶皟MES鎺ュ彛鐢熸垚绌鸿溅鍑哄簱浠诲姟
-                                        //鎵�鏈夌殑灞傛暟閮藉彇瀹岋紝闇�瑕佹妸鏆傚瓨浣嶇姸鎬佹敼涓虹┖闂茬姸鎬�
-                                        srcLocation.LocationStatus = (int)LocationStatusEnum.Free;
-                                        _locationInfoRepository.UpdateData(srcLocation);
-                                    }
+                        //else
+                        //{
+                        //    //鍒ゆ柇鏄惁瀹屾垚鐨勬渶鍚庝竴灞傦紝鑷姩鐢熸垚绌鸿溅鍑哄簱浠诲姟
+                        //    string[] Levels = task.Remark.Split("-");
+                        //    if (Levels.Length == 2)
+                        //    {
+                        //        if (!string.IsNullOrEmpty(Levels[0])&& !string.IsNullOrEmpty(Levels[1]))
+                        //        {
+                        //            //濡傛灉褰撳墠鎻愬彇灞傛暟绛変簬鎬诲眰鏂欙紝鍒欒〃绀烘枡杞︽墍鏈夌殑灞傛暟鍙栧畬
+                        //            if(Convert.ToInt16(Levels[0])== Convert.ToInt16(Levels[1]))
+                        //            {
+                        //                string[] SourceCodes = task.SourceAddress.Split("-");
+                        //                string startPlan = "";
+                        //                if (SourceCodes.Length == 4)
+                        //                {
+                        //                    startPlan = "101" + SourceCodes[2].Substring(1, 2);
+                        //                }
+                        //                DeliveryPlan send = new DeliveryPlan { startPlan = startPlan, isQuit = false, CarId = task.PalletCode };
+                        //                string inparam2 = JsonConvert.SerializeObject(send);
+                        //                ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟鍥炰紶MES鍏ュ弬{inparam2}");
+                        //                ApiInvoke.DeliveryPlanCMD(send);//鍥炶皟MES鎺ュ彛鐢熸垚绌鸿溅鍑哄簱浠诲姟
+                        //                鎵�鏈夌殑灞傛暟閮藉彇瀹岋紝闇�瑕佹妸鏆傚瓨浣嶇姸鎬佹敼涓虹┖闂茬姸鎬�
+                        //                srcLocation.LocationStatus = (int)LocationStatusEnum.Free;
+                        //                _locationInfoRepository.UpdateData(srcLocation);
+                        //            }
 
-                                }
+                        //        }
                               
-                            }
-                        }
+                        //    }
+                        //}
 
                     }
                     catch (Exception ex)
                     {
                         _unitOfWorkManage.RollbackTran();
-                        ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
+                        ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.StackTrace}銆�");
                         content = WebResponseContent.Instance.Error($"灏忓爢鍨涙満鎵ц鍑哄簱浠诲姟澶辫触锛�,浠诲姟鍙�:銆恵taskNum}銆�,澶辫触淇℃伅:銆恵ex.Message}銆�");
                     }
 
@@ -1060,6 +1062,8 @@
             return content;
         }
 
+
+
         /// <summary>
         /// 鎭㈠鎸傝捣浠诲姟
         /// </summary>

--
Gitblit v1.9.3