From 38f7aa5340b760d639263959aa59f87c512e75fa Mon Sep 17 00:00:00 2001
From: 杨张扬 <634643841@qq.com>
Date: 星期六, 19 七月 2025 19:18:28 +0800
Subject: [PATCH] 双钱-点对点、满托出库上线、暂时取消RFID读卡器校验 双钱:取消任务收到4取货完成后,不会再次解锁重置起点

---
 wms/SpecHelper.cs |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/wms/SpecHelper.cs b/wms/SpecHelper.cs
index 539ffa8..5ae0d67 100644
--- a/wms/SpecHelper.cs
+++ b/wms/SpecHelper.cs
@@ -315,12 +315,11 @@
                                 return;
                             }
 
-                            var locCnt = db.Queryable<TN_Loc_Container>().First(a => a.S_LOC_CODE == endLoc.S_CODE);
+                            var locCnt = db.Queryable<TN_Loc_Container>().First(a => a.S_CNTR_CODE == tN_Task.S_CNTR_CODE);
 
                             if (locCnt != null)
                             {
-                                var cgInfo = db.Queryable<TN_CG_Detail>().First(a => a.S_CNTR_CODE == locCnt.S_CNTR_CODE);
-
+                                
                                 if (db.Deleteable<TN_Loc_Container>(locCnt).ExecuteCommand() > 0)
                                 {
                                     LogHelper.Info($"鍒犻櫎璐т綅瀹瑰櫒缁戝畾鍏崇郴鎴愬姛锛寋JsonConvert.SerializeObject(locCnt)}");
@@ -332,6 +331,8 @@
                                     return;
                                 }
 
+                                var cgInfo = db.Queryable<TN_CG_Detail>().First(a => a.S_CNTR_CODE == tN_Task.S_CNTR_CODE);
+
                                 if (cgInfo != null)
                                 {
                                     if (db.Deleteable<TN_CG_Detail>(cgInfo).ExecuteCommand() > 0)
@@ -341,6 +342,21 @@
                                     else
                                     {
                                         LogHelper.Info($"鍒犻櫎瀹瑰櫒璐у搧鏄庣粏澶辫触锛寋JsonConvert.SerializeObject(cgInfo)}");
+                                        tran.RollbackTran();
+                                        return;
+                                    }
+                                }
+
+                                var cnt = db.Queryable<TN_Container>().First(it => it.S_CODE == cgInfo.S_CNTR_CODE);
+                                if (cnt != null)
+                                {
+                                    if (db.Deleteable<TN_Container>(cnt).ExecuteCommand() > 0)
+                                    {
+                                        LogHelper.Info($"鍒犻櫎瀹瑰櫒鎴愬姛锛寋JsonConvert.SerializeObject(cnt)}");
+                                    }
+                                    else
+                                    {
+                                        LogHelper.Info($"鍒犻櫎瀹瑰櫒澶辫触锛寋JsonConvert.SerializeObject(cnt)}");
                                         tran.RollbackTran();
                                         return;
                                     }
@@ -409,13 +425,8 @@
 
                 if (model != null)
                 {
-                    var target = db.Queryable<TN_InventoryM>().First(o => o.RFID == model.RFID);
-                    if (target != null)
-                    {
-                        db.Deleteable<TN_InventoryM>(target).ExecuteCommand();
-                    }
                     model.EXPIRATION = System.DateTime.Now.AddHours(GetExportTime(model.SPEC));
-                    if (db.Insertable<TN_InventoryM>(model).ExecuteCommand() > 0)
+                    if (db.Storageable<TN_InventoryM>(model).ExecuteCommand() > 0)
                     {
                         LogHelper.Info($"鎻掑叆WMS搴撳瓨鏄庣粏鎴愬姛锛寋log}");
                     }

--
Gitblit v1.9.1