chengsc
2024-10-14 b31f32fbfb25c77567e3853e05ca114dd2a00fbe
Wms/Wms/Controllers/BllAsnController.cs
@@ -9,6 +9,8 @@
using WMS.IBLL.IBllAsnServer;
using WMS.IBLL.ILogServer;
using Model.ModelVm.BllAsnVm;
using Wms.Tools;
using Microsoft.Extensions.Options;
namespace Wms.Controllers
{
@@ -18,6 +20,7 @@
    public class BllAsnController : ControllerBase
    {
        #region 依赖注入
        private readonly ApiUrlConfig _config; //接口交互路径
        private readonly IArrivalNoticeServer _arrivalNoticeSvc;                    // 入库单据Svc 
        private readonly IPalletBindServer _PalletBindSvc;                          // 托盘绑定Svc 
        private readonly IBllBoxInfoServer _BoxInfoSvc;
@@ -29,8 +32,9 @@
        #endregion
        #region 构造函数
        public BllAsnController(IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc,IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc,IOperationASNServer logSvc, IPalletUnbindServer palletUnbind,IAuditLogServer auditLog,IBllLabelBoxNoServer labelBox)
        public BllAsnController(IOptions<ApiUrlConfig> setting, IArrivalNoticeServer arrivalNoticeSvc, IPalletBindServer palletBindSvc,IBllBoxInfoServer bllBoxInfoSvc, ITaskServer taskSvc,IOperationASNServer logSvc, IPalletUnbindServer palletUnbind,IAuditLogServer auditLog,IBllLabelBoxNoServer labelBox)
        {
            _config = setting.Value;
            _arrivalNoticeSvc = arrivalNoticeSvc;
            _PalletBindSvc = palletBindSvc;
            _BoxInfoSvc = bllBoxInfoSvc;
@@ -97,6 +101,11 @@
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        /// <summary>
        /// 获取添加明细数据源
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetMaterialsList(GetMaterialsVm model)
        {
@@ -129,7 +138,7 @@
                }
                model.CreateUser = int.Parse(UserId);
                string strMesage = _arrivalNoticeSvc.AddArrivalNotice(model);
                string strMesage = _arrivalNoticeSvc.AddArrivalNotice(model, _config.WcsHost + _config.AddOrderTaskUrl);
                if (strMesage == "")
                {
@@ -986,7 +995,33 @@
                return Ok(new { code = 1, count = 0, msg = e.Message });
            }
        }
        //编辑标签数量
        [HttpPost]
        public IActionResult EditLabelQty(EditLabelQtyVm 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.EditLabelQty(model.Id, model.Qty, int.Parse(userId));
                return Ok(new { code = 0, msg = "编辑成功", data = "" });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, count = 0, msg = e.Message });
            }
        }
        #endregion
    }