RepleatOrderInfoEndJob.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using Newtonsoft.Json;
  2. using Quartz;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using XYY.Tool.QuotaReduction;
  9. namespace XYY.Tool.TimingTask.jobs
  10. {
  11. internal class ReloadExecuteAsEmptyJob : IJob
  12. {
  13. public async Task Execute(IJobExecutionContext context)
  14. {
  15. string msg = string.Empty;
  16. RestSharp.RestClient client = new RestSharp.RestClient(JobConfig.ReloadExecuteAsEmptyApi);
  17. RestSharp.RestRequest request = new RestSharp.RestRequest(RestSharp.Method.POST);
  18. request.AddHeader("Authorization", "token 985833DB91DA7B38C3918D3F1F9D2339");
  19. client.Timeout = 0;
  20. var response = client.Execute(request);
  21. if(response.StatusCode != System.Net.HttpStatusCode.OK)
  22. {
  23. msg = "同步空计费日志失败" + (response.ErrorMessage ?? response.Content);
  24. }
  25. else
  26. {
  27. msg = "同步空计费完成";
  28. }
  29. dingApiRequest.sendDingMessageToChat("GenerateFirstBillsJob", "SMP同步空计费");
  30. }
  31. }
  32. }