chengsc
2025-05-23 3f9d7eb876f6d60d92e7f8a71240097b6ac50eb6
Wms/Wms/Controllers/PdaAsnController.cs
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Model.InterFaceModel;
using Model.ModelDto.BllAsnDto;
using Model.ModelDto.DataDto;
@@ -11,6 +13,7 @@
using System.Security.Claims;
using Utility;
using Utility.Tools;
using Wms.Tools;
using WMS.BLL.LogServer;
using WMS.Entity.BllAsnEntity;
using WMS.Entity.DataEntity;
@@ -23,11 +26,15 @@
    [Authorize]
    public class PdaAsnController : ControllerBase
    {
        private readonly ApiUrlConfig _config; //接口交互路径
        private readonly IPdaAsnServer _PdaAsnSvc;
        private readonly UserManager _userManager;
        public PdaAsnController(IPdaAsnServer pdaAsnSvc)
        public PdaAsnController(IOptions<ApiUrlConfig> setting, IPdaAsnServer pdaAsnSvc,UserManager userManager)
        {
            _PdaAsnSvc = pdaAsnSvc;
            _config = setting.Value;
            _PdaAsnSvc = pdaAsnSvc;
            _userManager = userManager;
        }
        
@@ -175,7 +182,7 @@
        {
            try
            {
                var models = _PdaAsnSvc.GetBindBoxInfos(model);
                var models = _PdaAsnSvc.GetBindBoxInfos(model, _config.BoxHost + _config.GetBoxUrl);
                return Ok(new { code = 0, msg = "标签箱码信息", data = models });
            }
@@ -212,9 +219,53 @@
            }
        }
        /// <summary>
        /// 根据单据获取标签数量
        /// </summary>
        /// <param name="model">ASNNo:入库单、ASNDetailNo:入库单明细号</param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetBoxCountByAsn(PalletBindVm model)
        {
            try
            {
                var list = _PdaAsnSvc.GetBoxCountByAsn(model.ASNNo,model.ASNDetailNo);
                return Ok(new { code = 0, msg = "根据单据获取标签数量", data= list});
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        //---------------------------------------------申请入库页面----------------------------------------------------------------------
        /// <summary>
        /// 保存指定的储位
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult SaveAppointLocate(PalletBindVm model)
        {
            try
            {
                _PdaAsnSvc.SaveAppointLocate(model.PalletNo, model.LocatNo, _userManager.UserId);
                return Ok(new HttpReturnModel{ Success = "0", Message = "成功指定储位" });
            }
            catch (Exception e)
            {
                return Ok(new HttpReturnModel { Success = "1", Message = e.Message });
            }
        }
        #endregion