diff --git a/Sln.Wcs.HoistApi/Domain/Dto/GetHoistStatus/GetHoistStatusDto.cs b/Sln.Wcs.HoistApi/Domain/Dto/GetHoistStatus/GetHoistStatusDto.cs new file mode 100644 index 0000000..2a9e71e --- /dev/null +++ b/Sln.Wcs.HoistApi/Domain/Dto/GetHoistStatus/GetHoistStatusDto.cs @@ -0,0 +1,71 @@ +#region << 版 本 注 释 >> + +/*-------------------------------------------------------------------- +* 版权所有 (c) 2026 WenJY 保留所有权利。 +* CLR版本:4.0.30319.42000 +* 机器名称:Mr.Wen's MacBook Pro +* 命名空间:Sln.Wcs.HoistApi.Domain.Dto.GetHoistStatus +* 唯一标识:8BF91B3B-BB38-4809-9F3A-0B634C3853DC +* +* 创建者:WenJY +* 电子邮箱: +* 创建时间:2026-05-29 14:30:55 +* 版本:V1.0.0 +* 描述: +* +*-------------------------------------------------------------------- +* 修改人: +* 时间: +* 修改说明: +* +* 版本:V1.0.0 +*--------------------------------------------------------------------*/ + +#endregion << 版 本 注 释 >> + +namespace Sln.Wcs.HoistApi.Domain.Dto.GetHoistStatus; + +public class GetHoistStatusDto +{ + /// + /// 提升机编号 + /// + public string hoistCode { get; set; } + + /// + /// 反馈任务执行指令:是否可以下发任务 + /// + public string canDispatchTask { get; set; } + + /// + /// 当前楼层 + /// + public string currentFloor { get; set; } + + /// + /// 接驳位状态(1~5 楼) + /// 索引 0 → 1楼,索引 1 → 2楼,... 索引 4 → 5楼 + /// + public List transferStationStatus { get; set; } + + /// + /// 读写器触发状态(1~5 楼) + /// 索引 0 → 1楼,索引 1 → 2楼,... 索引 4 → 5楼 + /// + public List readerTriggerStatus { get; set; } + + /// + /// 自动状态:true = 自动模式,false = 手动模式 + /// + public string isAutoMode { get; set; } + + /// + /// 屏蔽调度:true = 屏蔽中,false = 未屏蔽 + /// + public string isDispatchBlocked { get; set; } + + /// + /// 状态指示(详见 ) + /// + public string stateIndicator { get; set; } +} \ No newline at end of file diff --git a/Sln.Wcs.HoistApi/Domain/Dto/GetHoistStatus/GetHoistStatusResultDto.cs b/Sln.Wcs.HoistApi/Domain/Dto/GetHoistStatus/GetHoistStatusResultDto.cs new file mode 100644 index 0000000..7af62ed --- /dev/null +++ b/Sln.Wcs.HoistApi/Domain/Dto/GetHoistStatus/GetHoistStatusResultDto.cs @@ -0,0 +1,36 @@ +#region << 版 本 注 释 >> + +/*-------------------------------------------------------------------- +* 版权所有 (c) 2026 WenJY 保留所有权利。 +* CLR版本:4.0.30319.42000 +* 机器名称:Mr.Wen's MacBook Pro +* 命名空间:Sln.Wcs.HoistApi.Domain.Dto.GetHoistStatus +* 唯一标识:CF90B482-6D53-45A9-A645-52786ED616D4 +* +* 创建者:WenJY +* 电子邮箱: +* 创建时间:2026-05-29 14:31:03 +* 版本:V1.0.0 +* 描述: +* +*-------------------------------------------------------------------- +* 修改人: +* 时间: +* 修改说明: +* +* 版本:V1.0.0 +*--------------------------------------------------------------------*/ + +#endregion << 版 本 注 释 >> + +using Sln.Wcs.Common.Domain.Dto; +using Sln.Wcs.HoistApi.Domain.Enum; +using Sln.Wcs.HoistApi.Domain.Model.GetHoistStatus; +using Sln.Wcs.HoistApi.Domain.Model.HoistControl; + +namespace Sln.Wcs.HoistApi.Domain.Dto.GetHoistStatus; + +public class GetHoistStatusResultDto:ResultDto +{ + +} \ No newline at end of file diff --git a/Sln.Wcs.HoistApi/Domain/Model/GetHoistStatus/GetHoistStatusResultModel.cs b/Sln.Wcs.HoistApi/Domain/Model/GetHoistStatus/GetHoistStatusResultModel.cs new file mode 100644 index 0000000..c203fcd --- /dev/null +++ b/Sln.Wcs.HoistApi/Domain/Model/GetHoistStatus/GetHoistStatusResultModel.cs @@ -0,0 +1,81 @@ +#region << 版 本 注 释 >> + +/*-------------------------------------------------------------------- +* 版权所有 (c) 2026 WenJY 保留所有权利。 +* CLR版本:4.0.30319.42000 +* 机器名称:Mr.Wen's MacBook Pro +* 命名空间:Sln.Wcs.HoistApi.Domain.Model.GetHoistStatus +* 唯一标识:A8DBEA2F-0505-40E1-B810-2617B9B0EBA7 +* +* 创建者:WenJY +* 电子邮箱: +* 创建时间:2026-05-29 14:32:07 +* 版本:V1.0.0 +* 描述: +* +*-------------------------------------------------------------------- +* 修改人: +* 时间: +* 修改说明: +* +* 版本:V1.0.0 +*--------------------------------------------------------------------*/ + +#endregion << 版 本 注 释 >> + +namespace Sln.Wcs.HoistApi.Domain.Model.GetHoistStatus; + +public class GetHoistStatusResultModel +{ + /// + /// 返回码 + /// + public string code { get; set; } + + /// + /// 返回消息 + /// + public string message { get; set; } + + /// + /// 提升机编号 + /// + public string hoistCode { get; set; } + + /// + /// 反馈任务执行指令:是否可以下发任务 + /// + public int canDispatchTask { get; set; } + + /// + /// 当前楼层 + /// + public int currentFloor { get; set; } + + /// + /// 接驳位状态(1~5 楼) + /// 索引 0 → 1楼,索引 1 → 2楼,... 索引 4 → 5楼 + /// + public int[] transferStationStatus { get; set; } = new int[5]; + + /// + /// 读写器触发状态(1~5 楼) + /// 索引 0 → 1楼,索引 1 → 2楼,... 索引 4 → 5楼 + /// + public int[] readerTriggerStatus { get; set; } = new int[5]; + + /// + /// 自动状态:true = 自动模式,false = 手动模式 + /// + public int isAutoMode { get; set; } + + /// + /// 屏蔽调度:true = 屏蔽中,false = 未屏蔽 + /// + public int isDispatchBlocked { get; set; } + + /// + /// 状态指示(详见 ) + /// + public int stateIndicator { get; set; } +} \ No newline at end of file diff --git a/Sln.Wcs.HoistApi/Service/IHoistApiService.cs b/Sln.Wcs.HoistApi/Service/IHoistApiService.cs index 6941516..431fdc0 100644 --- a/Sln.Wcs.HoistApi/Service/IHoistApiService.cs +++ b/Sln.Wcs.HoistApi/Service/IHoistApiService.cs @@ -23,6 +23,7 @@ #endregion << 版 本 注 释 >> +using Sln.Wcs.HoistApi.Domain.Dto.GetHoistStatus; using Sln.Wcs.HoistApi.Domain.Dto.HoistControl; using Sln.Wcs.HoistApi.Domain.Dto.HoistTaskExecutor; @@ -44,4 +45,11 @@ public interface IHoistApiService /// /// HoistTaskExeResultDto HoistTaskExecutor(HoistTaskExeDto hoistTaskExeDto); + + /// + /// 获取提升机状态 + /// + /// + /// + GetHoistStatusResultDto GetHoistStatus(GetHoistStatusDto hoistStatusDto); } \ No newline at end of file diff --git a/Sln.Wcs.HoistApi/Service/Impl/HoistApiService.cs b/Sln.Wcs.HoistApi/Service/Impl/HoistApiService.cs index a239d10..25cf8be 100644 --- a/Sln.Wcs.HoistApi/Service/Impl/HoistApiService.cs +++ b/Sln.Wcs.HoistApi/Service/Impl/HoistApiService.cs @@ -23,9 +23,11 @@ #endregion << 版 本 注 释 >> +using Sln.Wcs.HoistApi.Domain.Dto.GetHoistStatus; using Sln.Wcs.HoistApi.Domain.Dto.HoistControl; using Sln.Wcs.HoistApi.Domain.Dto.HoistTaskExecutor; using Sln.Wcs.HoistApi.Domain.Enum; +using Sln.Wcs.HoistApi.Domain.Model.GetHoistStatus; using Sln.Wcs.HoistApi.Domain.Model.HoistControl; using Sln.Wcs.HoistApi.Domain.Model.HoistTaskExecutor; using Sln.Wcs.HoistApi.Util; @@ -143,4 +145,51 @@ public class HoistApiService:IHoistApiService }; } } + + /// + /// 获取提升机状态 + /// + /// + /// + /// + public GetHoistStatusResultDto GetHoistStatus(GetHoistStatusDto hoistStatusDto) + { + try + { + if (hoistStatusDto == null) + { + throw new ArgumentException($"输入参数为空。"); + } + + var data = new HoistSdk.Dto.GetHoistStatus.GetHoistStatusDto() + { + hoistCode = hoistStatusDto.hoistCode, + }; + + var resp = this.hoistSdk.GetHoistStatus(data); + + bool parseRes = this.codeUtil.parse(resp.code, resp.message, out HoistStatusEnum hoistStatusEnum); + + return new GetHoistStatusResultDto() + { + code = hoistStatusEnum, + msg = resp.message, + data = new GetHoistStatusResultModel() + { + code = resp.code, + message = resp.message, + hoistCode = resp.hoistCode, + }, + }; + + } + catch (Exception ex) + { + return new GetHoistStatusResultDto() + { + code = HoistStatusEnum.SDK调用异常, + msg = ex.Message, + }; + } + } } \ No newline at end of file