RedisExtenshin.cs 858 B

1234567891011121314151617181920212223242526272829
  1. using FreeRedis;
  2. using Newtonsoft.Json;
  3. namespace WCS.WorkEngineering.Extensions
  4. {
  5. public static class RedisExtenshin
  6. {
  7. ///// <summary>
  8. ///// 写入垛形信息
  9. ///// </summary>
  10. ///// <param name="redis"></param>
  11. ///// <param name="stackInfoList"></param>
  12. //public static void SetPalletizingInformation(this RedisClient redis, List<StackInfo> stackInfoList)
  13. //{
  14. // var lockKey = nameof(SetPalletizingInformation);
  15. // try
  16. // {
  17. // if (redis.SetNx(lockKey, 1)) //设置锁
  18. // {
  19. // redis.Set("PalletizingInformation", JsonConvert.SerializeObject(stackInfoList));
  20. // }
  21. // }
  22. // finally
  23. // {
  24. // redis.Del(lockKey);
  25. // }
  26. //}
  27. }
  28. }