From b9f7560cbe0e562a40e9515a0559a3e951f0fee6 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期一, 07 四月 2025 09:16:01 +0800
Subject: [PATCH] 问题修改

---
 Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs |   49 ++++++++++++++++++++++++++++++++++---------------
 1 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
index 07842f2..3cc81a2 100644
--- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
+++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -306,6 +306,10 @@
                 {
                     throw new Exception("澶嶆牳澶辫触锛屽鏍镐汉鍛樺拰鍏抽棴璁㈠崟浜哄憳涓嶈兘鐩稿悓锛�");
                 }
+                if (date.Id == notice.CreateUser)
+                {
+                    throw new Exception("澶嶆牳澶辫触锛屽鏍镐汉鍛樺拰鍒涘缓璁㈠崟浜哄憳涓嶈兘鐩稿悓锛�");
+                }
                 var list = new List<SoDetail>();
                 foreach (var d in detail)
                 {
@@ -1283,8 +1287,7 @@
                                 throw new Exception("褰撳墠鍗曟嵁鏄庣粏涓鍒掓暟閲忎笌鎷h揣鏁伴噺涓嶇锛岃鏍稿疄");
                             }
                         }
-                        if (d.Qty < d.CompleteQty)
-                        {
+                       
                             //鏇存敼搴撳瓨鏄庣粏閿佸畾鏁伴噺
                             var allotList = Db.Queryable<BllExportAllot>().Where(o => o.SODetailNo == d.Id && o.Status == "3" && o.IsDel == "0").ToList();
                             foreach (var o in allotList)
@@ -1335,7 +1338,7 @@
                                 Db.Updateable(st).UpdateColumns(it => new { it.LockQty }).ExecuteCommand();
                             }
                             #endregion
-                        }
+                        
 
                     }
                     //娣诲姞鎿嶄綔鏃ュ織璁板綍
@@ -1687,7 +1690,7 @@
         #region 涓嬪彂鍑哄簱銆佸嚭搴撳畬鎴愩�侀噸鏂颁笅鍙戜换鍔°�佸彇娑堜换鍔°�佸紓甯稿鐞�
 
         // 涓嬪彂鍑哄簱锛堣皟鐢╟s鎺ュ彛缁欎粬搴撲綅鍦板潃锛�
