Administrator
2024-02-04 2fb34955b5a23b2a0b5844e8b91af3c58416e2f1
Wms/Wms/Controllers/BllAsnController.cs
@@ -849,11 +849,11 @@
        #region 箱码标签
        [HttpPost]
        public IActionResult GetLabelBoxList(LabelBoxVm model)
        public IActionResult GetLabelBoxList(LabelBoxInfoVm model)
        {
            try
            {
                var list = _labelBox.GetLabelBoxList(model, out int count);
                var list = _BoxInfoSvc.GetLabelBoxList(model, out int count);
                return Ok(new { code = 0, count, msg = "箱码标签列表", data = list });
            }
            catch (Exception e)
@@ -867,7 +867,7 @@
        {
            try
            {
                var list = _labelBox.GetLabelBoxModel(id);
                var list = _BoxInfoSvc.GetLabelBoxModel(id);
                return Ok(new { code = 0, msg = "箱码模板信息", data = list });
            }
            catch (Exception e)
@@ -876,6 +876,58 @@
            }
        }
        [HttpPost]
        public IActionResult AddLabelBox(AddLabelBoxInfoVm 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 = "未获取到当前操作人信息" });
                }
                var list = _BoxInfoSvc.AddLabelBox(model.Id, model.IsReset, decimal.Parse(model.ArriveQty),  model.ProductionTime, model.ExpirationTime, model.StoreTime, int.Parse(userId));
                return Ok(new { code = 0,  msg = "生成箱码标签成功", data = list });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, count = 0, msg = e.Message });
            }
        }
        [HttpPost]
        public IActionResult GetBuDaLabelList(BuDaLabelBoxVm 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 = "未获取到当前操作人信息" });
                }
                var list = _BoxInfoSvc.GetBuDaLabelList(model.BoxNo, model.EndBoxNo, model.BoxNo2, model.EndBoxNo2,model.Type,int.Parse(userId));
                return Ok(new { code = 0, msg = "获取补打箱码标签信息", data = list });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, count = 0, msg = e.Message });
            }
        }
        #endregion
    }