From 63eb28a9ba7aa9c549bc99f9c68d0a4c051453ba Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期四, 20 三月 2025 17:38:47 +0800
Subject: [PATCH] 修正sugsql导航更新加配置的bug

---
 cylsg/cylsg.Application/CyOS/CyOSSDriver.cs |   35 +++++++++++++++++++++++------------
 1 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/cylsg/cylsg.Application/CyOS/CyOSSDriver.cs b/cylsg/cylsg.Application/CyOS/CyOSSDriver.cs
index ddd0db6..15c2b80 100644
--- a/cylsg/cylsg.Application/CyOS/CyOSSDriver.cs
+++ b/cylsg/cylsg.Application/CyOS/CyOSSDriver.cs
@@ -209,14 +209,28 @@
             a.Deliveredstatus= Param.Deliveredstatus;
             a.Attachments = Param.Attachments;
 
-            return await _client.UpdateNav(a).Include(x=>x.Attachments,new SqlSugar.UpdateNavOptions()
-                { 
-                   OneToManyInsertOrUpdate = true,//閰嶇疆鍚敤 鎻掑叆銆佹洿鏂版垨鍒犻櫎妯″紡
-                }).Include(x=>x.DeliverPlans,new UpdateNavOptions()
-                {
-                    OneToManyInsertOrUpdate=true,
-                }
-                ).ExecuteCommandAsync();
+            return await _client.UpdateNav(a).Include(x=>x.Attachments).ExecuteCommandAsync();
+
+            //await _client.AsTenant().BeginTranAsync();
+            //try
+            //{
+            //    var id = await _client.Insertable(pram).ExecuteReturnIdentityAsync();
+            //    if (pram.WorkPlanAttachments?.Count > 0)
+            //    {
+            //        foreach (var item in pram.WorkPlanAttachments)
+            //        {
+            //            item.OA_WorkPlanId = id;
+
+            //        }
+            //        await _client.Insertable(pram.WorkPlanAttachments).ExecuteCommandAsync();
+            //    }
+            //    await _client.AsTenant().CommitTranAsync();
+            //}
+            //catch (Exception)
+            //{
+            //    await _client.AsTenant().RollbackTranAsync();
+            //    throw;
+            //}
 
             //await _client.AsTenant().BeginTranAsync();
             //try
@@ -457,10 +471,7 @@
                 //{
                 //     OneToManyInsertOrUpdate = true,
                 //})
-                    .Include(x => x.CarConditionAttachments,new UpdateNavOptions
-                {
-                    OneToManyInsertOrUpdate = true,
-                }).ExecuteCommandAsync();
+                    .Include(x => x.CarConditionAttachments).ExecuteCommandAsync();
             }
            
 

--
Gitblit v1.9.1