diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index c11c09348..7826602ac 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -224,11 +224,14 @@ namespace IRaCIS.Core.Application.Services var trialInfo = await (_trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync()); + var isInternal = _userInfo.IsZhiZhun; #region 统一用户修改 var systemDocQuery = from sysDoc in _systemDocumentRepository.AsQueryable(true).Where(t => t.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == _userInfo.UserTypeId)) + //外部人员 只签署 外部需要签署的 + .WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter) from trialUser in _trialIdentityUserRepository.AsQueryable(false) .Where(t => t.TrialId == inQuery.TrialId && t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => sysDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == t.UserRole.UserTypeId))) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs index a470d02b2..6695567d1 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs @@ -161,10 +161,15 @@ namespace IRaCIS.Core.Application.Service var query = _userRoleRepository.Where(t => t.UserTypeEnum != UserTypeEnum.SuperAdmin && t.IdentityUser.Status == UserStateEnum.Enable).IgnoreQueryFilters() //正式或者培训的项目 不能允许测试用户(必须正式用户) 同时必须是内部的用户 - .WhereIf(trialType == TrialType.OfficialTrial || trialType == TrialType.Training, t => t.IdentityUser.IsTestUser == false /*&& t.IdentityUser.IsZhiZhun*/) + .WhereIf(trialType == TrialType.OfficialTrial || trialType == TrialType.Training, t => t.IdentityUser.IsTestUser == false + && (t.IdentityUser.IsZhiZhun + || t.UserTypeRole.UserTypeEnum == UserTypeEnum.IQC + || t.UserTypeRole.UserTypeEnum==UserTypeEnum.MIM)) //测试项目 可以加入 测试用户 或者内部正式用户 - .WhereIf(trialType == TrialType.NoneOfficial, t => t.IdentityUser.IsTestUser == true /*|| (t.IdentityUser.IsTestUser == false && t.IdentityUser.IsZhiZhun)*/) + .WhereIf(trialType == TrialType.NoneOfficial, t => t.IdentityUser.IsTestUser == true || (t.IdentityUser.IsTestUser == false && (t.IdentityUser.IsZhiZhun + || t.UserTypeRole.UserTypeEnum == UserTypeEnum.IQC + || t.UserTypeRole.UserTypeEnum == UserTypeEnum.MIM))) .Where(t => userTypeEnums.Contains(t.UserTypeEnum)) .WhereIf(inQuery.UserTypeEnum != null, t => t.UserTypeEnum == inQuery.UserTypeEnum) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserRealName), t => t.IdentityUser.FullName.Contains(inQuery.UserRealName)) diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 5bdac402f..6c405f19f 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -607,7 +607,7 @@ namespace IRaCIS.Core.Application.Services item.InstanceInfoList.ForEach(x => { - var keyFramesList = rowInfoList.Where(y => y.InstanceId == x.Id && y.NumberOfFrames != 0).Select(y => y.NumberOfFrames).Distinct().ToList(); + var keyFramesList = rowInfoList.Where(y => y.InstanceId == x.Id && y.NumberOfFrames != 0&&y.NumberOfFrames!=null).Select(y => y.NumberOfFrames).Distinct().ToList(); if (keyFramesList.Count() > 0) { diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index e3fd55c6e..8558b55bf 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -173,7 +173,7 @@ namespace IRaCIS.Core.Application.Service var identityUserId = NewId.NextSequentialGuid(); - var selectUser = item.OrderByDescending(t => t.Status).FirstOrDefault(); + var selectUser = item.OrderByDescending(t => t.Status).ThenBy(t=>t.CreateTime).FirstOrDefault(); var identityUser = _mapper.Map(selectUser);