wxw
7 天以前 f7a2b37e42aac9578f96d9a954f065d1de74b2b2
Wms/Wms/Controllers/BllAsnController.cs
@@ -162,6 +162,48 @@
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        /// <summary>
        /// 入库单据导入
        /// </summary>
        /// <param name="models"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult ImportArrivalNotice(ArrivalNoticeVms models)
        {
            try
            {
                if (models.ListArrivalNotice.Count > 50)
                {
                    throw new Exception("单次导入最多50条数据");
                }
                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("未获取到用户信息");
                }
                models.CreateUser = int.Parse(UserId);
                string strMessage = _arrivalNoticeSvc.ImportArrivalNotice(models);
                if (strMessage.Contains("-1"))
                {
                    return Ok(new { code = 1, msg = strMessage });
                }
                else
                {
                    return Ok(new { code = 0, msg = strMessage });
                }
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        [HttpPost]
        public IActionResult EditArrivalNotice(ArrivalNoticeVm model)
@@ -1005,8 +1047,66 @@
                return Ok(new { code = 1, count = 0, msg = e.Message });
            }
        }
        /// <summary>
        /// 拆分箱码标签
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult ChaiLableBox(LabelOperVm 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 = "未获取到当前操作人信息" });
                }
                _BoxInfoSvc.ChaiLableBox(model.BoxNo, model.ChaiQty, int.Parse(userId));
                return Ok(new { code = 0, msg = "操作成功", data = "" });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, count = 0, msg = e.Message });
            }
        }
        /// <summary>
        /// 合并箱码标签
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult MergeLableBox(LabelOperVm 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 = "未获取到当前操作人信息" });
                }
                _BoxInfoSvc.MergeLableBox(model.BoxNo, model.BoxNo2, int.Parse(userId));
                return Ok(new { code = 0, msg = "操作成功", data = "" });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, count = 0, msg = e.Message });
            }
        }
        #endregion
        #region 数据归档