ReceiveTaskService.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 ReceiveTaskService
  9. {
  10. public readonly static ReceiveTaskService Instance = new ReceiveTaskService();
  11. private ReceiveTaskService()
  12. { }
  13. public void Start(JobMqMsg jobInfo)
  14. {
  15. string content = "";
  16. try
  17. {
  18. string OrderString = jobInfo.OrderString;
  19. // string Msg = "success";
  20. if (OrderString.StartsWith("Ap:") && OrderString.EndsWith(":Sycn"))
  21. {
  22. string Table = OrderString.Split(':')[1];
  23. PublicTableHelper.Instance.Start(Table);
  24. }
  25. // jobInfo.Status = Msg == "success" ? 1 : 0;
  26. // jobInfo.Msg = Msg == "success" ? "执行完成" : Msg;
  27. // RabbitMQClient.Instance.SendMsg(Newtonsoft.Json.JsonConvert.SerializeObject(jobInfo), "PublicBack");
  28. }
  29. catch (Exception ex)
  30. {
  31. if (!string.IsNullOrEmpty(content))
  32. {
  33. Dictionary<string, string> data = new Dictionary<string, string>();
  34. data.Add("ErrTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  35. data.Add("ErrMsg", ex.ToString());
  36. LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "public_err");
  37. }
  38. else
  39. {
  40. LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
  41. }
  42. }
  43. }
  44. }
  45. }