chengsc
2024-09-09 0c9661af88f5533ac73fbab82da39ea78d42853b
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>
@@ -1182,11 +1226,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
                        {
@@ -1325,17 +1374,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 +1545,7 @@
        #region 储位图例
        #region 立库
        /// <summary>
        /// 根据仓库 排
        /// </summary>
@@ -1608,6 +1662,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>