From 5b4f00ff3ea04a3246a8f6f86bdefe749fcfd0c4 Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期二, 26 三月 2024 08:24:28 +0800
Subject: [PATCH] 合并代码

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

diff --git a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
index 3209e53..e85ca4e 100644
--- a/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
+++ b/Wms/WMS.BLL/BllSoServer/ExportNoticeServer.cs
@@ -506,7 +506,8 @@
                     SkuName = it.SkuName,
                     LotNo = it.LotNo,
                     Standard = it.Standard,
-                    Qty = type == "4" ? it.Qty : it.Qty - it.LockQty - it.FrozenQty
+                    //Qty = type == "4" ? it.Qty : it.Qty - it.LockQty - it.FrozenQty,
+                    Qty = it.Qty - it.LockQty - it.FrozenQty,
 
                 }).ToList();
 
@@ -2548,6 +2549,38 @@
                     {
                         throw new Exception("鏈煡璇㈠埌浠诲姟淇℃伅");
                     }
+                    //鑾峰彇瀵瑰簲搴撲綅淇℃伅
+                    var startlocat = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.WareHouseNo == "W01" && a.LocatNo == task.StartLocat);
+                    if (startlocat == null)
+                    {
+                        throw new Exception("鏈煡璇㈠埌鍌ㄤ綅淇℃伅");
+                    }
+                    startlocat.Status = "0";//淇敼鍒嗛厤淇℃伅鐘舵��
+                    //鑾峰彇鍌ㄤ綅淇℃伅
+                    var locat = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.WareHouseNo == "W01" && a.LocatNo == task.StartLocat);
+                    //鑾峰彇绉诲簱浠籨鍔″搴旂洰鏍囧偍浣嶄俊鎭�
+                    SysStorageLocat endlocat = new SysStorageLocat();
+                    if (task.Type == "2")
+                    {
+                        endlocat = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.WareHouseNo == "W01" && a.LocatNo == task.EndLocat);
+                        if (endlocat == null)
+                        {
+                            throw new Exception("鏈煡璇㈠埌鐩爣鍌ㄤ綅淇℃伅");
+                        }
+                    }
+                    if (locat == null)
+                    {
+                        Db.RollbackTran();
+                        throw new Exception("鏈煡璇㈠埌鍌ㄤ綅淇℃伅锛岃鏍稿疄锛�");
+                    }
+                    locat.Status = "1"; //鏈夌墿鍝�
+                    Db.Updateable(locat).ExecuteCommand();
+                    if (endlocat != null)
+                    {
+                        endlocat.Status = "0"; //绌哄偍浣� 0
+                        Db.Updateable(endlocat).ExecuteCommand();
+                    }
+
                     //淇敼浠诲姟 
                     task.IsSuccess = 1;
                     task.IsSend = 0;
@@ -2571,31 +2604,6 @@
 
                         noticeDetail.FactQty -= item.Qty; //淇敼鍑哄簱鍗曟槑缁嗙殑涓嬫灦鏁伴噺
                         Db.Updateable(noticeDetail).ExecuteCommand();
-
-                        //鑾峰彇鍌ㄤ綅淇℃伅
-                        var locat = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.WareHouseNo == "W01" && a.LocatNo == task.StartLocat);
-                        //鑾峰彇绉诲簱浠诲姟瀵瑰簲鐩爣鍌ㄤ綅淇℃伅
-                        SysStorageLocat endlocat = new SysStorageLocat();
-                        if (task.Type == "2")
-                        {
-                            endlocat = Db.Queryable<SysStorageLocat>().First(a => a.IsDel == "0" && a.WareHouseNo == "W03" && a.LocatNo == task.EndLocat);
-                            if (endlocat == null)
-                            {
-                                throw new Exception("鏈煡璇㈠埌鐩爣鍌ㄤ綅淇℃伅");
-                            }
-                        }
-                        if (locat == null)
-                        {
-                            Db.RollbackTran();
-                            throw new Exception("鏈煡璇㈠埌鍌ㄤ綅淇℃伅锛岃鏍稿疄锛�");
-                        }
-                        locat.Status = "1"; //鏈夌墿鍝�
-                        Db.Updateable(locat).ExecuteCommand();
-                        if (endlocat != null)
-                        {
-                            endlocat.Status = "0"; //绌哄偍浣� 0
-                            Db.Updateable(endlocat).ExecuteCommand();
-                        }
 
                         if (noticeDetail.FactQty == 0)
                         {

--
Gitblit v1.8.0