From 5ce969ed34e91c931cce38e2feb5d2c208633a96 Mon Sep 17 00:00:00 2001
From: chengsc <Demo@DESKTOP-CPA90BF>
Date: 星期日, 03 十一月 2024 18:34:53 +0800
Subject: [PATCH] 修改问题

---
 Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs b/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
index 161ce8e..9888083 100644
--- a/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
@@ -180,6 +180,7 @@
                 //鍒ゆ柇鎵樼洏缁戝畾淇℃伅涓槸鍚︽湁
                 var bind = Db.Queryable<BllPalletBind>().First(m => m.IsDel == "0" && m.ASNDetailNo == detail.Id && m.PalletNo == model.PalletNo && m.Status != "2");
                 var bindId = 0;
+                var boxQtyZong = model.Detail.Sum(m => m.Qty);
                 if (bind == null)
                 {
                     bind = new BllPalletBind
@@ -189,7 +190,7 @@
                         PalletNo = model.PalletNo,
                         PalletNo2 = "",
                         PalletNo3 = "",
-                        Qty = model.Qty,
+                        Qty = boxQtyZong,
                         FullQty = pNum,
                         Status = "0",//绛夊緟鎵ц
                         Type = model.Type, //鎵樼洏绫诲瀷  0鐗╂枡鎵�  1绌烘墭鐩樻墭
@@ -213,7 +214,8 @@
                 }
                 else
                 {
-                    throw new Exception("缁勭洏淇℃伅閲嶅");
+                    //throw new Exception("缁勭洏淇℃伅閲嶅");
+                    return;
                 }
 
 
@@ -316,8 +318,8 @@
                                 Standard = box.Standard,
                                 PackageStandard = box.PackageStandard,
                                 StoreTime = box.StoreTime,
-                                QtyCount = (int)box.QtyCount,
-                                QtyOrd = (int)box.QtyOrd,
+                                QtyCount = box.QtyCount.HasValue? (int)box.QtyCount : 0,
+                                QtyOrd = box.QtyOrd.HasValue ? (int)box.QtyOrd : 0,
                                 CreateUser = userId,
                                 CreateTime = comTime,
                             };
@@ -493,6 +495,7 @@
                     .GroupBy((a, b) => new
                     {
                         a.PalletNo,
+                        a.BindNo,
                         a.BoxNo,
                         a.SkuNo,
                         a.SkuName,
@@ -510,6 +513,7 @@
                     .Select((a, b) => new BoxInfoDto()
                     {
                         BoxNo = a.BoxNo,
+                        BindNo = a.BindNo,
                         PalletNo = a.PalletNo,
                         Qty = SqlFunc.AggregateSum(a.Qty),
                         FullQty = a.FullQty,
@@ -540,9 +544,10 @@
         /// <param name="boxNo">绠辩爜</param>
         /// <param name="boxNo3">鏀爜</param>
         /// <returns></returns>
-        public List<BoxInfoDto> GetBoxInfoByBoxNo(string boxNo, string boxNo3)
+        public List<BoxInfoDto> GetBoxInfoByBoxNo(string bindNo, string boxNo, string boxNo3)
         {
             Expression<Func<BllBoxInfo, bool>> item = Expressionable.Create<BllBoxInfo>()
+                .AndIF(!string.IsNullOrWhiteSpace(bindNo), it => it.BindNo == int.Parse(bindNo))
                 .AndIF(!string.IsNullOrWhiteSpace(boxNo), it => it.BoxNo == boxNo.Trim())
                 .AndIF(!string.IsNullOrWhiteSpace(boxNo3), it => it.BoxNo3.Contains(boxNo3.Trim()))
                 .And(m => m.IsDel == "0")
@@ -1618,7 +1623,7 @@
 
 
 
-                var areaNoStr = "A03";
+                var areaNoStr = "A07";
                 var allotLocate = new AllotLocation();
                 
                 #region 鏍规嵁sku纭鍖哄煙鍒掑垎
@@ -2291,7 +2296,7 @@
 
                 SysStorageLocat locate;
                 var areaList = new List<string>();
-                areaList.Add("A03");
+                areaList.Add("A07");
                 locate = allotLocate.GetSuiTableLocate(houseNo, areaList, roadwayNo);
                  
                 Db.BeginTran();
@@ -2522,6 +2527,7 @@
                                 SkuName = boxInfo.SkuName,
                                 Standard = sku.Standard,
                                 ProductionTime = boxInfo.ProductionTime,
+                                ExpirationTime = boxInfo.ExpirationTime,
                                 SupplierLot = boxInfo.SupplierLot,
                                 InspectStatus = boxInfo.InspectStatus,
                                 InspectMark = boxInfo.InspectMark,
@@ -2695,6 +2701,7 @@
                                     SkuName = demo.SkuName,
                                     Standard = noticeDetail.Standard,
                                     ProductionTime = demo.ProductionTime,
+                                    ExpirationTime = demo.ExpirationTime,
                                     SupplierLot = demo.SupplierLot,
                                     InspectStatus = demo.InspectStatus,
                                     InspectMark = demo.InspectMark,

--
Gitblit v1.8.0