JobConfig.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. using Quartz;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using XYY.Tool.TimingTask.jobs;
  8. namespace XYY.Tool.QuotaReduction
  9. {
  10. public static class JobConfig
  11. {
  12. #region 链接配置
  13. private static string host_9521 = "http://120.24.149.148:9521/api/";//120.24.149.148:9521
  14. private static string host_9513 = "http://120.24.149.148:9513/api/";
  15. private static string host_9518 = "http://120.24.149.148:9518/api/";
  16. private static string host_9503 = "http://120.24.149.148:9503/api/";
  17. private static string host_smp = "http://api.smp.xingyunyi.cn/";
  18. private static string host_9520 = "http://120.24.149.148:9520/api/";
  19. #if DEBUG
  20. //host_9521= "http://localhost:9521/api/";
  21. //host_9518 = "http://localhost:9518/api/";
  22. #endif
  23. #region QuotaReductionJob 取消授信
  24. public static string QuotaReductionJobApi => $"{host_9521}CustomerAccount/QuotaReduction";
  25. /// <summary>
  26. /// 重试次数,不含首次请求
  27. /// </summary>
  28. public static int QuotaReductionJobTryTime => 3;
  29. /// <summary>
  30. /// 时间间隔,毫秒
  31. /// </summary>
  32. public static int QuotaReductionJobTryTimeInterval => 300000;
  33. #endregion
  34. #region 消息发送请求
  35. public static string dingdingApi => "http://120.24.149.148:9505/WarningNotice/NoticeText";
  36. public static string weChatApi => "http://120.24.149.148:9505/WarningNotice/NoticeTextToUser";
  37. /// <summary>
  38. /// 重试次数,不含首次请求
  39. /// </summary>
  40. public static int dingdingTryTime => 3;
  41. /// <summary>
  42. /// 时间间隔,毫秒
  43. /// </summary>
  44. public static int dingdingTryTimeInterval => 300000;
  45. #endregion
  46. #region GenerateFirstBillsJob 生成帐单
  47. public static string GenerateFirstBillsJobApi => $"{host_9521}FiannceCustomerDeliveryBill/GenerateFirstBills";
  48. public static string AlertFreezeCustomerJobApi => $"{host_9513}Customer/AlertFreezeCustomer?days=18";
  49. public static string ReChargeJobApi => $"{host_9503}ExpressFee/Charges";
  50. public static string ReloadExecuteAsEmptyApi => $"{host_smp}FinanceTask/ReloadExecuteAsEmpty";
  51. /// <summary>
  52. /// 重试次数,不含首次请求
  53. /// </summary>
  54. public static int GenerateFirstBillsJobTryTime => 3;
  55. /// <summary>
  56. /// 时间间隔,毫秒
  57. /// </summary>
  58. public static int GenerateFirstBillsJobTryTimeInterval => 300000;
  59. #endregion
  60. #region PB相关
  61. public static string PBPostManifestAction => $"{host_9518}order/PostManifest";
  62. #endregion
  63. #region 燃油附加费同步
  64. public static string FedexSurchargesSyncApi => $"{host_9521}ExpressageThirdPartyData/FedexSurchargesSync";
  65. public static string DHLSurchargesSyncApi => $"{host_9521}ExpressageThirdPartyData/DHLSurchargesSync";
  66. #endregion
  67. #region 结算价自动生成客户报价文件
  68. public static string GenerateQuotationApi => $"{host_9521}ExpressBulkAdjustmentQuote/GenerateQuotation";
  69. //先按5个一批执行
  70. public static string GenerateCustomerFileApi => $"{host_9521}ExpressBulkAdjustmentQuote/GenerateCustomerFile?fileCount=5";
  71. public static string GenerateZipFileApi => $"{host_9521}ExpressBulkAdjustmentQuote/GenerateZipFile";
  72. #endregion
  73. #region 提单轨迹任务更新
  74. public static string Lading51TrackApi => $"{host_9520}BatchTracking/Lading51Track";//Lading51Track
  75. #endregion
  76. #endregion
  77. public static IJobDetail[] jobs
  78. {
  79. get
  80. {
  81. return new IJobDetail[]
  82. {
  83. JobBuilder.Create<QuotaReductionJob>().Build(),
  84. JobBuilder.Create<GenerateFirstBillsJob>().Build(),
  85. JobBuilder.Create<AlertFreezeCustomerJob>().Build(),
  86. JobBuilder.Create<PBPostManifestJob>().Build(),
  87. JobBuilder.Create<RetryChargeJob>().Build(),
  88. JobBuilder.Create<FuelSurchargeJob>().Build(),
  89. //报价文件任务 start
  90. JobBuilder.Create<GenerateCustomerQuotationJob>().Build(),
  91. JobBuilder.Create<GenerateCustomerFileJob>().Build(),
  92. JobBuilder.Create<GenerateZipFileJob>().Build(),
  93. //报价文件任务 end
  94. JobBuilder.Create<ReloadExecuteAsEmptyJob>().Build(),
  95. JobBuilder.Create<SendOnlineOutTimeJob>().Build(),
  96. JobBuilder.Create<Lading51TrackJob>().Build(),
  97. JobBuilder.Create<FustGoTrackingJob>().Build(),
  98. };
  99. }
  100. }
  101. public static string[] crons
  102. {
  103. get
  104. {
  105. return new string[]
  106. {
  107. //"0 0/2 * * * ?",//每1分钟执行,测试用
  108. "0 0 0 */1 * ?",//每天零点执行
  109. "0 0 0 */1 * ?",//每天零点执行
  110. "0 0 9 * * ?",//每天9点执行
  111. "0 0 0 */1 * ?",//每天零点执行
  112. "0 0 2 * * ?",//每天2点执行
  113. "0 0 5 * * ?",//每天5点执行
  114. "0 0/3 * * * ?",//每3分钟执行
  115. "0 0/10 * * * ?",//每10分钟执行
  116. "0 0/20 * * * ?",//每20分钟执行
  117. "0 0 5 * * ?",//每天5点执行
  118. "0 0 5 * * ?",//每天9点执行
  119. "0 0/30 * * * ?",//每30分钟执行
  120. //"0 0 */1 * * ?",//每1小时执行
  121. "0 0 0/1 * * ? ",
  122. };
  123. }
  124. }
  125. }
  126. }