PrizeSetHelper.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using Library;
  4. using LitJson;
  5. using System.Linq;
  6. using System.Data;
  7. using System.Threading;
  8. using MySystem.PxcModels;
  9. namespace MySystem
  10. {
  11. public class PrizeSetHelper
  12. {
  13. public readonly static PrizeSetHelper Instance = new PrizeSetHelper();
  14. private PrizeSetHelper()
  15. { }
  16. public static void Do(string type, string no)
  17. {
  18. try
  19. {
  20. string field = "PosSn";
  21. if(type == "3" || type == "7") field = "OrderNo";
  22. Dictionary<string, string> data = new Dictionary<string, string>();
  23. data.Add("prize_tag", type);
  24. data.Add("content", "{\"" + field + "\":\"" + no + "\"}");
  25. RedisDbconn.Instance.AddList("PrizeSendQueue", Newtonsoft.Json.JsonConvert.SerializeObject(data));
  26. }
  27. catch(Exception ex)
  28. {
  29. function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "发送MQ奖励数据异常");
  30. }
  31. }
  32. }
  33. }