JobConfig.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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/";//120.24.149.148
  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. #region 汇率同步任务
  77. public static string ExchangeRateSyncApi => $"{host_9521}ExpressageThirdPartyData/ExchangeRateSync";
  78. #endregion
  79. #region 订单邮件发送服务
  80. public static string OrderMailSendApi => $"{host_9520}TrackingMail/OrderMailSend?qty=300";
  81. public static string OrderSingMailAddApi => $"{host_9520}TrackingMail/OrderSingMailAdd?day=7";
  82. #endregion
  83. #endregion
  84. public static IJobDetail[] jobs
  85. {
  86. get
  87. {
  88. return new IJobDetail[]
  89. {
  90. JobBuilder.Create<QuotaReductionJob>().Build(),
  91. JobBuilder.Create<GenerateFirstBillsJob>().Build(),
  92. JobBuilder.Create<AlertFreezeCustomerJob>().Build(),
  93. JobBuilder.Create<PBPostManifestJob>().Build(),
  94. JobBuilder.Create<RetryChargeJob>().Build(),
  95. JobBuilder.Create<FuelSurchargeJob>().Build(),
  96. //报价文件任务 start
  97. JobBuilder.Create<GenerateCustomerQuotationJob>().Build(),
  98. JobBuilder.Create<GenerateCustomerFileJob>().Build(),
  99. JobBuilder.Create<GenerateZipFileJob>().Build(),
  100. //报价文件任务 end
  101. JobBuilder.Create<ReloadExecuteAsEmptyJob>().Build(),
  102. JobBuilder.Create<SendOnlineOutTimeJob>().Build(),
  103. JobBuilder.Create<Lading51TrackJob>().Build(),
  104. JobBuilder.Create<FustGoTrackingJob>().Build(),
  105. JobBuilder.Create<ExchangeRateJob>().Build(),
  106. //订单邮件任务
  107. JobBuilder.Create<OrderMailSendJob>().Build(),
  108. JobBuilder.Create<OrderSingMailAddJob>().Build(),
  109. };
  110. }
  111. }
  112. public static string[] crons
  113. {
  114. get
  115. {
  116. return new string[]
  117. {
  118. //"0 0/2 * * * ?",//每1分钟执行,测试用
  119. "0 0 0 */1 * ?",//每天零点执行
  120. "0 0 0 */1 * ?",//每天零点执行
  121. "0 0 9 * * ?",//每天9点执行
  122. "0 0 0 */1 * ?",//每天零点执行
  123. "0 0 2 * * ?",//每天2点执行
  124. "0 0 5 * * ?",//每天5点执行
  125. "0 0/3 * * * ?",//每3分钟执行
  126. "0 0/10 * * * ?",//每10分钟执行
  127. "0 0/20 * * * ?",//每20分钟执行
  128. "0 0 5 * * ?",//每天5点执行
  129. "0 0 5 * * ?",//每天9点执行
  130. "0 0 */1 * * ?",//每1小时执行
  131. //"0 0 */1 * * ?",//每1小时执行
  132. "0 0 0/1 * * ?",
  133. "0 0 0/6 * * ?",//每六小时执行一次,汇率同步
  134. "0 0/5 * * * ?",//每5分钟一次,邮件发送
  135. "0 0 */10 * * ?",//每10小时执行,邮件签收添加
  136. };
  137. }
  138. }
  139. }
  140. }