From 65dac074f71375381eba0a5ff8dc108cacafc3f9 Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-5BIMHQ3>
Date: 星期二, 25 六月 2024 10:18:16 +0800
Subject: [PATCH] Merge branch 'wxw'

---
 Wms/Wms/Controllers/UpApiController.cs |  107 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 69 insertions(+), 38 deletions(-)

diff --git a/Wms/Wms/Controllers/UpApiController.cs b/Wms/Wms/Controllers/UpApiController.cs
index 7b2f635..e67646d 100644
--- a/Wms/Wms/Controllers/UpApiController.cs
+++ b/Wms/Wms/Controllers/UpApiController.cs
@@ -404,24 +404,29 @@
             }
         }
 
-        //RCS鍙《
+        #region 浜屾ゼ涓氬姟
+        /// <summary>
+        /// RCS鍙《
+        /// </summary>
+        /// <param name="pallmsg"></param>
+        /// <returns></returns>
         [HttpPost]
         public IActionResult GetPalletNo(Pallnetmsg pallmsg)
         {
-            var Pallnet = "";
-            var locate = "";
-            var result = new ErpModel { Success = -1, Message = "",};
+            var result = new ErpModel { Success = -1, Message = "", };
             try
             {
-                if (pallmsg.lotno != null)
+                if (string.IsNullOrWhiteSpace(pallmsg.Location))
                 {
-                    _rcsserver.GetPalletNo(pallmsg.warehouseno, pallmsg.type, pallmsg.lotno, out Pallnet, out locate);
+                    result.Message = "鍙枡浣嶇疆涓虹┖锛�";
+                    return Ok(result);
                 }
-                else
+                if (string.IsNullOrWhiteSpace(pallmsg.Type))
                 {
-                    _rcsserver.GetPalletNo(pallmsg.warehouseno, pallmsg.type, out Pallnet, out locate);
+                    result.Message = "浠诲姟绫诲瀷涓虹┖锛�";
+                    return Ok(result);
                 }
-                
+                _rcsserver.GetPalletNo(pallmsg);
                 result.Success = 0;
                 result.Message = "鍙《鎴愬姛锛�";
                 return Ok(result);
@@ -432,15 +437,34 @@
                 return Ok(result);
             }
         }
-        //RCS鐢宠鍌ㄤ綅
+
+        /// <summary>
+        /// RCS鐢宠鍌ㄤ綅
+        /// </summary>
+        /// <param name="pallmsg"></param>
+        /// <returns></returns>
         [HttpPost]
         public IActionResult ApplyLocatNo(Pallnetmsg pallmsg)
         {
-            var lotno = "";
             var result = new ErpModel { Success = -1, Message = "" };
             try
             {
-                _rcsserver.ApplyLocatNo(pallmsg.palletno,pallmsg.type, out lotno);
+                if (string.IsNullOrWhiteSpace(pallmsg.Location))
+                {
+                    result.Message = "鐢宠浣嶇疆涓虹┖锛�";
+                    return Ok(result);
+                }
+                if (string.IsNullOrWhiteSpace(pallmsg.Type))
+                {
+                    result.Message = "浠诲姟绫诲瀷涓虹┖锛�";
+                    return Ok(result);
+                }
+                if (string.IsNullOrWhiteSpace(pallmsg.Palletno))
+                {
+                    result.Message = "鐢宠鎵樼洏鍙蜂负绌猴紒";
+                    return Ok(result);
+                }
+                _rcsserver.ApplyLocatNo(pallmsg);
                 result.Success = 0;
                 result.Message = "鐢宠鍌ㄤ綅鎴愬姛锛�";
                 return Ok(result);
@@ -453,31 +477,6 @@
             }
         }
 
-        //涓嬪彂璋冨害RCS浠诲姟
-        //RCS鐢宠鍌ㄤ綅
-        [HttpPost]
-        public IActionResult genAgvSchedulingTask(AgvTask agvtask)
-        {
-            var lotno = "";
-            var url = "";
-            genAgvSchedulingTaskRep chrep = new genAgvSchedulingTaskRep();
-            var result = new ErpModel { Success = -1, Message = "" };
-            try
-            {
-                _rcsserver.genAgvSchedulingTask(agvtask,url,ref chrep);
-                result.Success = 0;
-                result.Message = "鐢宠鍌ㄤ綅鎴愬姛锛�";
-                return Ok(result);
-            }
-            catch (Exception e)
-            {
-
-                result.Message = e.Message;
-                return Ok(result);
-            }
-        }
-
-        #region 浜屾ゼ涓氬姟
         /// <summary>
         /// 鍏ュ簱鍗曟嵁涓嬪彂
         /// </summary>
@@ -534,7 +533,7 @@
                     throw new Exception("鏈幏鍙栧埌鐢ㄦ埛淇℃伅");
                 }*/
 
-                result = _noticeSvc.RCSFinishTask(model.TaskNo,model.Status);
+                result = _noticeSvc.RCSFinishTask(model.TaskNo, model.Status);
 
                 return Ok(result);
             }
@@ -544,6 +543,38 @@
                 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