From 55e2a6f351ebafbf2c95442f59699eb85cbdee5c Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 16 一月 2025 10:30:17 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs"
index 24712a8..0f3b2f5 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs"
@@ -247,6 +247,9 @@
                     Pickcode = outboundOrder.UpperOrderNo,
                     PickList = eRPPickModels
                 };
+                string Createuser = "";
+                if (!string.IsNullOrEmpty(App.User.UserName)) Createuser = App.User.UserName;
+                else Createuser = stockLockInfos.FirstOrDefault().Creater;
                 issueModel = new ERPIssueModel()
                 {
                     UniqueTag = outboundOrder.Id.ToString(),
@@ -256,7 +259,7 @@
                     Deptno = outboundOrder.DepartmentCode,
                     Deptname = outboundOrder.DepartmentName,
                     Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
-                    Createuser = App.User.UserName ?? stockLockInfos.FirstOrDefault().Creater ?? "admin",
+                    Createuser = string.IsNullOrEmpty(Createuser) ? Createuser : "admin",
                     Issitem = new List<ERPIssueItemModel>() { issueItemModel },
                 };
             }
@@ -625,5 +628,36 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
+        /// <summary>
+        /// 鏍规嵁鍑哄簱鍗曟帹閫丒RP绯荤粺
+        /// </summary>
+        /// <param name="outId"></param>
+        /// <param name="WarehouseCode"></param>
+        /// <returns></returns>
+        public WebResponseContent PushERPOutBound(int outId, string WarehouseCode)
+        {
+            WebResponseContent content=new WebResponseContent();
+            try
+            {
+                //鑾峰彇鍑哄簱鍗�
+                Dt_OutboundOrder outboundOrder = Db.Queryable<Dt_OutboundOrder>().Where(x => x.Id == outId).Includes(x => x.Details).First();
+                if (outboundOrder == null)
+                {
+                    return content.Error("鍑哄簱鍗曚笉瀛樺湪");
+                }
+                if (outboundOrder.Details.Count!=(outboundOrder.Details.Where(x=>x.OrderDetailStatus==OrderDetailStatusEnum.Over.ObjToInt()).ToList().Count)||outboundOrder.OrderStatus!=OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt())
+                {
+                    return content.Error("璇ュ嚭搴撳崟鏈畬鎴�");
+                }
+                ERPIssueModel issueModel = GetERPIssueModel(outboundOrder, WarehouseCode);
+                string response=_invokeERPService.InvokeOutStandardsApi(issueModel);
+                return content.OK(response);
+            }
+            catch (Exception ex)
+            {
+                content.Error(ex.Message);
+            }
+            return content;
+        }
     }
 }

--
Gitblit v1.9.3