项目文档修改临时提交
parent
12fb19c47c
commit
a449013c5d
|
@ -16097,7 +16097,7 @@
|
||||||
SystemDocumentService
|
SystemDocumentService
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedUser},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||||
<summary>
|
<summary>
|
||||||
SystemDocumentService
|
SystemDocumentService
|
||||||
</summary>
|
</summary>
|
||||||
|
@ -16120,7 +16120,7 @@
|
||||||
TrialDocumentService
|
TrialDocumentService
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocConfirmedUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Contracts.ISystemDocumentService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocNeedConfirmedUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocNeedConfirmedUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocConfirmedUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Contracts.ISystemDocumentService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocNeedConfirmedUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocNeedConfirmedUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocConfirmedIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||||
<summary>
|
<summary>
|
||||||
TrialDocumentService
|
TrialDocumentService
|
||||||
</summary>
|
</summary>
|
||||||
|
@ -16197,20 +16197,6 @@
|
||||||
<param name="isSystemDoc"></param>
|
<param name="isSystemDoc"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetTrialUserDocumentList(System.Guid)">
|
|
||||||
<summary>
|
|
||||||
从项目下参与者的维度 先看人员列表(展示统计数字) 点击数字 再看人员具体签署的 系统文档+项目文档(共用上面与人相关的具体文档列表)
|
|
||||||
</summary>
|
|
||||||
<param name="trialId"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetTrialSystemDocumentList(IRaCIS.Core.Application.Contracts.DocumentTrialUnionQuery)">
|
|
||||||
<summary>
|
|
||||||
从 文档的维度 先看到文档列表(系统文档+项目文档 以及需要确认的人数 和已经确认人数) 点击数字查看某文档下面人确认情况
|
|
||||||
</summary>
|
|
||||||
<param name="inQuery"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.Application.Services.TrialRevenuesPriceVerificationService">
|
<member name="T:IRaCIS.Core.Application.Services.TrialRevenuesPriceVerificationService">
|
||||||
<summary>
|
<summary>
|
||||||
Financial---项目收入价格验证
|
Financial---项目收入价格验证
|
||||||
|
|
|
@ -35,9 +35,9 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
||||||
IRepository<StudyMonitor> _studyMonitorRepository,
|
IRepository<StudyMonitor> _studyMonitorRepository,
|
||||||
IRepository<CommonDocument> _commonDocumentRepository,
|
IRepository<CommonDocument> _commonDocumentRepository,
|
||||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository,
|
IRepository<SystemDocConfirmedIdentityUser> _systemDocConfirmedUserRepository,
|
||||||
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
||||||
IRepository<TrialDocConfirmedUser> _trialDocConfirmedUserRepository,
|
IRepository<TrialDocConfirmedIdentityUser> _trialDocConfirmedUserRepository,
|
||||||
IRepository<Subject> _subjectRepository,
|
IRepository<Subject> _subjectRepository,
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment) : BaseService
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment) : BaseService
|
||||||
{
|
{
|
||||||
|
|
|
@ -121,6 +121,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
#region 医生基本信息
|
#region 医生基本信息
|
||||||
CreateMap<Doctor, SelectionReviewerDTO>()
|
CreateMap<Doctor, SelectionReviewerDTO>()
|
||||||
.ForMember(d => d.DoctorUserName, u => u.MapFrom(t => t.UserRole.IdentityUser.UserName));
|
.ForMember(d => d.DoctorUserName, u => u.MapFrom(t => t.UserRole.IdentityUser.UserName));
|
||||||
|
|
||||||
|
|
||||||
CreateMap<Doctor, DoctorDTO>().IncludeMembers(t => t.Hospital).Include<Doctor, SelectionReviewerDTO>()
|
CreateMap<Doctor, DoctorDTO>().IncludeMembers(t => t.Hospital).Include<Doctor, SelectionReviewerDTO>()
|
||||||
.ForMember(d => d.AccountUserName, u => u.MapFrom(s => s.EnrollList.Where(t => t.DoctorUserId != null).Select(c => c.DoctorUser.UserName).FirstOrDefault()))
|
.ForMember(d => d.AccountUserName, u => u.MapFrom(s => s.EnrollList.Where(t => t.DoctorUserId != null).Select(c => c.DoctorUser.UserName).FirstOrDefault()))
|
||||||
.ForMember(d => d.Department, u => u.MapFrom(s => s.Department.Value))
|
.ForMember(d => d.Department, u => u.MapFrom(s => s.Department.Value))
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// 生成时间 2022-01-05 09:17:10
|
// 生成时间 2022-01-05 09:17:10
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Contracts
|
namespace IRaCIS.Core.Application.Contracts
|
||||||
|
@ -38,6 +39,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public string ExperimentName { get; set; }
|
public string ExperimentName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,8 +58,21 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public string RealName { get; set; } = string.Empty;
|
public string RealName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
public Guid UserTypeId { get; set; }
|
//[JsonIgnore]
|
||||||
public string UserTypeShortName { get; set; } = string.Empty;
|
//public string IdentityUserTypes { get; set; }
|
||||||
|
|
||||||
|
//[JsonIgnore]
|
||||||
|
//public string DocNeedSignUserTypes { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public List<string> UserConfirmedUserTypeList => IdentityUserTypeList.Intersect(DocNeedSignUserTypeList).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public IEnumerable<string> IdentityUserTypeList { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
|
public IEnumerable<string> DocNeedSignUserTypeList { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId);
|
Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId);
|
||||||
|
|
||||||
|
|
||||||
Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument);
|
//Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument);
|
||||||
List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId);
|
//List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
[ApiExplorerSettings(GroupName = "Trial")]
|
[ApiExplorerSettings(GroupName = "Trial")]
|
||||||
public class SystemDocumentService(IRepository<SystemDocument> _systemDocumentRepository,
|
public class SystemDocumentService(IRepository<SystemDocument> _systemDocumentRepository,
|
||||||
IRepository<UserRole> _userRoleRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISystemDocumentService
|
IRepository<SystemDocConfirmedIdentityUser> _systemDocConfirmedUserRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISystemDocumentService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
|
|
||||||
await _systemDocumentRepository.UpdatePartialFromQueryAsync(systemDocumentId, u => new SystemDocument() { IsDeleted = true });
|
await _systemDocumentRepository.UpdatePartialFromQueryAsync(systemDocumentId, u => new SystemDocument() { IsDeleted = true });
|
||||||
|
|
||||||
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == systemDocumentId, x => new SystemDocConfirmedUser()
|
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == systemDocumentId, x => new SystemDocConfirmedIdentityUser()
|
||||||
{
|
{
|
||||||
IsDeleted = true
|
IsDeleted = true
|
||||||
});
|
});
|
||||||
|
@ -151,7 +151,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
//外部人员 只签署 文档类型枚举值有值的
|
//外部人员 只签署 文档类型枚举值有值的
|
||||||
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
|
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
|
||||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = _userInfo.UserRoleId, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = _userInfo.IdentityUserId, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
from confirm in cc.DefaultIfEmpty()
|
from confirm in cc.DefaultIfEmpty()
|
||||||
|
|
||||||
join user in _userRoleRepository.Where() on _userInfo.UserRoleId equals user.Id
|
join user in _userRoleRepository.Where() on _userInfo.UserRoleId equals user.Id
|
||||||
|
@ -175,8 +175,9 @@ namespace IRaCIS.Core.Application.Services
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = user.FullName,
|
RealName = user.FullName,
|
||||||
UserName = user.UserName,
|
UserName = user.UserName,
|
||||||
UserTypeId = user.UserTypeId,
|
|
||||||
UserTypeShortName = user.UserTypeRole.UserTypeShortName
|
//UserTypeId = user.UserTypeId,
|
||||||
|
//UserTypeShortName = user.UserTypeRole.UserTypeShortName
|
||||||
};
|
};
|
||||||
|
|
||||||
return await query.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
|
return await query.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
|
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Filter;
|
using IRaCIS.Core.Application.Filter;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Services
|
namespace IRaCIS.Core.Application.Services
|
||||||
{
|
{
|
||||||
|
@ -16,15 +18,15 @@ namespace IRaCIS.Core.Application.Services
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Trial")]
|
[ApiExplorerSettings(GroupName = "Trial")]
|
||||||
public class TrialDocumentService(IRepository<TrialDocument> _trialDocumentRepository,
|
public class TrialDocumentService(IRepository<TrialDocument> _trialDocumentRepository,
|
||||||
IRepository<TrialDocConfirmedUser> _trialDocUserTypeConfirmedUserRepository,
|
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
ISystemDocumentService _systemDocumentService,
|
ISystemDocumentService _systemDocumentService,
|
||||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository,
|
IRepository<SystemDocConfirmedIdentityUser> _systemDocConfirmedUserRepository,
|
||||||
IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository,
|
IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository,
|
||||||
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
||||||
IRepository<SystemDocument> _systemDocumentRepository,
|
IRepository<SystemDocument> _systemDocumentRepository,
|
||||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
IRepository<TrialIdentityUser> _trialIdentityUserRepository,
|
||||||
IRepository<TrialDocConfirmedUser> _trialDocConfirmedUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
|
IRepository<TrialDocConfirmedIdentityUser> _trialDocConfirmedUserRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialDocumentService
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialDocumentService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -57,9 +59,9 @@ namespace IRaCIS.Core.Application.Services
|
||||||
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
|
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
|
||||||
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
|
|
||||||
join trialUser in _trialUserRoleRepository.Where(t => t.UserId == _userInfo.UserRoleId) on trialDoc.TrialId equals trialUser.TrialId
|
join trialUser in _trialIdentityUserRepository.Where(t => t.IdentityUserId == _userInfo.IdentityUserId) on trialDoc.TrialId equals trialUser.TrialId
|
||||||
join confirm in _trialDocConfirmedUserRepository.Where() on
|
join confirm in _trialDocConfirmedUserRepository.Where() on
|
||||||
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
new { trialUser.IdentityUserId, TrialDocumentId = trialDoc.Id } equals new { IdentityUserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||||
|
|
||||||
from confirm in cc.DefaultIfEmpty()
|
from confirm in cc.DefaultIfEmpty()
|
||||||
select new TrialSignDocView()
|
select new TrialSignDocView()
|
||||||
|
@ -82,11 +84,12 @@ namespace IRaCIS.Core.Application.Services
|
||||||
//IsConfirmed = confirm.ConfirmTime != null,
|
//IsConfirmed = confirm.ConfirmTime != null,
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
RealName = trialUser.IdentityUser.FullName,
|
||||||
UserName = trialUser.UserRole.IdentityUser.UserName,
|
UserName = trialUser.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
|
||||||
|
|
||||||
|
IdentityUserTypeList = trialUser.TrialUserRoleList.Select(t => t.UserRole.UserTypeRole.UserTypeShortName).ToList(),
|
||||||
|
|
||||||
|
DocNeedSignUserTypeList = trialDoc.NeedConfirmedUserTypeList.Select(t => t.UserTypeRole.UserTypeShortName).ToList(),
|
||||||
};
|
};
|
||||||
|
|
||||||
trialDocQueryable = trialDocQueryable.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
trialDocQueryable = trialDocQueryable.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||||
|
@ -221,9 +224,9 @@ namespace IRaCIS.Core.Application.Services
|
||||||
//系统文档查询
|
//系统文档查询
|
||||||
var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId, ignoreQueryFilters: true)
|
var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId, ignoreQueryFilters: true)
|
||||||
.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||||
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.UserRoleId)))
|
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId)))
|
||||||
|
|
||||||
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.UserRoleId)
|
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserRole.IdentityUserId == _userInfo.IdentityUserId)
|
||||||
on needConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
on needConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmedUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmedUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
from confirm in cc.DefaultIfEmpty()
|
from confirm in cc.DefaultIfEmpty()
|
||||||
|
@ -248,16 +251,23 @@ namespace IRaCIS.Core.Application.Services
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.IdentityUser.UserName,
|
UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
|
||||||
|
|
||||||
|
IdentityUserTypeList = trialUser.TrialUser.TrialUserRoleList.Select(t => t.UserRole.UserTypeRole.UserTypeShortName),
|
||||||
|
|
||||||
|
//DocNeedSignUserTypeList = needConfirmedUserType.SystemDocument.NeedConfirmedUserTypeList.Select(t => t.UserTypeRole.UserTypeShortName).ToList(),
|
||||||
|
|
||||||
|
//UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
|
//UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
||||||
};
|
};
|
||||||
|
|
||||||
//项目文档查询
|
//项目文档查询
|
||||||
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId)
|
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId)
|
||||||
.WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
.WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.UserRoleId)))
|
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId)))
|
||||||
|
|
||||||
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.UserRoleId) on trialDoc.TrialId equals trialUser.TrialId
|
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserRole.IdentityUserId == _userInfo.IdentityUserId) on trialDoc.TrialId equals trialUser.TrialId
|
||||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||||
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||||
from confirm in cc.DefaultIfEmpty()
|
from confirm in cc.DefaultIfEmpty()
|
||||||
|
@ -280,17 +290,23 @@ namespace IRaCIS.Core.Application.Services
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.IdentityUser.UserName,
|
UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
|
||||||
|
|
||||||
|
//UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
|
//UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
||||||
|
|
||||||
|
|
||||||
|
IdentityUserTypeList = trialUser.TrialUser.TrialUserRoleList.Select(t => t.UserRole.UserTypeRole.UserTypeShortName).ToList(),
|
||||||
|
|
||||||
|
//DocNeedSignUserTypeList = trialDoc.NeedConfirmedUserTypeList.Select(t => t.UserTypeRole.UserTypeShortName).ToList(),
|
||||||
};
|
};
|
||||||
|
|
||||||
#region 报错 奇怪的bug
|
#region 报错 奇怪的bug
|
||||||
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
|
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)/*.Distinct()*/
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||||
.WhereIf(inQuery.IsSign == true, t => t.ConfirmTime != null)
|
.WhereIf(inQuery.IsSign == true, t => t.ConfirmTime != null)
|
||||||
.WhereIf(inQuery.IsSign == false, t => t.ConfirmTime == null);
|
.WhereIf(inQuery.IsSign == false, t => t.ConfirmTime == null)
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -322,12 +338,12 @@ namespace IRaCIS.Core.Application.Services
|
||||||
|
|
||||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||||
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.UserRoleId && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
.CountAsync();
|
.CountAsync();
|
||||||
|
|
||||||
|
|
||||||
var needSignSystemDocCount = await _systemDocumentRepository
|
var needSignSystemDocCount = await _systemDocumentRepository
|
||||||
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.UserRoleId && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
.CountAsync();
|
.CountAsync();
|
||||||
|
|
||||||
var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||||
|
@ -353,6 +369,120 @@ namespace IRaCIS.Core.Application.Services
|
||||||
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetDocumentConfirmList(DocumentTrialUnionQuery inQuery)
|
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetDocumentConfirmList(DocumentTrialUnionQuery inQuery)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#region 测试
|
||||||
|
|
||||||
|
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||||
|
|
||||||
|
var trialDocQuery = from trialDoc in _trialDocumentRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
|
.WhereIf(inQuery.UserTypeId != null, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId))
|
||||||
|
join trialUser in _trialIdentityUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
|
.WhereIf(inQuery.UserId != null, t => t.IdentityUserId == inQuery.UserId)
|
||||||
|
|
||||||
|
on trialDoc.TrialId equals trialUser.TrialId
|
||||||
|
|
||||||
|
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||||
|
new { trialUser.IdentityUserId, TrialDocumentId = trialDoc.Id } equals new { IdentityUserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||||
|
from confirm in cc.DefaultIfEmpty()
|
||||||
|
select new UnionDocumentWithConfirmInfoView()
|
||||||
|
{
|
||||||
|
IsSystemDoc = false,
|
||||||
|
|
||||||
|
Id = trialDoc.Id,
|
||||||
|
CreateTime = trialDoc.CreateTime,
|
||||||
|
IsDeleted = trialDoc.IsDeleted,
|
||||||
|
SignViewMinimumMinutes = trialDoc.SignViewMinimumMinutes,
|
||||||
|
Name = trialDoc.Name,
|
||||||
|
Path = trialDoc.Path,
|
||||||
|
FileTypeId = trialDoc.FileTypeId,
|
||||||
|
FileType = _userInfo.IsEn_Us ? trialDoc.FileType.Value : trialDoc.FileType.ValueCN,
|
||||||
|
UpdateTime = trialDoc.UpdateTime,
|
||||||
|
//IsConfirmed= confirm.ConfirmTime!=null,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
|
RealName = trialUser.IdentityUser.FullName,
|
||||||
|
UserName = trialUser.IdentityUser.UserName,
|
||||||
|
|
||||||
|
//UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
|
//UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
|
FullFilePath = trialDoc.Path
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//var result = from sysDoc in _systemDocumentRepository.AsQueryable()
|
||||||
|
// from trialUser in _trialIdentityUserRepository.AsQueryable() // 无条件笛卡尔积
|
||||||
|
|
||||||
|
|
||||||
|
// select new
|
||||||
|
// {
|
||||||
|
|
||||||
|
// Table2Id = sysDoc,
|
||||||
|
// };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//var systemDocQuery =
|
||||||
|
// from sysDoc in _systemDocumentRepository.AsQueryable()
|
||||||
|
// from trialUser in _trialIdentityUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
|
|
||||||
|
// join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.IdentityUserId, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
|
// //from confirm in cc.DefaultIfEmpty()
|
||||||
|
// select new UnionDocumentWithConfirmInfoView()
|
||||||
|
// {
|
||||||
|
// IsSystemDoc = true,
|
||||||
|
|
||||||
|
// Id = sysDoc.Id,
|
||||||
|
// CreateTime = sysDoc.CreateTime,
|
||||||
|
// IsDeleted = sysDoc.IsDeleted,
|
||||||
|
// SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
|
||||||
|
// Name = sysDoc.Name,
|
||||||
|
// Path = sysDoc.Path,
|
||||||
|
// FileType = _userInfo.IsEn_Us ? sysDoc.FileType.Value : sysDoc.FileType.ValueCN,
|
||||||
|
// FileTypeId = sysDoc.FileTypeId,
|
||||||
|
// UpdateTime = sysDoc.UpdateTime,
|
||||||
|
// //IsConfirmed = confirm.ConfirmTime != null,
|
||||||
|
|
||||||
|
// ConfirmUserId = confirm.ConfirmUserId,
|
||||||
|
// ConfirmTime = confirm.ConfirmTime,
|
||||||
|
|
||||||
|
// RealName = trialUser.IdentityUser.FullName,
|
||||||
|
// UserName = trialUser.IdentityUser.UserName,
|
||||||
|
|
||||||
|
// //UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
|
// //UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
|
// FullFilePath = sysDoc.Path
|
||||||
|
// };
|
||||||
|
|
||||||
|
//var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t => !(t.IsDeleted == true && t.ConfirmUserId == null))
|
||||||
|
// .WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||||
|
// .WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||||
|
// .WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
|
||||||
|
// .WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
|
||||||
|
// .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted);
|
||||||
|
|
||||||
|
var result = await trialDocQuery.ToPagedListAsync(inQuery);
|
||||||
|
|
||||||
|
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true)
|
||||||
|
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||||
|
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
|
.CountAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var needSignSystemDocCount = await _systemDocumentRepository
|
||||||
|
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
|
.CountAsync();
|
||||||
|
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region linq join 方式
|
#region linq join 方式
|
||||||
//var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocumentNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == querySystemDocument.TrialId)
|
//var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocumentNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == querySystemDocument.TrialId)
|
||||||
|
@ -387,100 +517,106 @@ namespace IRaCIS.Core.Application.Services
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
#region 废弃
|
||||||
|
//var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||||
|
|
||||||
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
//var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
||||||
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
// join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
// .WhereIf(inQuery.UserId != null, t => t.UserRole.IdentityUserId == inQuery.UserId)
|
||||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserRole.UserTypeId == inQuery.UserTypeId)
|
// .WhereIf(inQuery.UserTypeId != null, t => t.UserRole.UserTypeId == inQuery.UserTypeId)
|
||||||
on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
// on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||||
|
|
||||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
// join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||||
new { trialUser.UserId, TrialDocumentId = trialDocumentNeedConfirmedUserType.TrialDocumentId } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
// new { trialUser.UserRole.IdentityUserId, TrialDocumentId = trialDocumentNeedConfirmedUserType.TrialDocumentId } equals new { IdentityUserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||||
from confirm in cc.DefaultIfEmpty()
|
// from confirm in cc.DefaultIfEmpty()
|
||||||
select new UnionDocumentWithConfirmInfoView()
|
// select new UnionDocumentWithConfirmInfoView()
|
||||||
{
|
// {
|
||||||
IsSystemDoc = false,
|
// IsSystemDoc = false,
|
||||||
|
|
||||||
Id = trialDocumentNeedConfirmedUserType.TrialDocument.Id,
|
// Id = trialDocumentNeedConfirmedUserType.TrialDocument.Id,
|
||||||
CreateTime = trialDocumentNeedConfirmedUserType.TrialDocument.CreateTime,
|
// CreateTime = trialDocumentNeedConfirmedUserType.TrialDocument.CreateTime,
|
||||||
IsDeleted = trialDocumentNeedConfirmedUserType.TrialDocument.IsDeleted,
|
// IsDeleted = trialDocumentNeedConfirmedUserType.TrialDocument.IsDeleted,
|
||||||
SignViewMinimumMinutes = trialDocumentNeedConfirmedUserType.TrialDocument.SignViewMinimumMinutes,
|
// SignViewMinimumMinutes = trialDocumentNeedConfirmedUserType.TrialDocument.SignViewMinimumMinutes,
|
||||||
Name = trialDocumentNeedConfirmedUserType.TrialDocument.Name,
|
// Name = trialDocumentNeedConfirmedUserType.TrialDocument.Name,
|
||||||
Path = trialDocumentNeedConfirmedUserType.TrialDocument.Path,
|
// Path = trialDocumentNeedConfirmedUserType.TrialDocument.Path,
|
||||||
FileTypeId = trialDocumentNeedConfirmedUserType.TrialDocument.FileTypeId,
|
// FileTypeId = trialDocumentNeedConfirmedUserType.TrialDocument.FileTypeId,
|
||||||
FileType = _userInfo.IsEn_Us ? trialDocumentNeedConfirmedUserType.TrialDocument.FileType.Value : trialDocumentNeedConfirmedUserType.TrialDocument.FileType.ValueCN,
|
// FileType = _userInfo.IsEn_Us ? trialDocumentNeedConfirmedUserType.TrialDocument.FileType.Value : trialDocumentNeedConfirmedUserType.TrialDocument.FileType.ValueCN,
|
||||||
UpdateTime = trialDocumentNeedConfirmedUserType.TrialDocument.UpdateTime,
|
// UpdateTime = trialDocumentNeedConfirmedUserType.TrialDocument.UpdateTime,
|
||||||
//IsConfirmed= confirm.ConfirmTime!=null,
|
// //IsConfirmed= confirm.ConfirmTime!=null,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
// ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
// ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
// RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.IdentityUser.UserName,
|
// UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
|
||||||
|
|
||||||
FullFilePath = trialDocumentNeedConfirmedUserType.TrialDocument.Path
|
// //UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
};
|
// //UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
|
// FullFilePath = trialDocumentNeedConfirmedUserType.TrialDocument.Path
|
||||||
|
// };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var systemDocQuery = from needConfirmEdUserType in _systemDocNeedConfirmedUserTypeRepository.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
//var systemDocQuery = from needConfirmEdUserType in _systemDocNeedConfirmedUserTypeRepository.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||||
|
|
||||||
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
// join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
// .WhereIf(inQuery.UserId != null, t => t.UserRole.IdentityUserId == inQuery.UserId)
|
||||||
on needConfirmEdUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
// on needConfirmEdUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
// join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
from confirm in cc.DefaultIfEmpty()
|
// from confirm in cc.DefaultIfEmpty()
|
||||||
select new UnionDocumentWithConfirmInfoView()
|
// select new UnionDocumentWithConfirmInfoView()
|
||||||
{
|
// {
|
||||||
IsSystemDoc = true,
|
// IsSystemDoc = true,
|
||||||
|
|
||||||
Id = needConfirmEdUserType.SystemDocument.Id,
|
// Id = needConfirmEdUserType.SystemDocument.Id,
|
||||||
CreateTime = needConfirmEdUserType.SystemDocument.CreateTime,
|
// CreateTime = needConfirmEdUserType.SystemDocument.CreateTime,
|
||||||
IsDeleted = needConfirmEdUserType.SystemDocument.IsDeleted,
|
// IsDeleted = needConfirmEdUserType.SystemDocument.IsDeleted,
|
||||||
SignViewMinimumMinutes = needConfirmEdUserType.SystemDocument.SignViewMinimumMinutes,
|
// SignViewMinimumMinutes = needConfirmEdUserType.SystemDocument.SignViewMinimumMinutes,
|
||||||
Name = needConfirmEdUserType.SystemDocument.Name,
|
// Name = needConfirmEdUserType.SystemDocument.Name,
|
||||||
Path = needConfirmEdUserType.SystemDocument.Path,
|
// Path = needConfirmEdUserType.SystemDocument.Path,
|
||||||
FileType = _userInfo.IsEn_Us ? needConfirmEdUserType.SystemDocument.FileType.Value : needConfirmEdUserType.SystemDocument.FileType.ValueCN,
|
// FileType = _userInfo.IsEn_Us ? needConfirmEdUserType.SystemDocument.FileType.Value : needConfirmEdUserType.SystemDocument.FileType.ValueCN,
|
||||||
FileTypeId = needConfirmEdUserType.SystemDocument.FileTypeId,
|
// FileTypeId = needConfirmEdUserType.SystemDocument.FileTypeId,
|
||||||
UpdateTime = needConfirmEdUserType.SystemDocument.UpdateTime,
|
// UpdateTime = needConfirmEdUserType.SystemDocument.UpdateTime,
|
||||||
//IsConfirmed = confirm.ConfirmTime != null,
|
// //IsConfirmed = confirm.ConfirmTime != null,
|
||||||
|
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
// ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
// ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
// RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.IdentityUser.UserName,
|
// UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
|
||||||
|
|
||||||
FullFilePath = needConfirmEdUserType.SystemDocument.Path
|
// //UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
};
|
// //UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t => !(t.IsDeleted == true && t.ConfirmUserId == null))
|
// FullFilePath = needConfirmEdUserType.SystemDocument.Path
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
// };
|
||||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
|
||||||
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
|
|
||||||
.WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
|
|
||||||
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
|
||||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserTypeId == inQuery.UserTypeId);
|
|
||||||
|
|
||||||
var result = await unionQuery.ToPagedListAsync(inQuery);
|
//var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t => !(t.IsDeleted == true && t.ConfirmUserId == null))
|
||||||
|
// .WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||||
|
// .WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||||
|
// .WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
|
||||||
|
// .WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
|
||||||
|
// .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
||||||
|
// /*.Distinct()*/;
|
||||||
|
|
||||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true)
|
//var result = await unionQuery.ToPagedListAsync(inQuery);
|
||||||
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
|
||||||
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.UserRoleId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
//var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true)
|
||||||
.CountAsync();
|
// .Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||||
|
// .Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
|
// .CountAsync();
|
||||||
|
|
||||||
|
|
||||||
var needSignSystemDocCount = await _systemDocumentRepository
|
//var needSignSystemDocCount = await _systemDocumentRepository
|
||||||
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.UserRoleId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
// .Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
.CountAsync();
|
// .CountAsync();
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr });
|
//return ResponseOutput.Ok(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr });
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -492,8 +628,8 @@ namespace IRaCIS.Core.Application.Services
|
||||||
[HttpGet("{trialId:guid}")]
|
[HttpGet("{trialId:guid}")]
|
||||||
public async Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId)
|
public async Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId)
|
||||||
{
|
{
|
||||||
return await _trialUserRoleRepository.Where(t => t.TrialId == trialId)
|
return await _trialIdentityUserRepository.Where(t => t.TrialId == trialId)
|
||||||
.Select(t => new TrialUserDto() { UserId = t.UserId, RealName = t.UserRole.FullName, UserName = t.UserRole.IdentityUser.UserName })
|
.Select(t => new TrialUserDto() { UserId = t.IdentityUserId, RealName = t.IdentityUser.FullName, UserName = t.IdentityUser.UserName })
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,7 +649,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt", "AfterStopCannNotOpt")]
|
||||||
//[Authorize(Policy = IRaCISPolicy.PM)]
|
//[Authorize(Policy = IRaCISPolicy.PM)]
|
||||||
public async Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument)
|
public async Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument)
|
||||||
{
|
{
|
||||||
|
@ -585,7 +721,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpDelete("{trialId:guid}/{trialDocumentId:guid}")]
|
[HttpDelete("{trialId:guid}/{trialDocumentId:guid}")]
|
||||||
//[Authorize(Policy = IRaCISPolicy.PM)]
|
//[Authorize(Policy = IRaCISPolicy.PM)]
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt", "AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId)
|
public async Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId)
|
||||||
{
|
{
|
||||||
if (await _trialDocumentRepository.AsQueryable(true).Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any()))
|
if (await _trialDocumentRepository.AsQueryable(true).Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any()))
|
||||||
|
@ -616,7 +752,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
{
|
{
|
||||||
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.UserRoleId))
|
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.UserRoleId))
|
||||||
{
|
{
|
||||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.UserRoleId, SignFirstViewTime = DateTime.Now });
|
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedIdentityUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.UserRoleId, SignFirstViewTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,10 +760,10 @@ namespace IRaCIS.Core.Application.Services
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!await _trialDocUserTypeConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.UserRoleId))
|
if (!await _trialDocConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.UserRoleId))
|
||||||
{
|
{
|
||||||
|
|
||||||
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.UserRoleId, SignFirstViewTime = DateTime.Now });
|
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedIdentityUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.UserRoleId, SignFirstViewTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,7 +780,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
{
|
{
|
||||||
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.UserRoleId))
|
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.UserRoleId))
|
||||||
{
|
{
|
||||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.UserRoleId, SignFirstViewTime = DateTime.Now });
|
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedIdentityUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.UserRoleId, SignFirstViewTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -656,10 +792,10 @@ namespace IRaCIS.Core.Application.Services
|
||||||
[HttpPut("{trialId:guid}/{documentId:guid}")]
|
[HttpPut("{trialId:guid}/{documentId:guid}")]
|
||||||
public async Task<IResponseOutput> SetTrialDocFirstViewTime(Guid documentId)
|
public async Task<IResponseOutput> SetTrialDocFirstViewTime(Guid documentId)
|
||||||
{
|
{
|
||||||
if (!await _trialDocUserTypeConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.UserRoleId))
|
if (!await _trialDocConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.IdentityUserId))
|
||||||
{
|
{
|
||||||
|
|
||||||
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.UserRoleId, SignFirstViewTime = DateTime.Now });
|
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedIdentityUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.UserRoleId, SignFirstViewTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
var success = await _trialDocConfirmedUserRepository.SaveChangesAsync();
|
var success = await _trialDocConfirmedUserRepository.SaveChangesAsync();
|
||||||
|
@ -671,7 +807,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
/// 用户 签名某个文档 可能是系统的,也可能是项目的
|
/// 用户 签名某个文档 可能是系统的,也可能是项目的
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt", "AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> UserConfirm(UserConfirmCommand userConfirmCommand)
|
public async Task<IResponseOutput> UserConfirm(UserConfirmCommand userConfirmCommand)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -705,7 +841,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
var trialDocConfirm = await _trialDocUserTypeConfirmedUserRepository.FirstOrDefaultAsync(t => t.TrialDocumentId == userConfirmCommand.DocumentId && t.ConfirmUserId == _userInfo.UserRoleId, true);
|
var trialDocConfirm = await _trialDocConfirmedUserRepository.FirstOrDefaultAsync(t => t.TrialDocumentId == userConfirmCommand.DocumentId && t.ConfirmUserId == _userInfo.IdentityUserId, true);
|
||||||
|
|
||||||
if (trialDocConfirm.ConfirmTime != null)
|
if (trialDocConfirm.ConfirmTime != null)
|
||||||
{
|
{
|
||||||
|
@ -722,7 +858,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
trialDocConfirm.ConfirmTime = DateTime.Now;
|
trialDocConfirm.ConfirmTime = DateTime.Now;
|
||||||
trialDocConfirm.SignText = userConfirmCommand.SignText;
|
trialDocConfirm.SignText = userConfirmCommand.SignText;
|
||||||
|
|
||||||
await _trialDocUserTypeConfirmedUserRepository.SaveChangesAsync();
|
await _trialDocConfirmedUserRepository.SaveChangesAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -738,13 +874,13 @@ namespace IRaCIS.Core.Application.Services
|
||||||
/// <param name="isSystemDoc"></param>
|
/// <param name="isSystemDoc"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPut("{documentId:guid}/{isSystemDoc:bool}")]
|
[HttpPut("{documentId:guid}/{isSystemDoc:bool}")]
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt", "SignSystemDocNoTrialId" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt", "AfterStopCannNotOpt", "SignSystemDocNoTrialId")]
|
||||||
public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc)
|
public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc)
|
||||||
{
|
{
|
||||||
if (isSystemDoc)
|
if (isSystemDoc)
|
||||||
{
|
{
|
||||||
await _systemDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new SystemDocument() { IsDeleted = true });
|
await _systemDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new SystemDocument() { IsDeleted = true });
|
||||||
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == documentId, x => new SystemDocConfirmedUser()
|
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == documentId, x => new SystemDocConfirmedIdentityUser()
|
||||||
{
|
{
|
||||||
IsDeleted = true
|
IsDeleted = true
|
||||||
});
|
});
|
||||||
|
@ -752,7 +888,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _trialDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new TrialDocument() { IsDeleted = true });
|
await _trialDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new TrialDocument() { IsDeleted = true });
|
||||||
await _trialDocUserTypeConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.TrialDocumentId == documentId, x => new TrialDocConfirmedUser()
|
await _trialDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.TrialDocumentId == documentId, x => new TrialDocConfirmedIdentityUser()
|
||||||
{
|
{
|
||||||
IsDeleted = true
|
IsDeleted = true
|
||||||
});
|
});
|
||||||
|
@ -762,93 +898,8 @@ namespace IRaCIS.Core.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 废弃
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 从项目下参与者的维度 先看人员列表(展示统计数字) 点击数字 再看人员具体签署的 系统文档+项目文档(共用上面与人相关的具体文档列表)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="trialId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("{trialId:guid}")]
|
|
||||||
[Obsolete]
|
|
||||||
public List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId)
|
|
||||||
{
|
|
||||||
var query = _trialUserRoleRepository.Where(t => t.TrialId == trialId)
|
|
||||||
.Select(t => new TrialUserUnionDocumentView()
|
|
||||||
{
|
|
||||||
UserId = t.UserId,
|
|
||||||
UserName = t.UserRole.IdentityUser.UserName,
|
|
||||||
RealName = t.UserRole.FullName,
|
|
||||||
UserTypeShortName = t.UserRole.UserTypeRole.UserTypeShortName,
|
|
||||||
TrialDocumentCount = t.Trial.TrialDocumentList.Count(u => u.NeedConfirmedUserTypeList.Any(k => k.NeedConfirmUserTypeId == t.UserRole.UserTypeId)),
|
|
||||||
TrialDocumentConfirmedCount = t.Trial.TrialDocumentList.SelectMany(u => u.TrialDocConfirmedUserList).Count(k => k.ConfirmUserId == t.UserId),
|
|
||||||
SystemDocumentConfirmedCount = t.UserRole.SystemDocConfirmedList.Count(),
|
|
||||||
//这样写不行
|
|
||||||
//SystemDocumentCount = _systemDocumentRepository.Where(s => s.NeedConfirmedUserTypeList.Any(kk => kk.NeedConfirmUserTypeId == t.User.UserTypeId))
|
|
||||||
// .WhereIf(!_userInfo.IsAdmin, s => s.IsAbandon == false || (s.IsAbandon == true && s.SystemDocConfirmedUserList.Any(uu => uu.ConfirmUserId == t.UserId))).Count()
|
|
||||||
SystemDocumentCount = t.UserRole.UserTypeRole.SystemDocNeedConfirmedUserTypeList.Where(cc => cc.NeedConfirmUserTypeId == t.UserRole.UserTypeId).Select(y => y.SystemDocument).Count()
|
|
||||||
});
|
|
||||||
|
|
||||||
return query.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 从 文档的维度 先看到文档列表(系统文档+项目文档 以及需要确认的人数 和已经确认人数) 点击数字查看某文档下面人确认情况
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inQuery"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
[Obsolete]
|
|
||||||
public async Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery inQuery)
|
|
||||||
{
|
|
||||||
var systemDocumentQueryable = _systemDocumentRepository
|
|
||||||
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false)
|
|
||||||
.Select(t => new DocumentUnionWithUserStatView()
|
|
||||||
{
|
|
||||||
Id = t.Id,
|
|
||||||
IsSystemDoc = true,
|
|
||||||
CreateTime = t.CreateTime,
|
|
||||||
FullFilePath = t.Path,
|
|
||||||
IsDeleted = t.IsDeleted,
|
|
||||||
Name = t.Name,
|
|
||||||
Path = t.Path,
|
|
||||||
FileType = t.FileType.Value,
|
|
||||||
UpdateTime = t.UpdateTime,
|
|
||||||
SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
|
||||||
DocumentConfirmedUserCount = t.SystemDocConfirmedUserList.Count(),
|
|
||||||
|
|
||||||
//DocumentUserCount= _trialUserRoleRepository.Where(tu=>tu.TrialId== querySystemDocument.TrialId).Count(u=>t.NeedConfirmedUserTypeList.Any(cc=>cc.NeedConfirmUserTypeId== u.User.UserTypeId ))
|
|
||||||
DocumentUserCount = t.NeedConfirmedUserTypeList.SelectMany(u => u.UserTypeRole.UserList.SelectMany(b => b.UserRoleTrials.Where(r => r.TrialId == inQuery.TrialId))).Count()
|
|
||||||
});
|
|
||||||
|
|
||||||
var trialDocQueryable = _trialDocumentRepository.Where(t => t.TrialId == inQuery.TrialId).Select(t => new DocumentUnionWithUserStatView()
|
|
||||||
{
|
|
||||||
Id = t.Id,
|
|
||||||
IsSystemDoc = false,
|
|
||||||
CreateTime = t.CreateTime,
|
|
||||||
FullFilePath = t.Path,
|
|
||||||
IsDeleted = t.IsDeleted,
|
|
||||||
Name = t.Name,
|
|
||||||
Path = t.Path,
|
|
||||||
FileType = t.FileType.Value,
|
|
||||||
UpdateTime = t.UpdateTime,
|
|
||||||
SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
|
||||||
|
|
||||||
DocumentConfirmedUserCount = t.TrialDocConfirmedUserList.Count(),
|
|
||||||
DocumentUserCount = t.Trial.TrialUserRoleList.Count(cc => t.NeedConfirmedUserTypeList.Any(k => k.NeedConfirmUserTypeId == cc.UserRole.UserTypeId))
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
|
||||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId);
|
|
||||||
|
|
||||||
return await unionQuery.ToPagedListAsync(inQuery);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
// .ForMember(t => t.UserConfirmInfo, c => c.MapFrom(t => t.TrialDocConfirmedUserList.Where(u => u.ConfirmUserId == userId).FirstOrDefault()))
|
// .ForMember(t => t.UserConfirmInfo, c => c.MapFrom(t => t.TrialDocConfirmedUserList.Where(u => u.ConfirmUserId == userId).FirstOrDefault()))
|
||||||
// .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token)); ;
|
// .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token)); ;
|
||||||
|
|
||||||
CreateMap<TrialDocConfirmedUser, TrialDocumentUserConfirmView>()
|
CreateMap<TrialDocConfirmedIdentityUser, TrialDocumentUserConfirmView>()
|
||||||
.ForMember(d => d.UserName, c => c.MapFrom(t => t.User.UserName))
|
.ForMember(d => d.UserName, c => c.MapFrom(t => t.User.UserName))
|
||||||
.ForMember(d => d.RealName, c => c.MapFrom(t => t.User.FullName));
|
.ForMember(d => d.RealName, c => c.MapFrom(t => t.User.FullName));
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return await query.ToPagedListAsync(inQuery);
|
return await query.ToPagedListAsync(inQuery,nameof(TrialUserRoleScreeningDto.EMail));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -527,7 +527,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
await _repository.BatchDeleteNoTrackingAsync<TrialCriterionDictionaryCode>(t => t.TrialReadingCriterion.TrialId == trialId);
|
await _repository.BatchDeleteNoTrackingAsync<TrialCriterionDictionaryCode>(t => t.TrialReadingCriterion.TrialId == trialId);
|
||||||
await _repository.BatchDeleteNoTrackingAsync<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId);
|
await _repository.BatchDeleteNoTrackingAsync<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId);
|
||||||
await _trialDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.TrialId == trialId);
|
await _trialDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.TrialId == trialId);
|
||||||
await _repository.BatchDeleteNoTrackingAsync<TrialDocConfirmedUser>(t => t.TrialDocument.TrialId == trialId);
|
await _repository.BatchDeleteNoTrackingAsync<TrialDocConfirmedIdentityUser>(t => t.TrialDocument.TrialId == trialId);
|
||||||
|
|
||||||
await _repository.BatchDeleteNoTrackingAsync<TrialDocument>(t => t.TrialId == trialId);
|
await _repository.BatchDeleteNoTrackingAsync<TrialDocument>(t => t.TrialId == trialId);
|
||||||
await _repository.BatchDeleteNoTrackingAsync<TrialDocNeedConfirmedUserType>(t => t.TrialDocument.TrialId == trialId);
|
await _repository.BatchDeleteNoTrackingAsync<TrialDocNeedConfirmedUserType>(t => t.TrialDocument.TrialId == trialId);
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IRepository<TrialClinicalDataSetCriterion> _trialClinicalDataSetCriterionRepository,
|
IRepository<TrialClinicalDataSetCriterion> _trialClinicalDataSetCriterionRepository,
|
||||||
IRepository<DicomInstance> _dicomInstanceRepository,
|
IRepository<DicomInstance> _dicomInstanceRepository,
|
||||||
IRepository<Internationalization> _internationalizationRepository,
|
IRepository<Internationalization> _internationalizationRepository,
|
||||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository,
|
IRepository<SystemDocConfirmedIdentityUser> _systemDocConfirmedUserRepository,
|
||||||
IRepository<DicomStudy> _dicomStudyRepository,
|
IRepository<DicomStudy> _dicomStudyRepository,
|
||||||
IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository,
|
IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
|
@ -365,8 +365,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = confirm.ConfirmUser.FullName,
|
RealName = confirm.ConfirmUser.FullName,
|
||||||
UserName = confirm.ConfirmUser.UserName,
|
UserName = confirm.ConfirmUser.UserName,
|
||||||
UserTypeId = confirm.ConfirmUser.UserTypeId,
|
|
||||||
UserTypeShortName = confirm.ConfirmUser.UserTypeRole.UserTypeShortName,
|
|
||||||
|
|
||||||
FullFilePath = sysDoc.Path
|
FullFilePath = sysDoc.Path
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,3 +24,30 @@ public class SystemDocConfirmedUser : BaseAddDeleteAuditEntity
|
||||||
public string SignText { get; set; } = string.Empty;
|
public string SignText { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[Comment("后台 - 系统文档签署记录")]
|
||||||
|
[Table("SystemDocConfirmedIdentityUser")]
|
||||||
|
public class SystemDocConfirmedIdentityUser : BaseAddDeleteAuditEntity
|
||||||
|
|
||||||
|
{
|
||||||
|
#region 导航属性
|
||||||
|
[JsonIgnore]
|
||||||
|
public SystemDocument SystemDocument { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
[ForeignKey("ConfirmUserId")]
|
||||||
|
public IdentityUser ConfirmUser { get; set; }
|
||||||
|
#endregion
|
||||||
|
public Guid SystemDocumentId { get; set; }
|
||||||
|
|
||||||
|
public DateTime? ConfirmTime { get; set; }
|
||||||
|
public Guid ConfirmUserId { get; set; }
|
||||||
|
|
||||||
|
public DateTime? SignFirstViewTime { get; set; }
|
||||||
|
|
||||||
|
[StringLength(1000)]
|
||||||
|
public string SignText { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ public class SystemDocument : BaseFullDeleteAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<SystemDocConfirmedUser> SystemDocConfirmedUserList { get; set; }
|
public List<SystemDocConfirmedIdentityUser> SystemDocConfirmedUserList { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<SystemDocNeedConfirmedUserType> NeedConfirmedUserTypeList { get; set; }
|
public List<SystemDocNeedConfirmedUserType> NeedConfirmedUserTypeList { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
@ -20,3 +20,24 @@ public class TrialDocConfirmedUser : BaseAddDeleteAuditEntity
|
||||||
[StringLength(1000)]
|
[StringLength(1000)]
|
||||||
public string SignText { get; set; } = string.Empty;
|
public string SignText { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class TrialDocConfirmedIdentityUser : BaseAddDeleteAuditEntity
|
||||||
|
{
|
||||||
|
#region 导航属性
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
[ForeignKey("ConfirmUserId")]
|
||||||
|
public IdentityUser User { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
|
public TrialDocument TrialDocument { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public Guid TrialDocumentId { get; set; }
|
||||||
|
public DateTime? ConfirmTime { get; set; }
|
||||||
|
public Guid ConfirmUserId { get; set; }
|
||||||
|
public DateTime? SignFirstViewTime { get; set; }
|
||||||
|
|
||||||
|
[StringLength(1000)]
|
||||||
|
public string SignText { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ public class TrialDocument : BaseFullDeleteAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<TrialDocConfirmedUser> TrialDocConfirmedUserList { get; set; }
|
public List<TrialDocConfirmedIdentityUser> TrialDocConfirmedUserList { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<TrialDocNeedConfirmedUserType> NeedConfirmedUserTypeList { get; set; }
|
public List<TrialDocNeedConfirmedUserType> NeedConfirmedUserTypeList { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
@ -18,8 +18,6 @@ public class UserRole : BaseFullAuditEntity
|
||||||
[ForeignKey("UserTypeId")]
|
[ForeignKey("UserTypeId")]
|
||||||
public UserType UserTypeRole { get; set; }
|
public UserType UserTypeRole { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public List<SystemDocConfirmedUser> SystemDocConfirmedList { get; set; }
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<TrialUserRole> UserRoleTrials { get; set; } = new List<TrialUserRole>();
|
public List<TrialUserRole> UserRoleTrials { get; set; } = new List<TrialUserRole>();
|
||||||
|
@ -118,6 +116,9 @@ public class IdentityUser: BaseFullAuditEntity
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<UserRole> UserRoleList { get; set; } = new List<UserRole>();
|
public List<UserRole> UserRoleList { get; set; } = new List<UserRole>();
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public List<SystemDocConfirmedIdentityUser> SystemDocConfirmedList { get; set; }
|
||||||
|
|
||||||
[Projectable]
|
[Projectable]
|
||||||
public string FullName => LastName + " / " + FirstName;
|
public string FullName => LastName + " / " + FirstName;
|
||||||
|
|
||||||
|
|
|
@ -894,11 +894,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
// 项目文件签署
|
// 项目文件签署
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialDocConfirmedUser)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialDocConfirmedIdentityUser)))
|
||||||
{
|
{
|
||||||
var type = GetEntityAuditOpt(item);
|
var type = GetEntityAuditOpt(item);
|
||||||
|
|
||||||
var entity = item.Entity as TrialDocConfirmedUser;
|
var entity = item.Entity as TrialDocConfirmedIdentityUser;
|
||||||
|
|
||||||
var extraIdentification = string.Empty;
|
var extraIdentification = string.Empty;
|
||||||
|
|
||||||
|
@ -917,7 +917,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
var trialDoc = await _dbContext.TrialDocument.Where(x => x.Id == entity.TrialDocumentId).FirstOrDefaultAsync();
|
var trialDoc = await _dbContext.TrialDocument.Where(x => x.Id == entity.TrialDocumentId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
await InsertInspection<TrialDocConfirmedUser>(entity as TrialDocConfirmedUser, type, x => new InspectionConvertDTO()
|
await InsertInspection<TrialDocConfirmedIdentityUser>(entity as TrialDocConfirmedIdentityUser, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
TrialId = trialDoc.TrialId,
|
TrialId = trialDoc.TrialId,
|
||||||
ExtraIndentification = extraIdentification,
|
ExtraIndentification = extraIdentification,
|
||||||
|
|
|
@ -525,12 +525,12 @@ public class IRaCISDBContext : DbContext
|
||||||
public virtual DbSet<SystemDocument> SystemDocument { get; set; }
|
public virtual DbSet<SystemDocument> SystemDocument { get; set; }
|
||||||
public virtual DbSet<TrialDocument> TrialDocument { get; set; }
|
public virtual DbSet<TrialDocument> TrialDocument { get; set; }
|
||||||
public virtual DbSet<TrialDocNeedConfirmedUserType> TrialDocUserTypeConfirm { get; set; }
|
public virtual DbSet<TrialDocNeedConfirmedUserType> TrialDocUserTypeConfirm { get; set; }
|
||||||
public virtual DbSet<SystemDocConfirmedUser> SystemDocConfirmedUser { get; set; }
|
|
||||||
public virtual DbSet<SystemDocNeedConfirmedUserType> SystemDocNeedConfirmedUserType { get; set; }
|
public virtual DbSet<SystemDocNeedConfirmedUserType> SystemDocNeedConfirmedUserType { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<TrialDocNeedConfirmedUserType> TrialDocNeedConfirmedUserType { get; set; }
|
public virtual DbSet<TrialDocNeedConfirmedUserType> TrialDocNeedConfirmedUserType { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<TrialDocConfirmedUser> TrialDocConfirmedUser { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 未分类
|
#region 未分类
|
||||||
|
@ -634,7 +634,12 @@ public class IRaCISDBContext : DbContext
|
||||||
|
|
||||||
public virtual DbSet<TrialIdentityUser> TrialIdentityUser { get; set; }
|
public virtual DbSet<TrialIdentityUser> TrialIdentityUser { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<SystemDocConfirmedIdentityUser> SystemDocConfirmedIdentityUser { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<TrialDocConfirmedIdentityUser> TrialDocConfirmedIdentityUser { get; set; }
|
||||||
|
|
||||||
|
//public virtual DbSet<TrialDocConfirmedUser> TrialDocConfirmedUser { get; set; }
|
||||||
|
//public virtual DbSet<SystemDocConfirmedUser> SystemDocConfirmedUser { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,9 +55,9 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SystemDocConfirmedUserConfigration : IEntityTypeConfiguration<SystemDocConfirmedUser>
|
public class SystemDocConfirmedUserConfigration : IEntityTypeConfiguration<SystemDocConfirmedIdentityUser>
|
||||||
{
|
{
|
||||||
public void Configure(EntityTypeBuilder<SystemDocConfirmedUser> builder)
|
public void Configure(EntityTypeBuilder<SystemDocConfirmedIdentityUser> builder)
|
||||||
{
|
{
|
||||||
#region 不用显示配置
|
#region 不用显示配置
|
||||||
//// 配置 CreateUser 关系
|
//// 配置 CreateUser 关系
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,134 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class SignDoc : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "SystemDocConfirmedIdentityUser",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
SystemDocumentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
ConfirmTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
ConfirmUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
SignFirstViewTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
SignText = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
|
||||||
|
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
DeleteUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||||
|
DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_SystemDocConfirmedIdentityUser", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_SystemDocConfirmedIdentityUser_IdentityUser_ConfirmUserId",
|
||||||
|
column: x => x.ConfirmUserId,
|
||||||
|
principalTable: "IdentityUser",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_SystemDocConfirmedIdentityUser_SystemDocument_SystemDocumentId",
|
||||||
|
column: x => x.SystemDocumentId,
|
||||||
|
principalTable: "SystemDocument",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_SystemDocConfirmedIdentityUser_User_CreateUserId",
|
||||||
|
column: x => x.CreateUserId,
|
||||||
|
principalTable: "User",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
},
|
||||||
|
comment: "后台 - 系统文档签署记录");
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "TrialDocConfirmedIdentityUser",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
TrialDocumentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
ConfirmTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
ConfirmUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
SignFirstViewTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
SignText = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
|
||||||
|
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
|
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
DeleteUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||||
|
DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_TrialDocConfirmedIdentityUser", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_TrialDocConfirmedIdentityUser_IdentityUser_ConfirmUserId",
|
||||||
|
column: x => x.ConfirmUserId,
|
||||||
|
principalTable: "IdentityUser",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_TrialDocConfirmedIdentityUser_TrialDocument_TrialDocumentId",
|
||||||
|
column: x => x.TrialDocumentId,
|
||||||
|
principalTable: "TrialDocument",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_TrialDocConfirmedIdentityUser_User_CreateUserId",
|
||||||
|
column: x => x.CreateUserId,
|
||||||
|
principalTable: "User",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_SystemDocConfirmedIdentityUser_ConfirmUserId",
|
||||||
|
table: "SystemDocConfirmedIdentityUser",
|
||||||
|
column: "ConfirmUserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_SystemDocConfirmedIdentityUser_CreateUserId",
|
||||||
|
table: "SystemDocConfirmedIdentityUser",
|
||||||
|
column: "CreateUserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_SystemDocConfirmedIdentityUser_SystemDocumentId",
|
||||||
|
table: "SystemDocConfirmedIdentityUser",
|
||||||
|
column: "SystemDocumentId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_TrialDocConfirmedIdentityUser_ConfirmUserId",
|
||||||
|
table: "TrialDocConfirmedIdentityUser",
|
||||||
|
column: "ConfirmUserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_TrialDocConfirmedIdentityUser_CreateUserId",
|
||||||
|
table: "TrialDocConfirmedIdentityUser",
|
||||||
|
column: "CreateUserId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_TrialDocConfirmedIdentityUser_TrialDocumentId",
|
||||||
|
table: "TrialDocConfirmedIdentityUser",
|
||||||
|
column: "TrialDocumentId");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "SystemDocConfirmedIdentityUser");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "TrialDocConfirmedIdentityUser");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -9246,6 +9246,57 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ConfirmTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("ConfirmUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("CreateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DeleteUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeletedTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("SignFirstViewTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("SignText")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(1000)
|
||||||
|
.HasColumnType("nvarchar(1000)");
|
||||||
|
|
||||||
|
b.Property<Guid>("SystemDocumentId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ConfirmUserId");
|
||||||
|
|
||||||
|
b.HasIndex("CreateUserId");
|
||||||
|
|
||||||
|
b.HasIndex("SystemDocumentId");
|
||||||
|
|
||||||
|
b.ToTable("SystemDocConfirmedIdentityUser", t =>
|
||||||
|
{
|
||||||
|
t.HasComment("后台 - 系统文档签署记录");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SystemDocConfirmedUser", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SystemDocConfirmedUser", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
@ -11169,6 +11220,54 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.TrialDocConfirmedIdentityUser", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ConfirmTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("ConfirmUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreateTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<Guid>("CreateUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("DeleteUserId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DeletedTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<bool>("IsDeleted")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("SignFirstViewTime")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("SignText")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(1000)
|
||||||
|
.HasColumnType("nvarchar(1000)");
|
||||||
|
|
||||||
|
b.Property<Guid>("TrialDocumentId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ConfirmUserId");
|
||||||
|
|
||||||
|
b.HasIndex("CreateUserId");
|
||||||
|
|
||||||
|
b.HasIndex("TrialDocumentId");
|
||||||
|
|
||||||
|
b.ToTable("TrialDocConfirmedIdentityUser");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.TrialDocConfirmedUser", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.TrialDocConfirmedUser", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
@ -16549,6 +16648,33 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SystemDocConfirmedIdentityUser", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.IdentityUser", "ConfirmUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ConfirmUserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CreateUserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.SystemDocument", "SystemDocument")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SystemDocumentId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ConfirmUser");
|
||||||
|
|
||||||
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
|
b.Navigation("SystemDocument");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SystemDocConfirmedUser", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.SystemDocConfirmedUser", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "ConfirmUser")
|
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "ConfirmUser")
|
||||||
|
@ -17129,6 +17255,33 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.Navigation("Trial");
|
b.Navigation("Trial");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.TrialDocConfirmedIdentityUser", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.IdentityUser", "User")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ConfirmUserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "CreateUserRole")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CreateUserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.TrialDocument", "TrialDocument")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("TrialDocumentId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
|
b.Navigation("TrialDocument");
|
||||||
|
|
||||||
|
b.Navigation("User");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.TrialDocConfirmedUser", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.TrialDocConfirmedUser", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "User")
|
b.HasOne("IRaCIS.Core.Domain.Models.UserRole", "User")
|
||||||
|
@ -17343,7 +17496,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.Trial", "Trial")
|
b.HasOne("IRaCIS.Core.Domain.Models.Trial", "Trial")
|
||||||
.WithMany()
|
.WithMany("TrialIdentityUserList")
|
||||||
.HasForeignKey("TrialId")
|
.HasForeignKey("TrialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
@ -17684,7 +17837,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.Trial", "Trial")
|
b.HasOne("IRaCIS.Core.Domain.Models.Trial", "Trial")
|
||||||
.WithMany("TrialUserList")
|
.WithMany("TrialUserRoleList")
|
||||||
.HasForeignKey("TrialId")
|
.HasForeignKey("TrialId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
@ -18409,6 +18562,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Navigation("TrialDocumentList");
|
b.Navigation("TrialDocumentList");
|
||||||
|
|
||||||
|
b.Navigation("TrialIdentityUserList");
|
||||||
|
|
||||||
b.Navigation("TrialReadingCriterionList");
|
b.Navigation("TrialReadingCriterionList");
|
||||||
|
|
||||||
b.Navigation("TrialSiteList");
|
b.Navigation("TrialSiteList");
|
||||||
|
@ -18419,7 +18574,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Navigation("TrialStateChangeList");
|
b.Navigation("TrialStateChangeList");
|
||||||
|
|
||||||
b.Navigation("TrialUserList");
|
b.Navigation("TrialUserRoleList");
|
||||||
|
|
||||||
b.Navigation("UserFeedBackList");
|
b.Navigation("UserFeedBackList");
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,7 @@ namespace IRaCIS.Core.Infrastructure.Extention
|
||||||
|
|
||||||
var propName = string.Empty;
|
var propName = string.Empty;
|
||||||
|
|
||||||
|
//前端传递 以前端为准
|
||||||
if (string.IsNullOrWhiteSpace(pageInput.SortField))
|
if (string.IsNullOrWhiteSpace(pageInput.SortField))
|
||||||
{
|
{
|
||||||
propName = sortField;
|
propName = sortField;
|
||||||
|
|
Loading…
Reference in New Issue