From 881a5320a82a597d288c8b565e1c9f5db759edb6 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 11 Mar 2024 15:56:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=9F=E5=BC=83=E4=B9=8B=E5=89=8D=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 6 - .../DTO/PersonalWorkstationViewModel.cs | 2 + .../TrialSiteUser/PersonalWorkstation.cs | 128 +++++++++--------- 3 files changed, 68 insertions(+), 68 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 6aa47444b..0d7a78a4b 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -11902,12 +11902,6 @@ 映射配置 - - - 个人面板 统计值 - - - 中心调研 每个项目 需要处理的审批统计 diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs index caab944e3..abe0dd5c7 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs @@ -386,6 +386,8 @@ namespace IRaCIS.Core.Application.Contracts public int? TrialSignedDocCount { get; set; } public int? SysSignedDocCount { get; set; } + public int? SysNoticeUnReadCount { get; set; } + #region PM/APM public int? PM_SiteSurveryCount { get; set; } public int? PM_CheckCount { get; set; } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index cfa8fdc26..9f4c79733 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -42,82 +42,82 @@ namespace IRaCIS.Core.Application _systemNoticeRepository = systemNoticeRepository; } - /// - /// 个人面板 统计值 - /// - /// - public async Task GetBasicStat() - { + ///// + ///// 个人面板 统计值 + ///// + ///// + //public async Task GetBasicStat() + //{ - return new PersonalStataDTO() - { - //正参与的数量 - TrialCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin - ? await _trialRepository.CountAsync() - : await _trialUserRepository.Where(t => t.UserId == _userInfo.Id && t.Trial.IsDeleted == false).CountAsync(), + // return new PersonalStataDTO() + // { + // //正参与的数量 + // TrialCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + // ? await _trialRepository.CountAsync() + // : await _trialUserRepository.Where(t => t.UserId == _userInfo.Id && t.Trial.IsDeleted == false).CountAsync(), - DeletedCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin - ? await _trialRepository.AsQueryable(true).CountAsync(t => t.IsDeleted) - : await _trialUserRepository.AsQueryable(true).Where(t => t.UserId == _userInfo.Id && t.Trial.IsDeleted) - .CountAsync(), + // DeletedCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + // ? await _trialRepository.AsQueryable(true).CountAsync(t => t.IsDeleted) + // : await _trialUserRepository.AsQueryable(true).Where(t => t.UserId == _userInfo.Id && t.Trial.IsDeleted) + // .CountAsync(), - TotalNeedSignTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin - ? 0 - : await _trialDocumentRepository.AsQueryable(true).Where(t => t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped) - .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) - .Where(t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null))) + // TotalNeedSignTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + // ? 0 + // : await _trialDocumentRepository.AsQueryable(true).Where(t => t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped) + // .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + // .Where(t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null))) - .SelectMany(t => t.NeedConfirmedUserTypeList) - .CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId), + // .SelectMany(t => t.NeedConfirmedUserTypeList) + // .CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId), - HaveSignedTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin - ? 0 - //废除了 已经签署了也要算进去 - : await _trialDocumentRepository.AsQueryable(true).Where(t => t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped) - .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) - .Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) - .SelectMany(t => t.TrialDocConfirmedUserList) - .CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null), + // HaveSignedTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + // ? 0 + // //废除了 已经签署了也要算进去 + // : await _trialDocumentRepository.AsQueryable(true).Where(t => t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped) + // .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + // .Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) + // .SelectMany(t => t.TrialDocConfirmedUserList) + // .CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null), - TotalNeedSignSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin - ? 0 - : await _systemDocumentRepository - .Where(t => t.IsDeleted == false || (t.IsDeleted == true && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null))) - .SelectMany(t => t.NeedConfirmedUserTypeList) - .CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId), + // TotalNeedSignSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + // ? 0 + // : await _systemDocumentRepository + // .Where(t => t.IsDeleted == false || (t.IsDeleted == true && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null))) + // .SelectMany(t => t.NeedConfirmedUserTypeList) + // .CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId), - HaveSignedSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin - ? 0 - : await _systemDocumentRepository - .Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) - .SelectMany(t => t.SystemDocConfirmedUserList) - .CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null), + // HaveSignedSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + // ? 0 + // : await _systemDocumentRepository + // .Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) + // .SelectMany(t => t.SystemDocConfirmedUserList) + // .CountAsync(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null), - TotalApprovalRequiredCount = - _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM ? - _trialRepository.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)).SelectMany(t => t.TrialSiteSurveyList).Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() - : _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM - ? _trialRepository.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)).SelectMany(t => t.TrialSiteSurveyList).Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count() - : 0, + // TotalApprovalRequiredCount = + // _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM ? + // _trialRepository.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)).SelectMany(t => t.TrialSiteSurveyList).Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() + // : _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM + // ? _trialRepository.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)).SelectMany(t => t.TrialSiteSurveyList).Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count() + // : 0, - TotalSystemNoticeCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin - ? 0 : await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished) + // TotalSystemNoticeCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + // ? 0 : await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished) - .CountAsync(), + // .CountAsync(), - NeedReadSystemNoticeCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin - ? 0 : await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished - && !t.NoticeUserReadList.Any(t => t.CreateUserId == _userInfo.Id)) - .Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > DateTime.Now) - .CountAsync(), + // NeedReadSystemNoticeCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin + // ? 0 : await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished + // && !t.NoticeUserReadList.Any(t => t.CreateUserId == _userInfo.Id)) + // .Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > DateTime.Now) + // .CountAsync(), - }; + // }; - } + //} /// @@ -1222,7 +1222,6 @@ namespace IRaCIS.Core.Application .CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId); - var siteSurveyCount = await _trialRepository .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() > 0) @@ -1262,9 +1261,14 @@ namespace IRaCIS.Core.Application TrialSignedDocCount=signedTrialCount, SysSignedDocCount=signedSysDocCont, - #region PM + SysNoticeUnReadCount= await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished + && !t.NoticeUserReadList.Any(t => t.CreateUserId == _userInfo.Id)) + .Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > DateTime.Now) + .CountAsync(), - PM_SiteSurveryCount = isPM ? siteSurveyCount : 0, + #region PM + + PM_SiteSurveryCount = isPM ? siteSurveyCount : 0, PM_CheckCount = isPM ? await _trialRepository .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))