From ff6d3b8c7befc1383207defb95a8fdf400511deb Mon Sep 17 00:00:00 2001 From: zhaozhenjing Date: Fri, 17 Oct 2025 11:20:31 +0800 Subject: [PATCH] =?UTF-8?q?[MODIFY]20251016=E6=8F=90=E5=87=BA=E7=9A=84bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/AppBusinessApplication.cs | 5 ++++ .../Business/AppBusinessApplicationService.cs | 28 +++++++++++-------- .../Impl/Business/AppManagementService.cs | 13 +++++++-- .../Business/AppViolationStatisticsService.cs | 2 ++ .../AppCaseManagementService.cs | 2 ++ ...pBusinessApplicationCreateOrModifyInput.cs | 5 +++- .../Output/AppBusinessApplicationListDto.cs | 11 ++++++-- .../Input/AppCaseManagementGetPageInput.cs | 5 ++++ .../Business/Apps/Input/AppRemindPageInput.cs | 5 ++++ .../Business/Apps/Output/AppRemindListDto.cs | 5 ++++ .../Input/ViolationStatisticsPageInput.cs | 5 +++- 11 files changed, 68 insertions(+), 18 deletions(-) diff --git a/src/1.datas/ATS.NonCustodial.Domain/Entities/Business/AppBusinessApplication.cs b/src/1.datas/ATS.NonCustodial.Domain/Entities/Business/AppBusinessApplication.cs index 89f5964..b58fc58 100644 --- a/src/1.datas/ATS.NonCustodial.Domain/Entities/Business/AppBusinessApplication.cs +++ b/src/1.datas/ATS.NonCustodial.Domain/Entities/Business/AppBusinessApplication.cs @@ -92,6 +92,11 @@ namespace ATS.NonCustodial.Domain.Entities.Business /// public DateTime ActiveTimePeriodEnd { get; set; } + /// + /// 结束监管日期 + /// + public DateTime? EndSupervisionDate { get; set; } + /// /// 申请描述 /// diff --git a/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppBusinessApplicationService.cs b/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppBusinessApplicationService.cs index a9cd1ff..82bfde4 100644 --- a/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppBusinessApplicationService.cs +++ b/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppBusinessApplicationService.cs @@ -7,7 +7,6 @@ using ATS.NonCustodial.Application.Contracts.Interfaces.Business.AppBusinessAppl using ATS.NonCustodial.Application.Contracts.Interfaces.Business.AppBusinessApplications.Output; using ATS.NonCustodial.Application.Contracts.Interfaces.Business.AppCaseManagements.AppCaseManagement; using ATS.NonCustodial.Application.Contracts.Interfaces.Business.Apps.Output; -using ATS.NonCustodial.Application.Impl.Admins; using ATS.NonCustodial.Application.Impl.Business.IM; using ATS.NonCustodial.Domain.Entities.Admins; using ATS.NonCustodial.Domain.Entities.Business; @@ -26,8 +25,6 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; -using NPOI.SS.Formula.Functions; -using System.Linq; using Yitter.IdGenerator; namespace ATS.NonCustodial.Application.Impl.Business @@ -117,8 +114,17 @@ namespace ATS.NonCustodial.Application.Impl.Business var caseIdList = selectLimits.Select(w => w.CaseId).Distinct().ToList(); var express = await GetExpression(input, _appBusinessApplicationRepository.AsQueryable(false, true)); + express = express.Where(w => caseIdList.Contains(w.CaseId)); var rtn = await base.GetPageAsync(input, express); - rtn.Data = rtn.Data.Where(w => caseIdList.Contains(w.CaseId)).ToList(); + //rtn.Data = rtn.Data.Where(w => caseIdList.Contains(w.CaseId)).ToList(); + foreach (var item in rtn.Data) + { + if (item.EndSupervisionDate.HasValue) + { + item.ActiveTimePeriodBegin = null; + item.ActiveTimePeriodEnd = null; + } + } return ResultOutput.Ok(rtn); } @@ -143,12 +149,12 @@ namespace ATS.NonCustodial.Application.Impl.Business var grudlist = express .WhereIf(input.supname.NotNull(), q => q.SupervisedPersonName.Contains(input.supname)) .GroupBy(q => new { q.CaseId, q.SupervisedPersonId, q.SupervisedPersonName }).Select(q => new { q.Key.SupervisedPersonName, q.Key.CaseId, Count = q.ToList().Count }).ToList(); - var grulist =from a in grudlist.ToList() - join b in spList.Select(q => q.AppCaseManagement).ToList() on a.CaseId equals b.Id - select new { a.SupervisedPersonName, a.Count, a.CaseId, b.Name }; + var grulist = from a in grudlist.ToList() + join b in spList.Select(q => q.AppCaseManagement).ToList() on a.CaseId equals b.Id + select new { a.SupervisedPersonName, a.Count, a.CaseId, b.Name }; var resultList = grulist.Distinct().Where(p => caseIds.Contains(p.CaseId)); var pagegrulist = resultList.Skip((input.PageIndex - 1) * input.PageSize).Take(input.PageSize).ToList(); - return ResultOutput.Ok(new { TotalCount = resultList.Count(), grudlist= pagegrulist }); + return ResultOutput.Ok(new { TotalCount = resultList.Count(), grudlist = pagegrulist }); } /// @@ -260,7 +266,7 @@ namespace ATS.NonCustodial.Application.Impl.Business //返回结果 return ResultOutput.Ok(); } - + /// /// 批量删除 /// @@ -327,7 +333,7 @@ namespace ATS.NonCustodial.Application.Impl.Business 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 dataList = await _appBusinessApplicationRepository.AsQueryable(false, true) .Where(w => caseIds.Contains(w.CaseId)) @@ -352,7 +358,7 @@ namespace ATS.NonCustodial.Application.Impl.Business //根据当前登录人查看其手里的案件被监管人 var spList = await base.GetCurrentUserCaseListAsync(); - var spIds = await spList.Where(q=>q.AppCaseSupervisedPerson!=null).Select(w => w.AppCaseSupervisedPerson!.SupervisedPersonId).ToListAsync(); + var spIds = await spList.Where(q => q.AppCaseSupervisedPerson != null).Select(w => w.AppCaseSupervisedPerson!.SupervisedPersonId).ToListAsync(); query = query .Where(w => spIds.Contains(w.SupervisedPersonId)) diff --git a/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppManagementService.cs b/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppManagementService.cs index 5f0c5ac..12da9b5 100644 --- a/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppManagementService.cs +++ b/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppManagementService.cs @@ -439,9 +439,16 @@ namespace ATS.NonCustodial.Application.Impl.Business [HttpPost] public async Task>> GetAppBusinessByStatusListAsync(GetAppBusinessByStatusListPageInput 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 data = await _appCaseManagementService.GetCaseSuperviseList(); - var caseIds = data.Select(w => w.CaseId).ToList(); + var caseIds = data.Where(w=> caseIdList.Contains(w.CaseId)).Select(w => w.CaseId).ToList(); //业务申请列表 var businessList = await _appBusinessApplicationRepository @@ -1182,9 +1189,11 @@ namespace ATS.NonCustodial.Application.Impl.Business CreatedTime = e.CreatedTime, SupervisedPersonId = e.SupervisedPersonId, SupervisedPersonName = e.SupervisedPersonName, - CaseId = e.CaseId + CaseId = e.CaseId, + EarlyWarningTypeId = e.EarlyWarningTypeId }) .WhereIf(input.CheckStatus.HasValue, w => w.CheckStatus == input.CheckStatus) + .WhereIf(input.EarlyWarningTypeId.HasValue,w=>w.EarlyWarningTypeId == input.EarlyWarningTypeId) .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) 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 90c337e..d11330b 100644 --- a/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppViolationStatisticsService.cs +++ b/src/2.services/ATS.NonCustodial.Application/Impl/Business/AppViolationStatisticsService.cs @@ -25,6 +25,7 @@ using AutoMapper.QueryableExtensions; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using NPOI.SS.Formula.Functions; +using StackExchange.Profiling.Internal; using System.Collections.Generic; using static Microsoft.EntityFrameworkCore.DbLoggerCategory; @@ -120,6 +121,7 @@ namespace ATS.NonCustodial.Application.Impl.Business .AsQueryable(false, true).Where(q=> spIds.Contains(q.SupervisedPersonId)) .WhereIf(input.CaseId != default, a => a.CaseId == input.CaseId) .WhereIf(input.SupervisedPersonId != default, w => w.SupervisedPersonId == input.SupervisedPersonId) + .WhereIf(input.SupervisedPersonName.HasValue(),w=>w.SupervisedPersonName.Contains(input.SupervisedPersonName)) .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()) .ToListAsync(); 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 0ad33c7..fdcc533 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 @@ -1538,6 +1538,8 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements .WhereIf(pageInput.CaseTypeId != null, a => a.CaseTypeId == pageInput.CaseTypeId) .WhereIf(pageInput.JudgmentStatusIds.IsNotNullOrEmpty(), w => pageInput.JudgmentStatusIds.Contains(w.JudgmentStatusId)) .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()); var express = base.GetWithOutStatusExpression(pageInput, query); diff --git a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppBusinessApplications/Input/AppBusinessApplicationCreateOrModifyInput.cs b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppBusinessApplications/Input/AppBusinessApplicationCreateOrModifyInput.cs index e41801e..8b1d304 100644 --- a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppBusinessApplications/Input/AppBusinessApplicationCreateOrModifyInput.cs +++ b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppBusinessApplications/Input/AppBusinessApplicationCreateOrModifyInput.cs @@ -43,7 +43,10 @@ namespace ATS.NonCustodial.Application.Contracts.Interfaces.Business.AppBusiness /// 活动时间段(年月日时分) /// public DateTime ActiveTimePeriodEnd { get; set; } - + /// + /// 申请结束监管日期 + /// + public DateTime EndSupervisionDate { get; set; } /// /// 申请描述 /// diff --git a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppBusinessApplications/Output/AppBusinessApplicationListDto.cs b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppBusinessApplications/Output/AppBusinessApplicationListDto.cs index 58363bf..fa1f26d 100644 --- a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppBusinessApplications/Output/AppBusinessApplicationListDto.cs +++ b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppBusinessApplications/Output/AppBusinessApplicationListDto.cs @@ -75,16 +75,21 @@ namespace ATS.NonCustodial.Application.Contracts.Interfaces.Business.AppBusiness /// /// 活动开始时间段(年月日时分) /// - public DateTime ActiveTimePeriodBegin { get; set; } + public DateTime? ActiveTimePeriodBegin { get; set; } /// /// 活动结束时间段(年月日时分) /// - public DateTime ActiveTimePeriodEnd { get; set; } - + public DateTime? ActiveTimePeriodEnd { get; set; } + /// + /// 结束监管日期 + /// + public DateTime? EndSupervisionDate { get; set; } /// /// 申请描述 /// public string? ApplicationDescription { get; set; } + + } } \ No newline at end of file diff --git a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppCaseManagements/AppCaseManagement/Input/AppCaseManagementGetPageInput.cs b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppCaseManagements/AppCaseManagement/Input/AppCaseManagementGetPageInput.cs index 033e49b..48823ea 100644 --- a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppCaseManagements/AppCaseManagement/Input/AppCaseManagementGetPageInput.cs +++ b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/AppCaseManagements/AppCaseManagement/Input/AppCaseManagementGetPageInput.cs @@ -1,5 +1,7 @@ using ATS.NonCustodial.Domain.Shared.Enums; using ATS.NonCustodial.Shared.Common.Dtos; +using ATS.NonCustodial.Shared.Common.Dtos.Query; +using ATS.NonCustodial.Shared.Common.Enums; namespace ATS.NonCustodial.Application.Contracts.Interfaces.Business.AppCaseManagements.AppCaseManagement.Input { @@ -31,5 +33,8 @@ namespace ATS.NonCustodial.Application.Contracts.Interfaces.Business.AppCaseMana public long? CaseTypeId { get; set; } public List? CaseIds { get; set; } + + public CmShopTimeArraySearchDto? TimeArraySearch { get; set; } = new CmShopTimeArraySearchDto(); + } } \ No newline at end of file diff --git a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/Apps/Input/AppRemindPageInput.cs b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/Apps/Input/AppRemindPageInput.cs index 4ccccde..e217e0e 100644 --- a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/Apps/Input/AppRemindPageInput.cs +++ b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/Apps/Input/AppRemindPageInput.cs @@ -18,5 +18,10 @@ namespace ATS.NonCustodial.Application.Contracts.Interfaces.Business.Apps.Input /// /// public CheckStatusEnum? CheckStatus { get; set; } + /// + /// 提醒类型 + /// + public long? EarlyWarningTypeId { get; set; } + } } \ No newline at end of file diff --git a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/Apps/Output/AppRemindListDto.cs b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/Apps/Output/AppRemindListDto.cs index 5a74fc2..34c8020 100644 --- a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/Apps/Output/AppRemindListDto.cs +++ b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/Apps/Output/AppRemindListDto.cs @@ -60,6 +60,11 @@ namespace ATS.NonCustodial.Application.Contracts.Interfaces.Business.Apps.Output /// 案件名称 /// public string? CaseName { get; set; } + /// + /// 案件名称 + /// + public long? EarlyWarningTypeId { get; set; } + } diff --git a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/ViolationStatistics/Input/ViolationStatisticsPageInput.cs b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/ViolationStatistics/Input/ViolationStatisticsPageInput.cs index 2186421..4f5b94e 100644 --- a/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/ViolationStatistics/Input/ViolationStatisticsPageInput.cs +++ b/src/3.contracts/ATS.NonCustodial.Application.Contracts/Interfaces/Business/ViolationStatistics/Input/ViolationStatisticsPageInput.cs @@ -14,7 +14,10 @@ namespace ATS.NonCustodial.Application.Contracts.Interfaces.Business.ViolationSt /// 被监管人Id /// public long? SupervisedPersonId { get; set; } - + /// + /// 被监管人Id + /// + public string? SupervisedPersonName { get; set; } /// /// 案件Id ///