Browse Source

配置swagger开关、任务计划开关、任务计划面板开关

master
wxd 2 years ago
parent
commit
427221e3b4
  1. 11
      src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs
  2. 17
      src/Shentun.Peis.HttpApi.Host/Schedulers/ChargeRequestInterfaceQueryWorker.cs
  3. 15
      src/Shentun.Peis.HttpApi.Host/Schedulers/ImportElectrocardiogramResultInterfaceWorker.cs
  4. 15
      src/Shentun.Peis.HttpApi.Host/Schedulers/ImportLisResultInterfaceWorker.cs
  5. 17
      src/Shentun.Peis.HttpApi.Host/Schedulers/ImportPacsResultInterfaceWorker.cs
  6. 12
      src/Shentun.Peis.HttpApi.Host/Schedulers/ImportPatientRegisterInterfaceWorker.cs
  7. 11
      src/Shentun.Peis.HttpApi.Host/Schedulers/SyncPatientRegisterReportInterfaceWorker.cs
  8. 9
      src/Shentun.Peis.HttpApi.Host/appsettings.json

11
src/Shentun.Peis.HttpApi.Host/PeisHttpApiHostModule.cs

@ -491,12 +491,16 @@ public class PeisHttpApiHostModule : AbpModule
app.UseErrorPage();
}
//配置是否启用任务面板
var IsEnabledDashboard = Convert.ToBoolean(configuration["Hangfire:IsEnabledDashboard"]);
if (IsEnabledDashboard)
{
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new[] { new CustomAuthorizeFilter() }
});
}
app.UseCorrelationId();
@ -565,7 +569,11 @@ public class PeisHttpApiHostModule : AbpModule
//app.UseMiddleware(typeof(AuthorizationMiddlewareResultHandler));
//配置是否启用swagger
var IsSwagger = Convert.ToBoolean(configuration["Swagger:IsEnabled"]);
if (IsSwagger)
{
app.UseSwagger();
app.UseAbpSwaggerUI(c =>
{
@ -583,6 +591,7 @@ public class PeisHttpApiHostModule : AbpModule
c.DefaultModelExpandDepth(-1);
});
}
app.UseAuditing();
app.UseAbpSerilogEnrichers();

17
src/Shentun.Peis.HttpApi.Host/Schedulers/ChargeRequestInterfaceQueryWorker.cs

