Browse Source

[MODIFY]查询修改

dev-zzj
zhaozhenjing 1 month ago
parent
commit
d45a891f41
  1. 63
      src/2.services/ATS.NonCustodial.Application/Impl/Business/AppViolationStatisticsService.cs
  2. 19
      src/2.services/ATS.NonCustodial.Application/Impl/Business/CaseManagements/AppCaseManagementService.cs

63
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

19
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<AppUser, long> _appUserRepository;
private readonly IEfRepository<AppDeviceManagement, long> _appDeviceManagementRepository;
private readonly IEfRepository<AppUser, long> _appuserRepository;
private readonly IEfRepository<AppEarlyWarningViewStatistics, long> _appEarlyWarningViewStatisticsRepository;
/// <summary>
///
@ -89,6 +91,7 @@ namespace ATS.NonCustodial.Application.Impl.Business.CaseManagements
IEfRepository<AppCommonFence, long> appCommonFenceRepository,
IEfRepository<AppUser, long> appUserRepository,
IEfRepository<AppSupervisedPersonRealTimeLocation, long> appSupervisedPersonRealTimeLocationRepository,
IEfRepository<AppEarlyWarningViewStatistics, long> appEarlyWarningViewStatisticsRepository,
IEfRepository<AppDeviceManagement, long> 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();

Loading…
Cancel
Save