|
|
@ -51,7 +51,8 @@ namespace Myshipping.Core.MQ
|
|
|
|
{
|
|
|
|
{
|
|
|
|
base.Dispose();
|
|
|
|
base.Dispose();
|
|
|
|
_serviceScope.Dispose();
|
|
|
|
_serviceScope.Dispose();
|
|
|
|
mqConn.Close();
|
|
|
|
if (mqConn != null && mqConn.IsOpen)
|
|
|
|
|
|
|
|
mqConn.Close();
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("RecCompanyUserChangeService Dispose");
|
|
|
|
_logger.LogInformation("RecCompanyUserChangeService Dispose");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -60,7 +61,7 @@ namespace Myshipping.Core.MQ
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.LogInformation("RecCompanyUserChangeService ExecuteAsync");
|
|
|
|
_logger.LogInformation("RecCompanyUserChangeService ExecuteAsync");
|
|
|
|
|
|
|
|
|
|
|
|
return Task.Run(async () =>
|
|
|
|
return Task.Run(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.LogInformation("RecCompanyUserChangeService ExecuteAsync RunTask");
|
|
|
|
_logger.LogInformation("RecCompanyUserChangeService ExecuteAsync RunTask");
|
|
|
|
|
|
|
|
|
|
|
@ -68,9 +69,8 @@ namespace Myshipping.Core.MQ
|
|
|
|
string QueueName = $"djy.comp&user.change.{DateTime.Now.Ticks}";
|
|
|
|
string QueueName = $"djy.comp&user.change.{DateTime.Now.Ticks}";
|
|
|
|
|
|
|
|
|
|
|
|
ConnectionFactory factory = new ConnectionFactory();
|
|
|
|
ConnectionFactory factory = new ConnectionFactory();
|
|
|
|
var cache = _serviceScope.ServiceProvider.GetService<ISysCacheService>();
|
|
|
|
var repoSysCfg = _serviceScope.ServiceProvider.GetService<SqlSugarRepository<SysConfig>>();
|
|
|
|
var sysConfig = await cache.GetAllSysConfig();
|
|
|
|
var mqUrl = repoSysCfg.FirstOrDefault(x => x.Code == "CompanyUserChangeMqUrl").Value;
|
|
|
|
var mqUrl = sysConfig.First(x => x.Code == "CompanyUserChangeMqUrl").Value;
|
|
|
|
|
|
|
|
factory.Uri = new Uri(mqUrl);
|
|
|
|
factory.Uri = new Uri(mqUrl);
|
|
|
|
mqConn = factory.CreateConnection("客户订舱平台");
|
|
|
|
mqConn = factory.CreateConnection("客户订舱平台");
|
|
|
|
|
|
|
|
|
|
|
|