From ecc5e81e699869011668189e0168037c04961a93 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期五, 27 六月 2025 09:12:00 +0800
Subject: [PATCH] Merge branch 'wxw'

---
 Wms/Wms/Controllers/UpApiController.cs |  217 +++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 167 insertions(+), 50 deletions(-)

diff --git a/Wms/Wms/Controllers/UpApiController.cs b/Wms/Wms/Controllers/UpApiController.cs
index b8743c0..ffa1384 100644
--- a/Wms/Wms/Controllers/UpApiController.cs
+++ b/Wms/Wms/Controllers/UpApiController.cs
@@ -26,6 +26,8 @@
 using WMS.IBLL.IPdaServer;
 using WMS.BLL.BllQualityServer;
 using WMS.IBLL;
+using ZXing.QrCode.Internal;
+using System.Xml.Linq;
 
 namespace Wms.Controllers
 {
@@ -45,6 +47,8 @@
         private readonly IPdaAsnServer _pdaAsnServer;// PDA
         private readonly IHttpServer _http;
 
+        private string logStr = $@".\log\SAP璧嬬爜\Sap涓嬪彂鎶ユ枃" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
+
         public UpApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IArrivalNoticeServer arrivalNoticeServer, IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc, IPdaAsnServer pdaAsnServer, IHttpServer http)
         {
             _config = setting.Value;
@@ -55,6 +59,119 @@
             _pdaAsnServer = pdaAsnServer;
             _http = http;
         }
+        #endregion
+
+        #region JC34 
+        /// <summary>
+        /// 鐗╂枡涓嬪彂
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost]
+        public IActionResult CreateSku(object model)
+        {
+            try
+            {
+                LogFile.SaveLogToFile($"Sap鐗╂枡涓绘暟鎹細( {model} ),", logStr);
+                return Ok(new { result = true, code = "1" ,message = "success" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { result = false, code = "400", message = e.Message });
+            }
+        }
+
+
+        /// <summary>
+        /// 瀹㈡埛淇℃伅鎺ユ敹
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost]
+        public IActionResult CreateCustomer(object model)
+        {
+             
+            try
+            {
+                LogFile.SaveLogToFile($"Sap瀹㈡埛淇℃伅涓绘暟鎹細( {model} ),", logStr);
+                return Ok(new { result = true, code = "1", message = "success" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { result = false, code = "400", message = e.Message });
+            }
+        }
+
+
+        /// <summary>
+        /// 鍏ュ簱鍗曟帴鏀�
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost]
+        public IActionResult CreateAsn(object model)
+        {
+
+            try
+            {
+                LogFile.SaveLogToFile($"Sap鍏ュ簱鍗曚笅鍙戯細( {model} ),", logStr);
+                return Ok(new { result = true, code = "1", message = "success" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { result = false, code = "400", message = e.Message });
+            }
+        }
+
+        /// <summary>
+        /// 鍑哄簱鍗曟帴鏀�
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost]
+        public IActionResult CreateSo(object model)
+        {
+
+            try
+            {
+                LogFile.SaveLogToFile($"Sap鍑哄簱鍗曚笅鍙戯細( {model} ),", logStr);
+                return Ok(new { result = true, code = "1", message = "success" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { result = false, code = "400", message = e.Message });
+            }
+        }
+
+
+        /// <summary>
+        /// 搴撳瓨璐ㄩ噺鐘舵�佹帴鏀�
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost]
+        public IActionResult UpQuality(object model)
+        {
+
+            try
+            {
+                //    var sd = JsonConvert.SerializeObject(model);
+                //    var sd2 = JsonConvert.DeserializeObject<BoxPalletBindVm>(sd);
+                LogFile.SaveLogToFile($"Sap璐ㄩ噺鐘舵�佸彉鏇达細( {model} ),", logStr);
+                return Ok(new { result = true, code = "1", message = "success" });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { result = false, code = "400", message = e.Message });
+            }
+        }
+        
+
         #endregion
 
         #region 璋冪敤涓婃父绯荤粺鎺ュ彛
