修改c-find 列表
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
552509ad9e
commit
ebaa2af196
|
|
@ -90,7 +90,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var query = _trialUseRoleRepository.Where(t => t.TrialId == inQuery.TrialId).IgnoreQueryFilters()
|
||||
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator || t.UserRole.UserTypeEnum == UserTypeEnum.CRA)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserRole.UserTypeId == inQuery.UserTypeId)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserRole.UserTypeId == inQuery.UserTypeId)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserRealName), t => (t.UserRole.FullName).Contains(inQuery.UserRealName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.OrganizationName), t => t.UserRole.OrganizationName.Contains(inQuery.OrganizationName))
|
||||
.ProjectTo<AssginSiteCRCListDTO>(_mapper.ConfigurationProvider, new { trialSiteId = inQuery.TrialSiteId });
|
||||
|
|
|
|||
|
|
@ -62,6 +62,12 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public string? ModalitiesInStudy { get; set; }
|
||||
|
||||
public List<HospitalGroupInfo> HospitalGroupList { get; set; }
|
||||
|
||||
public List<HospitalGroupInfo> CurrentUserHospitalGroupList { get; set; } = new List<HospitalGroupInfo>();
|
||||
|
||||
public List<HospitalGroupInfo> ViewHospitalGroupList => HospitalGroupList.Where(t => CurrentUserHospitalGroupList.Any(c => c.Id == t.Id)).ToList();
|
||||
|
||||
}
|
||||
|
||||
public class TJCmoveStudyCommand
|
||||
|
|
@ -76,6 +82,6 @@ namespace IRaCIS.Application.Contracts
|
|||
/// <summary>
|
||||
///PacsAE 的名字
|
||||
/// </summary>
|
||||
public string CalledAE { get; set; }
|
||||
public string CalledAE { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ using NPOI.HSSF.Record.Chart;
|
|||
using IRaCIS.Core.Application.Helper.OtherTool;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using DocumentFormat.OpenXml.Drawing.Charts;
|
||||
using DocumentFormat.OpenXml.Drawing.Diagrams;
|
||||
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
|
|
@ -819,7 +820,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改检查课题组 1是添加 2是删除
|
||||
/// 修改检查课题组 1是添加 2是删除,3是更新
|
||||
/// </summary>
|
||||
/// <param name="incommand"></param>
|
||||
/// <returns></returns>
|
||||
|
|
@ -843,7 +844,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
|
||||
}
|
||||
else
|
||||
else if (incommand.AddOrDelete == 2)
|
||||
{
|
||||
//删除
|
||||
foreach (var item in incommand.SCPstudyIdList)
|
||||
|
|
@ -857,6 +858,22 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
}
|
||||
}
|
||||
else if (incommand.AddOrDelete == 3)
|
||||
{
|
||||
//更新
|
||||
foreach (var item in incommand.SCPstudyIdList)
|
||||
{
|
||||
await _SCPStudyHospitalGroupRepository.BatchDeleteNoTrackingAsync(t => t.SCPStudyId == item);
|
||||
|
||||
foreach (var hospitalGroupId in incommand.HospitalGroupIdList)
|
||||
{
|
||||
await _SCPStudyHospitalGroupRepository.AddAsync(new SCPStudyHospitalGroup() { SCPStudyId = item, HospitalGroupId = hospitalGroupId });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
await _SCPStudyHospitalGroupRepository.SaveChangesAsync();
|
||||
|
||||
|
|
@ -3364,11 +3381,29 @@ namespace IRaCIS.Application.Services
|
|||
var resultInstanceUidList = result.Select(t => t.StudyInstanceUID).ToList();
|
||||
|
||||
var existStudyIdList = _studyRepository.Where(t => resultInstanceUidList.Contains(t.StudyInstanceUid))
|
||||
.Select(t => t.StudyInstanceUid).ToList();
|
||||
.Select(t => new { t.StudyInstanceUid, HospitalGroupList = t.HospitalGroupList.Select(t => new HospitalGroupInfo { Id = t.HospitalGroupId, Name = t.HospitalGroup.Name, Code = t.HospitalGroup.Code }).ToList() }).ToList();
|
||||
|
||||
var allHospitalGroupList = _hospitalGroupRepository.Where(t => t.IsEnable).Select(t => new HospitalGroupInfo() { Name = t.Name, Id = t.Id, Code = t.Code }).ToList();
|
||||
|
||||
var isAdminOrOA = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.Admin || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.OA || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin;
|
||||
|
||||
|
||||
foreach (var item in result)
|
||||
{
|
||||
item.IsStudyExist = existStudyIdList.Any(t => t == item.StudyInstanceUID);
|
||||
item.IsStudyExist = existStudyIdList.Any(t => t.StudyInstanceUid == item.StudyInstanceUID);
|
||||
item.HospitalGroupList = existStudyIdList.FirstOrDefault(t => t.StudyInstanceUid == item.StudyInstanceUID)?.HospitalGroupList;
|
||||
|
||||
if (isAdminOrOA)
|
||||
{
|
||||
//不处理,默认看所有
|
||||
|
||||
item.CurrentUserHospitalGroupList = allHospitalGroupList;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.CurrentUserHospitalGroupList = _userInfo.HospitalGroupList.Select(t => new HospitalGroupInfo() { Code = t.Code, Id = t.Id, Name = t.Name }).ToList();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue