diff --git a/src/Shentun.ColumnReferencePlugIns/WebAppoints/WebAppointWebPeisPlugIns.cs b/src/Shentun.ColumnReferencePlugIns/WebAppoints/WebAppointWebPeisPlugIns.cs index e231882a..f401186c 100644 --- a/src/Shentun.ColumnReferencePlugIns/WebAppoints/WebAppointWebPeisPlugIns.cs +++ b/src/Shentun.ColumnReferencePlugIns/WebAppoints/WebAppointWebPeisPlugIns.cs @@ -150,10 +150,25 @@ namespace Shentun.Peis.PlugIns.WebAppoints sql += " and is_upload='N' "; } + + var parameters = new DynamicParameters(); + parameters.Add("HandDate", DateTime.Now.Date.AddDays(-input.QueryDays)); + parameters.Add("CompleteFlag", PatientRegisterCompleteFlag.SumCheck); + + + if (input.ExcludeMedicalTypeIds.Any()) + { + // 构建IN子句的字符串 + var excludeIdsList = input.ExcludeMedicalTypeIds.Select(id => $"'{id}'"); + var excludeIdsString = string.Join(",", excludeIdsList); + sql += $" AND medical_type_id NOT IN ({excludeIdsString}) "; + } + + sql += $" limit {input.UploadCountLimit} "; - var patientRegisterIds = (await conn.QueryAsync(sql, - new { HandDate = DateTime.Now.Date.AddDays(-input.QueryDays), CompleteFlag = PatientRegisterCompleteFlag.SumCheck })).ToList(); + + var patientRegisterIds = (await conn.QueryAsync(sql, parameters)).ToList(); return patientRegisterIds; } } diff --git a/src/Shentun.Peis.Application.Contracts/TransToWebPeiss/SyncPatientRegisterReportInputDto.cs b/src/Shentun.Peis.Application.Contracts/TransToWebPeiss/SyncPatientRegisterReportInputDto.cs index 6cc914a1..d0ae0eb4 100644 --- a/src/Shentun.Peis.Application.Contracts/TransToWebPeiss/SyncPatientRegisterReportInputDto.cs +++ b/src/Shentun.Peis.Application.Contracts/TransToWebPeiss/SyncPatientRegisterReportInputDto.cs @@ -25,5 +25,7 @@ namespace Shentun.Peis.TransToWebPeiss public char UploadDateType { get; set; } public int UploadCountLimit { get; set; } = 100; + + public List ExcludeMedicalTypeIds { get; set; } = new List(); } } diff --git a/src/Shentun.Peis.HttpApi.Host/Schedulers/SyncPatientRegisterReportInterfaceWorker.cs b/src/Shentun.Peis.HttpApi.Host/Schedulers/SyncPatientRegisterReportInterfaceWorker.cs index 53460d21..b0fcccca 100644 --- a/src/Shentun.Peis.HttpApi.Host/Schedulers/SyncPatientRegisterReportInterfaceWorker.cs +++ b/src/Shentun.Peis.HttpApi.Host/Schedulers/SyncPatientRegisterReportInterfaceWorker.cs @@ -147,6 +147,9 @@ namespace Shentun.Peis.Schedulers //单次最大的上传数量 var uploadCountLimit = Convert.ToInt32(interfaceConfig.GetValue("Interface:Scheduler:UploadCountLimit", "100")); + + + SyncPatientRegisterReportInputDto input = new SyncPatientRegisterReportInputDto { QueryDays = QueryDays, @@ -157,6 +160,15 @@ namespace Shentun.Peis.Schedulers }; + //剔除的体检类别id 集合 a,b + var excludeMedicalTypeIdsValue = interfaceConfig.GetValue("Interface:ExcludeMedicalTypeIds", ""); + if (!string.IsNullOrWhiteSpace(excludeMedicalTypeIdsValue)) + { + List excludeMedicalTypeIds = excludeMedicalTypeIdsValue.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); + input.ExcludeMedicalTypeIds = excludeMedicalTypeIds; + // input.ExcludeMedicalTypeIds = excludeMedicalTypeIds.Select(s => Guid.Parse(s)).ToList(); + } + var assemblyName = interfaceConfig.GetSection("Interface").GetSection("AssemblyName").Value; var className = interfaceConfig.GetSection("Interface").GetSection("ClassName").Value;