chengsc
2025-05-08 fc2b395e10c968f4bcf540613538265655b7a15e
Wms/Wms/Controllers/PdaAsnController.cs
@@ -1,13 +1,20 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Model.InterFaceModel;
using Model.ModelDto.BllAsnDto;
using Model.ModelDto.DataDto;
using Model.ModelVm;
using Model.ModelVm.BllAsnVm;
using Model.ModelVm.PdaVm;
using Newtonsoft.Json;
using System;
using System.Security.Claims;
using Utility;
using Utility.Tools;
using WMS.BLL.LogServer;
using WMS.Entity.BllAsnEntity;
using WMS.Entity.DataEntity;
using WMS.IBLL.IPdaServer;
namespace Wms.Controllers
@@ -18,10 +25,12 @@
    public class PdaAsnController : ControllerBase
    {
        private readonly IPdaAsnServer _PdaAsnSvc;
        private readonly UserManager _userManager;
        public PdaAsnController(IPdaAsnServer pdaAsnSvc)
        public PdaAsnController(IPdaAsnServer pdaAsnSvc,UserManager userManager)
        {
            _PdaAsnSvc = pdaAsnSvc;
            _PdaAsnSvc = pdaAsnSvc;
            _userManager = userManager;
        }
        
@@ -33,8 +42,6 @@
        /// 绑定托盘
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        /// <returns></returns>
        /// <returns></returns>
        [HttpPost]
        [UnitOfWork]
@@ -94,33 +101,6 @@
                var models = _PdaAsnSvc.GetNoPasteAsnNoStrList();
                return Ok(new { code = 0, msg = "入库单信息", data = models });
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        /// <summary>
        /// 判断托盘是否可用
        /// </summary>
        /// <param name="model">PalletNo:托盘条码</param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult IsEnablePalletNo(PalletBindVm model)
        {
            try
            {
                var strMsg = _PdaAsnSvc.IsEnablePalletNo(model.PalletNo);
                if (strMsg == "")
                {
                    return Ok(new { code = 0, msg = "托盘可用!" });
                }
                else
                {
                    return Ok(new { code = 1, msg = strMsg });
                }
            }
            catch (Exception e)
            {
@@ -208,11 +188,81 @@
            }
        }
        /// <summary>
        /// 判断托盘是否可用  公用方法
        /// </summary>
        /// <param name="model">PalletNo:托盘条码</param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult IsEnablePalletNo(PalletBindVm model)
        {
            try
            {
                var strMsg = _PdaAsnSvc.IsEnablePalletNo(model.PalletNo);
        //---------------------------------------------组托收货页面----------------------------------------------------------------------
                if (strMsg == "")
                {
                    return Ok(new { code = 0, msg = "托盘可用!" });
                }
                else
                {
                    return Ok(new { code = 1, msg = strMsg });
                }
            }
            catch (Exception e)
            {
                return Ok(new { code = 1, msg = e.Message });
            }
        }
        /// <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