From 9eaf758e97367dbc2eca2bdbdc92ab39e08be9d0 Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周四, 15 5月 2025 13:12:17 +0800
Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo

---
 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs |   75 +++++++++++++++++++++++++++++--------
 1 files changed, 58 insertions(+), 17 deletions(-)

diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs
index ed7599c..9755550 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs
@@ -21,6 +21,7 @@
 using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
 using System.Collections.Generic;
 using CMS.Framework.AspNetCore.Users;
+using NPOI.SS.Formula.Functions;
 
 namespace CMS.Plugin.PipeLineLems.ProjectService
 {
@@ -146,7 +147,7 @@
 
                 _logger.LogInformation($"{changed.Name} 鍙橀噺鍊煎彂鐢熷彉鍖栵紝鏃у�納oldValue}=鏂板�納newValue}锛孴raceId={traceId}");
 
-                if (changed.Name == "璇锋眰鐢熸垚鎵撶爜浜у搧鐮佷俊鍙�" && changed.New?.Value.SafeString().ToBool() == true)
+                if (changed.Name == "璇锋眰鐢熸垚鎵撶爜浜у搧鐮佷俊鍙�")
                 {
 
                     // TODO: 澶勭悊鍙橀噺鍊煎彉鍖�
@@ -159,15 +160,21 @@
                         锛�4锛夊苟鍙戠鐞嗭細 濡傛灉涓氬姟灞傚苟鍙戦噺澶э紝蹇呴』浼樺寲浠g爜璁捐鍜屽疄鏂斤紝浠ュ噺灏戝湪楂樺苟鍙戞儏鍐典笅鐨勭郴缁熻祫婧愭秷鑰楋紝闃叉绯荤粺鎬ц兘闂銆�
                         锛�5锛変唬鐮佸畨鍏細 瀹夎骞朵娇鐢� CMS.CodeAnalysis 鍒嗘瀽鍣ㄦ潵鍒嗘瀽 IVariableDataCache.TagChanged 鐨勪娇鐢ㄦ儏鍐点�傝宸ュ叿鑳藉湪浣跨敤涓嶅綋鏃舵彁渚涚紪璇戦敊璇紝甯姪鎮ㄦ彁楂樹唬鐮佽川閲忋��*/
 
-                    _ = Task.Run(async () =>
+                    if (changed.New?.Value.SafeString().ToBool() == true)
                     {
-                        await HanlderForPringBarCodeByCreateProductAsync();
-                        // 渚�1锛氬悓姝ュ鐞�
-                        //await ProcessAsync();
+                        _ = Task.Run(async () =>
+                        {
+                            await HanlderForPringBarCodeByCreateProductAsync();
+                        });
+                    }
+                    else
+                    {
 
-                        // 渚�2锛氳皟鐢ㄥ閮ˋPI
-                        //await ExecuteExternalApiAsync();
-                    });
+                        _ = Task.Run(async () =>
+                        {
+                            await HanlderForPringBarCodeByCreateProductWhenFalseAsync();
+                        });
+                    }
                 }
 
                 if (changed.Name == "鎵撶爜杩涚珯淇″彿" && changed.New?.Value.SafeString().ToBool() == true)
@@ -221,7 +228,7 @@
                 }
 
 
-                if (changed.Name == "璇锋眰鐢熸垚鍒囧壊浜у搧鐮佷俊鍙�" && changed.New?.Value.SafeString().ToBool() == true)
+                if (changed.Name == "璇锋眰鐢熸垚鍒囧壊浜у搧鐮佷俊鍙�")
                 {
 
                     // TODO: 澶勭悊鍙橀噺鍊煎彉鍖�
@@ -234,15 +241,20 @@
                         锛�4锛夊苟鍙戠鐞嗭細 濡傛灉涓氬姟灞傚苟鍙戦噺澶э紝蹇呴』浼樺寲浠g爜璁捐鍜屽疄鏂斤紝浠ュ噺灏戝湪楂樺苟鍙戞儏鍐典笅鐨勭郴缁熻祫婧愭秷鑰楋紝闃叉绯荤粺鎬ц兘闂銆�
                         锛�5锛変唬鐮佸畨鍏細 瀹夎骞朵娇鐢� CMS.CodeAnalysis 鍒嗘瀽鍣ㄦ潵鍒嗘瀽 IVariableDataCache.TagChanged 鐨勪娇鐢ㄦ儏鍐点�傝宸ュ叿鑳藉湪浣跨敤涓嶅綋鏃舵彁渚涚紪璇戦敊璇紝甯姪鎮ㄦ彁楂樹唬鐮佽川閲忋��*/
 
-                    _ = Task.Run(async () =>
+                    if (changed.New?.Value.SafeString().ToBool() == true)
                     {
-                        await HanlderForCutByCreateProductAsync();
-                        // 渚�1锛氬悓姝ュ鐞�
-                        //await ProcessAsync();
-
-                        // 渚�2锛氳皟鐢ㄥ閮ˋPI
-                        //await ExecuteExternalApiAsync();
-                    });
+                        _ = Task.Run(async () =>
+                        {
+                            await HanlderForCutByCreateProductAsync();
+                        });
+                    }
+                    else
+                    {
+                        _ = Task.Run(async () =>
+                        {
+                            await HanlderForCutByCreateProductWhenFlaseAsync();
+                        });
+                    }
                 }
             }
         }
@@ -447,6 +459,7 @@
                     Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
                     {
                         { "鎵撶爜_ProductID", productID},
+                        { "CMS鍙嶉璇锋眰鐢熸垚鎵撶爜浜у搧鐮佷俊鍙风粨鏋�", true},
                     };
                     var ret = _variableService.WriteValueAsync(keyValuePairs_productID);
 
@@ -468,6 +481,19 @@
                     throw;
                 }
             }
+        }
+
+        /// <summary>
+        /// 璇锋眰鐢熸垚鎵撶爜浜у搧鐮佷俊鍙�(鍊间负false鐨勬椂鍊�)
+        /// </summary>
+        /// <returns></returns>
+        private async Task HanlderForPringBarCodeByCreateProductWhenFalseAsync()
+        {
+            Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
+            {
+                        { "CMS鍙嶉璇锋眰鐢熸垚鎵撶爜浜у搧鐮佷俊鍙风粨鏋�", false},
+                    };
+            var ret = _variableService.WriteValueAsync(keyValuePairs_productID);
         }
 
 
@@ -704,6 +730,7 @@
                     Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
                     {
                         { "鍒囧壊_ProductID", productID},
+                        { "CMS鍙嶉璇锋眰鐢熸垚鍒囧壊浜у搧鐮佷俊鍙风粨鏋�", true},
                     };
                     var ret = _variableService.WriteValueAsync(keyValuePairs_productID);
 
@@ -734,5 +761,19 @@
                 }
             }
         }
+
+        /// <summary>
+        /// 璇锋眰鐢熸垚鍒囧壊浜у搧鐮佷俊鍙凤紙鍊间负false鐨勬椂鍊欙級
+        /// </summary>
+        /// <returns></returns>
+        private async Task HanlderForCutByCreateProductWhenFlaseAsync()
+        {
+
+            Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
+                    {
+                        { "CMS鍙嶉璇锋眰鐢熸垚鍒囧壊浜у搧鐮佷俊鍙风粨鏋�", false},
+                    };
+            var ret = _variableService.WriteValueAsync(keyValuePairs_productID);
+        }
     }
 }

--
Gitblit v1.9.3