面板任务完成提交
This commit is contained in:
@@ -55,6 +55,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public class DocSignStat : TrialSelectDTO
|
||||
{
|
||||
|
||||
public bool IsSystemDoc { get; set; } = false;
|
||||
|
||||
public int? WaitSignCount { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace IRaCIS.Core.Application
|
||||
private readonly IRepository<TrialDocument> _trialDocumentRepository;
|
||||
private readonly IRepository<SystemDocument> _systemDocumentRepository;
|
||||
|
||||
public PersonalWorkstation(IRepository<Trial> trialRepository, IRepository<TrialUser> trialUserRepository, IRepository<TrialDocument> trialDocumentRepository,IRepository<SystemDocument> systemDocumentRepository)
|
||||
public PersonalWorkstation(IRepository<Trial> trialRepository, IRepository<TrialUser> trialUserRepository, IRepository<TrialDocument> trialDocumentRepository, IRepository<SystemDocument> systemDocumentRepository)
|
||||
{
|
||||
_trialRepository = trialRepository;
|
||||
_trialUserRepository = trialUserRepository;
|
||||
@@ -20,11 +20,13 @@ namespace IRaCIS.Core.Application
|
||||
_systemDocumentRepository = systemDocumentRepository;
|
||||
}
|
||||
|
||||
|
||||
public async Task<PersonalStataDTO> GetBasicStat()
|
||||
/// <summary>
|
||||
/// 个人面板 统计值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<PersonalStataDTO> GetBasicStat()
|
||||
{
|
||||
|
||||
|
||||
return new PersonalStataDTO()
|
||||
{
|
||||
//正参与的数量
|
||||
@@ -72,17 +74,55 @@ namespace IRaCIS.Core.Application
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Site 调研 每个项目 处理任务数
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialSiteSurveyStat>> GetSiteSurveyApprovalList(TrialSiteSurveyStatQuery query)
|
||||
{
|
||||
|
||||
return await _trialRepository.ProjectTo<TrialSiteSurveyStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id })
|
||||
.ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField, query.Asc);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 需要签署文件数量 系统级别的在第一行
|
||||
/// </summary>
|
||||
/// <param name="query"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<DocSignStat>> GetTrialDocStatList(TrialSiteSurveyStatQuery query)
|
||||
{
|
||||
var trialDocStat = await _trialRepository.ProjectTo<DocSignStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id, userTypeId = _userInfo.UserTypeId })
|
||||
.ToPagedListAsync(query.PageIndex, query.PageSize - 1, query.SortField, query.Asc);
|
||||
|
||||
|
||||
var sysDocStat = new DocSignStat()
|
||||
{
|
||||
IsSystemDoc = true,
|
||||
WaitSignCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
|
||||
? 0
|
||||
: await _systemDocumentRepository
|
||||
.Where(t =>
|
||||
t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) &&
|
||||
!t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id))
|
||||
.CountAsync()
|
||||
|
||||
};
|
||||
|
||||
var list = trialDocStat.CurrentPageData.ToList();
|
||||
|
||||
list.Insert(0,sysDocStat);
|
||||
|
||||
trialDocStat.CurrentPageData= list;
|
||||
return trialDocStat;
|
||||
|
||||
}
|
||||
|
||||
@@ -90,5 +130,6 @@ namespace IRaCIS.Core.Application
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +227,17 @@ namespace IRaCIS.Core.Application.Service
|
||||
u.MapFrom( c => userTypeEnumInt == (int)UserTypeEnum.SuperAdmin|| userTypeEnumInt == (int)UserTypeEnum.APM ?
|
||||
c.TrialSiteSurveyList.Where(t=> t.State==TrialSiteSurveyEnum.SPMApproved).Count()
|
||||
: c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count())
|
||||
);
|
||||
);
|
||||
|
||||
var userTypeId = Guid.Empty;
|
||||
CreateMap<Trial, DocSignStat>()
|
||||
.ForMember(t => t.WaitSignCount, u =>
|
||||
u.MapFrom(c => userTypeEnumInt == (int)UserTypeEnum.SuperAdmin ? 0
|
||||
|
||||
: c.TrialDocumentList.Where(t => t.NeedConfirmedUserTypeList.Any(t=>t.NeedConfirmUserTypeId== userTypeId) && !t.TrialDocConfirmedUserList.Any(t=>t.ConfirmUserId==userId)).Count())
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user