From c6d9fc76d16c944e64d6490eb2a6d866fd7a38f0 Mon Sep 17 00:00:00 2001
From: tjx <t2856754968@163.com>
Date: 星期三, 12 十一月 2025 09:06:01 +0800
Subject: [PATCH] 11

---
 MES.Service/service/BasicData/MesDepotsManager.cs |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/MES.Service/service/BasicData/MesDepotsManager.cs b/MES.Service/service/BasicData/MesDepotsManager.cs
index 0aea512..ae137ed 100644
--- a/MES.Service/service/BasicData/MesDepotsManager.cs
+++ b/MES.Service/service/BasicData/MesDepotsManager.cs
@@ -53,10 +53,10 @@
     // 鎻掑叆鏂颁粨搴撶殑鏂规硶
     private bool InsertDepot(SqlSugarScope db, MesDepots entity)
     {
-        var exists = db.Queryable<MesDepots>().Any(e => e.DepotId == entity.DepotId);
+        var exists = db.Queryable<MesDepots>().Any(e => e.DepotId == entity.DepotId && e.DepotCode == entity.DepotCode);
         if (exists)
         {
-            var result = db.Updateable(entity).ExecuteCommand();
+            var result = db.Updateable(entity).Where(e => e.DepotId == entity.DepotId && e.DepotCode == entity.DepotCode).ExecuteCommand();
             return true;
         }
         else
@@ -76,10 +76,10 @@
     // 鎻掑叆鎴栨洿鏂颁粨搴撶殑鏂规硶
     private bool InsertOrUpdate(SqlSugarScope db, MesDepots entity)
     {
-        var exists = db.Queryable<MesDepots>().Any(e => e.DepotId == entity.DepotId);
+        var exists = db.Queryable<MesDepots>().Any(e => e.DepotId == entity.DepotId && e.DepotCode == entity.DepotCode);
         if (exists)
         {
-            var update = db.Updateable(entity).ExecuteCommand();
+            var update = db.Updateable(entity).Where(e => e.DepotId == entity.DepotId && e.DepotCode == entity.DepotCode).ExecuteCommand();
             return true;
         }
         else

--
Gitblit v1.9.3