|
|
|
|
@ -16,7 +16,6 @@ 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; |
|
|
|
|
@ -30,9 +29,7 @@ using Castle.Components.DictionaryAdapter;
|
|
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
|
using Microsoft.EntityFrameworkCore.ChangeTracking; |
|
|
|
|
using SixLabors.ImageSharp; |
|
|
|
|
using System.Linq; |
|
|
|
|
using Yitter.IdGenerator; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -155,9 +152,46 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
|
|
|
|
|
var rtn = await base.GetPageAsync<AppCaseManagement, AppCaseManagementGetPageInput, AppCaseManagementListDto>(input, express); |
|
|
|
|
|
|
|
|
|
var position = await _appDictionaryService.GetDicByDicId(User.PositionId); |
|
|
|
|
foreach (var listDto in rtn.Data) |
|
|
|
|
{ |
|
|
|
|
listDto.Supervisor = selectLimits.Where(w => w.CaseId == listDto.Id).Select(w => w.SupervisorName).JoinAsString(","); |
|
|
|
|
listDto.Supervisor = (await _appCaseSupervisorRepository.AsQueryable(false, true) |
|
|
|
|
.Where(w => w.CaseId == listDto.Id).Select(w => w.SupervisorName).ToListAsync()).JoinAsString(","); |
|
|
|
|
|
|
|
|
|
if (listDto.CaseProgress == CaseProgressEnum.Pending) |
|
|
|
|
{ |
|
|
|
|
listDto.ReviewPermission = "0";//显示编辑按钮 |
|
|
|
|
} |
|
|
|
|
else if (listDto.CaseProgress == CaseProgressEnum.InExecution) |
|
|
|
|
{ |
|
|
|
|
listDto.ReviewPermission = "1";//显示编辑按钮 移送检察院按钮 |
|
|
|
|
} |
|
|
|
|
else if (listDto.CaseProgress == CaseProgressEnum.Examination) |
|
|
|
|
{ |
|
|
|
|
if (position.Code == "inquisitor" || User.IsAdmin) |
|
|
|
|
{ |
|
|
|
|
listDto.ReviewPermission = "3";//显示移送法院 结束案件 |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
listDto.ReviewPermission = "2";//显示查看按钮 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (listDto.CaseProgress == CaseProgressEnum.Hear) |
|
|
|
|
{ |
|
|
|
|
if (position.Code == "judge" || User.IsAdmin) |
|
|
|
|
{ |
|
|
|
|
listDto.ReviewPermission = "4";//显示查看 结束案件 |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
listDto.ReviewPermission = "2";//显示查看按钮 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
listDto.ReviewPermission = "2";//显示查看按钮 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResultOutput.Ok(rtn); |
|
|
|
|
@ -1633,11 +1667,12 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
//var appSupervisedlist = from a in base._appCaseManagementRepository.AsQueryable(false, true).Where(q => q.CaseProgress != CaseProgressEnum.Closed) |
|
|
|
|
// join b in _appSupervisedPersonRepository.AsQueryable(false, true) on a.Id equals b.CaseId |
|
|
|
|
// select b; |
|
|
|
|
var caseIdList = caselist.Where(w => caseIds.Contains(w.Id)).Select(s => s.Id); |
|
|
|
|
var appSupervisedlist = from a in base._appCaseManagementRepository.AsQueryable(false, true) |
|
|
|
|
join b in _appSupervisedPersonRepository.AsQueryable(false, true) on a.Id equals b.CaseId |
|
|
|
|
select b; |
|
|
|
|
var data = await appSupervisedlist |
|
|
|
|
.Where(q => caseIds.Contains(q.CaseId)) |
|
|
|
|
.Where(q => caseIdList.Contains(q.CaseId)) |
|
|
|
|
.WhereIf(input.TimeSearch?.BeginTime != null && input.TimeSearch?.EndTime != null, q => q.CreatedTime >= input.TimeSearch.BeginTime && q.CreatedTime <= $"{input.TimeSearch.EndTime.Value.ToString("yyyy-MM-dd")} 23:59:59".ToDateTime()) |
|
|
|
|
.WhereIf(input.name.NotNull(), q => q.SupervisedPersonName.Contains(input.name)) |
|
|
|
|
.OrderByDescending(r => r.CreatedTime) |
|
|
|
|
|