From 157abc191c34e57c1b958ae74fc3de6518ca8a30 Mon Sep 17 00:00:00 2001
From: zhaowc <526854230@qq.com>
Date: 星期五, 28 二月 2025 11:06:36 +0800
Subject: [PATCH] 修改客户需求

---
 Wms/Wms/Controllers/SysController.cs |  166 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 160 insertions(+), 6 deletions(-)

diff --git a/Wms/Wms/Controllers/SysController.cs b/Wms/Wms/Controllers/SysController.cs
index b159d44..43f7184 100644
--- a/Wms/Wms/Controllers/SysController.cs
+++ b/Wms/Wms/Controllers/SysController.cs
@@ -21,6 +21,7 @@
 using Model.ModelDto;
 using Model.ModelDto.LogDto;
 using Newtonsoft.Json.Linq;
+using Model.ModelVm.LogVm;
 
 namespace Wms.Controllers
 {
@@ -735,6 +736,50 @@
                 return Ok(new { code = 1, msg = e.Message });
             }
         }
+
+        /// <summary>
+        /// 娣诲姞鍖哄煙淇℃伅
+        /// </summary>
+        /// <param name="model">妯″瀷</param>
+        /// <returns></returns> 
+        [HttpPost]
+        public IActionResult InsertStorageArea(SysStorageArea model)
+        {
+            try
+            {
+                //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D
+                var claimsIdentity = this.User.Identity as ClaimsIdentity;
+                if (claimsIdentity == null)
+                {
+                    return Ok(new { code = 1, msg = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+                if (string.IsNullOrWhiteSpace(userId))
+                {
+                    return Ok(new { code = 1, msg = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+                model.CreateUser = int.Parse(userId);
+                string bolls = _areaSvc.InsertStorageArea(model);
+                var arr = bolls.Split(":");
+                if (arr[0] != "-1")
+                {
+                    SysStorageArea area = _areaSvc.GetStorageMaxArea();
+                    _operation.InsertOperation("浠撳簱璁剧疆", "鍖哄煙绠$悊", area.AreaNo, "娣诲姞", "娣诲姞鍖哄煙淇℃伅 鍖哄煙鍙凤細" + area.AreaNo, Convert.ToInt32(userId));
+                    return Ok(new { code = 0, msg = bolls, data = "" });
+                }
+                else
+                {
+                    return Ok(new { code = 1, msg = bolls, data = "" });
+                }
+
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+
+        }
+
         /// <summary>
         /// 淇敼鍖哄煙淇℃伅
         /// </summary>
@@ -1182,11 +1227,16 @@
                         string msg = "鍌ㄤ綅鐘舵�� 鍌ㄤ綅鍙凤細" + storage.RoadwayNo;
                         if (model.Id.Count > 1)
                         {
-                            foreach (var item in model.Id)
+                            var sstorage = _locatSvc.GetStorageLocat(model.Id);
+                            foreach (var item in sstorage)
                             {
-                                storage = _locatSvc.GetStorageLocat(item);
-                                _operation.InsertOperation("浠撳簱璁剧疆", "鍌ㄤ綅绠$悊", storage.LocatNo, "鎵归噺缂栬緫", "鎵归噺淇敼鍌ㄤ綅淇℃伅 鍌ㄤ綅鍙凤細" + storage.LocatNo, Convert.ToInt32(userId));
+                                _operation.InsertOperation("浠撳簱璁剧疆", "鍌ㄤ綅绠$悊", item.LocatNo, "鎵归噺缂栬緫", "鎵归噺淇敼鍌ㄤ綅淇℃伅 鍌ㄤ綅鍙凤細" + item.LocatNo, Convert.ToInt32(userId));
                             }
+                            //foreach (var item in model.Id)
+                            //{
+                            //    storage = _locatSvc.GetStorageLocat(item);
+                            //    _operation.InsertOperation("浠撳簱璁剧疆", "鍌ㄤ綅绠$悊", storage.LocatNo, "鎵归噺缂栬緫", "鎵归噺淇敼鍌ㄤ綅淇℃伅 鍌ㄤ綅鍙凤細" + storage.LocatNo, Convert.ToInt32(userId));
+                            //}
                         }
                         else
                         {
@@ -1211,6 +1261,47 @@
                 return Ok(new { code = 1, msg = "鏁版嵁鏍煎紡閿欒" });
             }
         }
+
+        /// <summary>
+        /// 淇敼鍌ㄤ綅鐘舵�佹爣璇嗕俊鎭泦鍚�
+        /// </summary>
+        /// <param name="model">妯″瀷</param>
+        /// <returns></returns>
+        [HttpPost]
+        public IActionResult EditStorageLocatListNew (EditLocateListNewVm model)
+        {
+            try
+            {
+                //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D
+                var claimsIdentity = this.User.Identity as ClaimsIdentity;
+                if (claimsIdentity == null)
+                {
+                    return Ok(new { code = 1, msg = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+                var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value;
+                if (string.IsNullOrWhiteSpace(userId))
+                {
+                    return Ok(new { code = 1, msg = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" });
+                }
+                var bolls = _locatSvc.EditStorageLocatListNew(model, int.Parse(userId));
+                if (bolls)
+                {
+                    _operation.InsertOperation("浠撳簱璁剧疆", "鍌ㄤ綅绠$悊", "", "淇敼", $"淇敼宸烽亾锛歿model.RoadWayNo}銆佹帓:{model.Row}銆佸垪:{model.Column}銆佸眰:{model.Layer}銆佹繁搴︼細{model.Dept}鐨勫尯鍩燂細{model.AreaNo}銆佺姸鎬�:{model.Status}銆佹爣璇嗭細{model.Flag}鐨勫偍浣嶄俊鎭� ", Convert.ToInt32(userId));
+
+                    return Ok(new { code = 0, msg = "缂栬緫鎴愬姛", data = "" });
+                }
+                else
+                {
+                    return Ok(new { code = 1, msg = "缂栬緫澶辫触", data = "" });
+                }
+
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+
         #endregion
 
         #region 鎵樼洏鏉$爜绠$悊
@@ -1325,17 +1416,21 @@
                 {
                     throw new Exception("褰撳墠鏄剧ず鐨勬潯鐮佷笉鏄渶鏂版潯鐮侊紝璇烽噸鏂版坊鍔�");
                 }
-                string str = model.PalletNo.Substring(3, 5);
-                string remove = model.PalletNo.Substring(0, 3);
+                string str = model.PalletNo.Substring(2, 6);
+                string remove = model.PalletNo.Substring(0, 2);
                 int sibelius = Convert.ToInt16(str);
                 for (int i = 0; i < model.GroupCount; i++)
                 {
+                    if (sibelius>999999)
+                    {
+                        throw new Exception("鎵樼洏缁勪腑宸叉湁鎵樼洏鐮佷綅鏁板凡杈句笂绾�");
+                    }
                     if (i != 0)
                     {
                         sibelius += 1;
                     }
 
-                    string code = remove + Convert.ToString(sibelius).PadLeft(5, '0');
+                    string code = remove + Convert.ToString(sibelius).PadLeft(6, '0');
                     for (int j = 0; j < model.SameCount; j++)
                     {
                         var re = BarcodeHelper.GetCodeBarBase64(code, 80, 50);
@@ -1492,6 +1587,7 @@
 
         #region 鍌ㄤ綅鍥句緥
 
+        #region 绔嬪簱
         /// <summary>
         /// 鏍规嵁浠撳簱 鎺�
         /// </summary>
@@ -1607,6 +1703,41 @@
                 msg = "鑾峰彇浠撳簱宸烽亾鎴愬姛"
             });
         }
+
+
+
+        #endregion
+
+        #region 骞冲簱
+
+        /// <summary>
+        /// 鏍规嵁浠撳簱 鎺�
+        /// </summary>
+        /// <param name="wareHouseNo">浠撳簱</param>
+        /// <param name="row">鎺�</param>
+        /// <param name="depth">娣卞害</param>
+        /// <returns></returns>
+        [HttpGet]
+        public IActionResult GetFlatLibraryLegend(string wareHouseNo, string row)
+        {
+            //鑾峰彇鍌ㄤ綅淇℃伅
+            List<SysStorageLocat> storagelist = _locatSvc.GetFlatLibraryLegend(wareHouseNo, row);
+
+            //Dictionary<string, int> dic = new Dictionary<string, int>()
+            //{
+            //    "B01"
+            //};
+
+            return Ok(new
+            {
+                data = storagelist,
+                //dic,
+                code = 0,
+                msg = ""
+            });
+        }
+
+        #endregion
 
         /// <summary>
         /// 鏍规嵁鍌ㄤ綅鍦板潃鑾峰彇鍌ㄤ綅涓婄殑鎵樼洏鍜岀墿鍝佷俊鎭�
@@ -1912,7 +2043,30 @@
 
         #endregion
 
+        #region 鎿嶄綔鏃ュ織
 
+        /// <summary>
+        /// 鑾峰彇鎿嶄綔鏃ュ織淇℃伅
+        /// </summary>
+        /// <param name="model"></param>
+        /// <returns></returns>
+        [AllowAnonymous]
+        [HttpPost]
+        public IActionResult GetLogOperationList(GetOperationVm model)
+        {
+            try
+            {
+                var bolls = _operation.GetOperationList(model.MenuName, model.Type, model.Msg, model.StartTime, model.EndTime, model.Page, model.Limit, out int count);
+
+                return Ok(new { code = 0, count, msg = "鎿嶄綔鏃ュ織淇℃伅", data = bolls });
+            }
+            catch (Exception e)
+            {
+                return Ok(new { code = 1, msg = e.Message });
+            }
+        }
+
+        #endregion
 
         #region 鏁版嵁琛ㄦ牸琛ㄥご鑷畾涔�(閫氱敤鏂规硶)
         /// <summary>

--
Gitblit v1.8.0