|
|
|
|
@ -20,12 +20,9 @@ using ATS.NonCustodial.Application.Contracts.Interfaces.Business.Apps;
|
|
|
|
|
using ATS.NonCustodial.Application.Contracts.Interfaces.Business.Apps.Input; |
|
|
|
|
using ATS.NonCustodial.Application.Contracts.Interfaces.Business.Apps.Output; |
|
|
|
|
using ATS.NonCustodial.Application.Contracts.Interfaces.Business.MaterialManager.Directories; |
|
|
|
|
using ATS.NonCustodial.Application.Contracts.Interfaces.Business.MaterialManager.Directories.Output; |
|
|
|
|
using ATS.NonCustodial.Application.Contracts.Interfaces.Business.PunchRecordServices; |
|
|
|
|
using ATS.NonCustodial.Application.Contracts.Interfaces.Business.PunchRecordServices.Input; |
|
|
|
|
using ATS.NonCustodial.Application.Contracts.Interfaces.Business.PunchRecordServices.Output; |
|
|
|
|
using ATS.NonCustodial.Application.Impl.Admins; |
|
|
|
|
using ATS.NonCustodial.Application.Impl.Business.CaseManagements; |
|
|
|
|
using ATS.NonCustodial.Application.Impl.Business.IM; |
|
|
|
|
using ATS.NonCustodial.Domain.Entities.Admins; |
|
|
|
|
using ATS.NonCustodial.Domain.Entities.Business; |
|
|
|
|
@ -51,8 +48,6 @@ using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
|
using Microsoft.AspNetCore.SignalR; |
|
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
|
using NPOI.SS.UserModel; |
|
|
|
|
using System.IO; |
|
|
|
|
|
|
|
|
|
namespace ATS.NonCustodial.Application.Impl.Business |
|
|
|
|
{ |
|
|
|
|
@ -189,7 +184,7 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
public async Task<IResultOutput<List<SupervisedPersonListOutput>>> GetSupervisedPersonListByName(string? name) |
|
|
|
|
{ |
|
|
|
|
//CaseProgressEnum案件已结束的不再展示 |
|
|
|
|
var rtn = (await GetCaseListDetail(name)).Where(w => w.Latitude != null && w.Longitude != null&&w.CaseProgress!= CaseProgressEnum.Closed).ToList(); |
|
|
|
|
var rtn = (await GetCaseListDetail(name)).Where(w => w.Latitude != null && w.Longitude != null && w.CaseProgress != CaseProgressEnum.Closed).ToList(); |
|
|
|
|
|
|
|
|
|
//返回结果 |
|
|
|
|
return (IResultOutput<List<SupervisedPersonListOutput>>)ResultOutput.Ok(rtn); |
|
|
|
|
@ -319,15 +314,15 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
{ |
|
|
|
|
var userCase = await base.GetCurrentSupervisePersonProcessingCase(input.SupervisedPersonId ?? User.Id); |
|
|
|
|
|
|
|
|
|
if (userCase == null) return new ResultOutput<PagedList<AppPunchRecordListDto>>(); |
|
|
|
|
|
|
|
|
|
return (IResultOutput<PagedList<AppPunchRecordListDto>>)await _appPunchRecordService.GetPageAsync(new AppPunchRecordGetPageInput() |
|
|
|
|
{ |
|
|
|
|
Id = userCase.CaseId, |
|
|
|
|
SupervisedPersonId = input.SupervisedPersonId ?? User.Id, |
|
|
|
|
PageIndex = input.PageIndex, |
|
|
|
|
PageSize = input.PageSize |
|
|
|
|
}); |
|
|
|
|
return userCase == null |
|
|
|
|
? new ResultOutput<PagedList<AppPunchRecordListDto>>() |
|
|
|
|
: (IResultOutput<PagedList<AppPunchRecordListDto>>)await _appPunchRecordService.GetPageAsync(new AppPunchRecordGetPageInput() |
|
|
|
|
{ |
|
|
|
|
Id = userCase.CaseId, |
|
|
|
|
SupervisedPersonId = input.SupervisedPersonId ?? User.Id, |
|
|
|
|
PageIndex = input.PageIndex, |
|
|
|
|
PageSize = input.PageSize |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
@ -560,14 +555,7 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
{ |
|
|
|
|
item.CheckStatus = input.CheckStatus; |
|
|
|
|
|
|
|
|
|
if (input.CheckStatus == CheckStatusEnum.Checked) |
|
|
|
|
{ |
|
|
|
|
item.CheckTime = DateTime.Now; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
item.CheckTime = null; |
|
|
|
|
} |
|
|
|
|
item.CheckTime = input.CheckStatus == CheckStatusEnum.Checked ? DateTime.Now : null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
await _appBusinessApplicationViewStatisticsRepository.UpdateAsync(busViewList); |
|
|
|
|
@ -639,10 +627,10 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
//职位名字 |
|
|
|
|
if (User.ChatPersonType != ChatPersonTypeEnum.SupervisedPerson) return item; |
|
|
|
|
{ |
|
|
|
|
var positionName = receiverList.FirstOrDefault(w => w.Id == item.ReceiverId)?.PositionName; |
|
|
|
|
if (postDict.ContainsKey(positionName)) |
|
|
|
|
var positionName = receiverList.FirstOrDefault(w => w.Id == item.ReceiverId)?.PositionName ?? "未知职位"; |
|
|
|
|
if (postDict.TryGetValue(positionName, out int count)) |
|
|
|
|
{ |
|
|
|
|
postDict[positionName] += 1; |
|
|
|
|
postDict[positionName] = count + 1; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
@ -710,13 +698,13 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
spcr.SupervisedPersonId |
|
|
|
|
}).FirstOrDefaultAsync(); |
|
|
|
|
|
|
|
|
|
if (data == null) return new ResultOutput<GetSuperPersonCaseDetailDto>(); |
|
|
|
|
|
|
|
|
|
return await this.GetSuperPersonCaseDetail(new GetSuperPersonCaseDetailInput() |
|
|
|
|
{ |
|
|
|
|
CaseId = data!.Id, |
|
|
|
|
SuperPersonId = data.SupervisedPersonId |
|
|
|
|
}); |
|
|
|
|
return data == null |
|
|
|
|
? new ResultOutput<GetSuperPersonCaseDetailDto>() |
|
|
|
|
: await this.GetSuperPersonCaseDetail(new GetSuperPersonCaseDetailInput() |
|
|
|
|
{ |
|
|
|
|
CaseId = data!.Id, |
|
|
|
|
SuperPersonId = data.SupervisedPersonId |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
@ -730,7 +718,7 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
List<AppRemindListDto> rtn; |
|
|
|
|
var totalCount = 0; |
|
|
|
|
//如果SupervisedPersonId不为空并查询结果为空执行下面查询 |
|
|
|
|
var currentCase = await GetCurrentSupervisePersonProcessingCase(input.SupervisedPersonId!=null ? (long)input.SupervisedPersonId : User.Id); |
|
|
|
|
var currentCase = await GetCurrentSupervisePersonProcessingCase(input.SupervisedPersonId != null ? (long)input.SupervisedPersonId : User.Id); |
|
|
|
|
if (input.RemindType == AppRemindTypeEnum.EarlyWarning) |
|
|
|
|
{ |
|
|
|
|
var earlyWarningList = (from ew in _appEarlyWarningRepository.AsQueryable(false, true) |
|
|
|
|
@ -858,7 +846,7 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
//发短信给监管人,提醒处理审批 |
|
|
|
|
await _smsService.SendMessageSMS(MessageAlertTypeEnum.ReviewNotification, user.FirstOrDefault().UserName, user.FirstOrDefault().Phone, DateTime.Now, applicationType.Name, "", currentUserCase.SupervisedPersonName); |
|
|
|
|
} |
|
|
|
|
return await _appBusinessApplicationService.CreateOrModify(input); |
|
|
|
|
return await _appBusinessApplicationService.CreateOrModify(input); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
@ -873,7 +861,7 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
join ba in _appBusinessApplicationRepository.AsQueryable(false, true) on c.Id equals ba.CaseId |
|
|
|
|
select ba) |
|
|
|
|
.WhereIf(input.AuditStatus != null, w => w.AuditStatus == input.AuditStatus) |
|
|
|
|
.Where(w => w.SupervisedPersonId == (input.SupervisedPersonId!=null ? input.SupervisedPersonId : User.Id)) |
|
|
|
|
.Where(w => w.SupervisedPersonId == (input.SupervisedPersonId != null ? input.SupervisedPersonId : User.Id)) |
|
|
|
|
.OrderByDescending(w => w.CreatedTime); |
|
|
|
|
|
|
|
|
|
//正在进行的案件 |
|
|
|
|
@ -906,14 +894,14 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
join a in _appSupervisedPersonRepository.AsQueryable(false, true) on c.Id equals a.CaseId |
|
|
|
|
join ba in _appFileAccessRecordsRepository.AsQueryable(false, true) on a.SupervisedPersonId equals ba.SupervisedPersonId |
|
|
|
|
select ba) |
|
|
|
|
.Where(w => w.SupervisedPersonId == (input.SupervisedPersonId!=null ? input.SupervisedPersonId : User.Id)) |
|
|
|
|
.Where(w => w.SupervisedPersonId == (input.SupervisedPersonId != null ? input.SupervisedPersonId : User.Id)) |
|
|
|
|
.OrderByDescending(w => w.CreatedTime); |
|
|
|
|
var Direclist = (from c in _appDirectoryDescriptorRepository.AsQueryable(false, true) |
|
|
|
|
join a in _appFileDescriptorRepository.AsQueryable(false, true) on c.Id equals a.DirectoryId |
|
|
|
|
select new{ typename=c.Name, a.Name,a.Id,a.DirectoryId }).ToList(); |
|
|
|
|
select new { typename = c.Name, a.Name, a.Id, a.DirectoryId }).ToList(); |
|
|
|
|
foreach (var item in Direclist) |
|
|
|
|
{ |
|
|
|
|
var Direcbol = query.ToList().Where(q => q.FileDescriptorId == item.Id&&q.CaseId==(input.CaseId!=null? input.CaseId:0)).OrderByDescending(q=>q.CreatedTime).ToList(); |
|
|
|
|
var Direcbol = query.ToList().Where(q => q.FileDescriptorId == item.Id && q.CaseId == (input.CaseId != null ? input.CaseId : 0)).OrderByDescending(q => q.CreatedTime).ToList(); |
|
|
|
|
if (Direcbol.Count > 0) |
|
|
|
|
{ |
|
|
|
|
list.Add(new |
|
|
|
|
@ -924,21 +912,21 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
bol = true |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
list.Add(new |
|
|
|
|
{ |
|
|
|
|
typename = $"{item.typename}", |
|
|
|
|
name = $"{item.Name}", |
|
|
|
|
time="", |
|
|
|
|
time = "", |
|
|
|
|
bol = false |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var totalCount = list.Count(); |
|
|
|
|
var pagelist = list.Skip((input.PageIndex - 1) * input.PageSize) |
|
|
|
|
.Take(input.PageSize); |
|
|
|
|
var pagelist = list.Skip((input.PageIndex - 1) * input.PageSize) |
|
|
|
|
.Take(input.PageSize); |
|
|
|
|
return ResultOutput.Ok(new |
|
|
|
|
{ |
|
|
|
|
TotalCount = totalCount, |
|
|
|
|
@ -958,7 +946,10 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="input"></param> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
public async Task<IResultOutput> AddPunchRecord(AppPunchRecordAddInput input) => await _appPunchRecordService.AddAsync(input); |
|
|
|
|
public async Task<IResultOutput> AddPunchRecord(AppPunchRecordAddInput input) |
|
|
|
|
{ |
|
|
|
|
return await _appPunchRecordService.AddAsync(input); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// 被监管人登录 |
|
|
|
|
@ -1010,7 +1001,7 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
if (!string.IsNullOrEmpty(input.phone)) |
|
|
|
|
{ |
|
|
|
|
bool checkCode = await _smsService.CheckCodeAsync(input.phone, input.checkCode, "CheckCode"); |
|
|
|
|
if (!checkCode) return ResultOutput.NotOk("无效验证码"); |
|
|
|
|
if (!checkCode) return ResultOutput.NotOk("验证码错误"); |
|
|
|
|
} |
|
|
|
|
//[1]校验当前账户是否是第一次绑定 |
|
|
|
|
//if (!await _appSupervisedPersonRepository.AnyAsync(w => w.IdCard == input.IdCard && !w.IsBound)) return ResultOutput.NotOk("当前身份没有被监管,请检查身份证是否输入正确"); |
|
|
|
|
@ -1043,10 +1034,10 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
spData.EnterFace = input.EnterFace; |
|
|
|
|
spData.IMEI = input.IMEI; |
|
|
|
|
var userdata = _appUserRepository.AsQueryable(false, true).Where(q => q.Id == spData.SupervisedPersonId).FirstOrDefault(); |
|
|
|
|
if (userdata!=null) |
|
|
|
|
if (userdata != null) |
|
|
|
|
{ |
|
|
|
|
userdata.CId = input.CId; |
|
|
|
|
await _appUserRepository.UpdateAsync(userdata,UpdatingProps<AppUser>(q=>q.CId)); |
|
|
|
|
await _appUserRepository.UpdateAsync(userdata, UpdatingProps<AppUser>(q => q.CId)); |
|
|
|
|
} |
|
|
|
|
await _appSupervisedPersonRepository.UpdateAsync(spData); |
|
|
|
|
|
|
|
|
|
@ -1196,7 +1187,7 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
.WhereIf(input.CheckStatus.HasValue, w => w.CheckStatus == input.CheckStatus) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
earlyList = earlyList.Distinct((x, y) => x.CaseId == y.CaseId && x.SupervisedPersonId == y.SupervisedPersonId && x.CreatedTime == y.CreatedTime).OrderByDescending(q => q.CreatedTime).ToList(); |
|
|
|
|
if (!input.CheckStatus.HasValue) |
|
|
|
|
if (!input.CheckStatus.HasValue) |
|
|
|
|
{ |
|
|
|
|
var WarningList = new List<AppRemindListDto>(); |
|
|
|
|
var NotChecked = earlyList.Where(q => q.CheckStatus == CheckStatusEnum.NotChecked).OrderByDescending(q => q.CreatedTime).ToList(); |
|
|
|
|
@ -1231,9 +1222,9 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
var caseIdList = selectLimits.Select(w => w.CaseId).Distinct().ToList(); |
|
|
|
|
|
|
|
|
|
var data = (await base.GetCurrentUserCaseListAsync()) |
|
|
|
|
.Where(W => W.AppCaseManagement!=null&& W.AppCaseManagement.CaseProgress != CaseProgressEnum.Closed && caseIdList.Contains(W.AppCaseManagement.Id)) |
|
|
|
|
.Where(W => W.AppCaseSupervisedPerson != null&& caseIdList.Contains(W.AppCaseSupervisedPerson.CaseId)) |
|
|
|
|
.Where(W=>W.AppCaseSupervisor!=null && caseIdList.Contains(W.AppCaseSupervisor.CaseId)) |
|
|
|
|
.Where(W => W.AppCaseManagement != null && W.AppCaseManagement.CaseProgress != CaseProgressEnum.Closed && caseIdList.Contains(W.AppCaseManagement.Id)) |
|
|
|
|
.Where(W => W.AppCaseSupervisedPerson != null && caseIdList.Contains(W.AppCaseSupervisedPerson.CaseId)) |
|
|
|
|
.Where(W => W.AppCaseSupervisor != null && caseIdList.Contains(W.AppCaseSupervisor.CaseId)) |
|
|
|
|
.WhereIf(name.NotNull(), w => w.AppCaseSupervisedPerson.SupervisedPersonName!.Contains(name)) |
|
|
|
|
.Select(w => new |
|
|
|
|
{ |
|
|
|
|
@ -1315,7 +1306,7 @@ namespace ATS.NonCustodial.Application.Impl.Business
|
|
|
|
|
var caseIdList = selectLimits.Select(w => w.CaseId).Distinct().ToList(); |
|
|
|
|
|
|
|
|
|
var data = (await base.GetCurrentUserCaseListAsync()) |
|
|
|
|
.Where(W => W.AppCaseManagement!=null&& W.AppCaseSupervisedPerson != null && W.AppCaseSupervisor != null && W.AppCaseManagement.CaseProgress != CaseProgressEnum.Pending && caseIdList.Contains(W.AppCaseManagement.Id)&&caseIdList.Contains(W.AppCaseSupervisedPerson.CaseId)&&caseIdList.Contains(W.AppCaseSupervisor.CaseId)) |
|
|
|
|
.Where(W => W.AppCaseManagement != null && W.AppCaseSupervisedPerson != null && W.AppCaseSupervisor != null && W.AppCaseManagement.CaseProgress != CaseProgressEnum.Pending && caseIdList.Contains(W.AppCaseManagement.Id) && caseIdList.Contains(W.AppCaseSupervisedPerson.CaseId) && caseIdList.Contains(W.AppCaseSupervisor.CaseId)) |
|
|
|
|
.WhereIf(name.NotNull(), w => w.AppCaseSupervisedPerson.SupervisedPersonName!.Contains(name)) |
|
|
|
|
.Select(w => new |
|
|
|
|
{ |
|
|
|
|
|