diff --git a/src/Shentun.Peis.Application/OccupationalDiseaseReports/OccupationalDiseaseReportAppService.cs b/src/Shentun.Peis.Application/OccupationalDiseaseReports/OccupationalDiseaseReportAppService.cs index 61c32c9..1e0cefc 100644 --- a/src/Shentun.Peis.Application/OccupationalDiseaseReports/OccupationalDiseaseReportAppService.cs +++ b/src/Shentun.Peis.Application/OccupationalDiseaseReports/OccupationalDiseaseReportAppService.cs @@ -20,7 +20,7 @@ using Volo.Abp.Identity; namespace Shentun.Peis.OccupationalDiseaseReports { [ApiExplorerSettings(GroupName = "Work")] - [Authorize] + //[Authorize] public class OccupationalDiseaseReportAppService : ApplicationService { @@ -348,12 +348,17 @@ namespace Shentun.Peis.OccupationalDiseaseReports } } + List customerOrgIds = new List(); + if (customerOrgPara.CustomerOrgId != null) { - var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(customerOrgPara.CustomerOrgId.Value); - query = query.Where(m => CustomerOrgIds.Contains(m.patientRegister.CustomerOrgId)); + customerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(customerOrgPara.CustomerOrgId.Value); } + if (customerOrgIds.Any()) + { + query = query.Where(m => customerOrgIds.Contains(m.patientRegister.CustomerOrgId)); + } if (customerOrgPara.CustomerOrgGroupId.Any()) { @@ -426,7 +431,7 @@ namespace Shentun.Peis.OccupationalDiseaseReports { var isSelected = ocCheckTypeDetails.Count(f => f.OcCheckTypeName == item.OcCheckTypeName) > 0 ? true : false; item.IsSelected = isSelected; - } + } #endregion @@ -577,7 +582,7 @@ namespace Shentun.Peis.OccupationalDiseaseReports from posionHaveEmpty in poisonTemp.DefaultIfEmpty() where patientRegister.CustomerOrgRegisterId == customerOrgPara.CustomerOrgRegisterId // && !registerCheckSummaryEmpty.Summary.Contains("未见异常") - && patientRegister.CompleteFlag != PatientRegisterCompleteFlag.PreRegistration + // && patientRegister.CompleteFlag != PatientRegisterCompleteFlag.PreRegistration && asbitemHaveEmpty.IsCheck == 'Y' select new { @@ -616,6 +621,12 @@ namespace Shentun.Peis.OccupationalDiseaseReports } + if (customerOrgIds.Any()) + { + asbitemAbnormalQuery = asbitemAbnormalQuery.Where(m => customerOrgIds.Contains(m.patientRegister.CustomerOrgId)); + } + + if (customerOrgPara.CustomerOrgGroupId.Any()) { asbitemAbnormalQuery = asbitemAbnormalQuery.Where(m => m.patientRegister.CustomerOrgGroupId != null && customerOrgPara.CustomerOrgGroupId.Contains(m.patientRegister.CustomerOrgGroupId.Value));