面板任务完成提交
parent
a17dc00ca8
commit
34dd484582
|
@ -976,6 +976,12 @@
|
|||
<param name="querySystemDocument"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.GetWaitSignSysDocList">
|
||||
<summary>
|
||||
获取需要签署的系统文档列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Services.TrialDocumentService">
|
||||
<summary>
|
||||
TrialDocumentService
|
||||
|
@ -1009,6 +1015,20 @@
|
|||
<param name="querySystemDocument"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetTrialUserSelect(System.Guid)">
|
||||
<summary>
|
||||
项目下面的参与用户下拉
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetTrialDocAndSystemDocType(System.Guid)">
|
||||
<summary>
|
||||
项目+系统的文档类型 下拉
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.DeleteTrialDocument(System.Guid,System.Guid)">
|
||||
<summary>
|
||||
已签名的文档 不允许删除
|
||||
|
@ -1471,6 +1491,26 @@
|
|||
映射配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetBasicStat">
|
||||
<summary>
|
||||
个人面板 统计值
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetSiteSurveyApprovalList(IRaCIS.Core.Application.Contracts.TrialSiteSurveyStatQuery)">
|
||||
<summary>
|
||||
Site 调研 每个项目 处理任务数
|
||||
</summary>
|
||||
<param name="query"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetTrialDocStatList(IRaCIS.Core.Application.Contracts.TrialSiteSurveyStatQuery)">
|
||||
<summary>
|
||||
需要签署数量
|
||||
</summary>
|
||||
<param name="query"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.GetSignText(System.String)">
|
||||
<summary>
|
||||
获取签名文本
|
||||
|
|
|
@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Hosting;
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using User = IRaCIS.Core.Domain.Models.User;
|
||||
|
||||
namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
|
@ -22,12 +23,12 @@ namespace IRaCIS.Core.Application.Services
|
|||
{
|
||||
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
private readonly IRepository<SystemDocument> systemDocumentRepository;
|
||||
private readonly IRepository<SystemDocument> _systemDocumentRepository;
|
||||
|
||||
public SystemDocumentService(IWebHostEnvironment hostEnvironment, IRepository<SystemDocument> systemDocumentRepository)
|
||||
{
|
||||
_hostEnvironment = hostEnvironment;
|
||||
this.systemDocumentRepository = systemDocumentRepository;
|
||||
_systemDocumentRepository = systemDocumentRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -36,9 +37,9 @@ namespace IRaCIS.Core.Application.Services
|
|||
/// <param name="querySystemDocument"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SystemDocumentView>> GetSystemDocumentListAsync(SystemDocumentQuery querySystemDocument)
|
||||
public async Task<PageOutput<SystemDocumentView>> GetSystemDocumentListAsync(SystemDocumentQuery querySystemDocument)
|
||||
{
|
||||
var systemDocumentQueryable = systemDocumentRepository
|
||||
var systemDocumentQueryable = _systemDocumentRepository
|
||||
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
||||
.WhereIf(!string.IsNullOrEmpty(querySystemDocument.Type), t => t.Type.Contains(querySystemDocument.Type))
|
||||
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
|
||||
|
@ -53,23 +54,23 @@ namespace IRaCIS.Core.Application.Services
|
|||
var entity = _mapper.Map<SystemDocument>(addOrEditSystemDocument);
|
||||
|
||||
|
||||
if (await systemDocumentRepository.AnyAsync(t => t.Type == addOrEditSystemDocument.Type && t.Name == addOrEditSystemDocument.Name))
|
||||
if (await _systemDocumentRepository.AnyAsync(t => t.Type == addOrEditSystemDocument.Type && t.Name == addOrEditSystemDocument.Name))
|
||||
{
|
||||
return ResponseOutput.NotOk("同类型已存在该文件名");
|
||||
}
|
||||
|
||||
await systemDocumentRepository.AddAsync(entity,true);
|
||||
await _systemDocumentRepository.AddAsync(entity, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var document = await systemDocumentRepository.Where(t => t.Id == addOrEditSystemDocument.Id, true).Include(t => t.NeedConfirmedUserTypeList).FirstOrDefaultAsync();
|
||||
var document = await _systemDocumentRepository.Where(t => t.Id == addOrEditSystemDocument.Id, true).Include(t => t.NeedConfirmedUserTypeList).FirstOrDefaultAsync();
|
||||
|
||||
if (document == null) return Null404NotFound(document);
|
||||
|
||||
if (await systemDocumentRepository.AnyAsync(t => t.Type == addOrEditSystemDocument.Type && t.Name == addOrEditSystemDocument.Name && t.Id != addOrEditSystemDocument.Id))
|
||||
if (await _systemDocumentRepository.AnyAsync(t => t.Type == addOrEditSystemDocument.Type && t.Name == addOrEditSystemDocument.Name && t.Id != addOrEditSystemDocument.Id))
|
||||
{
|
||||
return ResponseOutput.NotOk("同类型已存在该文件名");
|
||||
}
|
||||
|
@ -118,5 +119,49 @@ namespace IRaCIS.Core.Application.Services
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取需要签署的系统文档列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
public async Task<List<UnionDocumentWithConfirmInfoView>> GetWaitSignSysDocList()
|
||||
{
|
||||
|
||||
|
||||
var query = from sysDoc in _systemDocumentRepository.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
|
||||
join confirm in _repository.GetQueryable<SystemDocConfirmedUser>() on new { ConfirmUserId = _userInfo.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
|
||||
join user in _repository.GetQueryable<User>() on _userInfo.Id equals user.Id
|
||||
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
IsSystemDoc = true,
|
||||
|
||||
Id = sysDoc.Id,
|
||||
CreateTime = sysDoc.CreateTime,
|
||||
IsAbandon = sysDoc.IsAbandon,
|
||||
SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
|
||||
Name = sysDoc.Name,
|
||||
Path = sysDoc.Path,
|
||||
Type = sysDoc.Type,
|
||||
UpdateTime = sysDoc.UpdateTime,
|
||||
|
||||
FullFilePath = sysDoc.Path + "?access_token=" + _userInfo.UserToken,
|
||||
|
||||
ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = user.LastName + " / " + user.FirstName,
|
||||
UserName = user.UserName,
|
||||
UserTypeShortName = user.UserTypeRole.UserTypeShortName
|
||||
};
|
||||
|
||||
return await query.Where(t=>t.ConfirmTime==null).ToListAsync();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -361,7 +361,11 @@ namespace IRaCIS.Core.Application.Services
|
|||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 项目下面的参与用户下拉
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId)
|
||||
{
|
||||
|
@ -371,13 +375,17 @@ namespace IRaCIS.Core.Application.Services
|
|||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 项目+系统的文档类型 下拉
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<List<string>> GetTrialDocAndSystemDocType(Guid trialId)
|
||||
{
|
||||
return await _trialDocumentRepository.Where(t => t.TrialId == trialId).Select(t => t.Type).Union(_repository.GetQueryable<SystemDocument>().Select(t => t.Type)).Distinct()
|
||||
|
||||
.ToListAsync();
|
||||
return await _trialDocumentRepository.Where(t => t.TrialId == trialId).Select(t => t.Type)
|
||||
.Union(_repository.GetQueryable<SystemDocument>().Select(t => t.Type)).Distinct()
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument)
|
||||
|
@ -565,6 +573,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
/// <param name="trialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{trialId:guid}")]
|
||||
[Obsolete]
|
||||
public List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId)
|
||||
{
|
||||
var query = _repository.Where<TrialUser>(t => t.TrialId == trialId)
|
||||
|
@ -593,6 +602,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
/// <param name="querySystemDocument"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Obsolete]
|
||||
public PageOutput<DocumentUnionWithUserStatView> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument)
|
||||
{
|
||||
var systemDocumentQueryable = _repository
|
||||
|
|
|
@ -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())
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue