From 1dbd9b02ebdeca70f55eb444bb0f597ec9a2dfb8 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周四, 15 5月 2025 09:21:06 +0800 Subject: [PATCH] 增加 CMS反馈请求生成切割产品码信号结果 --- PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs | 10 ++++ PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs | 75 +++++++++++++++++++++++++++++-------- 2 files changed, 67 insertions(+), 18 deletions(-) diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs index 5b134ea..9e1d4b1 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs @@ -34,12 +34,20 @@ public class SharedService : CMSPluginAppService { - + /// <summary> + /// 鍒嗘嫞鍔熻兘 + /// </summary> + /// <param name="_serviceProvider"></param> + /// <param name="input"></param> + /// <param name="myCurrentUser"></param> + /// <returns></returns> public async Task<MesOrderResponse> CommonPick(IServiceProvider _serviceProvider, PickInput input, MyCurrentUser myCurrentUser) { //1銆佽褰曞垎鎷h褰曡〃 //2銆佹洿鏂颁綔涓氳鍒掕〃鐨勭姸鎬� =宸插垎鎷� //3銆佸啓鍏� 鍒嗘嫞鍙橀噺 + //4銆佸啓鍏ヨ拷婧姤琛� + //5銆佺墿鏂欑粍鐩� VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); var _workSectionManager = _serviceProvider.GetRequiredService<IWorkSectionManager>(); 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