From 24eaa29a52b8c050fc391eafd0b0cc370733cf91 Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期三, 26 十一月 2025 15:22:16 +0800
Subject: [PATCH] 修改拣货拼托判断有误

---
 Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs b/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs
index cb18376..c818606 100644
--- a/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs
+++ b/Wms/WMS.BLL/BllQualityServer/QualityInspectServer.cs
@@ -80,7 +80,7 @@
                 skuname = "%" + model.SkuName + "%", //鐗╂枡鍚嶇О
                 lotno = model.LotNo, //鎵规鍙�
                 isqualified = model.IsQualified, //鏄惁鍚堟牸
-                origin=model.Origin//鏉ユ簮
+                origin = model.Origin//鏉ユ簮
             });
             return qualityList;
         }
@@ -166,7 +166,7 @@
             {
                 sqlStr += $" and LotNo='{model.LotNo}' ";
             }
-            BllArrivalNoticeDetail arrivalDetail = Db.SqlQueryable<BllArrivalNoticeDetail>(sqlStr).First();            
+            BllArrivalNoticeDetail arrivalDetail = Db.SqlQueryable<BllArrivalNoticeDetail>(sqlStr).First();
             if (arrivalDetail == null)
             {
                 throw new Exception("鏈壘鍒板叆搴撳崟淇℃伅锛�");
@@ -195,7 +195,7 @@
             List<DataStockDetail> detail = Db.SqlQueryable<DataStockDetail>(sqlStr2).ToList();
             foreach (var item in detail)
             {
-                List<BllBoxInfo> box = Db.Queryable<BllBoxInfo>().Where(a => a.IsDel == "0" && a.SkuNo == model.SkuNo && a.LotNo == model.LotNo).ToList();
+                //List<BllBoxInfo> box = Db.Queryable<BllBoxInfo>().Where(a => a.IsDel == "0" && a.SkuNo == model.SkuNo && a.LotNo == model.LotNo).ToList();
                 //鍒ゆ柇鍚堟牸鐘舵�佹槸鍚﹀悎鏍�
                 if (model.IsQualified == "1")
                 {
@@ -211,12 +211,17 @@
                     item.InspectStatus = "2"; //2涓嶅悎鏍�
                 }
 
-                Db.Updateable(box).ExecuteCommand();
+                //Db.Updateable(box).ExecuteCommand();
                 Db.Updateable(item).ExecuteCommand();
             }
 
             Db.Updateable(arrivalDetail).ExecuteCommand();
             var isquality = Db.Insertable(model).ExecuteCommand();
+
+            //淇敼搴撳瓨绠辩爜璐ㄦ鐘舵��
+            string uptDataBoxStatusSql = $@"update DataBoxInfo set InspectStatus='1' where IsDel='0' and SkuNo='{model.SkuNo}' and LotNo='{model.LotNo}' and StockDetailId in (select Id from DataStockDetail where IsDel='0' and SkuNo='{model.SkuNo}' and LotNo='{model.LotNo}' and InspectStatus='1') ";
+            int uptDataBoxStatus = Db.Ado.ExecuteCommand(uptDataBoxStatusSql);
+
 
             return isquality;
         }
@@ -457,7 +462,7 @@
                 //鍥炴粴浜嬪姟
                 Db.RollbackTran();
                 //鎶涘嚭寮傚父
-                throw new Exception("鎺ユ敹SAP涓嬪彂搴撳瓨璋冩暣鍗曞紓甯�:", ex);
+                throw new Exception($"鎺ユ敹SAP涓嬪彂搴撳瓨璋冩暣鍗曞紓甯�:{ex}");
             }
         }
         #endregion

--
Gitblit v1.8.0