From 0caa59dda5ede8b93c4fd47f095bbf716f57383b Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期四, 13 十一月 2025 11:03:19 +0800
Subject: [PATCH] 开发LIMS质量结果下发接口

---
 Wms/WMS.BLL/BllTransServer/RcsServer.cs |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/Wms/WMS.BLL/BllTransServer/RcsServer.cs b/Wms/WMS.BLL/BllTransServer/RcsServer.cs
index caab7f1..a401604 100644
--- a/Wms/WMS.BLL/BllTransServer/RcsServer.cs
+++ b/Wms/WMS.BLL/BllTransServer/RcsServer.cs
@@ -14,6 +14,7 @@
 using WMS.BLL.LogServer;
 using WMS.DAL;
 using WMS.Entity.BllAsnEntity;
+using WMS.Entity.BllQualityEntity;
 using WMS.Entity.BllSoEntity;
 using WMS.Entity.Context;
 using WMS.Entity.DataEntity;
@@ -1621,5 +1622,59 @@
                 throw new Exception(e.Message);
             }
         }
+
+        /// <summary>
+        /// 璐ㄩ噺缁撴灉涓嬪彂
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        /// <exception cref="Exception"></exception>
+        public void QualityResult(QualityResultVm model)
+        {
+            try
+            {
+                //楠岃瘉鎵规鍙锋槸鍚︿负绌�
+                if (string.IsNullOrEmpty(model.LotNo))
+                {
+                    throw new Exception("鎵规鍙蜂笉鍙负绌猴紝璇锋牳鏌ワ紒");
+                }
+                //寮�鍚簨鍔�
+                Db.BeginTran();
+
+                BllQualityInspect inspectModel = new BllQualityInspect();
+                inspectModel.InspectNo = "";
+                inspectModel.ASNNo = "";
+                inspectModel.LotNo = model.LotNo;
+                inspectModel.IsQualified = model.IsQualified;
+                inspectModel.Origin = "LIMS"; //鏉ユ簮
+                inspectModel.CreateTime = Db.GetDate(); //鍒涘缓鏃ユ湡
+                inspectModel.SkuNo = ""; //鐗╂枡鍙�
+                inspectModel.SkuName = ""; //鐗╂枡鍚嶇О
+                inspectModel.PassQty = 0; //鍚堟牸鏁伴噺
+                inspectModel.FailQty = 0; //涓嶅悎鏍兼暟閲�
+                inspectModel.Standard = ""; //瑙勬牸
+                inspectModel.CreateUser = 0;
+                //鎻掑叆璐ㄦ淇℃伅
+                Db.Insertable(inspectModel).ExecuteCommand();
+
+                //鏌ユ壘搴撳瓨鏄庣粏淇℃伅
+                List<DataStockDetail> detail = Db.Queryable<DataStockDetail>().Where(m => m.IsDel == "0" && m.LotNo == model.LotNo).ToList();
+                foreach (var item in detail)
+                {
+                    item.InspectStatus = model.IsQualified == "1" ? "1" : "2";//0:寰呮楠岋紝1锛氬悎鏍硷紝2锛氫笉鍚堟牸
+
+                    Db.Updateable(item).ExecuteCommand();
+                }
+
+                //鎻愪氦浜嬪姟
+                Db.CommitTran();
+            }
+            catch (Exception ex)
+            {
+                //鍥炴粴浜嬪姟
+                Db.RollbackTran();
+                throw new Exception(ex.Message);
+            }
+        }
     }
 }

--
Gitblit v1.8.0