12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using _4PXOrder;
- using EasyNetQ;
- using Microsoft.Extensions.Hosting;
- using Microsoft.Extensions.Logging;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading;
- using System.Threading.Tasks;
- using XYY.Core.Standard.Data.Infrastructure;
- using XYY.Service.JobManage;
- using XYY.Service.Standard.Finance.Charging.CustomerOrderFee;
- using XYY.Service.Standard.First.JobSubscribe;
- using XYY.Service.Standard.Order;
- using XYY.Service.Strandard.EMailService;
- using XYY.TaskTrack.Standard;
- namespace XYY.WindowsService.MQ
- {
- public class Worker : BackgroundService
- {
- private readonly ILogger<Worker> _logger;
- private readonly IMQManager _mQManager;
- private readonly IJobSubscribe _jobSubscribe;
- private readonly ITrackSupplement _trackSupplement;
- private readonly IAddHNJobSubscribe _hNJobSubscribe;
- private readonly ISendFirstSubscribe _sendFirstSubscribe;
- private readonly ISendFirstNoteSubscribe _sendFirstNoteSubscribe;
- private readonly IFinanceQuotationJobSub _financeQuotationJobSub;
- private readonly IFeeBaseFileJobSub _feeBaseFileJobSub;
- private readonly ICancelOrderJobSubscribe _cancelOrderJobSubscribe;
- private readonly IFinanceChargeConsumer _financeChargeConsumer;
- private readonly IEmailService emailService;
- private readonly IUnitOfWork unitOfWork;
- private readonly IBus bus;
- private readonly XiKeTrackingSendJobSubscribe XiKeTrackingSendJobSubscribe;
- public Worker(ILogger<Worker> logger, IMQManager mQManager,
- IJobSubscribe jobSubscribe, IAddHNJobSubscribe hNJobSubscribe,
- ISendFirstSubscribe sendFirstSubscribe,
- ISendFirstNoteSubscribe sendFirstNoteSubscribe,
- IFinanceQuotationJobSub financeQuotationJobSub,
- ITrackSupplement trackSupplement, IFeeBaseFileJobSub feeBaseFileJobSub,
- ICancelOrderJobSubscribe cancelOrderJobSubscribe,
- IFinanceChargeConsumer financeChargeConsumer
- , XiKeTrackingSendJobSubscribe xiKeTrackingSendJobSubscribe
- , IEmailService emailService, IUnitOfWork unitOfWork, IBus bus)
- {
- _logger = logger;
- _mQManager = mQManager;
- _jobSubscribe = jobSubscribe;
- _hNJobSubscribe = hNJobSubscribe;
- _sendFirstSubscribe = sendFirstSubscribe;
- _sendFirstNoteSubscribe = sendFirstNoteSubscribe;
- _financeQuotationJobSub = financeQuotationJobSub;
- _trackSupplement = trackSupplement;
- _feeBaseFileJobSub = feeBaseFileJobSub;
- _cancelOrderJobSubscribe = cancelOrderJobSubscribe;
- _financeChargeConsumer = financeChargeConsumer;
- XiKeTrackingSendJobSubscribe = xiKeTrackingSendJobSubscribe;
- this.emailService = emailService;
- this.unitOfWork = unitOfWork;
- this.bus = bus;
- }
- protected override async Task ExecuteAsync(CancellationToken stoppingToken)
- {
- await _mQManager.Subscribe(_jobSubscribe);
- await _mQManager.Subscribe(_hNJobSubscribe);
- await _mQManager.Subscribe(_sendFirstSubscribe);
- await _mQManager.Subscribe(_sendFirstNoteSubscribe);
- await _mQManager.Subscribe(_financeQuotationJobSub);
- await _mQManager.Subscribe(_trackSupplement);
- await _mQManager.Subscribe(_feeBaseFileJobSub);
- await _mQManager.Subscribe(_cancelOrderJobSubscribe);
- await _mQManager.Subscribe(_financeChargeConsumer);
- await _mQManager.Subscribe(XiKeTrackingSendJobSubscribe);
- /*通用服务MQ订阅*/
- var manage = new WebApiJobManage<ExpressFeechargesModel>(_mQManager,
- "http://120.24.149.148:9503/api/ExpressFee/Charges2",
- new Dictionary<string, string> { { "Authorization", "token 132A7468DE079C6CEB59F383A661E612" } },
- emailService,
- new string[] { "fanlihang@xingyunyi.cn" },
- "郑州分公司重算",
- new JobDbService(unitOfWork),
- new BatchRechargingJobGetService(unitOfWork)
- );
- manage.ClientReg();
- }
- }
- }
|