@ -10,12 +10,14 @@ using ATS.NonCustodial.Application.Contracts.Interfaces.Business.AppCaseManageme
using ATS.NonCustodial.Domain.Entities.Admins ;
using ATS.NonCustodial.Domain.Entities.Admins ;
using ATS.NonCustodial.Domain.Entities.Business ;
using ATS.NonCustodial.Domain.Entities.Business ;
using ATS.NonCustodial.Domain.Entities.Business.CaseManagements ;
using ATS.NonCustodial.Domain.Entities.Business.CaseManagements ;
using ATS.NonCustodial.Domain.Entities.Business.EarlyWarning ;
using ATS.NonCustodial.Domain.Shared.AggRootEntities.Dtos ;
using ATS.NonCustodial.Domain.Shared.AggRootEntities.Dtos ;
using ATS.NonCustodial.Domain.Shared.Common.Dtos ;
using ATS.NonCustodial.Domain.Shared.Common.Dtos ;
using ATS.NonCustodial.Domain.Shared.Enums ;
using ATS.NonCustodial.Domain.Shared.Enums ;
using ATS.NonCustodial.Domain.Shared.OrmRepositories.Basic.EfCore ;
using ATS.NonCustodial.Domain.Shared.OrmRepositories.Basic.EfCore ;
using ATS.NonCustodial.DynamicApi ;
using ATS.NonCustodial.DynamicApi ;
using ATS.NonCustodial.DynamicApi.Attributes ;
using ATS.NonCustodial.DynamicApi.Attributes ;
using ATS.NonCustodial.Shared.Common.Auth ;
using ATS.NonCustodial.Shared.Common.Dtos ;
using ATS.NonCustodial.Shared.Common.Dtos ;
using ATS.NonCustodial.Shared.Common.Enums ;
using ATS.NonCustodial.Shared.Common.Enums ;
using ATS.NonCustodial.Shared.Common.UnifiedResults ;
using ATS.NonCustodial.Shared.Common.UnifiedResults ;
@ -30,6 +32,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc ;
using Microsoft.AspNetCore.Mvc ;
using Microsoft.EntityFrameworkCore ;
using Microsoft.EntityFrameworkCore ;
using SixLabors.ImageSharp ;
using SixLabors.ImageSharp ;
using System.Linq ;
using Yitter.IdGenerator ;
using Yitter.IdGenerator ;
@ -58,6 +61,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
private readonly IEfRepository < AppUser , long > _ appUserRepository ;
private readonly IEfRepository < AppUser , long > _ appUserRepository ;
private readonly IEfRepository < AppDeviceManagement , long > _ appDeviceManagementRepository ;
private readonly IEfRepository < AppDeviceManagement , long > _ appDeviceManagementRepository ;
private readonly IEfRepository < AppUser , long > _ appuserRepository ;
private readonly IEfRepository < AppUser , long > _ appuserRepository ;
private readonly IEfRepository < AppEarlyWarningViewStatistics , long > _ appEarlyWarningViewStatisticsRepository ;
/// <summary>
/// <summary>
///
///
@ -87,6 +91,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
IEfRepository < AppCommonFence , long > appCommonFenceRepository ,
IEfRepository < AppCommonFence , long > appCommonFenceRepository ,
IEfRepository < AppUser , long > appUserRepository ,
IEfRepository < AppUser , long > appUserRepository ,
IEfRepository < AppSupervisedPersonRealTimeLocation , long > appSupervisedPersonRealTimeLocationRepository ,
IEfRepository < AppSupervisedPersonRealTimeLocation , long > appSupervisedPersonRealTimeLocationRepository ,
IEfRepository < AppEarlyWarningViewStatistics , long > appEarlyWarningViewStatisticsRepository ,
IEfRepository < AppDeviceManagement , long > appDeviceManagementRepository )
IEfRepository < AppDeviceManagement , long > appDeviceManagementRepository )
: base (
: base (
appCaseManagementRepository ,
appCaseManagementRepository ,
@ -103,6 +108,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
_ appUserRepository = appUserRepository ;
_ appUserRepository = appUserRepository ;
_ appDeviceManagementRepository = appDeviceManagementRepository ;
_ appDeviceManagementRepository = appDeviceManagementRepository ;
_ appuserRepository = appuserRepository ;
_ appuserRepository = appuserRepository ;
_ appEarlyWarningViewStatisticsRepository = appEarlyWarningViewStatisticsRepository ;
}
}
#endregion Identity
#endregion Identity
@ -140,24 +146,97 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
[HttpPost]
[HttpPost]
public async Task < IResultOutput > GetPageAsync ( AppCaseManagementGetPageInput input )
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 ( ) ;
var caseIdList = selectLimits . Select ( w = > w . CaseId ) . Distinct ( ) . ToList ( ) ;
//当前用户角色
var userRole = await _ userService . IsAdmin ( null ) ;
var express = await GetExpression ( input , _ appCaseManagementRepository . AsQueryable ( false , true ) ) ;
var express = await GetExpression ( input , _ appCaseManagementRepository . AsQueryable ( false , true ) ) ;
// 先应用案件ID过滤条件
express = express . Where ( w = > caseIdList . Contains ( w . Id ) ) ;
var rtn = await base . GetPageAsync < AppCaseManagement , AppCaseManagementGetPageInput , AppCaseManagementListDto > ( input , express ) ;
//非管理员只能看到自己监管的案件
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 caseIds = rtn . Data . Select ( w = > w . Id ) . ToList ( ) ;
var caseSupervisor = await _ appCaseSupervisorRepository . AsQueryable ( false , true )
. Where ( w = > caseIds . Contains ( w . CaseId ) )
. ToListAsync ( ) ;
var rtn = await base . GetPageAsync < AppCaseManagement , AppCaseManagementGetPageInput , AppCaseManagementListDto > ( input , express ) ;
var position = await _ appDictionaryService . GetDicByDicId ( User . PositionId ) ;
foreach ( var listDto in rtn . Data )
foreach ( var listDto in rtn . Data )
{
{
listDto . Supervisor = caseSupervisor . 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" )
{
listDto . ReviewPermission = "3" ; //显示移送法院 结束案件
}
else
{
listDto . ReviewPermission = "2" ; //显示查看按钮
}
}
else if ( listDto . CaseProgress = = CaseProgressEnum . Hear )
{
if ( position . Code = = "judge" )
{
listDto . ReviewPermission = "4" ; //显示查看 结束案件
}
else
{
listDto . ReviewPermission = "2" ; //显示查看按钮
}
}
else
{
listDto . ReviewPermission = "2" ; //显示查看按钮
}
}
}
return ResultOutput . Ok ( rtn ) ;
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>
/// 案件统计
/// 案件统计
/// </summary>
/// </summary>
@ -217,8 +296,18 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
[HttpPost]
[HttpPost]
public async Task < IResultOutput > caseStatistics ( )
public async Task < IResultOutput > caseStatistics ( )
{
{
//获取当前用户权限下的案件ids
var limits = User . limits ;
var selectLimits = await _ appCaseSupervisorRepository . AsQueryable ( false , true )
. Where ( w = > limits . Contains ( w . UnitId . ToString ( ) ) )
. ToListAsync ( ) ;
var caseIdList = selectLimits . Select ( w = > w . CaseId ) . Distinct ( ) . ToList ( ) ;
//获取案件信息
//获取案件信息
var express = await base . GetCurrentUserCaseListAsync ( ) ;
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 ) ) ;
//案件信息Id
//案件信息Id
var caseIds = await express . Select ( w = > w . AppCaseManagement . Id ) . ToListAsync ( ) ;
var caseIds = await express . Select ( w = > w . AppCaseManagement . Id ) . ToListAsync ( ) ;
//监管人数
//监管人数
@ -244,9 +333,16 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
[HttpPost]
[HttpPost]
public async Task < IResultOutput > casetypeStatistics ( )
public async Task < IResultOutput > casetypeStatistics ( )
{
{
//获取当前用户权限下的案件ids
var limits = User . limits ;
var selectLimits = await _ appCaseSupervisorRepository . AsQueryable ( false , true )
. Where ( w = > limits . Contains ( w . UnitId . ToString ( ) ) )
. ToListAsync ( ) ;
var caseIdList = selectLimits . Select ( w = > w . CaseId ) . Distinct ( ) . ToList ( ) ;
var diclist = new List < dynamic > ( ) ;
var diclist = new List < dynamic > ( ) ;
//获取当前用户能看到的数据Id
//获取当前用户能看到的数据Id
var caseIds = await ( await base . GetCurrentUserCaseListAsync ( ) ) . 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 express = await _ appCaseManagementRepository . AsQueryable ( false , true ) . Where ( q = > caseIds . Contains ( q . Id ) ) . ToListAsync ( ) ;
var otherexpress = express ;
var otherexpress = express ;
@ -397,7 +493,20 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
//案子结束时间
//案子结束时间
item . CaseClosedTime = input . CaseProgress = = CaseProgressEnum . Closed ? DateTime . Now : null ;
item . CaseClosedTime = input . CaseProgress = = CaseProgressEnum . Closed ? DateTime . Now : null ;
} ) ;
} ) ;
//if (input.CaseProgress == CaseProgressEnum.Closed)
//{
// var statisticsList= await _appEarlyWarningViewStatisticsRepository.AsQueryable().Where(w=> input.Ids.Contains(w.CaseId.Value)).ToListAsync();
// foreach (var item in statisticsList)
// {
// item.CheckStatus = CheckStatusEnum.Checked;
// item.CheckTime = DateTime.Now;
// }
// if (statisticsList!=null && statisticsList.Count > 0)
// {
// //关闭案件时,将案件的未查阅状态改为已查阅
// await _appEarlyWarningViewStatisticsRepository.UpdateAsync(statisticsList);
// }
//}
await _ appCaseManagementRepository . UpdateAsync ( dataList ) ;
await _ appCaseManagementRepository . UpdateAsync ( dataList ) ;
return ResultOutput . Ok ( ) ;
return ResultOutput . Ok ( ) ;
@ -474,6 +583,14 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
var validSpCase = await ValidSupervisedPerson ( input ) ;
var validSpCase = await ValidSupervisedPerson ( input ) ;
if ( ! validSpCase . Success ) return validSpCase ;
if ( ! validSpCase . Success ) return validSpCase ;
if ( input . Threshold > = int . MaxValue )
{
return ResultOutput . NotOk ( "预警阈值输入数字过大" ) ;
}
if ( input . Threshold < 0 )
{
return ResultOutput . NotOk ( "预警阈值不能为负数" ) ;
}
#endregion Valid
#endregion Valid
var caseId = input . Id ;
var caseId = input . Id ;
@ -490,6 +607,10 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
else
else
{
{
var entity = Mapper . Map < AppCaseManagement > ( input ) ;
var entity = Mapper . Map < AppCaseManagement > ( input ) ;
if ( entity . Threshold = = 0 )
{
entity . Threshold = 5 ;
}
caseId = ( await _ appCaseManagementRepository . InsertAsync ( entity ) ) . Id ;
caseId = ( await _ appCaseManagementRepository . InsertAsync ( entity ) ) . Id ;
}
}
@ -500,7 +621,8 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
{
{
CaseId = caseId . Value ,
CaseId = caseId . Value ,
SupervisorId = csp . SupervisedId ,
SupervisorId = csp . SupervisedId ,
SupervisorName = csp . SupervisedName
SupervisorName = csp . SupervisedName ,
UnitId = GetUnitIdByUserId ( csp . SupervisedId )
} ) ;
} ) ;
var dels = new List < long > ( ) ;
var dels = new List < long > ( ) ;
var list = await _ appCaseSupervisorRepository . AsQueryable ( false , true ) . Where ( w = > w . CaseId = = caseId ) . ToListAsync ( ) ;
var list = await _ appCaseSupervisorRepository . AsQueryable ( false , true ) . Where ( w = > w . CaseId = = caseId ) . ToListAsync ( ) ;
@ -795,7 +917,8 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
{
{
CaseId = caseId . Value ,
CaseId = caseId . Value ,
SupervisorId = csp . SupervisedId ,
SupervisorId = csp . SupervisedId ,
SupervisorName = csp . SupervisedName
SupervisorName = csp . SupervisedName ,
UnitId = GetUnitIdByUserId ( csp . SupervisedId )
} ) ;
} ) ;
var Supervisordata = await _ appCaseSupervisorRepository . FindAsync ( q = > q . CaseId = = caseId & & sList . Select ( q = > q . SupervisorId ) . Contains ( q . SupervisorId ) ) ;
var Supervisordata = await _ appCaseSupervisorRepository . FindAsync ( q = > q . CaseId = = caseId & & sList . Select ( q = > q . SupervisorId ) . Contains ( q . SupervisorId ) ) ;
@ -866,20 +989,33 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
/// <returns></returns>
/// <returns></returns>
public async Task < IResultOutput > CaseStatisticsHandlingTime ( CaseStatisticsHandlingTimePageInput input )
public async Task < IResultOutput > CaseStatisticsHandlingTime ( CaseStatisticsHandlingTimePageInput input )
{
{
//获取当前用户权限下的案件ids
var limits = User . limits ;
var selectLimits = await _ appCaseSupervisorRepository . AsQueryable ( false , true )
. 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
var query = _ appCaseManagementRepository
. AsQueryable ( false , true )
. 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 . 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 . 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 ) ) ;
. WhereIf ( input . TimeSearch . EndTime . Length = = 2 , w = > w . CaseClosedTime > input . TimeSearch . EndTime [ 0 ] & & w . CaseClosedTime < = input . TimeSearch . EndTime [ 1 ] . AddDays ( 1 ) )
. WhereIf ( ! userRole . IsAdmin , w = > supervisorCaseList . Contains ( w . Id ) ) ;
var pageData = await
var pageData = await
query . ProjectTo < CaseStatisticsHandlingTimeListDto > ( Mapper . ConfigurationProvider )
query . ProjectTo < CaseStatisticsHandlingTimeListDto > ( Mapper . ConfigurationProvider )
. PagedAsync ( input )
. PagedAsync ( input )
. ConfigureAwait ( false ) ;
. ConfigureAwait ( false ) ;
var caseIds = pageData . Data . Select ( w = > w . Id ) ;
var caseIds = pageData . Data . Select ( w = > w . Id ) ;
//涉事人员(被监管人员)
//涉事人员(被监管人员)
var personInvolvedList = await _ appSupervisedPersonRepository
var personInvolvedList = await _ appSupervisedPersonRepository
. AsQueryable ( false , true )
. AsQueryable ( false , true )
@ -907,11 +1043,24 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
/// <returns></returns>
/// <returns></returns>
public async Task < IResultOutput > CaseTypeStatistics ( CaseTypeStatisticsGetPageInput input )
public async Task < IResultOutput > CaseTypeStatistics ( CaseTypeStatisticsGetPageInput 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 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 )
var data = await _ appCaseManagementRepository . AsQueryable ( false , true )
. Where ( w = > caseIds . Contains ( w . Id ) )
. WhereIf ( input . KeyWord . NotNull ( ) , a = > a . Name . Contains ( input . KeyWord ) )
. WhereIf ( input . KeyWord . NotNull ( ) , a = > a . Name . Contains ( input . KeyWord ) )
. WhereIf ( input . TimeSearch . BeginTime . Length = = 2 , w = > w . CreatedTime > input . TimeSearch . BeginTime [ 0 ] & & w . CreatedTime < input . TimeSearch . BeginTime [ 1 ] . AddDays ( 1 ) )
. 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 . 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 ( input . ajtype . NotNull ( ) , w = > w . CaseTypeId = = input . ajtype . ToLong ( ) )
. WhereIf ( ! userRole . IsAdmin , w = > supervisorCaseList . Contains ( w . Id ) )
. ToListAsync ( ) ;
. ToListAsync ( ) ;
var dataGroup = data . GroupBy ( w = > w . CaseTypeId ) ;
var dataGroup = data . GroupBy ( w = > w . CaseTypeId ) ;
@ -956,6 +1105,12 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
/// <returns></returns>
/// <returns></returns>
public async Task < IResultOutput > CaseHandlingFrequencyStatistics ( CaseHandlingFrequencyStatisticsGetPageInput input )
public async Task < IResultOutput > CaseHandlingFrequencyStatistics ( CaseHandlingFrequencyStatisticsGetPageInput 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 ( ) ;
//query
//query
var query = await ( await base . GetCurrentUserCaseListAsync ( ) )
var query = await ( await base . GetCurrentUserCaseListAsync ( ) )
//.Where(w => w.AppCaseSupervisedPerson != null && w.AppCaseManagement.CaseProgress != CaseProgressEnum.Closed)
//.Where(w => w.AppCaseSupervisedPerson != null && w.AppCaseManagement.CaseProgress != CaseProgressEnum.Closed)
@ -969,7 +1124,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
SupervisedPersonName = w . AppCaseSupervisedPerson . SupervisedPersonName
SupervisedPersonName = w . AppCaseSupervisedPerson . SupervisedPersonName
} ) . ToListAsync ( ) ;
} ) . ToListAsync ( ) ;
var dataGroup = query . GroupBy ( w = > new
var dataGroup = query . Where ( w = > caseIds . Contains ( w . CaseId ) ) . GroupBy ( w = > new
{
{
w . CaseId ,
w . CaseId ,
w . SupervisedPersonId ,
w . SupervisedPersonId ,
@ -1067,7 +1222,15 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
/// <returns></returns>
/// <returns></returns>
public async Task < IResultOutput > ImBusinessWorkbench ( )
public async Task < IResultOutput > ImBusinessWorkbench ( )
{
{
var caseIds = await ( await base . GetCurrentUserCaseListAsync ( ) ) . Select ( w = > w . AppCaseManagement . Id ) . ToListAsync ( ) ;
//获取当前用户权限下的案件ids
var limits = User . limits ;
var selectLimits = await _ appCaseSupervisorRepository . AsQueryable ( false , true )
. Where ( w = > limits . Contains ( w . UnitId . ToString ( ) ) )
. ToListAsync ( ) ;
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 )
var imManagementList = await ( from cm in _ appCaseManagementRepository . AsQueryable ( false , true )
. Where ( w = > w . CaseProgress ! = CaseProgressEnum . Closed & & caseIds . Contains ( w . Id ) )
. Where ( w = > w . CaseProgress ! = CaseProgressEnum . Closed & & caseIds . Contains ( w . Id ) )
@ -1094,11 +1257,18 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
/// <returns></returns>
/// <returns></returns>
public async Task < IResultOutput > CaseBusinessWorkbench ( )
public async Task < IResultOutput > CaseBusinessWorkbench ( )
{
{
//获取当前用户权限下的案件ids
var limits = User . limits ;
var selectLimits = await _ appCaseSupervisorRepository . AsQueryable ( false , true )
. Where ( w = > limits . Contains ( w . UnitId . ToString ( ) ) )
. ToListAsync ( ) ;
var caseIdList = selectLimits . Select ( w = > w . CaseId ) . Distinct ( ) . ToList ( ) ;
var dataDict = await _ appDictionaryService . GetListNoApiAsync ( null ) ;
var dataDict = await _ appDictionaryService . GetListNoApiAsync ( null ) ;
var caseList = ( await ( await base . GetCurrentUserCaseListAsync ( ) ) . ToListAsync ( ) )
var caseList = ( await ( await base . GetCurrentUserCaseListAsync ( ) ) . ToListAsync ( ) )
. Where ( w = > w . AppCaseManagement . CaseProgress ! = CaseProgressEnum . Closed )
. 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 )
. OrderByDescending ( w = > w . AppCaseSupervisedPerson ? . CreatedTime )
. Where ( w = > w . AppCaseSupervisedPerson ! = null )
. Skip ( 0 )
. Skip ( 0 )
. Take ( 5 )
. Take ( 5 )
. Select ( caseAgg = >
. Select ( caseAgg = >
@ -1325,19 +1495,30 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
/// </remarks>
/// </remarks>
public async Task < IResultOutput > GetSupervisedPersonList ( )
public async Task < IResultOutput > GetSupervisedPersonList ( )
{
{
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 position = await _ appDictionaryService . GetDicByDicId ( User . PositionId ) ;
var rtn = await ( from c in _ appCaseManagementRepository . AsQueryable ( false , true )
var rtn = await ( from c in _ appCaseManagementRepository . AsQueryable ( false , true )
join spr in _ appSupervisedPersonRepository . AsQueryable ( false , true ) on c . Id equals spr . CaseId
join spr in _ appSupervisedPersonRepository . AsQueryable ( false , true ) on c . Id equals spr . CaseId
//join device in _appDeviceManagementRepository.AsQueryable(false, true) on spr.SupervisedPersonId equals device.SupervisedPersonId into td
//join device in _appDeviceManagementRepository.AsQueryable(false, true) on spr.SupervisedPersonId equals device.SupervisedPersonId into td
//from d in td.DefaultIfEmpty()
//from d in td.DefaultIfEmpty()
//where c.CaseProgress != CaseProgressEnum.Closed && spr.IdCard != null && d == null
//where c.CaseProgress != CaseProgressEnum.Closed && spr.IdCard != null && d == null
where c . CaseProgress ! = CaseProgressEnum . Closed & & spr . IdCard ! = null
where c . CaseProgress ! = CaseProgressEnum . Closed & & spr . IdCard ! = null
select new SupervisedPersonDto ( )
select new SupervisedPersonDto ( )
{
{
SupervisedPersonId = spr . SupervisedPersonId ,
SupervisedPersonId = spr . SupervisedPersonId ,
SupervisedPersonName = spr . SupervisedPersonName ,
SupervisedPersonName = spr . SupervisedPersonName ,
CaseId = c . Id ,
CaseId = c . Id ,
IdCard = spr . IdCard
IdCard = spr . IdCard ,
} ) . ToListAsync ( ) ;
CaseProgress = c . CaseProgress
} )
. WhereIf ( ! userRole . IsAdmin , w = > supervisorCaseList . Contains ( w . CaseId ) )
. WhereIf ( position . Code = = "police" , w = > w . CaseProgress = = CaseProgressEnum . Pending | | w . CaseProgress = = CaseProgressEnum . InExecution )
. WhereIf ( position . Code = = "inquisitor" , w = > w . CaseProgress = = CaseProgressEnum . Examination )
. WhereIf ( position . Code = = "judge" , w = > w . CaseProgress = = CaseProgressEnum . Hear ) . ToListAsync ( ) ;
//去重
//去重
rtn = rtn . Distinct ( ( x , y ) = > x . SupervisedPersonId = = y . SupervisedPersonId ) . ToList ( ) ;
rtn = rtn . Distinct ( ( x , y ) = > x . SupervisedPersonId = = y . SupervisedPersonId ) . ToList ( ) ;
@ -1374,10 +1555,18 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
[HttpPost]
[HttpPost]
public async Task < IResultOutput < PagedList < GetSupervisedPersonApprovalStatusOutput > > > GetSupervisedPersonApprovalStatus ( GetSupervisedPersonApprovalStatusPageInput input )
public async Task < IResultOutput < PagedList < GetSupervisedPersonApprovalStatusOutput > > > 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 ( ) )
var queryable = ( await GetCurrentUserCaseListAsync ( ) )
. WhereIf ( input . SupervisedPersonId > 0 , w = > w . AppCaseSupervisedPerson . SupervisedPersonId = = input . SupervisedPersonId )
. WhereIf ( input . SupervisedPersonId > 0 , w = > w . AppCaseSupervisedPerson . SupervisedPersonId = = input . SupervisedPersonId )
. WhereIf ( input . ApprovalStatus . HasValue , w = > w . AppCaseSupervisedPerson . ApprovalStatus = = input . ApprovalStatus )
. 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 < AppCaseSupervisedPerson , GetSupervisedPersonApprovalStatusOutput > ( w . AppCaseSupervisedPerson ) ) . ToListAsync ( ) ;
var caseSpQueryable = await queryable . Where ( q = > q . AppCaseSupervisedPerson ! = null ) . Select ( w = > Mapper . Map < AppCaseSupervisedPerson , GetSupervisedPersonApprovalStatusOutput > ( w . AppCaseSupervisedPerson ) ) . ToListAsync ( ) ;
if ( ( await base . IsAdmin ( ) ) . IsAdmin ) caseSpQueryable = caseSpQueryable . Distinct ( ( x , y ) = > x . CaseId = = y . CaseId & & x . SupervisedPersonId = = y . SupervisedPersonId ) . ToList ( ) ;
if ( ( await base . IsAdmin ( ) ) . IsAdmin ) caseSpQueryable = caseSpQueryable . Distinct ( ( x , y ) = > x . CaseId = = y . CaseId & & x . SupervisedPersonId = = y . SupervisedPersonId ) . ToList ( ) ;
@ -1404,6 +1593,8 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
/// <returns></returns>
/// <returns></returns>
public async Task < List < long > > GetUserIdListByCurrentUser ( )
public async Task < List < long > > GetUserIdListByCurrentUser ( )
{
{
var limits = User . limits ;
var data = await ( await base . GetCurrentUserCaseListAsync ( ) ) . ToListAsync ( ) ;
var data = await ( await base . GetCurrentUserCaseListAsync ( ) ) . ToListAsync ( ) ;
var userList = new List < long > ( ) ;
var userList = new List < long > ( ) ;
@ -1429,10 +1620,14 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
var caseIds = await ( await base . GetCurrentUserCaseListAsync ( ) ) . Select ( w = > w . AppCaseManagement . Id ) . ToListAsync ( ) ;
var caseIds = await ( await base . GetCurrentUserCaseListAsync ( ) ) . Select ( w = > w . AppCaseManagement . Id ) . ToListAsync ( ) ;
query = query
query = query
. Where ( w = > caseIds . Contains ( w . Id ) )
. WhereIf ( pageInput . CaseIds . IsNotNullOrEmpty ( ) , w = > pageInput . CaseIds . Contains ( w . Id ) )
. WhereIf ( pageInput . CaseName . NotNull ( ) , a = > a . Name . Contains ( pageInput . CaseName ) )
. WhereIf ( pageInput . CaseName . NotNull ( ) , a = > a . Name . Contains ( pageInput . CaseName ) )
. WhereIf ( pageInput . CaseTypeId ! = null , a = > a . CaseTypeId = = pageInput . CaseTypeId )
. WhereIf ( pageInput . CaseTypeId ! = null , a = > a . CaseTypeId = = pageInput . CaseTypeId )
. WhereIf ( pageInput . JudgmentStatusIds . IsNotNullOrEmpty ( ) , w = > pageInput . JudgmentStatusIds . Contains ( w . JudgmentStatusId ) )
. WhereIf ( pageInput . JudgmentStatusIds . IsNotNullOrEmpty ( ) , w = > pageInput . JudgmentStatusIds . Contains ( w . JudgmentStatusId ) )
. WhereIf ( pageInput . CaseProgresses . IsNotNullOrEmpty ( ) , w = > pageInput . CaseProgresses . Contains ( w . CaseProgress ) )
. WhereIf ( pageInput . CaseProgresses . IsNotNullOrEmpty ( ) , w = > pageInput . CaseProgresses . Contains ( w . CaseProgress ) )
. WhereIf ( pageInput . TimeArraySearch . BeginTime . Length = = 2 , w = > w . CreatedTime > pageInput . TimeArraySearch . BeginTime [ 0 ] & & w . CreatedTime < pageInput . TimeArraySearch . BeginTime [ 1 ] . AddDays ( 1 ) )
. WhereIf ( pageInput . TimeArraySearch . EndTime . Length = = 2 , w = > w . CaseClosedTime > pageInput . TimeArraySearch . EndTime [ 0 ] & & w . CaseClosedTime < pageInput . TimeArraySearch . EndTime [ 1 ] . AddDays ( 1 ) )
. WhereIf ( pageInput . TimeSearch ! = null & & pageInput . TimeSearch . BeginTime ! = null & & pageInput . TimeSearch . EndTime ! = null , q = > q . CreatedTime > = pageInput . TimeSearch . BeginTime & & q . CreatedTime < = $"{pageInput.TimeSearch.EndTime.Value.ToString(" yyyy - MM - dd ")} 23:59:59" . ToDateTime ( ) ) ;
. WhereIf ( pageInput . TimeSearch ! = null & & pageInput . TimeSearch . BeginTime ! = null & & pageInput . TimeSearch . EndTime ! = null , q = > q . CreatedTime > = pageInput . TimeSearch . BeginTime & & q . CreatedTime < = $"{pageInput.TimeSearch.EndTime.Value.ToString(" yyyy - MM - dd ")} 23:59:59" . ToDateTime ( ) ) ;
var express = base . GetWithOutStatusExpression < AppCaseManagement , AppCaseManagementGetPageInput , long > ( pageInput , query ) ;
var express = base . GetWithOutStatusExpression < AppCaseManagement , AppCaseManagementGetPageInput , long > ( pageInput , query ) ;
@ -1514,14 +1709,24 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
[HttpPost]
[HttpPost]
public async Task < IResultOutput > GetSupervisedPersonAsync ( GetSupervisedPersonPage input )
public async Task < IResultOutput > GetSupervisedPersonAsync ( GetSupervisedPersonPage input )
{
{
var caseIds = await ( await base . GetCurrentUserCaseListAsync ( ) ) . Select ( w = > w . AppCaseManagement . Id ) . ToListAsync ( ) ;
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 caseIds = await (await base.GetCurrentUserCaseListAsync()).Select(w => w.AppCaseManagement.Id).ToListAsync();
var caselist = await ( await base . GetCurrentUserCaseListAsync ( ) ) . Select ( w = > new { w . AppCaseManagement . Id , w . AppCaseManagement . Name } ) . ToListAsync ( ) ;
var caselist = await ( await base . GetCurrentUserCaseListAsync ( ) ) . Select ( w = > new { w . AppCaseManagement . Id , w . AppCaseManagement . Name } ) . ToListAsync ( ) ;
//查询待执行,执行种案件涉嫌人员
//查询待执行,执行种案件涉嫌人员 去除状态筛选,与导出接口一致
var appSupervisedlist = from a in base . _ appCaseManagementRepository . AsQueryable ( false , true ) . Where ( q = > q . CaseProgress ! = CaseProgressEnum . Closed )
//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
join b in _ appSupervisedPersonRepository . AsQueryable ( false , true ) on a . Id equals b . CaseId
select b ;
select b ;
var data = await appSupervisedlist
var data = await appSupervisedlist
. Where ( q = > caseIds . Contains ( q . CaseId ) )
. Where ( q = > caseIdLi st . 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 . 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 ) )
. WhereIf ( input . name . NotNull ( ) , q = > q . SupervisedPersonName . Contains ( input . name ) )
. OrderByDescending ( r = > r . CreatedTime )
. OrderByDescending ( r = > r . CreatedTime )
@ -1799,14 +2004,25 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
/// <returns></returns>
/// <returns></returns>
public async Task < IActionResult > Getexport ( AppCaseManagementGetPageInput input )
public async Task < IActionResult > Getexport ( AppCaseManagementGetPageInput input )
{
{
input . PageIndex = 1 ;
input . PageSize = 9 9 9 9 9 9 ;
var limits = User . limits ;
var selectLimits = await _ appCaseSupervisorRepository . AsQueryable ( false , true )
. Where ( w = > limits . Contains ( w . UnitId . ToString ( ) ) )
. Select ( s = > s . CaseId )
. ToListAsync ( ) ;
input . CaseIds = input . CaseIds ? . Count > 0 ? input . CaseIds . Intersect ( selectLimits ) . ToList ( ) : selectLimits . Distinct ( ) . ToList ( ) ;
var express = await GetExpression ( input , _ appCaseManagementRepository . AsQueryable ( false , true ) ) ;
var express = await GetExpression ( input , _ appCaseManagementRepository . AsQueryable ( false , true ) ) ;
var rtn = await base . GetPageAsync < AppCaseManagement , AppCaseManagementGetPageInput , AppCaseManagementListexportDto > ( input , express ) ;
var rtn = await base . GetPageAsync < AppCaseManagement , AppCaseManagementGetPageInput , AppCaseManagementListexportDto > ( input , express ) ;
var caseIds = rtn . Data . Select ( w = > w . Id ) . ToList ( ) ;
//var caseIds = rtn.Data.Select(w => w.Id).ToList() ;
var caseSupervisor = await _ appCaseSupervisorRepository . AsQueryable ( false , true )
var caseSupervisor = await _ appCaseSupervisorRepository . AsQueryable ( false , true )
. Where ( w = > caseIds . Contains ( w . CaseId ) )
. Where ( w = > input . C aseIds. Contains ( w . CaseId ) )
. ToListAsync ( ) ;
. ToListAsync ( ) ;
foreach ( var listDto in rtn . Data )
foreach ( var listDto in rtn . Data )
@ -1830,10 +2046,23 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
/// <returns></returns>
/// <returns></returns>
public async Task < IActionResult > Getuserexport ( GetSupervisedPersonPage input )
public async Task < IActionResult > Getuserexport ( GetSupervisedPersonPage input )
{
{
var caseIds = await ( await base . GetCurrentUserCaseListAsync ( ) ) . Select ( w = > w . AppCaseManagement . Id ) . ToListAsync ( ) ;
input . PageIndex = 1 ;
input . PageSize = 9 9 9 9 ;
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 userRole = await _ userService . IsAdmin ( null ) ;
var supervisorCaseList = await _ appCaseSupervisorRepository . AsQueryable ( false , true )
. Where ( w = > w . SupervisorId = = User . Id ) . Select ( s = > s . CaseId ) . ToListAsync ( ) ;
// var intersection1 = supervisorCaseList.Intersect(caseIds).ToList();
var caselist = await ( await base . GetCurrentUserCaseListAsync ( ) ) . Select ( w = > new { w . AppCaseManagement . Id , w . AppCaseManagement . Name } ) . ToListAsync ( ) ;
var caselist = await ( await base . GetCurrentUserCaseListAsync ( ) ) . Select ( w = > new { w . AppCaseManagement . Id , w . AppCaseManagement . Name } ) . ToListAsync ( ) ;
var data = await _ appSupervisedPersonRepository . AsQueryable ( false , true )
var data = await _ appSupervisedPersonRepository . AsQueryable ( false , true )
. Where ( q = > caseIds . Contains ( q . CaseId ) )
. Where ( w = > caseIds . Contains ( w . CaseId ) )
. WhereIf ( userRole . IsAdmin , q = > supervisorCaseList . Contains ( q . CaseId ) )
. WhereIf ( input . name . NotNull ( ) , q = > q . SupervisedPersonName . Contains ( input . name ) )
. WhereIf ( input . name . NotNull ( ) , q = > q . SupervisedPersonName . Contains ( input . name ) )
. OrderByDescending ( r = > r . CreatedTime )
. OrderByDescending ( r = > r . CreatedTime )
. ProjectTo < AppSupervisedPersonListexportDto > ( Mapper . ConfigurationProvider )
. ProjectTo < AppSupervisedPersonListexportDto > ( Mapper . ConfigurationProvider )
@ -1842,8 +2071,8 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
foreach ( var listDto in data . Data )
foreach ( var listDto in data . Data )
{
{
var judgmentlist = await base . GetDictionariesOutput1 ( "judgment" , "" ) ;
//var judgmentlist = await base.GetDictionariesOutput1("judgment", "") ;
var type_caselist = await base . GetDictionariesOutput1 ( "type_case" , "" ) ;
//var type_caselist = await base.GetDictionariesOutput1("type_case", "") ;
listDto . Casename = caselist . Where ( q = > q . Id = = listDto . CaseId ) . Select ( q = > q . Name ) . JoinAsString ( "," ) ;
listDto . Casename = caselist . Where ( q = > q . Id = = listDto . CaseId ) . Select ( q = > q . Name ) . JoinAsString ( "," ) ;
//listDto.CaseTypename = type_caselist.Where(w => w.Id == listDto.CaseTypeId).Select(w => w.Name).JoinAsString(",");
//listDto.CaseTypename = type_caselist.Where(w => w.Id == listDto.CaseTypeId).Select(w => w.Name).JoinAsString(",");
//listDto.JudgmentStatusname = judgmentlist.Where(w => w.Id == listDto.JudgmentStatusId).Select(w => w.Name).JoinAsString(",");
//listDto.JudgmentStatusname = judgmentlist.Where(w => w.Id == listDto.JudgmentStatusId).Select(w => w.Name).JoinAsString(",");
@ -1856,6 +2085,12 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
}
}
# endregion
# endregion
private long GetUnitIdByUserId ( long id )
{
var user = _ appuserRepository . AsQueryable ( ) . Where ( w = > w . Id = = id ) . FirstOrDefault ( ) ;
return user ? . UnitId ? ? 0 ;
}
}
}
public class Controller : ControllerBase
public class Controller : ControllerBase
{
{