IPC-610
2025-01-02 286db121ac6b7e56b1b579ebcdd191526890f4af
Wms/Wms/Controllers/DownApiController.cs
@@ -16,6 +16,7 @@
using System.Collections.Generic;
using Model.ModelVm.PdaVm;
using WMS.IBLL.IPdaServer;
using Model.ModelVm;
namespace Wms.Controllers
{
@@ -32,8 +33,9 @@
        private readonly IStockCheckServer _crCheckSvc;//托盘绑定Svc 
        private readonly ITaskServer _taskSvc;//任务Svc 
        private readonly IPdaSoServer _pdaSoSvc;//空托出库Svc
        private readonly IPdaAsnServer _paAsnSvc;//空托跺绑定
        public DownApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IPalletBindServer asnPalletBindSvc, IStockCheckServer crCheckSvc, ITaskServer taskSvc, IPdaSoServer pdaSoSvc)
        public DownApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IPalletBindServer asnPalletBindSvc, IStockCheckServer crCheckSvc, ITaskServer taskSvc, IPdaSoServer pdaSoSvc,IPdaAsnServer paAsnSvc)
        {
            _config = setting.Value;
            _exNoticeSvc = exNoticeSvc;
@@ -41,6 +43,7 @@
            _crCheckSvc = crCheckSvc;
            _taskSvc = taskSvc;
            _pdaSoSvc = pdaSoSvc;
            _paAsnSvc = paAsnSvc;
        }
        #region WMS接口 调用下游系统接口 
@@ -426,7 +429,7 @@
                var bl = _exNoticeSvc.EmptyException(model);
                LogFile.SaveLogToFile($"空取异常:(执行结果成功),", logStr);
                return Ok(new { Success = 0, Message = "" });
                return Ok(new { Success = 0,StatusCode = 0, Message = "" });
            }
            catch (Exception e)
            {
@@ -451,7 +454,7 @@
                var list = _asnPalletBindSvc.FullException(model);
                LogFile.SaveLogToFile($"满入异常:( {JsonConvert.SerializeObject(list)} ),", logStr);
                return Ok(new { Success = 0, Message = "", TaskList = list });
                return Ok(new { Success = 0, StatusCode = 0, Message = "", TaskList = list });
            }
            catch (Exception e)
            {
@@ -538,6 +541,30 @@
        }
        /// <summary>
        /// WCS申请空托跺绑定
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult BindPlnInHouseWcs(PalletsBind model)
        {
            var logStr = $@".\log\WCS\WCS申请空托跺绑定" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
            try
            {
                var strMsg = _paAsnSvc.BindNullPallets(model);
                return Ok(new { Success = 0, Message = "空托跺绑定成功", TaskList = strMsg });
            }
            catch (Exception e)
            {
                LogFile.SaveLogToFile($"WCS申请空托跺绑定异常返回:( {e.Message} ),", logStr);
                return Ok(new ErpModel { Success = -1, Message = e.Message });
            }
        }
        /// <summary>
        /// WCS申请空托出库
        /// </summary>
        /// <param name="model"></param>
@@ -561,6 +588,78 @@
            }
        }
        /// <summary>
        /// WCS申请是否缠膜
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult RequestPackWcs(RequesIsBale model)
        {
            var logStr = $@".\log\WCS\WCS申请缠膜拆膜" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
            try
            {
               int t = _asnPalletBindSvc.RequestPackWcs(model.PalletNo);
                LogFile.SaveLogToFile($"WCS申请缠膜入库请求,请求托盘呈:( {model.PalletNo} ),", logStr);
                return Ok(new { Success = t, Message = "缠膜指令发送成功" });
            }
            catch (Exception e)
            {
                LogFile.SaveLogToFile($"WCS申请缠膜入库异常返回:( {e.Message} ),", logStr);
                return Ok(new ErpModel { Success = -1, Message = e.Message });
            }
        }
        /// <summary>
        /// WCS申请是否拆膜
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult RequestUnPackWcs(RequesIsBale model)
        {
            var logStr = $@".\log\WCS\WCS申请缠膜拆膜" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
            try
            {
                int t = _asnPalletBindSvc.RequestUnPackWcs(model.PalletNo);
                return Ok(new { Success = t, Message = "拆膜指令发送成功" });
            }
            catch (Exception e)
            {
                LogFile.SaveLogToFile($"WCS申请拆膜出库异常返回:( {e.Message} ),", logStr);
                return Ok(new ErpModel { Success = -1, Message = e.Message });
            }
        }
        /// <summary>
        /// WCS反馈缠膜完成
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult RequestPackedWcs(RequesIsBale model)
        {
            var logStr = $@".\log\WCS\WCS申请缠膜拆膜" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
            try
            {
                int t = _asnPalletBindSvc.RequestPackedWcs(model.PalletNo);
                return Ok(new { Success = t, Message = "缠膜完成指令发送成功" });
            }
            catch (Exception e)
            {
                LogFile.SaveLogToFile($"WCS申请缠膜完成异常返回:( {e.Message} ),", logStr);
                return Ok(new ErpModel { Success = -1, Message = e.Message });
            }
        }
        ///// <summary>
        ///// 成品箱码拆垛拣货
@@ -625,6 +724,7 @@
                switch (orderType)
                {
                    case "0"://入库任务执行
                    case "1"://出库任务执行
                    case "2"://盘库任务执行
                    case "3"://移库任务执行