| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using MySystem.Models;
- using Library;
- using LitJson;
- namespace MySystem
- {
- public class SycnSpService
- {
- public readonly static SycnSpService Instance = new SycnSpService();
- private SycnSpService()
- { }
- public void Start(JobMqMsg jobInfo)
- {
- try
- {
- function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(jobInfo), "SycnSpServer监控");
- string OrderString = jobInfo.OrderString;
- function.WriteLog(OrderString, "SycnSpServer监控");
- if (OrderString.StartsWith("Sp:") && OrderString.EndsWith(":SpServer"))
- {
- function.WriteLog("ok", "SycnSpServer监控");
- string Kind = OrderString.Split(':')[1];
- function.WriteLog("Kind:" + Kind, "SycnSpServer监控");
- dosomething(Kind);
- function.WriteLog("finish:" + Kind, "SycnSpServer监控");
- function.WriteLog("\r\n\r\n\r\n", "SycnSpServer监控");
- jobInfo.Status = 1;
- jobInfo.Msg = "执行完成";
- RabbitMQClient.Instance.SendMsg(Newtonsoft.Json.JsonConvert.SerializeObject(jobInfo), "SycnSpServerBack");
- }
- }
- catch (Exception ex)
- {
- function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "sycn_sp_server_err");
- }
- }
- public void dosomething(string Kind)
- {
- if (Kind == "bind")
- {
- SycnSpBindService.Instance.Start();
- }
- else if (Kind == "active")
- {
- SycnSpActiveService.Instance.Start();
- }
- else if (Kind == "trade")
- {
- SycnSpTradeService.Instance.Start();
- }
- else if (Kind == "merchant")
- {
- SycnSpMerchantService.Instance.Start();
- }
- }
- }
- }
|