From 0e42f871905f207658d822fcbe29aeb57b2156af Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周三, 21 5月 2025 16:18:01 +0800
Subject: [PATCH] 修复查询bug

---
 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs |   71 ++++++++++++++++++++++++++++++++---
 1 files changed, 65 insertions(+), 6 deletions(-)

diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs
index 6a65e24..9e1ae40 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs
@@ -37,7 +37,6 @@
         private readonly ILogger<PipeLineLemsProjectService> _logger;
         private readonly IVariableDataCache _variableDataCache;
 
-
         /// <summary>
         /// 鍙橀噺鏈嶅姟
         /// </summary>
@@ -96,6 +95,7 @@
 
                 { "瑁呴厤瀹屽伐淇″彿", "瑁呴厤瀹屽伐淇″彿(鎻忚堪)" },
                 { "鐒婃帴瀹屽伐淇″彿", "鐒婃帴瀹屽伐淇″彿(鎻忚堪)" },
+                { "娉曞叞鍐茬爜瀹屽伐淇″彿", "娉曞叞鍐茬爜瀹屽伐淇″彿(鎻忚堪)" },
             };
 
             // 鍒涘缓閫氶亾鐩戝惉
@@ -296,6 +296,24 @@
                         _ = Task.Run(async () =>
                         {
                             await HanlderFor瀹屽伐淇″彿WhenFalseAsync("鐒婃帴");
+                        });
+                    }
+                }
+
+                if (changed.Name == "娉曞叞鍐茬爜瀹屽伐淇″彿")
+                {
+                    if (changed.New?.Value.SafeString().ToBool() == true)
+                    {
+                        _ = Task.Run(async () =>
+                        {
+                            await HanlderFor娉曞叞鍐茬爜瀹屽伐淇″彿Async();
+                        });
+                    }
+                    else
+                    {
+                        _ = Task.Run(async () =>
+                        {
+                            await HanlderFor瀹屽伐淇″彿WhenFalseAsync("娉曞叞鍐茬爜");
                         });
                     }
                 }
@@ -892,12 +910,12 @@
                     {
                         UserAccount = userName.Content.Value.SafeString().ToString()
                     };
-                    sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName = "瑁呴厤宸ュ簭" }, myCurrentUser);
+                    await sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName = "瑁呴厤宸ュ簭" }, myCurrentUser);
 
                 }
-                catch (Exception)
+                catch (Exception ex)
                 {
-
+                    _logger.LogException(ex, LogLevel.Error);
                 }
             }
         }
@@ -934,12 +952,53 @@
                     {
                         UserAccount = userName.Content.Value.SafeString().ToString()
                     };
-                    sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName = "鐒婃帴宸ュ簭" }, myCurrentUser);
+                    await sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName = "鐒婃帴宸ュ簭" }, myCurrentUser);
 
                 }
-                catch (Exception)
+                catch (Exception ex)
                 {
+                    _logger.LogException(ex, LogLevel.Error);
+                }
+            }
+        }
 
+        /// <summary>
+        /// 娉曞叞鍐茬爜瀹屽伐淇″彿=true鏃�
+        /// </summary>
+        /// <returns></returns>
+        private async Task HanlderFor娉曞叞鍐茬爜瀹屽伐淇″彿Async()
+        {
+
+            var txt = "娉曞叞鍐茬爜";
+            var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>();
+            var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>();
+            var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>();
+
+            var pipeSpecCode = await _variableService.ReadValueAsync($"{txt}绠℃缂栫爜");
+
+            if (string.IsNullOrEmpty(pipeSpecCode?.Content?.Value.SafeString().ToString()))
+            {
+
+            }
+            else
+            {
+                var myPipeSpecCode = pipeSpecCode.Content.Value.SafeString().ToString();
+                CallMaterialOrder callMaterialOrder = null;
+                try
+                {
+                    var sharedService = _serviceProvider.GetRequiredService<SharedService>();
+                    var userName = await _variableService.ReadValueAsync($"{txt}浜�");
+                    MyCurrentUser myCurrentUser = new MyCurrentUser()
+                    {
+                        UserAccount = userName.Content.Value.SafeString().ToString()
+                    };
+                    await sharedService.SendFlangeCode_CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput()
+                    { PipeSpecCode = myPipeSpecCode, ProcessName = $"{txt}宸ュ簭" }, myCurrentUser);
+
+                }
+                catch (Exception ex)
+                {
+                    _logger.LogException(ex, LogLevel.Error);
                 }
             }
         }

--
Gitblit v1.9.3