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
|
||||
{
|
||||
[Description("测试")]
|
||||
Test = -1,
|
||||
[Description("HIR修改")]
|
||||
HIR = -1,
|
||||
|
||||
[Description("医生模块")]
|
||||
Reviewer = 1,
|
||||
|
|
|
|||
|
|
@ -13564,6 +13564,26 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</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)">
|
||||
<summary>
|
||||
添加或更新受试者信息[New]
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO;
|
|||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Management")]
|
||||
[ApiExplorerSettings(GroupName = "HIR")]
|
||||
public class UserService(IRepository<UserRole> _userRoleRepository,
|
||||
IMailVerificationService _mailVerificationService,
|
||||
IRepository<VerificationCode> _verificationCodeRepository,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ public class HospitalGroupView : HospitalGroupAddOrEdit
|
|||
|
||||
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 Name { get; set; }
|
||||
|
||||
public List<Guid> IdentityUserIdList { get; set; }
|
||||
}
|
||||
|
||||
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;
|
||||
namespace IRaCIS.Core.Application.Service;
|
||||
|
||||
[ApiExplorerSettings(GroupName = "Test")]
|
||||
[ApiExplorerSettings(GroupName = "HIR")]
|
||||
public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepository,
|
||||
IRepository<IdentityUser> _identityUserRepository, IRepository<HospitalGroupIdentityUser> _hospitalGroupIdentityUserRepository,
|
||||
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]
|
||||
public async Task<List<HospitalGroupView>> GetHospitalGroupList(HospitalGroupQuery inQuery)
|
||||
{
|
||||
|
|
@ -39,7 +54,11 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
|||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 分页课题组列表
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<HospitalGroupView>> GetHospitalGroupPageList(HospitalGroupQuery inQuery)
|
||||
{
|
||||
|
|
@ -67,10 +86,34 @@ public class HospitalGroupService(IRepository<HospitalGroup> _hospitalGroupRepos
|
|||
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
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
[ApiExplorerSettings(GroupName = "HIR")]
|
||||
public class PatientService(IRepository<SCPStudySubjectVisit> _studySubjectVisitRepository,
|
||||
IRepository<SubjectPatient> _subjectPatientRepository,
|
||||
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.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));
|
||||
|
||||
CreateMap<Subject, PatienSubejctView>()
|
||||
|
|
@ -136,8 +136,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<Trial, NewTrialView>()
|
||||
.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.UnReadCount, u => u.MapFrom(s => s.VisitTaskList.Count(t=>t.TaskState==TaskState.Effect && t.SignTime==null)))
|
||||
.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)))
|
||||
;
|
||||
|
||||
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<IdentityUser, HospitalGroupAdminUserInfo>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,13 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[Comment("课题组")]
|
||||
public class HospitalGroup : BaseFullAuditEntity
|
||||
{
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
public List<HospitalGroupIdentityUser> IdentityUserList { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
|
@ -23,11 +30,23 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public string ContactPhone { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
[Comment("用户课题组中间关系表")]
|
||||
public class HospitalGroupIdentityUser : BaseFullAuditEntity
|
||||
{
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
public HospitalGroup HospitalGroup { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public IdentityUser IdentityUser { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
public Guid HospitalGroupId { get; set; }
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue