CustomerService.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using Library;
  5. using LitJson;
  6. namespace MySystem
  7. {
  8. public class CustomerService
  9. {
  10. public readonly static CustomerService Instance = new CustomerService();
  11. private CustomerService()
  12. { }
  13. public void Start(JobMqMsg jobInfo)
  14. {
  15. string content = "";
  16. try
  17. {
  18. string OrderString = jobInfo.OrderString;
  19. string Msg = "";
  20. if (OrderString == "")
  21. {
  22. string Table = OrderString.Split(':')[1];
  23. switch (Table)
  24. {
  25. }
  26. }
  27. if (!string.IsNullOrEmpty(Msg))
  28. {
  29. jobInfo.Status = Msg == "success" ? 1 : 0;
  30. jobInfo.Msg = Msg == "success" ? "执行完成" : Msg;
  31. RabbitMQClient.Instance.SendMsg(Newtonsoft.Json.JsonConvert.SerializeObject(jobInfo), "PublicBack");
  32. }
  33. else
  34. {
  35. TendisDbconn.Instance.AddList("MainPopWaitList", Newtonsoft.Json.JsonConvert.SerializeObject(jobInfo));
  36. }
  37. }
  38. catch (Exception ex)
  39. {
  40. if (!string.IsNullOrEmpty(content))
  41. {
  42. Dictionary<string, string> data = new Dictionary<string, string>();
  43. data.Add("ErrTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  44. data.Add("ErrMsg", ex.ToString());
  45. TendisDbconn.Instance.AddList("public_err", data);
  46. }
  47. else
  48. {
  49. TendisDbconn.Instance.AddList("public_service", DateTime.Now.ToString() + ":" + ex.ToString());
  50. }
  51. }
  52. }
  53. }
  54. }