From 5bec5fc00525c7d44f7351b045d45ab3c401f64a Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周二, 13 5月 2025 17:04:42 +0800
Subject: [PATCH] 库存次序显示

---
 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs |   55 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 47 insertions(+), 8 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 738d1b9..7211e3f 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
@@ -15,6 +15,10 @@
 using System.Text;
 using CMS.Plugin.PipeLineLems.Domain.WorkPlan;
 using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord;
+using Volo.Abp.Users;
+using CmsQueryExtensions.Entitys;
+using CMS.Unit.RuntimeValue.Abstractions;
+using CMS.Extensions.Variable;
 
 namespace CMS.Plugin.PipeLineLems.Application.Implements;
 
@@ -23,6 +27,34 @@
 /// </summary> 
 public class SharedService : CMSPluginAppService
 {
+
+
+    public async Task<MesOrderResponse> CommonPick(IServiceProvider _serviceProvider, PickInput input, MyCurrentUser myCurrentUser)
+    {
+        //1銆佽褰曞垎鎷h褰曡〃
+        //2銆佹洿鏂颁綔涓氳鍒掕〃鐨勭姸鎬� =宸插垎鎷�
+        //3銆佸啓鍏� 鍒嗘嫞鍙橀噺
+
+        VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>();
+
+        Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?>
+                    {
+                        { "鍒嗘嫞鎵樼洏鍙�","鎵樼洏1"},
+                        { "鍒嗘嫞鏂瑰悜", "鐭瑁呴厤"},
+                        { "鍒嗘嫞浜�", myCurrentUser.UserAccount }
+                    };
+        _variableService.WriteValueAsync(keyValuePairs);
+        var response = new MesOrderResponse
+        {
+            Code = "000000",
+            Data = "",
+            Fail = false,
+            Mesg = "澶勭悊鎴愬姛",
+            Success = true,
+            Time = DateTime.UtcNow
+        };
+        return response;
+    }
     /// <summary>
     /// 鍒涘缓浣滀笟璁″垝
     /// </summary>
@@ -33,9 +65,11 @@
     /// <exception cref="UserFriendlyException"></exception>
 
     public async Task<MesOrderResponse> CommonCreatebyApsAsync(List<WorkPlanInput> input, IServiceProvider _serviceProvider,
-        WorkPlanAppService workPlanAppService
-        )
+    WorkPlanAppService workPlanAppService,
+    string userId, string userAccount
+    )
     {
+
         if (input == null)
         {
             throw new UserFriendlyException("杈撳叆鍙傛暟涓嶈兘涓虹┖");
@@ -62,6 +96,7 @@
         var orderManager = _serviceProvider.GetRequiredService<IOrderManager>();
         var productProvider = _serviceProvider.GetRequiredService<IProductProvider>();
         var formulaProvider = _serviceProvider.GetRequiredService<IFormulaProvider>();
+
         List<OrderModel> orderModels = new List<OrderModel>();
 
         #region 浜嬪姟
@@ -111,7 +146,8 @@
                     var order = await orderManager.GetByCodeAsync(prodOrderNo);
                     if (order != null)
                     {
-                        throw new UserFriendlyException($"鐢熶骇宸ュ崟[{prodOrderNo}]宸插瓨鍦�");
+                        //throw new UserFriendlyException($"鐢熶骇宸ュ崟[{prodOrderNo}]宸插瓨鍦�");
+                        continue;
                     }
 
                     OrderModel orderModelForCut = new OrderModel()
@@ -176,6 +212,7 @@
                     CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.鏈墽琛�,
                     DataIdentifier = gTask.Key,
                     MaterialMode = gTask.ToList().First().MaterialMode,
+                    CreatorName = userAccount,
                     Quantity = 1
                 };
 
@@ -184,7 +221,7 @@
 
 
 
-
+            //throw new UserFriendlyException($"涓诲姩瑙﹀彂澶辫触");
             //淇濆瓨鍒�  scms_workplans 琛ㄤ腑
             foreach (var item in input)
             {
@@ -193,6 +230,8 @@
                 insertObj.CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.鏈墽琛�;
                 insertObj.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鏈敓浜�;
                 insertObj.Sort = 1;
+                insertObj.CreatorName = userAccount;
+                insertObj.Remark = "绯荤粺瀵煎叆";
                 await workPlanAppService.CreateAsync(insertObj);
             }
 
@@ -296,10 +335,10 @@
         }
 
         // 楠岃瘉鐘舵��
-        //if (callMaterialOrder.CallMaterialStatus != Domain.Shared.Enums.CallMaterialStatusEnum.鏈墽琛�)
-        //{
-        //    throw new UserFriendlyException($"鍘熸枡鏍囪瘑涓� '{callMaterialOrder.DataIdentifier}' 鐨勫彨鏂欒褰曠姸鎬佷负 '{callMaterialOrder.CallMaterialStatus}'锛屼笉鍏佽鍙枡");
-        //}
+        if (callMaterialOrder.CallMaterialStatus != Domain.Shared.Enums.CallMaterialStatusEnum.鏈墽琛�)
+        {
+            throw new UserFriendlyException($"鍘熸枡鏍囪瘑涓� '{callMaterialOrder.DataIdentifier}' 鐨勫彨鏂欒褰曠姸鎬佷负 '{callMaterialOrder.CallMaterialStatus}'锛屼笉鍏佽鍙枡");
+        }
 
         // 鏇存柊鏁版嵁
         callMaterialOrder.WmsRetResult = "鎴愬姛";

--
Gitblit v1.9.3