-        public List<OutCommandDto> IssueOutHouse(string soNo, string unstackingMode, string outMode, string loadingAddre, int userId, string url, out string str)
+        public List<OutCommandDto> IssueOutHouse(string soNo, string unstackingMode, string outMode,string checkmode, string loadingAddre, int userId, string url, out string str)
         {
             try
             {
@@ -1707,8 +1710,11 @@
                 {
                     throw new Exception($"鏈壘鍒皗soNo}鍑哄簱鍗曚俊鎭�");
                 }
-                //鎵�鏈夎鍑哄簱鐨勫嚭搴撳垎閰嶄俊鎭�(鏈笅鍙戠殑淇℃伅鍜屽緟鎷h揣鐨勪俊鎭�)
-                var list = Db.Queryable<BllExportAllot>().Where(a => a.IsDel == "0" && a.SONo == soNo && a.Status == "0").ToList();
+                //鏇存柊鍑哄簱鍗曟嫞閫夋柟寮�
+                notice.UDF1 = checkmode; 
+                Db.Updateable(notice).ExecuteCommand();
+                //鎵�鏈夎鍑哄簱鐨勫嚭搴撳垎閰嶄俊鎭�(鏈笅鍙戠殑淇℃伅鍜屽緟鎷h揣鐨勪俊鎭拰閮ㄥ垎鎷h揣鍚庡洖娴佸叆搴撶殑鎵樼洏)
+                var list = Db.Queryable<BllExportAllot>().Where(a => a.IsDel == "0" && a.SONo == soNo && (a.Status == "0" || a.Status == "3")).ToList();
                 if (list.Count == 0) //鍒ゆ柇鏄惁鏈夐渶瑕佷笅鍙戠殑鍑哄簱娴佹按
                 {
                     throw new Exception("褰撳墠鍑哄簱鍗曟嵁鏃犻渶瑕佷笅鍙戠殑鎵樼洏");
@@ -2249,7 +2255,7 @@
                 //鍑哄簱浠诲姟鍙锋洿鏀癸紝濡傛灉鐢盤LC鍑哄簱锛屽垯PLC鍥炰紶浠诲姟鍙蜂负锛氫换鍔″彿+瀹為檯鍑哄簱鍙�
                 var TtaskNo = taskNo;
                 var outLine = "";
-                if (userId == 0)
+                if (taskNo.Length == 18)
                 {
                     TtaskNo = taskNo.Substring(0, taskNo.Length - 3);
                     outLine = taskNo.Substring(taskNo.Length - 3, 3);
@@ -2427,11 +2433,11 @@
                                 if (outLine == "443")//瑗夸晶鍑哄簱
                                 {
 
-                                    positionEnd = locateno.OrderBy(m => m.LocatNo).First(m => m.Row == 1 && m.Status == "0" && m.Flag == "0").LocatNo; //瑗夸晶鎴块棿搴撲綅鍜屽闈㈡埧闂�
+                                    positionEnd = locateno.OrderBy(m => m.LocatNo).First(m => m.Row == 1 && m.Status == "0" && m.Flag == "0").LocatNo; //瑗夸晶鎴块棿搴撲綅
                                 }
                                 else if (outLine == "440")  //涓滀晶鍑哄簱
                                 {
-                                    positionEnd = locateno.OrderBy(m => m.LocatNo).First(m => m.Row == 2  && m.Status == "0" && m.Flag == "0").LocatNo; //涓滀晶鎴块棿搴撲綅
+                                    positionEnd = locateno.OrderBy(m => m.LocatNo).First(m => m.Row == 3  && m.Status == "0" && m.Flag == "0").LocatNo; //涓滀晶鎴块棿搴撲綅鍜屽闈㈡埧闂�
                                 }
                             }
                             else if (type1.Type == "2" || type1.Type == "3") //鎶芥鍑哄簱 /鍙栨牱鍑哄簱
@@ -2441,7 +2447,18 @@
                             else if (type1.Type == "4")//涓嶅悎鏍煎搧鍑哄簱
                             {
 
-                                positionEnd = Db.Queryable<SysStorageLocat>().OrderBy(m => m.LocatNo).First(m => m.AreaNo == "B03" && m.Status == "0" && m.Flag == "0").LocatNo;
+                                positionEnd = Db.Queryable<SysStorageLocat>().OrderBy(m => m.LocatNo).First(m => (m.AreaNo == "B01"|| m.AreaNo == "B02"||m.AreaNo == "B04") && m.Status == "0" && m.Flag == "0").LocatNo;
+                            }
+                            else if (type1.Type == "0")//鎴愬搧鍑哄簱
+                            {
+                                if (type1.UDF1 == "0") //鍑哄簱鍒版殏瀛樺尯
+                                {
+                                    positionEnd = Db.Queryable<SysStorageLocat>().OrderBy(m => m.LocatNo).First(m => m.AreaNo == "B02" && m.Status == "0" && m.Flag == "0").LocatNo;
+                                }
+                                else
+                                {
+                                    return;
+                                }
                             }
                             else //鍏朵粬鍗曟嵁绫诲瀷閮藉瓨鏀惧彂璐х紦瀛樺尯
                             {
@@ -2481,7 +2498,8 @@
                         agvTask.CtnrTyp = "1";            //瀹瑰櫒绫诲瀷锛屽�间负1
                         if (type == "D02")
                         {
-                            agvTask.CtnrNum = "10";     //鍙犳墭浠诲姟闇�瑕佷笅鍙戠┖鎵樼洏鏁伴噺
+                            var palnoNum = Db.Queryable<BllPalletBind>().OrderByDescending(w=>w.Id).First(w => w.IsDel == "0" && w.PalletNo == task.PalletNo);
+                            agvTask.CtnrNum = palnoNum.Qty.ToString();     //鍙犳墭浠诲姟闇�瑕佷笅鍙戠┖鎵樼洏鏁伴噺
                         }
 
                         agvTaskList.Add(agvTask);
@@ -2668,8 +2686,9 @@
                     StartLocate = locateNo, // 璧峰浣嶇疆
                     StartRoadway = locate.RoadwayNo,
                     EndLocate = task.EndLocat, // 鐩爣浣嶇疆 
+                    EndRoadway = task.EndRoadway,
                     TaskNo = task.TaskNo, // 浠诲姟鍙�
-                    TaskType = "1",// 浠诲姟绫诲瀷 (鍑哄簱)
+                    TaskType = task.Type,// 浠诲姟绫诲瀷 (鍑哄簱)
                     OutMode = "",  //鐩爣鍦板潃
                     Order = 1
                 }; //鍑哄簱鏁版嵁 
@@ -3931,7 +3950,7 @@
                     throw new Exception("鎷h揣鏁伴噺涓嶈兘澶т簬绠卞唴鍓╀綑寰呮嫞鏁伴噺");
                 }
                 decimal pickQty = 0;//鎷h揣鐨勬暟閲�
-
+                Db.BeginTran();
                 var comList = new List<BllCompleteDetail>();
                 foreach (var item in boxInfos)
                 {
@@ -4038,12 +4057,12 @@
                 }
                 //淇敼鍑哄簱鍗曚俊鎭�
                 Db.Updateable(notice).ExecuteCommand();
-                
+                Db.CommitTran();
                 return allot.LoadingAddre;
             }
             catch (Exception e)
             {
-
+                Db.RollbackTran();
                 throw new Exception(e.Message);
             }
         }

--
Gitblit v1.8.0