@ -25,14 +25,24 @@ namespace Shentun.Peis.Schedulers
private static long i;
private static bool _isRunning = false;
private static readonly object lockObject = new object();
private readonly IConfiguration _configuration;
public ChargeRequestInterfaceQueryWorker(IConfiguration configuration)
{
_configuration = configuration;
}
public virtual void DoWork(Guid interfaceId)
{
if (_isRunning) return;
//lock (lockObject)
//{
_isRunning = true;
try
{
var backJobTypeIds = _configuration.GetSection("BackJobTypeId").Value;
//Logger.LogInformation("Executed" + GetType().Name + "..!");
var appServiceHelper = new AppServiceHelper();
//appServiceHelper.Login();
@ -43,6 +53,13 @@ namespace Shentun.Peis.Schedulers
_isRunning = false;
return;
}
if (!backJobTypeIds.Contains(thirdInterfaceDto.ThirdInterfaceType))
{
_isRunning = false;
return;
}
if (thirdInterfaceDto.IsActive != 'Y')
{
_isRunning = false;

15
src/Shentun.Peis.HttpApi.Host/Schedulers/ImportElectrocardiogramResultInterfaceWorker.cs

@ -23,6 +23,12 @@ namespace Shentun.Peis.Schedulers
private static long i;
private static bool _isRunning = false;
private static readonly object lockObject = new object();
private readonly IConfiguration _configuration;
public ImportElectrocardiogramResultInterfaceWorker(IConfiguration configuration)
{
_configuration = configuration;
}
public virtual void DoWork(Guid interfaceId)
{
if (_isRunning) return;
@ -31,6 +37,8 @@ namespace Shentun.Peis.Schedulers
_isRunning = true;
try
{
var backJobTypeIds = _configuration.GetSection("BackJobTypeId").Value;
//Logger.LogInformation("Executed" + GetType().Name + "..!");
var appServiceHelper = new AppServiceHelper();
//appServiceHelper.Login();
@ -41,6 +49,13 @@ namespace Shentun.Peis.Schedulers
_isRunning = false;
return;
}
if (!backJobTypeIds.Contains(thirdInterfaceDto.ThirdInterfaceType))
{
_isRunning = false;
return;
}
if (thirdInterfaceDto.IsActive != 'Y')
{
_isRunning = false;

15
src/Shentun.Peis.HttpApi.Host/Schedulers/ImportLisResultInterfaceWorker.cs

@ -23,6 +23,12 @@ namespace Shentun.Peis.Schedulers
private static long i;
private static bool _isRunning = false;
private static readonly object lockObject = new object();
private readonly IConfiguration _configuration;
public ImportLisResultInterfaceWorker(IConfiguration configuration)
{
_configuration = configuration;
}
public virtual void DoWork(Guid interfaceId)
{
if (_isRunning) return;
@ -31,6 +37,8 @@ namespace Shentun.Peis.Schedulers
_isRunning = true;
try
{
var backJobTypeIds = _configuration.GetSection("BackJobTypeId").Value;
//Logger.LogInformation("Executed" + GetType().Name + "..!");
var appServiceHelper = new AppServiceHelper();
//appServiceHelper.Login();
@ -41,6 +49,13 @@ namespace Shentun.Peis.Schedulers
_isRunning = false;
return;
}
if (!backJobTypeIds.Contains(thirdInterfaceDto.ThirdInterfaceType))
{
_isRunning = false;
return;
}
if (thirdInterfaceDto.IsActive != 'Y')
{
_isRunning = false;

17
src/Shentun.Peis.HttpApi.Host/Schedulers/ImportPacsResultInterfaceWorker.cs

@ -23,6 +23,14 @@ namespace Shentun.Peis.Schedulers
private static long i;
private static bool _isRunning = false;
private static readonly object lockObject = new object();
private readonly IConfiguration _configuration;
public ImportPacsResultInterfaceWorker(IConfiguration configuration)
{
_configuration = configuration;
}
public virtual void DoWork(Guid interfaceId)
{
if (_isRunning) return;
@ -31,6 +39,8 @@ namespace Shentun.Peis.Schedulers
_isRunning = true;
try
{
var backJobTypeIds = _configuration.GetSection("BackJobTypeId").Value;
//Logger.LogInformation("Executed" + GetType().Name + "..!");
var appServiceHelper = new AppServiceHelper();
//appServiceHelper.Login();
@ -41,6 +51,13 @@ namespace Shentun.Peis.Schedulers
_isRunning = false;
return;
}
if (!backJobTypeIds.Contains(thirdInterfaceDto.ThirdInterfaceType))
{
_isRunning = false;
return;
}
if (thirdInterfaceDto.IsActive != 'Y')
{
_isRunning = false;

12
src/Shentun.Peis.HttpApi.Host/Schedulers/ImportPatientRegisterInterfaceWorker.cs

@ -19,6 +19,12 @@ namespace Shentun.Peis.Schedulers
private static long i;
private static bool _isRunning = false;
private static readonly object lockObject = new object();
private readonly IConfiguration _configuration;
public ImportPatientRegisterInterfaceWorker(IConfiguration configuration)
{
_configuration = configuration;
}
public virtual void DoWork(Guid interfaceId)
{
if (_isRunning) return;
@ -27,6 +33,7 @@ namespace Shentun.Peis.Schedulers
_isRunning = true;
try
{
var backJobTypeIds = _configuration.GetSection("BackJobTypeId").Value;
//Logger.LogInformation("Executed" + GetType().Name + "..!");
var appServiceHelper = new AppServiceHelper();
//appServiceHelper.Login();
@ -37,6 +44,11 @@ namespace Shentun.Peis.Schedulers
_isRunning = false;
return;
}
if (!backJobTypeIds.Contains(thirdInterfaceDto.ThirdInterfaceType))
{
_isRunning = false;
return;
}
if (thirdInterfaceDto.IsActive != 'Y')
{
_isRunning = false;

11
src/Shentun.Peis.HttpApi.Host/Schedulers/SyncPatientRegisterReportInterfaceWorker.cs

@ -43,14 +43,17 @@ namespace Shentun.Peis.Schedulers
private readonly TransToWebPeisAppService _appService;
private readonly PrintReportAppService _printReportAppService;
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository;
private readonly IConfiguration _configuration;
public SyncPatientRegisterReportInterfaceWorker(
TransToWebPeisAppService appService,
IRepository<PatientRegister, Guid> patientRegisterRepository,
PrintReportAppService printReportAppService)
PrintReportAppService printReportAppService,
IConfiguration configuration)
{
_appService = appService;
_patientRegisterRepository = patientRegisterRepository;
_printReportAppService = printReportAppService;
_configuration = configuration;
}
public void DoWork(Guid interfaceId)
@ -61,6 +64,7 @@ namespace Shentun.Peis.Schedulers
_isRunning = true;
try
{
var backJobTypeIds = _configuration.GetSection("BackJobTypeId").Value;
//Logger.LogInformation("Executed" + GetType().Name + "..!");
var appServiceHelper = new AppServiceHelper();
appServiceHelper.Login();
@ -71,6 +75,11 @@ namespace Shentun.Peis.Schedulers
_isRunning = false;
return;
}
if (!backJobTypeIds.Contains(thirdInterfaceDto.ThirdInterfaceType))
{
_isRunning = false;
return;
}
if (thirdInterfaceDto.IsActive != 'Y')
{
_isRunning = false;

9
src/Shentun.Peis.HttpApi.Host/appsettings.json

@ -41,5 +41,12 @@
},
"AdminId": "3a11fe49-5719-0e9e-dd44-0c4aff0900b0",
//"AdminId": "3a0c4180-107c-0c89-b25b-0bd34666dcec",
"PeisReportPdfPath": "E:\\mypeis\\PeisReportPdf\\"
"PeisReportPdfPath": "E:\\mypeis\\PeisReportPdf\\",
"BackJobTypeId": "",
"Swagger": {
"IsEnabled": true
},
"Hangfire": {
"IsEnabledDashboard": true
}
}
Loading…
Cancel
Save