@@ -242,7 +359,7 @@
                     await _stockCheckSvc.StockAdjustAuto(model.Id);
                 }
                 //绯荤粺瀵规帴鍚庢斁寮�
-                //var bl =_stockCheckSvc.FinishCr(model.Id,_config.ErpHost + _config.DataChangeUrl, int.Parse(userId));
+                var bl =_stockCheckSvc.FinishCr(model.Id,_config.ErpHost + _config.DataChangeUrl, int.Parse(userId));
                 //if (bl)
                 //{
                 return Ok(new { code = 0, count = 0, msg = "鐩樼偣鍗曡皟鏁翠笂浼犳垚鍔�" });
@@ -354,59 +471,59 @@
             }
         }
 
-        /// <summary>
-        /// 鍏ュ簱鍗曟嵁涓嬪彂
-        /// </summary>
-        /// <param name="model">鍏ュ簱鍗曚俊鎭�</param>
-        /// <returns></returns>
-        [Authorize]
-        [HttpPost]
-        public IActionResult CreateAsn(AsnInfo model)
-        {
-            var result = new ErpModel { Success = -1, Message = "" };
-            try
-            {
-                var claimsIdentity = this.User.Identity as ClaimsIdentity;
-                if (claimsIdentity == null)
-                {
-                    throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
-                }
-                string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
-                if (string.IsNullOrWhiteSpace(UserId))
-                {
-                    throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
-                }
+        ///// <summary>
+        ///// 鍏ュ簱鍗曟嵁涓嬪彂
+        ///// </summary>
+        ///// <param name="model">鍏ュ簱鍗曚俊鎭�</param>
+        ///// <returns></returns>
+        //[Authorize]
+        //[HttpPost]
+        //public IActionResult CreateAsn(AsnInfo model)
+        //{
+        //    var result = new ErpModel { Success = -1, Message = "" };
+        //    try
+        //    {
+        //        var claimsIdentity = this.User.Identity as ClaimsIdentity;
+        //        if (claimsIdentity == null)
+        //        {
+        //            throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+        //        }
+        //        string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+        //        if (string.IsNullOrWhiteSpace(UserId))
+        //        {
+        //            throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+        //        }
 
-                result = _arrivalNoticeSvc.CreateAsn(model);
+        //        result = _arrivalNoticeSvc.CreateAsn(model);
 
-                return Ok(result);
-            }
-            catch (Exception e)
-            {
-                result.Message = e.Message;
-                return Ok(result);
-            }
-        }
+        //        return Ok(result);
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        result.Message = e.Message;
+        //        return Ok(result);
+        //    }
+        //}
 
-        /// <summary>
-        /// 鍑哄簱鍗曚笅鍙戞帴鍙�
-        /// </summary>
-        /// <param name="model">鍑哄簱鍗曚俊鎭�</param>
-        /// <returns></returns>
-        [HttpPost]
-        public IActionResult CreateSo(SoInfo model)
-        {
-            try
-            {
-                SoResInfo result = _exNoticeSvc.ErpAddExportNotice(model);
-                return Ok(result);
+        ///// <summary>
+        ///// 鍑哄簱鍗曚笅鍙戞帴鍙�
+        ///// </summary>
+        ///// <param name="model">鍑哄簱鍗曚俊鎭�</param>
+        ///// <returns></returns>
+        //[HttpPost]
+        //public IActionResult CreateSo(SoInfo model)
+        //{
+        //    try
+        //    {
+        //        SoResInfo result = _exNoticeSvc.ErpAddExportNotice(model);
+        //        return Ok(result);
 
-            }
-            catch (Exception e)
-            {
-                return Ok(new ErpModel { Success = -1, Message = e.Message });
-            }
-        }
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        return Ok(new ErpModel { Success = -1, Message = e.Message });
+        //    }
+        //}
 
         /// <summary>
         /// 杞﹂棿鍙枡

--
Gitblit v1.8.0