IPC-610
2024-12-03 2f0120d0c10ac24603936911ee5812d4e71d2740
Wms/Wms/Controllers/DownApiController.cs
@@ -14,6 +14,9 @@
using WMS.IBLL.ILogServer;
using Wms.Tools;
using System.Collections.Generic;
using Model.ModelVm.PdaVm;
using WMS.IBLL.IPdaServer;
using Model.ModelVm;
namespace Wms.Controllers
{
@@ -29,13 +32,17 @@
        private readonly IPalletBindServer _asnPalletBindSvc;//托盘绑定Svc 
        private readonly IStockCheckServer _crCheckSvc;//托盘绑定Svc 
        private readonly ITaskServer _taskSvc;//任务Svc 
        public DownApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IPalletBindServer asnPalletBindSvc, IStockCheckServer crCheckSvc, ITaskServer taskSvc)
        private readonly IPdaSoServer _pdaSoSvc;//空托出库Svc
        private readonly IPdaAsnServer _paAsnSvc;//空托跺绑定
        public DownApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IPalletBindServer asnPalletBindSvc, IStockCheckServer crCheckSvc, ITaskServer taskSvc, IPdaSoServer pdaSoSvc)
        {
            _config = setting.Value;
            _exNoticeSvc = exNoticeSvc;
            _asnPalletBindSvc = asnPalletBindSvc;
            _crCheckSvc = crCheckSvc;
            _taskSvc = taskSvc;
            _pdaSoSvc = pdaSoSvc;
        }
        #region WMS接口 调用下游系统接口 
@@ -220,10 +227,10 @@
                    var list = _asnPalletBindSvc.RequestRoadWayModel(model.PalletNo, model.HouseNo);
                    LogFile.SaveLogToFile($"WCS申请巷道返回:( {JsonConvert.SerializeObject(list)} ),", logStr);
                    new OperationASNServer().AddLogOperationAsn("入库作业", "入库日志", model.PalletNo.Substring(0, 8),
                        "申请巷道", $"申请巷道托盘号:{model.PalletNo.Substring(0, 8)}的成功信息", 2);
                    new OperationASNServer().AddLogOperationAsn("入库作业", "入库日志", model.PalletNo,
                        "申请巷道", $"申请巷道托盘号:{model.PalletNo}的成功信息", 2);
                    return Ok(new { Success = 0, Message = "申请储位成功", TaskList = list });
                    return Ok(new { Success = 0, Message = "申请巷道成功", TaskList = list });
                }
                else
                {
@@ -234,15 +241,15 @@
                    new OperationASNServer().AddLogOperationAsn("入库作业", "入库日志", model.PalletNo.Substring(0, 8),
                        "申请巷道", $"申请巷道托盘号:{model.PalletNo.Substring(0, 8)}的成功信息", 2);
                    return Ok(new { Success = 0, Message = "申请储位成功", TaskList = list });
                    return Ok(new { Success = 0, Message = "申请巷道成功", TaskList = list });
                }
            }
            catch (Exception e)
            {
                LogFile.SaveLogToFile($"WCS申请巷道返回:( {e.Message} ),", logStr);
                new OperationASNServer().AddLogOperationAsn("入库作业", "入库日志", model.PalletNo.Substring(0, 8),
                    "申请巷道", $"申请巷道托盘号:{model.PalletNo.Substring(0, 8)}的失败信息", 2);
                new OperationASNServer().AddLogOperationAsn("入库作业", "入库日志", model.PalletNo,
                    "申请巷道", $"申请巷道托盘号:{model.PalletNo}的失败信息", 2);
                return Ok(new ErpModel { Success = -1, Message = e.Message });
            }
@@ -532,6 +539,55 @@
            }
        }
        /// <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>
        /// <returns></returns>
        [AllowAnonymous]
        [HttpPost]
        public IActionResult IssuePlnOutHouseWcs(OutModePalletVm model)
        {
            var logStr = $@".\log\WCS\WCS申请空托出库" + DateTime.Now.ToString("yyyyMMdd") + ".txt";
            try
            {
                List<OutCommandDto> _list = _pdaSoSvc.IssuePlnOutHouseWcs(model,0);
                return Ok(new { Success = 0, Message = "空托盘出库成功", TaskList = _list });
            }
            catch (Exception e)
            {
                LogFile.SaveLogToFile($"WCS申请空托出库异常返回:( {e.Message} ),", logStr);
                return Ok(new ErpModel { Success = -1, Message = e.Message });
            }
        }
        ///// <summary>
        ///// 成品箱码拆垛拣货
        ///// </summary>