From bdd84cc48ba7b2527584c44d174da8e7d20c5375 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期三, 18 九月 2024 16:37:13 +0800
Subject: [PATCH] 增加对申请入库时对平库库位的校验

---
 Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs b/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
index 33efe0f..69e37ea 100644
--- a/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
@@ -33,7 +33,7 @@
 
         #region 鎺ュ彛鏂规硶
 
-        //JC23缁戝畾鐗╂枡鎵樼洏鍗冲鍔犲簱瀛�
+        //JC26缁戝畾鐗╂枡鎵樼洏鍗冲鍔犲簱瀛�
         public void BindPalletStock(BoxPalletBindVm model, int userId)
         {
             try
@@ -72,10 +72,10 @@
                     {
                         throw new Exception("鍗曟嵁鍙蜂笉鍙负绌�!");
                     }
-                    if (model.AsnDetailNo == 0)
-                    {
-                        throw new Exception("鍗曟嵁鏄庣粏涓嶅彲涓虹┖!");
-                    }
+                    //if (model.AsnDetailNo == 0)
+                    //{
+                    //    throw new Exception("鍗曟嵁鏄庣粏涓嶅彲涓虹┖!");
+                    //}
                     //鏍规嵁鍗曟嵁鍙疯幏鍙栧叆搴撳崟鎬诲崟
                     notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.ASNNo == model.AsnNo && a.OrderCode == model.OrderCode);
                     if (notice.Status != "0" && notice.Status != "1" && notice.Status != "2")
@@ -91,11 +91,13 @@
                         throw new Exception("鎵规涓嶈兘涓虹┖!");
                     }
                     // 楠岃瘉鍏ュ簱鍗曟槑缁嗘槸鍚﹀瓨鍦�
-                    detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" && m.Id == model.AsnDetailNo && m.ASNNo == model.AsnNo && m.LotNo == model.LotNo && m.SkuNo == model.SkuNo);
+                    detail = Db.Queryable<BllArrivalNoticeDetail>().First(m => m.IsDel == "0" 
+                    && m.ASNNo == model.AsnNo && m.LotNo == model.LotNo && m.SkuNo == model.SkuNo);
                     if (detail == null)
                     {
                         throw new Exception("褰撳墠鐗╂枡鍙婃壒娆′笌鍗曟嵁鏃犲叧鑱旓紝璇锋牳瀹�!");
                     }
+                    model.AsnDetailNo = detail.Id;
                 }
 
 
@@ -267,7 +269,7 @@
                         InspectQty = 0,
                         ASNNo = bind.ASNNo,
                         ASNDetailNo = bind.ASNDetailNo,
-                        WareHouseNo = "",//鎵�灞炰粨搴�
+                        WareHouseNo = "W01",//鎵�灞炰粨搴�
                         RoadwayNo = "",//鎵�灞炲贩閬�
                         AreaNo = "",//鎵�灞炲尯鍩�
                         LocatNo = "",//鍌ㄤ綅鍦板潃
@@ -446,8 +448,8 @@
                                 Standard = box.Standard,
                                 PackageStandard = box.PackageStandard,
                                 StoreTime = box.StoreTime,
-                                QtyCount = (int)box.QtyCount,
-                                QtyOrd = (int)box.QtyOrd,
+                                QtyCount = box.QtyCount,
+                                QtyOrd = box.QtyOrd,
                                 CreateUser = userId,
                                 CreateTime = comTime,
                             };
@@ -637,7 +639,7 @@
                     .LeftJoin<SysUserInfor>((a, b, c) => a.CreateUser == c.Id)
                     .LeftJoin<SysUserInfor>((a, b, c, d) => a.UpdateUser == d.Id)
                     .LeftJoin<SysStorageLocat>((a, b, c, d, e) => a.LocatNo == e.LocatNo)
-                    .LeftJoin<SysWareHouse>((a, b, c, d, e,f) => e.WareHouseNo == f.WareHouseNo)
+                    .LeftJoin<SysWareHouse>((a, b, c, d, e,f) => a.WareHouseNo == f.WareHouseNo)
                     //.LeftJoin<BllBoxInfo>((a, b, c, d, e, f) => a.Id == e.BindNo)
                     .Select((a, b, c, d,e,f) => new PalletBindDto()
                     {
@@ -685,6 +687,7 @@
                 throw new Exception(ex.Message);
             }
         }
+
 
         public List<BoxInfoDto> GetBoxInfoList(BoxInfoVm model, out int count)
         {
@@ -1375,7 +1378,7 @@
                    .AndIF(!string.IsNullOrWhiteSpace(layer), m => m.Layer == int.Parse(layer))
                    .AndIF(!string.IsNullOrWhiteSpace(locateNo), m => m.LocatNo.Contains(locateNo))
                    .And(m => m.IsDel == "0" && m.Status == "0" && m.Flag == "0" && m.WareHouseNo == houseNo)
-                   .And(m => m.AreaNo == categoryAreaNo)
+                   .And(m => categoryAreaNo.Contains(m.AreaNo))
                    .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏�
                 var total = 0;
                 var list = Db.Queryable<SysStorageLocat>().Where(item).OrderByDescending(a => a.Depth).OrderBy(a => a.Column)
@@ -1560,7 +1563,9 @@
                     throw new Exception("璇烽�夋嫨鎵�灞炰粨搴�");
                 }
                 //楠岃瘉鏄惁涓哄钩搴撳叆搴�
-                if (houseNo == "W02")
+                var houseType = Db.Queryable<SysWareHouse>().First(a => a.WareHouseNo == houseNo);//鑾峰彇浠撳簱绫诲瀷
+                //楠岃瘉鏄惁涓哄钩搴撳叆搴�
+                if (houseType.Type == "2")
                 {
                     throw new Exception("骞冲簱璇蜂娇鐢≒DA鎵嬫寔杩涜骞冲簱鍏ュ簱");
                 }
@@ -1949,6 +1954,8 @@
                                 Db.Updateable(bindModel).ExecuteCommand();
                                 asnNo = stockModel.ASNNo;
                             }
+
+
                         }
                     }
                     foreach (DataStockDetail stockModel in stockDetail)

--
Gitblit v1.8.0