From 964db60bb3d2e9a0a695b71554a98765e900732a Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期六, 16 三月 2024 10:58:34 +0800
Subject: [PATCH] Merge branch 'yyk'

---
 Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index 8d0d9c4..c3031a1 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -17,6 +17,7 @@
 using Model.ModelDto.PdaDto;
 using Dm;
 using Model.InterFaceModel;
+using WMS.Entity.BllQualityEntity;
 
 namespace WMS.BLL.BllPdaServer
 {
@@ -1788,9 +1789,9 @@
                 }
                 //鏍规嵁鍗曟嵁鍙疯幏鍙栧叆搴撳崟鎬诲崟
                 var notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.ASNNo == model.AsnNo);
-                if (notice.Status != "0" && notice.Status != "1")
+                if (notice.Status != "0" && notice.Status != "1" && notice.Status != "2")
                 {
-                    throw new Exception("-1:鍏ュ簱鍗曠姸鎬佷笉鏄瓑寰呮墽琛屾垨鎵ц瀹屾垚!");
+                    throw new Exception("-1:璇ュ崟鎹凡鍏冲崟!");
                 }
                 if (string.IsNullOrEmpty(model.LotNo))
                 {
@@ -2371,8 +2372,28 @@
                             detailModel.SupplierNo = notice.CustomerNo;//渚涘簲鍟嗙紪鐮�
                             detailModel.SupplierName = notice.CustomerName;//渚涘簲鍟嗗悕绉�
                         }
+                        #region  缁存姢璐ㄦ缁撴灉
+                        //鑾峰彇璇ユ壒娆℃渶缁堣川妫�缁撴灉
+                        var quality = Db.Queryable<BllQualityInspect>().Where(a => a.LotNo == noticeDetail.LotNo && a.IsDel == "0").OrderByDescending(a => a.CreateTime).First();
+                        if (quality != null)
+                        {
+                            //淇敼鍚堟牸涓嶅悎鏍兼暟閲�
+                            if (quality.IsQualified == "1") //鍚堟牸
+                            {
+                                //澧炲姞鍚堟牸鏁伴噺
+                                quality.PassQty += detailModel.Qty;
+                                detailModel.InspectStatus = "1";
+                            }
+                            else if (quality.IsQualified == "0") //涓嶅悎鏍�
+                            {
+                                //澧炲姞涓嶅悎鏍兼暟閲�
+                                quality.FailQty += detailModel.Qty;
+                                detailModel.InspectStatus = "2";
+                            }
+                            Db.Updateable(quality).ExecuteCommand(); //淇敼璐ㄦ淇℃伅
+                        }
+                        #endregion
                         stId = Db.Insertable<DataStockDetail>(detailModel).ExecuteReturnIdentity();
-
                     }
                     else
                     {

--
Gitblit v1.8.0