From 826e5950faf61ffa8d6442b1e17f98ffd67d26de Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-5BIMHQ3>
Date: 星期二, 25 六月 2024 08:17:18 +0800
Subject: [PATCH] 修改问题

---
 Wms/Wms/Controllers/UpApiController.cs |  165 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 164 insertions(+), 1 deletions(-)

diff --git a/Wms/Wms/Controllers/UpApiController.cs b/Wms/Wms/Controllers/UpApiController.cs
index ab24289..c1093d8 100644
--- a/Wms/Wms/Controllers/UpApiController.cs
+++ b/Wms/Wms/Controllers/UpApiController.cs
@@ -14,6 +14,8 @@
 using Model.ModelVm.BllCheckVm;
 using WMS.DAL;
 using Microsoft.AspNetCore.Authorization;
+using WMS.IBLL.IBllTransServer;
+using static Model.InterFaceModel.RCSModel;
 
 namespace Wms.Controllers
 {
@@ -30,13 +32,18 @@
         private readonly IArrivalNoticeServer _arrivalNoticeSvc;
         private readonly IStockCheckServer _stockCheckSvc;//鐩樼偣鍗昐vc 
         private readonly IProcurePlanServer _procurePlanSvc;//閲囪喘鍗昐vs
-        public UpApiController(IOptions<ApiUrlConfig> setting,IExportNoticeServer exNoticeSvc,IArrivalNoticeServer arrivalNoticeServer,IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc)
+        private readonly IRcsServer _rcsserver;//RCS鐩稿叧浠诲姟
+        private readonly INoticeServer _noticeSvc;//浜屾ゼ鍗曟嵁鐩稿叧
+
+        public UpApiController(IOptions<ApiUrlConfig> setting,IExportNoticeServer exNoticeSvc,IArrivalNoticeServer arrivalNoticeServer,IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc,IRcsServer rcsserver, INoticeServer noticeSvc)
         {
             _config = setting.Value;
             _exNoticeSvc = exNoticeSvc;
             _arrivalNoticeSvc = arrivalNoticeServer;
             _stockCheckSvc = stockCheckSvc;
             _procurePlanSvc = procurePlanSvc;
+            _rcsserver = rcsserver;
+            _noticeSvc = noticeSvc;
         }
         #endregion
 
@@ -396,6 +403,162 @@
                 return Ok(result);
             }
         }
+
+        #region 浜屾ゼ涓氬姟
+        /// <summary>
+        /// RCS鍙《
+        /// </summary>
+        /// <param name="pallmsg"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult GetPalletNo(Pallnetmsg pallmsg)
+        {
+            var result = new ErpModel { Success = -1, Message = "", };
+            try
+            {
+                if (string.IsNullOrWhiteSpace(pallmsg.Location))
+                {
+                    result.Message = "鍙枡浣嶇疆涓虹┖锛�";
+                    return Ok(result);
+                }
+                _rcsserver.GetPalletNo(pallmsg);
+
+
+                result.Success = 0;
+                result.Message = "鍙《鎴愬姛锛�";
+                return Ok(result);
+            }
+            catch (Exception e)
+            {
+                result.Message = e.Message;
+                return Ok(result);
+            }
+        }
+
+        /// <summary>
+        /// RCS鐢宠鍌ㄤ綅
+        /// </summary>
+        /// <param name="pallmsg"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult ApplyLocatNo(Pallnetmsg pallmsg)
+        {
+            var result = new ErpModel { Success = -1, Message = "" };
+            try
+            {
+                _rcsserver.ApplyLocatNo(pallmsg);
+                result.Success = 0;
+                result.Message = "鐢宠鍌ㄤ綅鎴愬姛锛�";
+                return Ok(result);
+            }
+            catch (Exception e)
+            {
+
+                result.Message = e.Message;
+                return Ok(result);
+            }
+        }
+
+        /// <summary>
+        /// 鍏ュ簱鍗曟嵁涓嬪彂
+        /// </summary>
+        /// <param name="model">鍏ュ簱鍗曚俊鎭�</param>
+        /// <returns></returns>
+        //[Authorize]
+        [HttpPost]
+        public IActionResult CreateAsnWork(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 = _noticeSvc.CreateAsnWork(model);
+
+                return Ok(result);
+            }
+            catch (Exception e)
+            {
+                result.Message = e.Message;
+                return Ok(result);
+            }
+        }
+
+        /// <summary>
+        /// 浠诲姟瀹屾垚鍙嶉
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult RCSFinishTask(TaskModel 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 = _noticeSvc.RCSFinishTask(model.TaskNo, model.Status);
+
+                return Ok(result);
+            }
+            catch (Exception e)
+            {
+                result.Message = e.Message;
+                return Ok(result);
+            }
+        }
+
+        /// <summary>
+        /// 鍑哄簱鍗曟嵁涓嬪彂
+        /// </summary>
+        /// <param name="model">鍑哄簱鍗曚俊鎭�</param>
+        /// <returns></returns>
+        //[Authorize]
+        [HttpPost]
+        public IActionResult CreateSoWork(SoInfo model)
+        {
+            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("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
+                }*/
+
+                SoResInfo result = _exNoticeSvc.ErpAddExportNotice(model);
+                return Ok(result);
+
+            }
+            catch (Exception e)
+            {
+                return Ok(new ErpModel { Success = -1, Message = e.Message });
+            }
+        }
+        #endregion
+
         //绠辩爜淇℃伅 鎵嬫寔缁勬墭鐢� (璧嬬爜鎴栬拷婧笅鍙戝埌wms)
 
         //璐ㄦ缁撴灉涓嬪彂鎺ュ彛 

--
Gitblit v1.8.0