chengsc
2025-06-02 2056ae6f3d8243b0555f437ec6d214666d5bde53
Wms/Wms/Controllers/PdaAsnController.cs
@@ -1,6 +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;
@@ -12,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;
@@ -24,11 +26,13 @@
    [Authorize]
    public class PdaAsnController : ControllerBase
    {
        private readonly ApiUrlConfig _config; //接口交互路径
        private readonly IPdaAsnServer _PdaAsnSvc;
        private readonly UserManager _userManager;
        public PdaAsnController(IPdaAsnServer pdaAsnSvc,UserManager userManager)
        public PdaAsnController(IOptions<ApiUrlConfig> setting, IPdaAsnServer pdaAsnSvc,UserManager userManager)
        {
            _config = setting.Value;
            _PdaAsnSvc = pdaAsnSvc; 
            _userManager = userManager;
        }
@@ -178,7 +182,27 @@
        {
            try
            {
                var models = _PdaAsnSvc.GetBindBoxInfos(model);
                var models = _PdaAsnSvc.GetBindBoxInfos(model, _config.BoxHost + _config.GetBoxUrl);
                return Ok(new { code = 0, msg = "标签箱码信息", data = models });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        /// <summary>
        /// 根据箱码获取标签箱码信息(车间入库-获取WMS生成的箱信息)
        /// </summary>
        /// <param name="boxNo">BoxNo:箱号</param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult GetWmsBoxInfos(string boxNo)
        {
            try
            {
                var models = _PdaAsnSvc.GetWmsBoxInfos(boxNo);
                return Ok(new { code = 0, msg = "标签箱码信息", data = models });
            }
@@ -239,6 +263,40 @@
        }
        /// <summary>
        /// 绑定托盘
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult ChejianIn(PdaPalletBindVm model)
        {
            try
            {
                if (_userManager.UserId ==0)
                {
                    throw new Exception("未获取到用户信息");
                }
                if (model.TableType == 0)
                {
                    _PdaAsnSvc.ChejianIn(model.PalletNo,model.BoxNo,model.SkuQty,model.AreaNo, _userManager.UserId);
                }
                else if (model.TableType == 1)
                {
                    _PdaAsnSvc.ChejianQtyIn(model.PalletNo,model.SkuNo,model.LotNo,model.SkuQty,model.AreaNo, _userManager.UserId);
                }
                return Ok(new { code = 0, msg = "绑定成功!" });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        //---------------------------------------------申请入库页面----------------------------------------------------------------------
@@ -254,7 +312,7 @@
            {
                _PdaAsnSvc.SaveAppointLocate(model.PalletNo, model.LocatNo, _userManager.UserId);
                return Ok(new HttpReturnModel{ Success = "0", Message = "根据单据获取标签数量" });
                return Ok(new HttpReturnModel{ Success = "0", Message = "成功指定储位" });
            }
            catch (Exception e)