yuyou_x
2024-03-16 ecb386a4201213c6635f28f9e9e02e3faf217b51
Wms/Wms/Controllers/SysController.cs
@@ -735,6 +735,50 @@
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        /// <summary>
        /// 添加区域信息
        /// </summary>
        /// <param name="model">模型</param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult InsertStorageArea(SysStorageArea model)
        {
            try
            {
                //获取当前登录的用户ID
                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>
@@ -1492,6 +1536,7 @@
        #region 储位图例
        #region 立库
        /// <summary>
        /// 根据仓库 排
        /// </summary>
@@ -1608,6 +1653,41 @@
            });
        }
        #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>
        /// 根据储位地址获取储位上的托盘和物品信息
        /// </summary>