StationExtension.cs 865 B

12345678910111213141516171819202122232425
  1. using ServiceCenter.Redis;
  2. using WCS.Core;
  3. using WCS.Entity.Protocol.Station;
  4. using WCS.WorkEngineering.Worlds.Logs;
  5. namespace WCS.WorkEngineering.Extensions
  6. {
  7. public class Station : Device<IStation520, IStation521, IStation523>
  8. {
  9. public Station(Device device, World world) : base(device, world)
  10. {
  11. }
  12. /// <summary>
  13. /// 入库站点是否被禁止
  14. /// </summary>
  15. /// <returns></returns>
  16. public void StorageStationIsForbid()
  17. {
  18. var config = RedisHub.Default.Check("ForbidTubuEnter") ?? throw new Exception("请在Redis中配置互斥量值");
  19. var configs = config.Split(",");
  20. if (configs.Contains(Entity.Code)) throw new KnownException("当前入库口已被禁用,请联系运维人员了解具体情况", LogLevelEnum.High);
  21. }
  22. }
  23. }