From 46a26db1f8d9e2c759e20bfa4d1570325d6f7b39 Mon Sep 17 00:00:00 2001 From: zhaozhenjing Date: Wed, 17 Sep 2025 13:50:33 +0800 Subject: [PATCH] =?UTF-8?q?[MODIFY]=20APP=E8=AE=A4=E8=AF=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9D=83=E9=99=90=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseManagements/AppCaseManagementService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/2.services/ATS.NonCustodial.Application/Impl/Business/CaseManagements/AppCaseManagementService.cs b/src/2.services/ATS.NonCustodial.Application/Impl/Business/CaseManagements/AppCaseManagementService.cs index d1008cc..fd142c5 100644 --- a/src/2.services/ATS.NonCustodial.Application/Impl/Business/CaseManagements/AppCaseManagementService.cs +++ b/src/2.services/ATS.NonCustodial.Application/Impl/Business/CaseManagements/AppCaseManagementService.cs @@ -1417,10 +1417,18 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements [HttpPost] public async Task>> GetSupervisedPersonApprovalStatus(GetSupervisedPersonApprovalStatusPageInput input) { + //获取当前用户权限下的案件ids + var limits = User.limits; + var selectLimits = await _appCaseSupervisorRepository.AsQueryable(false, true) + .Where(w => limits.Contains(w.UnitId.ToString())) + .ToListAsync(); + var caseIds = selectLimits.Select(w => w.CaseId).Distinct().ToList(); + var queryable = (await GetCurrentUserCaseListAsync()) .WhereIf(input.SupervisedPersonId > 0, w => w.AppCaseSupervisedPerson.SupervisedPersonId == input.SupervisedPersonId) .WhereIf(input.ApprovalStatus.HasValue, w => w.AppCaseSupervisedPerson.ApprovalStatus == input.ApprovalStatus) - .WhereIf(input.name.NotNull(), w => w.AppCaseSupervisedPerson.SupervisedPersonName.Contains(input.name)); + .WhereIf(input.name.NotNull(), w => w.AppCaseSupervisedPerson.SupervisedPersonName.Contains(input.name)) + .Where(w=>w.AppCaseManagement !=null &&w.AppCaseSupervisedPerson!=null && w.AppCaseSupervisor != null && caseIds.Contains(w.AppCaseSupervisedPerson.CaseId) && caseIds.Contains(w.AppCaseManagement.Id) && caseIds.Contains(w.AppCaseSupervisor.CaseId)); var caseSpQueryable = await queryable.Where(q => q.AppCaseSupervisedPerson != null).Select(w => Mapper.Map(w.AppCaseSupervisedPerson)).ToListAsync(); if ((await base.IsAdmin()).IsAdmin) caseSpQueryable = caseSpQueryable.Distinct((x, y) => x.CaseId == y.CaseId && x.SupervisedPersonId == y.SupervisedPersonId).ToList();