|
|
|
|
@ -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; |
|
|
|
|
@ -145,11 +146,24 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
.Where(w => limits.Contains(w.UnitId.ToString())) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
var caseIdList = selectLimits.Select(w => w.CaseId).Distinct().ToList(); |
|
|
|
|
|
|
|
|
|
//当前用户角色 |
|
|
|
|
var userRole = await _userService.IsAdmin(null); |
|
|
|
|
|
|
|
|
|
var express = await GetExpression(input, _appCaseManagementRepository.AsQueryable(false, true)); |
|
|
|
|
// 先应用案件ID过滤条件 |
|
|
|
|
express = express.Where(w => caseIdList.Contains(w.Id)); |
|
|
|
|
|
|
|
|
|
//非管理员只能看到自己监管的案件 |
|
|
|
|
if(!userRole.IsAdmin) |
|
|
|
|
{ |
|
|
|
|
var supervisorCaseList = await _appCaseSupervisorRepository.AsQueryable(false, true) |
|
|
|
|
.Where(w => w.SupervisorId == User.Id).Select(s => s.CaseId).ToListAsync(); |
|
|
|
|
express= express.Where(w => supervisorCaseList.Contains(w.Id)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rtn = await base.GetPageAsync<AppCaseManagement, AppCaseManagementGetPageInput, AppCaseManagementListDto>(input, express); |
|
|
|
|
|
|
|
|
|
var position = await _appDictionaryService.GetDicByDicId(User.PositionId); |
|
|
|
|
@ -168,7 +182,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
} |
|
|
|
|
else if (listDto.CaseProgress == CaseProgressEnum.Examination) |
|
|
|
|
{ |
|
|
|
|
if (position.Code == "inquisitor" || User.IsAdmin) |
|
|
|
|
if (position.Code == "inquisitor" ) |
|
|
|
|
{ |
|
|
|
|
listDto.ReviewPermission = "3";//显示移送法院 结束案件 |
|
|
|
|
} |
|
|
|
|
@ -179,7 +193,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
} |
|
|
|
|
else if (listDto.CaseProgress == CaseProgressEnum.Hear) |
|
|
|
|
{ |
|
|
|
|
if (position.Code == "judge" || User.IsAdmin) |
|
|
|
|
if (position.Code == "judge") |
|
|
|
|
{ |
|
|
|
|
listDto.ReviewPermission = "4";//显示查看 结束案件 |
|
|
|
|
} |
|
|
|
|
@ -963,22 +977,27 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
.Where(w => limits.Contains(w.UnitId.ToString())) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
var caseIdList = selectLimits.Select(w => w.CaseId).Distinct().ToList(); |
|
|
|
|
var userRole = await _userService.IsAdmin(null); |
|
|
|
|
var supervisorCaseList = await _appCaseSupervisorRepository.AsQueryable(false, true) |
|
|
|
|
.Where(w => w.SupervisorId == User.Id).Select(s => s.CaseId).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var query = _appCaseManagementRepository |
|
|
|
|
.AsQueryable(false, true) |
|
|
|
|
.Where(w => w.CaseProgress == CaseProgressEnum.Closed) |
|
|
|
|
.Where(w => w.CaseProgress == CaseProgressEnum.Closed && caseIdList.Contains(w.Id)) |
|
|
|
|
.WhereIf(input.KeyWord.NotNull(), a => a.Name.Contains(input.KeyWord)) |
|
|
|
|
.WhereIf(input.TimeSearch.BeginTime.Length == 2, w => w.CaseBeginTime > input.TimeSearch.BeginTime[0] && w.CaseBeginTime < input.TimeSearch.BeginTime[1].AddDays(1)) |
|
|
|
|
.WhereIf(input.TimeSearch.EndTime.Length == 2, w => w.CaseClosedTime > input.TimeSearch.EndTime[0] && w.CaseClosedTime <= input.TimeSearch.EndTime[1].AddDays(1)) |
|
|
|
|
.Where(w => caseIdList.Contains(w.Id)); |
|
|
|
|
.WhereIf(!userRole.IsAdmin , w=>supervisorCaseList.Contains(w.Id)); |
|
|
|
|
|
|
|
|
|
var pageData = await |
|
|
|
|
query.ProjectTo<CaseStatisticsHandlingTimeListDto>(Mapper.ConfigurationProvider) |
|
|
|
|
.PagedAsync(input) |
|
|
|
|
.ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
var caseIds = pageData.Data.Select(w => w.Id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//涉事人员(被监管人员) |
|
|
|
|
var personInvolvedList = await _appSupervisedPersonRepository |
|
|
|
|
.AsQueryable(false, true) |
|
|
|
|
@ -1012,6 +1031,10 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
.Where(w => limits.Contains(w.UnitId.ToString())) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
var caseIds = selectLimits.Select(w => w.CaseId).Distinct().ToList(); |
|
|
|
|
var userRole = await _userService.IsAdmin(null); |
|
|
|
|
var supervisorCaseList = await _appCaseSupervisorRepository.AsQueryable(false, true) |
|
|
|
|
.Where(w => w.SupervisorId == User.Id).Select(s => s.CaseId).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var data = await _appCaseManagementRepository.AsQueryable(false, true) |
|
|
|
|
.Where(w => caseIds.Contains(w.Id)) |
|
|
|
|
@ -1019,6 +1042,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
.WhereIf(input.TimeSearch.BeginTime.Length == 2, w => w.CreatedTime > input.TimeSearch.BeginTime[0] && w.CreatedTime < input.TimeSearch.BeginTime[1].AddDays(1)) |
|
|
|
|
.WhereIf(input.TimeSearch.EndTime.Length == 2, w => w.CaseClosedTime > input.TimeSearch.EndTime[0] && w.CaseClosedTime < input.TimeSearch.EndTime[1].AddDays(1)) |
|
|
|
|
.WhereIf(input.ajtype.NotNull(), w => w.CaseTypeId == input.ajtype.ToLong()) |
|
|
|
|
.WhereIf(!userRole.IsAdmin, w => supervisorCaseList.Contains(w.Id)) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
|
|
|
|
|
var dataGroup = data.GroupBy(w => w.CaseTypeId); |
|
|
|
|
|