SycnSpService.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using MySystem.PxcModels;
  5. using Library;
  6. using LitJson;
  7. namespace MySystem
  8. {
  9. public class SycnSpService
  10. {
  11. public readonly static SycnSpService Instance = new SycnSpService();
  12. private SycnSpService()
  13. { }
  14. public void Start(JobMqMsg jobInfo)
  15. {
  16. try
  17. {
  18. string OrderString = jobInfo.OrderString;
  19. if (OrderString.StartsWith("Sp:") && OrderString.EndsWith(":SpServer"))
  20. {
  21. string Kind = OrderString.Split(':')[1];
  22. dosomething(Kind);
  23. // jobInfo.Status = 1;
  24. // jobInfo.Msg = "执行完成";
  25. // RabbitMQClient.Instance.SendMsg(Newtonsoft.Json.JsonConvert.SerializeObject(jobInfo), "SycnSpServerBack");
  26. }
  27. }
  28. catch (Exception ex)
  29. {
  30. function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "同步SP数据到MAIN异常");
  31. }
  32. }
  33. public void dosomething(string Kind)
  34. {
  35. // if (Kind == "bind")
  36. // {
  37. // SycnSpBindService.Instance.Start();
  38. // }
  39. // else if (Kind == "active")
  40. // {
  41. // SycnSpActiveService.Instance.Start();
  42. // }
  43. // else if (Kind == "trade")
  44. // {
  45. // SycnSpTradeService.Instance.Start();
  46. // }
  47. // else if (Kind == "merchant")
  48. // {
  49. // SycnSpMerchantService.Instance.Start();
  50. // }
  51. }
  52. }
  53. }