| | |
| | | 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 |
| | | { |
| | |
| | | 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接口 调用下游系统接口 |
| | |
| | | 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 |
| | | { |
| | |
| | | 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 }); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /// <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> |