|
|
|
|
@ -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); |
|
|
|
|
@ -252,7 +286,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
|
|
|
|
|
//获取案件信息 |
|
|
|
|
var express = await base.GetCurrentUserCaseListAsync(); |
|
|
|
|
express = express.Where(w =>w.AppCaseManagement!=null && caseIdList.Contains(w.AppCaseManagement.Id)&& w.AppCaseSupervisedPerson != null && caseIdList.Contains(w.AppCaseSupervisedPerson.CaseId)&& w.AppCaseSupervisor != null && caseIdList.Contains(w.AppCaseSupervisor.CaseId)); |
|
|
|
|
express = express.Where(w => w.AppCaseManagement != null && caseIdList.Contains(w.AppCaseManagement.Id) && w.AppCaseSupervisedPerson != null && caseIdList.Contains(w.AppCaseSupervisedPerson.CaseId) && w.AppCaseSupervisor != null && caseIdList.Contains(w.AppCaseSupervisor.CaseId)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//案件信息Id |
|
|
|
|
@ -289,7 +323,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
|
|
|
|
|
var diclist = new List<dynamic>(); |
|
|
|
|
//获取当前用户能看到的数据Id |
|
|
|
|
var caseIds = await (await base.GetCurrentUserCaseListAsync()).Where(w=>w.AppCaseManagement!=null&& caseIdList.Contains(w.AppCaseManagement.Id)).Select(w => w.AppCaseManagement.Id).ToListAsync(); |
|
|
|
|
var caseIds = await (await base.GetCurrentUserCaseListAsync()).Where(w => w.AppCaseManagement != null && caseIdList.Contains(w.AppCaseManagement.Id)).Select(w => w.AppCaseManagement.Id).ToListAsync(); |
|
|
|
|
//获取案件信息 |
|
|
|
|
var express = await _appCaseManagementRepository.AsQueryable(false, true).Where(q => caseIds.Contains(q.Id)).ToListAsync(); |
|
|
|
|
var otherexpress = express; |
|
|
|
|
@ -517,11 +551,11 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
var validSpCase = await ValidSupervisedPerson(input); |
|
|
|
|
if (!validSpCase.Success) return validSpCase; |
|
|
|
|
|
|
|
|
|
if(input.Threshold>=int.MaxValue) |
|
|
|
|
if (input.Threshold >= int.MaxValue) |
|
|
|
|
{ |
|
|
|
|
return ResultOutput.NotOk("预警阈值输入数字过大"); |
|
|
|
|
} |
|
|
|
|
if (input.Threshold <0) |
|
|
|
|
if (input.Threshold < 0) |
|
|
|
|
{ |
|
|
|
|
return ResultOutput.NotOk("预警阈值不能为负数"); |
|
|
|
|
} |
|
|
|
|
@ -541,7 +575,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
var entity = Mapper.Map<AppCaseManagement>(input); |
|
|
|
|
if(entity.Threshold==0) |
|
|
|
|
if (entity.Threshold == 0) |
|
|
|
|
{ |
|
|
|
|
entity.Threshold = 5; |
|
|
|
|
} |
|
|
|
|
@ -1154,7 +1188,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
var caseIdList = selectLimits.Select(w => w.CaseId).Distinct().ToList(); |
|
|
|
|
var caseIds = await (await base.GetCurrentUserCaseListAsync()).Where(w => w.AppCaseManagement != null && caseIdList.Contains(w.AppCaseManagement.Id)).Select(w => w.AppCaseManagement.Id).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var imManagementList = await (from cm in _appCaseManagementRepository.AsQueryable(false, true) |
|
|
|
|
.Where(w => w.CaseProgress != CaseProgressEnum.Closed && caseIds.Contains(w.Id)) |
|
|
|
|
@ -1180,7 +1214,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
/// </summary> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
public async Task<IResultOutput> CaseBusinessWorkbench() |
|
|
|
|
{ |
|
|
|
|
{ |
|
|
|
|
//获取当前用户权限下的案件ids |
|
|
|
|
var limits = User.limits; |
|
|
|
|
var selectLimits = await _appCaseSupervisorRepository.AsQueryable(false, true) |
|
|
|
|
@ -1190,8 +1224,8 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
|
|
|
|
|
|
|
|
|
|
var dataDict = await _appDictionaryService.GetListNoApiAsync(null); |
|
|
|
|
var caseList = (await (await base.GetCurrentUserCaseListAsync()).ToListAsync()) |
|
|
|
|
.Where(w => w.AppCaseManagement!=null && w.AppCaseManagement.CaseProgress != CaseProgressEnum.Closed && caseIdList.Contains(w.AppCaseManagement.Id) |
|
|
|
|
&&w.AppCaseSupervisedPerson!=null && caseIdList.Contains(w.AppCaseSupervisedPerson.CaseId)&&w.AppCaseSupervisor !=null && caseIdList.Contains(w.AppCaseSupervisor.CaseId)) |
|
|
|
|
.Where(w => w.AppCaseManagement != null && w.AppCaseManagement.CaseProgress != CaseProgressEnum.Closed && caseIdList.Contains(w.AppCaseManagement.Id) |
|
|
|
|
&& w.AppCaseSupervisedPerson != null && caseIdList.Contains(w.AppCaseSupervisedPerson.CaseId) && w.AppCaseSupervisor != null && caseIdList.Contains(w.AppCaseSupervisor.CaseId)) |
|
|
|
|
.OrderByDescending(w => w.AppCaseSupervisedPerson?.CreatedTime) |
|
|
|
|
.Skip(0) |
|
|
|
|
.Take(5) |
|
|
|
|
@ -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) |
|
|
|
|
|