|
|
|
|
@ -16,6 +16,7 @@ using ATS.NonCustodial.Domain.Shared.Enums;
|
|
|
|
|
using ATS.NonCustodial.Domain.Shared.OrmRepositories.Basic.EfCore; |
|
|
|
|
using ATS.NonCustodial.DynamicApi; |
|
|
|
|
using ATS.NonCustodial.DynamicApi.Attributes; |
|
|
|
|
using ATS.NonCustodial.Shared.Common.Auth; |
|
|
|
|
using ATS.NonCustodial.Shared.Common.Dtos; |
|
|
|
|
using ATS.NonCustodial.Shared.Common.Enums; |
|
|
|
|
using ATS.NonCustodial.Shared.Common.UnifiedResults; |
|
|
|
|
@ -140,24 +141,45 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
[HttpPost] |
|
|
|
|
public async Task<IResultOutput> GetPageAsync(AppCaseManagementGetPageInput input) |
|
|
|
|
{ |
|
|
|
|
var limits = User.limits; |
|
|
|
|
var selectLimits = await _appCaseSupervisorRepository.AsQueryable(false, true) |
|
|
|
|
.Where(w => limits.Contains(w.UnitId.ToString())) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
input.CaseIds= selectLimits.Select(w => w.CaseId).Distinct().ToList(); |
|
|
|
|
|
|
|
|
|
var express = await GetExpression(input, _appCaseManagementRepository.AsQueryable(false, true)); |
|
|
|
|
|
|
|
|
|
var rtn = await base.GetPageAsync<AppCaseManagement, AppCaseManagementGetPageInput, AppCaseManagementListDto>(input, express); |
|
|
|
|
|
|
|
|
|
var caseIds = rtn.Data.Select(w => w.Id).ToList(); |
|
|
|
|
|
|
|
|
|
var caseSupervisor = await _appCaseSupervisorRepository.AsQueryable(false, true) |
|
|
|
|
.Where(w => caseIds.Contains(w.CaseId)) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
|
|
|
|
|
foreach (var listDto in rtn.Data) |
|
|
|
|
{ |
|
|
|
|
listDto.Supervisor = caseSupervisor.Where(w => w.CaseId == listDto.Id).Select(w => w.SupervisorName).JoinAsString(","); |
|
|
|
|
listDto.Supervisor = selectLimits.Where(w => w.CaseId == listDto.Id).Select(w => w.SupervisorName).JoinAsString(","); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResultOutput.Ok(rtn); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//[HttpPost] |
|
|
|
|
//public async Task<IResultOutput> GetPageAsync(AppCaseManagementGetPageInput input) |
|
|
|
|
//{ |
|
|
|
|
// var express = await GetExpression(input, _appCaseManagementRepository.AsQueryable(false, true)); |
|
|
|
|
|
|
|
|
|
// var rtn = await base.GetPageAsync<AppCaseManagement, AppCaseManagementGetPageInput, AppCaseManagementListDto>(input, express); |
|
|
|
|
|
|
|
|
|
// var caseIds = rtn.Data.Select(w => w.Id).ToList(); |
|
|
|
|
|
|
|
|
|
// var caseSupervisor = await _appCaseSupervisorRepository.AsQueryable(false, true) |
|
|
|
|
// .Where(w => caseIds.Contains(w.CaseId)) |
|
|
|
|
// .ToListAsync(); |
|
|
|
|
|
|
|
|
|
// foreach (var listDto in rtn.Data) |
|
|
|
|
// { |
|
|
|
|
// listDto.Supervisor = caseSupervisor.Where(w => w.CaseId == listDto.Id).Select(w => w.SupervisorName).JoinAsString(","); |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// return ResultOutput.Ok(rtn); |
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 案件统计 |
|
|
|
|
/// </summary> |
|
|
|
|
@ -1429,6 +1451,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
var caseIds = await (await base.GetCurrentUserCaseListAsync()).Select(w => w.AppCaseManagement.Id).ToListAsync(); |
|
|
|
|
|
|
|
|
|
query = query |
|
|
|
|
.WhereIf(pageInput.CaseIds.IsNotNullOrEmpty(), w => pageInput.CaseIds.Contains(w.Id)) |
|
|
|
|
.WhereIf(pageInput.CaseName.NotNull(), a => a.Name.Contains(pageInput.CaseName)) |
|
|
|
|
.WhereIf(pageInput.CaseTypeId != null, a => a.CaseTypeId == pageInput.CaseTypeId) |
|
|
|
|
.WhereIf(pageInput.JudgmentStatusIds.IsNotNullOrEmpty(), w => pageInput.JudgmentStatusIds.Contains(w.JudgmentStatusId)) |
|
|
|
|
|