12345678910111213141516171819202122232425262728293031323334353637383940 |
- using FreeRedis;
- using ServiceCenter.Extensions;
- using ServiceCenter.Logs;
- using ServiceCenter.Redis;
- using WCS.Core;
- using WCS.WorkEngineering.Protocol.Station;
- namespace WCS.WorkEngineering.Extensions
- {
- public class Station : Device<IStation520, IStation521, IStation523>
- {
- public Station(Device device, World world) : base(device, world)
- {
- }
- /// <summary>
- /// 入库站点是否被禁止
- /// </summary>
- /// <returns></returns>
- public void 入库站点是否被禁止()
- {
- //RedisHub.Do(RedisSentinelClient => {
- //})
- var config = RedisHub.Default.Check("ForbidTubuEnter") ?? throw new Exception("请在Redis中配置检测门禁用");
- var configs = config.Split(",");
- if (configs.Contains(Entity.Code)) throw new KnownException("当前检测门已被禁用,请联系运维人员了解具体情况", LogLevelEnum.High);
- }
- /// <summary>
- /// 入库站点是否满足执行条件
- /// </summary>
- /// <returns></returns>
- public void 入库站点是否满足执行条件()
- {
- //if (Data.VoucherNo != Data2.VoucherNo) throw new KnownException($"凭证号不一致,DB520:{Data.VoucherNo}-DB521:{Data2.VoucherNo}", LogLevelEnum.High);
- if (Data3.Status.HasFlag(StationStatus.Run)) throw new KnownException("设备运行中", LogLevelEnum.Low);
- }
- }
- }
|