Administrator
2024-03-05 b506c4535c62c4c5fd7c5b5c0bd7bb8b03390dbd
Wms/Wms/Controllers/BllAsnController.cs
@@ -78,6 +78,25 @@
            }
        }
        /// <summary>
        /// 获取入库单明细剩余打印数量
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetAsnDetailQtyList(int id)
        {
            try
            {
                var models = _arrivalNoticeSvc.GetAsnDetailQtyList(id);
                return Ok(new { code = 0, msg = "入库单明细信息", data = models });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        [HttpPost]
        public IActionResult GetMaterialsList(GetMaterialsVm model)
        {
@@ -118,7 +137,7 @@
                }
                if (strMesage.Contains("-1"))
                {
                    return Ok(new { code = 0, msg = strMesage });
                    return Ok(new { code = 1, msg = strMesage });
                }
                else
                {
@@ -849,11 +868,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 +886,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 +895,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
    }