From d45a891f41720c816447788f66314c14e474cf76 Mon Sep 17 00:00:00 2001 From: zhaozhenjing Date: Thu, 20 Nov 2025 16:42:46 +0800 Subject: [PATCH] =?UTF-8?q?[MODIFY]=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/AppViolationStatisticsService.cs | 63 ++++++++++--------- .../AppCaseManagementService.cs | 19 +++++- 2 files changed, 53 insertions(+), 29 deletions(-) diff --git a/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppViolationStatisticsService.cs b/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppViolationStatisticsService.cs index 11c1db3..0e03664 100644 --- a/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppViolationStatisticsService.cs +++ b/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppViolationStatisticsService.cs @@ -327,17 +327,11 @@ namespace ATS.NonCustodial.Application.Impl.Business { if (item == null) continue; var caseType= await _appDictionaryService.GetDicByDicId(item.CaseTypeId); - NotClockListDto notClockListDto = new NotClockListDto(); - notClockListDto.Bmsah = item.Bmsah; - notClockListDto.CaseId = item.Id; - notClockListDto.CaseName = item.Name; - notClockListDto.CreatedTime = item.CreatedTime; - notClockListDto.CaseTypeName = caseType.Name; + var unitList = await (from c in _appSupervisorRepository.AsQueryable(false, true) join u in _userRepository.AsQueryable(false, true) on c.SupervisorId equals u.Id where c.CaseId == item.Id select u.Unitname).FirstOrDefaultAsync(); - notClockListDto.SupervisionUnit = unitList; //根据案件找到被监管 var supervisedPerson = await _appSupervisedPersonRepository .AsQueryable(false, true) @@ -345,8 +339,16 @@ namespace ATS.NonCustodial.Application.Impl.Business .ToListAsync(); foreach (var person in supervisedPerson) { + NotClockListDto notClockListDto = new NotClockListDto(); + notClockListDto.Bmsah = item.Bmsah; + notClockListDto.CaseId = item.Id; + notClockListDto.CaseName = item.Name; + notClockListDto.CreatedTime = item.CreatedTime; + notClockListDto.CaseTypeName = caseType.Name; notClockListDto.SupervisedPersonId = person.SupervisedPersonId; notClockListDto.SupervisedPersonName = person.SupervisedPersonName; + notClockListDto.SupervisionUnit = unitList; + var earlyList = await _appEarlyWarningRepository .AsQueryable(false, true) .Where(w => w.EarlyWarningTypeId == applicationType.Id && w.SupervisedPersonId == person.SupervisedPersonId @@ -398,18 +400,12 @@ namespace ATS.NonCustodial.Application.Impl.Business { if (item == null) continue; var caseType = await _appDictionaryService.GetDicByDicId(item.CaseTypeId); - ViolationListDto notClockListDto = new ViolationListDto(); - notClockListDto.Bmsah = item.Bmsah; - notClockListDto.CaseId = item.Id; - notClockListDto.CaseName = item.Name; - notClockListDto.CreatedTime = item.CreatedTime; - notClockListDto.CaseTypeName = caseType.Name; + var unitList =await (from c in _appSupervisorRepository.AsQueryable(false, true) join u in _userRepository.AsQueryable(false, true) on c.SupervisorId equals u.Id where c.CaseId == item.Id select u.Unitname).FirstOrDefaultAsync(); - notClockListDto.SupervisionUnit = unitList; //根据案件找到被监管 var supervisedPerson = await _appSupervisedPersonRepository .AsQueryable(false, true) @@ -417,6 +413,14 @@ namespace ATS.NonCustodial.Application.Impl.Business .ToListAsync(); foreach (var person in supervisedPerson) { + ViolationListDto notClockListDto = new ViolationListDto(); + notClockListDto.Bmsah = item.Bmsah; + notClockListDto.CaseId = item.Id; + notClockListDto.CaseName = item.Name; + notClockListDto.CreatedTime = item.CreatedTime; + notClockListDto.CaseTypeName = caseType.Name; + notClockListDto.SupervisionUnit = unitList; + notClockListDto.SupervisedPersonId = person.SupervisedPersonId; notClockListDto.SupervisedPersonName = person.SupervisedPersonName; var earlyList = await _appEarlyWarningRepository @@ -471,18 +475,11 @@ namespace ATS.NonCustodial.Application.Impl.Business { if (item == null) continue; var caseType = await _appDictionaryService.GetDicByDicId(item.CaseTypeId); - ViolationExportDto notClockListDto = new ViolationExportDto(); - notClockListDto.Bmsah = item.Bmsah; - notClockListDto.CaseId = item.Id; - notClockListDto.CaseName = item.Name; - notClockListDto.CreatedTime = item.CreatedTime; - notClockListDto.CaseTypeName = caseType.Name; var unitList = await (from c in _appSupervisorRepository.AsQueryable(false, true) join u in _userRepository.AsQueryable(false, true) on c.SupervisorId equals u.Id where c.CaseId == item.Id select u.Unitname).FirstOrDefaultAsync(); - notClockListDto.SupervisionUnit = unitList; //根据案件找到被监管 var supervisedPerson = await _appSupervisedPersonRepository .AsQueryable(false, true) @@ -490,6 +487,14 @@ namespace ATS.NonCustodial.Application.Impl.Business .ToListAsync(); foreach (var person in supervisedPerson) { + ViolationExportDto notClockListDto = new ViolationExportDto(); + notClockListDto.Bmsah = item.Bmsah; + notClockListDto.CaseId = item.Id; + notClockListDto.CaseName = item.Name; + notClockListDto.CreatedTime = item.CreatedTime; + notClockListDto.CaseTypeName = caseType.Name; + notClockListDto.SupervisionUnit = unitList; + notClockListDto.SupervisedPersonId = person.SupervisedPersonId; notClockListDto.SupervisedPersonName = person.SupervisedPersonName; var earlyList = await _appEarlyWarningRepository @@ -538,17 +543,11 @@ namespace ATS.NonCustodial.Application.Impl.Business { if (item == null) continue; var caseType = await _appDictionaryService.GetDicByDicId(item.CaseTypeId); - NotClockExportDto notClockListDto = new NotClockExportDto(); - notClockListDto.Bmsah = item.Bmsah; - notClockListDto.CaseId = item.Id; - notClockListDto.CaseName = item.Name; - notClockListDto.CreatedTime = item.CreatedTime; - notClockListDto.CaseTypeName = caseType.Name; + var unitList = await (from c in _appSupervisorRepository.AsQueryable(false, true) join u in _userRepository.AsQueryable(false, true) on c.SupervisorId equals u.Id where c.CaseId == item.Id select u.Unitname).FirstOrDefaultAsync(); - notClockListDto.SupervisionUnit = unitList; //根据案件找到被监管 var supervisedPerson = await _appSupervisedPersonRepository .AsQueryable(false, true) @@ -556,8 +555,16 @@ namespace ATS.NonCustodial.Application.Impl.Business .ToListAsync(); foreach (var person in supervisedPerson) { + NotClockExportDto notClockListDto = new NotClockExportDto(); + notClockListDto.Bmsah = item.Bmsah; + notClockListDto.CaseId = item.Id; + notClockListDto.CaseName = item.Name; + notClockListDto.CreatedTime = item.CreatedTime; + notClockListDto.CaseTypeName = caseType.Name; notClockListDto.SupervisedPersonId = person.SupervisedPersonId; notClockListDto.SupervisedPersonName = person.SupervisedPersonName; + notClockListDto.SupervisionUnit = unitList; + var earlyList = await _appEarlyWarningRepository .AsQueryable(false, true) .Where(w => w.EarlyWarningTypeId== applicationType.Id && w.SupervisedPersonId == person.SupervisedPersonId diff --git a/src/2.services/ATS.NonCustodial.Application/Impl/Business/CaseManagements/AppCaseManagementService.cs b/src/2.services/ATS.NonCustodial.Application/Impl/Business/CaseManagements/AppCaseManagementService.cs index 6a1984d..013660e 100644 --- a/src/2.services/ATS.NonCustodial.Application/Impl/Business/CaseManagements/AppCaseManagementService.cs +++ b/src/2.services/ATS.NonCustodial.Application/Impl/Business/CaseManagements/AppCaseManagementService.cs @@ -10,6 +10,7 @@ using ATS.NonCustodial.Application.Contracts.Interfaces.Business.AppCaseManageme using ATS.NonCustodial.Domain.Entities.Admins; using ATS.NonCustodial.Domain.Entities.Business; 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.Common.Dtos; using ATS.NonCustodial.Domain.Shared.Enums; @@ -60,6 +61,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements private readonly IEfRepository _appUserRepository; private readonly IEfRepository _appDeviceManagementRepository; private readonly IEfRepository _appuserRepository; + private readonly IEfRepository _appEarlyWarningViewStatisticsRepository; /// /// @@ -89,6 +91,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements IEfRepository appCommonFenceRepository, IEfRepository appUserRepository, IEfRepository appSupervisedPersonRealTimeLocationRepository, + IEfRepository appEarlyWarningViewStatisticsRepository, IEfRepository appDeviceManagementRepository) : base( appCaseManagementRepository, @@ -105,6 +108,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements _appUserRepository = appUserRepository; _appDeviceManagementRepository = appDeviceManagementRepository; _appuserRepository = appuserRepository; + _appEarlyWarningViewStatisticsRepository = appEarlyWarningViewStatisticsRepository; } #endregion Identity @@ -489,7 +493,20 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements //案子结束时间 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); return ResultOutput.Ok();