修复 项目创建人Pm和添加的外部人员,没有显示加入日期。

修改  面板统计 过滤条件
Uat_Study
hang 2022-04-13 11:48:04 +08:00
parent fabe70c057
commit 463d27f6b0
6 changed files with 29 additions and 9 deletions

View File

@ -45,6 +45,8 @@ namespace IRaCIS.Application.Contracts
public class TrialMaintenanceDTO : UserTrialCommand
{
[JsonIgnore]
public int No { get; set; }
//For MiniExcel ExcelFormat
public string State => IsDeleted ? "退出" : "加入";
@ -110,6 +112,9 @@ namespace IRaCIS.Application.Contracts
}
public class SiteUserExportDTO : UserTrialDTO
{
[JsonIgnore]
public int No { get; set; }
public string TrialSiteCode { get; set; } = String.Empty;
public string TrialSiteAliasName { get; set; } = String.Empty;
}
@ -124,6 +129,9 @@ namespace IRaCIS.Application.Contracts
public class TrialSiteUserSummaryDto: TrialSiteUserSurveyView
{
[JsonIgnore]
public int No { get; set; }
public string TrialSiteCode { get; set; } = String.Empty;
public string TrialSiteAliasName { get; set; } = String.Empty;

View File

@ -72,12 +72,12 @@ namespace IRaCIS.Core.Application
.SelectMany(t => t.SystemDocConfirmedUserList)
.CountAsync(t => t.ConfirmUserId == _userInfo.Id),
TotalApprovalRequiredCount= _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
? 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()
: _trialRepository.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)).SelectMany(t => t.TrialSiteSurveyList).Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).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
};
}
@ -92,7 +92,11 @@ namespace IRaCIS.Core.Application
public async Task<PageOutput<TrialSiteSurveyStat>> GetSiteSurveyApprovalList(TrialSiteSurveyStatQuery query)
{
return await _trialRepository.ProjectTo<TrialSiteSurveyStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id })
return 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)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() > 0)
.ProjectTo<TrialSiteSurveyStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id })
.OrderByDescending(t=>t.ApprovalRequiredCount).ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField, query.Asc);
}

View File

@ -316,7 +316,7 @@ namespace IRaCIS.Core.Application.Service
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId))
{
await _trialUserRepository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId });
await _trialUserRepository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
}
@ -482,7 +482,7 @@ namespace IRaCIS.Core.Application.Service
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId))
{
await _trialUserRepository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId });
await _trialUserRepository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId,JoinTime = DateTime.Now });
await _trialSiteUserRepository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId });

View File

@ -47,6 +47,8 @@ namespace IRaCIS.Application.Services
t => (t.User.LastName + " / " + t.User.FirstName).Contains(param.UserRealName))
.ProjectTo<TrialMaintenanceDTO>(_mapper.ConfigurationProvider).ToListAsync();
var no = 1;
exportInfo.TrialUserList.ForEach(t => t.No = no++);
return await ExcelExportHelper.DataExportAsync(StaticData.TrialUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment);

View File

@ -173,7 +173,7 @@ namespace IRaCIS.Application.Services
//如果是PM 则需要将该人员添加到 运维人员表
//添加运维人员PM
await _repository.AddAsync(new TrialUser() { TrialId = trial.Id, UserId = _userInfo.Id });
await _repository.AddAsync(new TrialUser() { TrialId = trial.Id, UserId = _userInfo.Id ,JoinTime = DateTime.Now});
// 添加扩展信息表记录
await _repository.AddAsync(new TrialPaymentPrice() { TrialId = trial.Id });

View File

@ -58,6 +58,9 @@ namespace IRaCIS.Core.Application.Services
.ProjectTo<SiteUserExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
var no = 1;
exportInfo.TrialSiteUserList.ForEach(t => t.No = no++);
return await ExcelExportHelper.DataExportAsync(StaticData.TrialSiteUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment);
}
@ -102,10 +105,13 @@ namespace IRaCIS.Core.Application.Services
data.TrialSiteUserList = await query.ToListAsync();
var exportInfo = data;
//处理翻译
var no = 1;
exportInfo.TrialSiteUserList.ForEach(t => t.No = no++);
return await ExcelExportHelper.DataExportAsync(StaticData.TrialSiteUserSummary_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment);