|
|
|
@ -31,6 +31,7 @@ using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using System.Dynamic; |
|
|
|
using System.Dynamic; |
|
|
|
|
|
|
|
using System.Linq; |
|
|
|
using Yitter.IdGenerator; |
|
|
|
using Yitter.IdGenerator; |
|
|
|
|
|
|
|
|
|
|
|
namespace ATS.NonCustodial.Application.Impl.Business |
|
|
|
namespace ATS.NonCustodial.Application.Impl.Business |
|
|
|
@ -192,14 +193,15 @@ namespace ATS.NonCustodial.Application.Impl.Business |
|
|
|
var supervisorCaseList = await _appCaseSupervisorRepository.AsQueryable(false, true) |
|
|
|
var supervisorCaseList = await _appCaseSupervisorRepository.AsQueryable(false, true) |
|
|
|
.Where(w => w.SupervisorId == User.Id).Select(s => s.CaseId).ToListAsync(); |
|
|
|
.Where(w => w.SupervisorId == User.Id).Select(s => s.CaseId).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
var intersection1 = supervisorCaseList.Intersect(supervisorCaseList).ToList(); |
|
|
|
// var intersection1 = supervisorCaseList.Intersect(supervisorCaseList).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
// var caseIds = await (await base.GetCurrentUserCaseListAsync()).Select(w => w.AppCaseManagement.Id).ToListAsync(); |
|
|
|
// var caseIds = await (await base.GetCurrentUserCaseListAsync()).Select(w => w.AppCaseManagement.Id).ToListAsync(); |
|
|
|
//var list= await base._appSupervisedPersonRepository.AsQueryable(false, true).Where(q=> caseIds.Contains(q.CaseId)).ToListAsync(); |
|
|
|
//var list= await base._appSupervisedPersonRepository.AsQueryable(false, true).Where(q=> caseIds.Contains(q.CaseId)).ToListAsync(); |
|
|
|
|
|
|
|
|
|
|
|
var data = await _appPunchRecordStatisticsRepository |
|
|
|
var data = await _appPunchRecordStatisticsRepository |
|
|
|
.AsQueryable(false, true) |
|
|
|
.AsQueryable(false, true) |
|
|
|
.Where(w => intersection1.Contains(w.CaseId)) |
|
|
|
.Where(w => caseIds.Contains(w.CaseId)) |
|
|
|
|
|
|
|
.WhereIf(!userRole.IsAdmin,w=> supervisorCaseList.Contains(w.CaseId)) |
|
|
|
.WhereIf(!string.IsNullOrEmpty(input.name), q => q.SupervisedPersonName.Contains(input.name)) |
|
|
|
.WhereIf(!string.IsNullOrEmpty(input.name), q => q.SupervisedPersonName.Contains(input.name)) |
|
|
|
.OrderByDescending(r => r.CreatedTime) |
|
|
|
.OrderByDescending(r => r.CreatedTime) |
|
|
|
.ProjectTo<AppPunchRecordListDto>(Mapper.ConfigurationProvider) |
|
|
|
.ProjectTo<AppPunchRecordListDto>(Mapper.ConfigurationProvider) |
|
|
|
|