HIR 课题组列表增加
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
5ea6d221e3
commit
73f1f2938f
|
|
@ -16,8 +16,8 @@ namespace IRaCIS.Core.API;
|
||||||
|
|
||||||
public enum SwaggerVersion
|
public enum SwaggerVersion
|
||||||
{
|
{
|
||||||
[Description("测试")]
|
[Description("HIR修改")]
|
||||||
Test = -1,
|
HIR = -1,
|
||||||
|
|
||||||
[Description("医生模块")]
|
[Description("医生模块")]
|
||||||
Reviewer = 1,
|
Reviewer = 1,
|
||||||
|
|
|
||||||
|
|
@ -13564,6 +13564,26 @@
|
||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.HospitalGroupService.GetGAUserList">
|
||||||
|
<summary>
|
||||||
|
GA用户列表
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.HospitalGroupService.GetHospitalGroupList(IRaCIS.Core.Application.ViewModel.HospitalGroupQuery)">
|
||||||
|
<summary>
|
||||||
|
不分页课题组列表
|
||||||
|
</summary>
|
||||||
|
<param name="inQuery"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.HospitalGroupService.GetHospitalGroupPageList(IRaCIS.Core.Application.ViewModel.HospitalGroupQuery)">
|
||||||
|
<summary>
|
||||||
|
分页课题组列表
|
||||||
|
</summary>
|
||||||
|
<param name="inQuery"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.SubjectService.AddOrUpdateSubject(IRaCIS.Application.Contracts.SubjectCommand)">
|
<member name="M:IRaCIS.Core.Application.Service.SubjectService.AddOrUpdateSubject(IRaCIS.Application.Contracts.SubjectCommand)">
|
||||||
<summary>
|
<summary>
|
||||||
添加或更新受试者信息[New]
|
添加或更新受试者信息[New]
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(GroupName = "Management")]
|
[ApiExplorerSettings(GroupName = "HIR")]
|
||||||
public class UserService(IRepository<UserRole> _userRoleRepository,
|
public class UserService(IRepository<UserRole> _userRoleRepository,
|
||||||
IMailVerificationService _mailVerificationService,
|
IMailVerificationService _mailVerificationService,
|
||||||
IRepository<VerificationCode> _verificationCodeRepository,
|
IRepository<VerificationCode> _verificationCodeRepository,
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ public class HospitalGroupView : HospitalGroupAddOrEdit
|
||||||
|
|
||||||
public DateTime UpdateTime { get; set; }
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
|
public List<HospitalGroupAdminUserInfo> GAUserList { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -32,6 +34,8 @@ public class HospitalGroupAddOrEdit
|
||||||
public string ContactPhone { get; set; }
|
public string ContactPhone { get; set; }
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public List<Guid> IdentityUserIdList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class HospitalGroupQuery : PageInput
|
public class HospitalGroupQuery : PageInput
|
||||||
|
|
@ -50,3 +54,18 @@ public class HospitalGroupQuery : PageInput
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class HospitalGroupAdminUserInfo
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
public string FullName { get; set; }
|
||||||
|
|
||||||
|
public string Email { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,29 @@ using IRaCIS.Core.Infra.EFCore;
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
namespace IRaCIS.Core.Application.Service;
|
namespace IRaCIS.Core.Application.Service;
|
||||||
|
|
||||||
[ApiExplorerSettings(GroupName = "Test")]
|
[ApiExplorerSettings(GroupName = "HIR")]
|
||||||
public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepository,
|
public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepository,
|
||||||
|
IRepository<IdentityUser> _identityUserRepository, IRepository<HospitalGroupIdentityUser> _hospitalGroupIdentityUserRepository,
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IHospitalGroupService
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IHospitalGroupService
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// GA用户列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
|
||||||
|
public async Task<List<HospitalGroupAdminUserInfo>> GetGAUserList()
|
||||||
|
{
|
||||||
|
var list = await _identityUserRepository.Where(t => t.UserRoleList.Any(t => t.UserTypeEnum == UserTypeEnum.GA)).ProjectTo<HospitalGroupAdminUserInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 不分页课题组列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inQuery"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<List<HospitalGroupView>> GetHospitalGroupList(HospitalGroupQuery inQuery)
|
public async Task<List<HospitalGroupView>> GetHospitalGroupList(HospitalGroupQuery inQuery)
|
||||||
{
|
{
|
||||||
|
|
@ -32,14 +47,18 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactPhone), t => t.ContactPhone.Contains(inQuery.ContactPhone))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactPhone), t => t.ContactPhone.Contains(inQuery.ContactPhone))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactName), t => t.ContactName.Contains(inQuery.ContactName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactName), t => t.ContactName.Contains(inQuery.ContactName))
|
||||||
.ProjectTo<HospitalGroupView>(_mapper.ConfigurationProvider);
|
.ProjectTo<HospitalGroupView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var pageList = await hospitalGroupQueryable.SortToListAsync(inQuery);
|
var pageList = await hospitalGroupQueryable.SortToListAsync(inQuery);
|
||||||
|
|
||||||
return pageList;
|
return pageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页课题组列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inQuery"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<HospitalGroupView>> GetHospitalGroupPageList(HospitalGroupQuery inQuery)
|
public async Task<PageOutput<HospitalGroupView>> GetHospitalGroupPageList(HospitalGroupQuery inQuery)
|
||||||
{
|
{
|
||||||
|
|
@ -50,7 +69,7 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactPhone), t => t.ContactPhone.Contains(inQuery.ContactPhone))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactPhone), t => t.ContactPhone.Contains(inQuery.ContactPhone))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactName), t => t.ContactName.Contains(inQuery.ContactName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactName), t => t.ContactName.Contains(inQuery.ContactName))
|
||||||
.ProjectTo<HospitalGroupView>(_mapper.ConfigurationProvider);
|
.ProjectTo<HospitalGroupView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var pageList = await hospitalGroupQueryable.ToPagedListAsync(inQuery);
|
var pageList = await hospitalGroupQueryable.ToPagedListAsync(inQuery);
|
||||||
|
|
||||||
|
|
@ -67,10 +86,34 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
||||||
VerifyMsg = _localizer["HospitalGroup_DuplicateCode"]
|
VerifyMsg = _localizer["HospitalGroup_DuplicateCode"]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (addOrEditHospitalGroup.Id == null)
|
||||||
|
{
|
||||||
|
|
||||||
var entity = await _hospitalGroupRepository.InsertOrUpdateAsync(addOrEditHospitalGroup, true, verifyExp1);
|
var addEntity = _mapper.Map<HospitalGroup>(addOrEditHospitalGroup);
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
addEntity.IdentityUserList = addOrEditHospitalGroup.IdentityUserIdList.Select(t => new HospitalGroupIdentityUser() { IdentityUserId = t }).ToList();
|
||||||
|
|
||||||
|
var newEntity = await _hospitalGroupRepository.AddAsync(addEntity, true, verifyExp1);
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(newEntity.Id.ToString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await _hospitalGroupIdentityUserRepository.BatchDeleteNoTrackingAsync(t => t.HospitalGroupId == addOrEditHospitalGroup.Id && t.IsManager);
|
||||||
|
|
||||||
|
//var find = await _hospitalGroupRepository.FirstOrDefaultAsync(t => t.Id == addOrEditHospitalGroup.Id);
|
||||||
|
|
||||||
|
//_mapper.Map(addOrEditHospitalGroup, find);
|
||||||
|
|
||||||
|
var adminUserList = addOrEditHospitalGroup.IdentityUserIdList.Select(t => new HospitalGroupIdentityUser() { IdentityUserId = t, HospitalGroupId = (Guid)addOrEditHospitalGroup.Id }).ToList();
|
||||||
|
|
||||||
|
await _hospitalGroupIdentityUserRepository.AddRangeAsync(adminUserList);
|
||||||
|
var entity = await _hospitalGroupRepository.UpdateFromDTOAsync(addOrEditHospitalGroup, false, false, verifyExp1);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ using IRaCIS.Core.Application.Helper.OtherTool;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(GroupName = "Trial")]
|
[ApiExplorerSettings(GroupName = "HIR")]
|
||||||
public class PatientService(IRepository<SCPStudySubjectVisit> _studySubjectVisitRepository,
|
public class PatientService(IRepository<SCPStudySubjectVisit> _studySubjectVisitRepository,
|
||||||
IRepository<SubjectPatient> _subjectPatientRepository,
|
IRepository<SubjectPatient> _subjectPatientRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(d => d.CallingAEList, u => u.MapFrom(s => s.SCPStudyList.Select(t => t.CallingAE).Distinct()))
|
.ForMember(d => d.CallingAEList, u => u.MapFrom(s => s.SCPStudyList.Select(t => t.CallingAE).Distinct()))
|
||||||
.ForMember(d => d.PatientId, u => u.MapFrom(s => s.Id));
|
.ForMember(d => d.PatientId, u => u.MapFrom(s => s.Id));
|
||||||
|
|
||||||
CreateMap<SCPStudySubjectVisit, VisitPatientStudyView>().IncludeMembers(t=>t.SCPStudy)
|
CreateMap<SCPStudySubjectVisit, VisitPatientStudyView>().IncludeMembers(t => t.SCPStudy)
|
||||||
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName));
|
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName));
|
||||||
|
|
||||||
CreateMap<Subject, PatienSubejctView>()
|
CreateMap<Subject, PatienSubejctView>()
|
||||||
|
|
@ -136,8 +136,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<Trial, NewTrialView>()
|
CreateMap<Trial, NewTrialView>()
|
||||||
.ForMember(d => d.TrialId, u => u.MapFrom(s => s.Id))
|
.ForMember(d => d.TrialId, u => u.MapFrom(s => s.Id))
|
||||||
.ForMember(d => d.UnSubmitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t=>t.SubmitState==SubmitStateEnum.ToSubmit)))
|
.ForMember(d => d.UnSubmitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.SubmitState == SubmitStateEnum.ToSubmit)))
|
||||||
.ForMember(d => d.UnReadCount, u => u.MapFrom(s => s.VisitTaskList.Count(t=>t.TaskState==TaskState.Effect && t.SignTime==null)))
|
.ForMember(d => d.UnReadCount, u => u.MapFrom(s => s.VisitTaskList.Count(t => t.TaskState == TaskState.Effect && t.SignTime == null)))
|
||||||
;
|
;
|
||||||
|
|
||||||
CreateMap<Trial, TrialInfoDTO>()
|
CreateMap<Trial, TrialInfoDTO>()
|
||||||
|
|
@ -202,8 +202,20 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CreateMap<HospitalGroup, HospitalGroupView>();
|
CreateMap<HospitalGroup, HospitalGroupView>()
|
||||||
|
.ForMember(d => d.GAUserList, u => u.MapFrom(s => s.IdentityUserList.Where(t => t.IsManager).Select(t => t.IdentityUser)))
|
||||||
|
.ForMember(d => d.IdentityUserIdList, u => u.MapFrom(s => s.IdentityUserList.Where(t => t.IsManager).Select(t => t.IdentityUser.Id)));
|
||||||
|
|
||||||
|
|
||||||
CreateMap<HospitalGroup, HospitalGroupAddOrEdit>().ReverseMap();
|
CreateMap<HospitalGroup, HospitalGroupAddOrEdit>().ReverseMap();
|
||||||
|
|
||||||
|
|
||||||
|
CreateMap<IdentityUser, HospitalGroupAdminUserInfo>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,13 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[Comment("课题组")]
|
[Comment("课题组")]
|
||||||
public class HospitalGroup : BaseFullAuditEntity
|
public class HospitalGroup : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
#region 导航属性
|
||||||
|
[JsonIgnore]
|
||||||
|
public List<HospitalGroupIdentityUser> IdentityUserList { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
|
|
@ -23,11 +30,23 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
public string ContactPhone { get; set; }
|
public string ContactPhone { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Comment("用户课题组中间关系表")]
|
[Comment("用户课题组中间关系表")]
|
||||||
public class HospitalGroupIdentityUser : BaseFullAuditEntity
|
public class HospitalGroupIdentityUser : BaseFullAuditEntity
|
||||||
{
|
{
|
||||||
|
#region 导航属性
|
||||||
|
[JsonIgnore]
|
||||||
|
public HospitalGroup HospitalGroup { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public IdentityUser IdentityUser { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
public Guid HospitalGroupId { get; set; }
|
public Guid HospitalGroupId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue