修改医院
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
d165632cc8
commit
3e9221b39c
|
@ -445,6 +445,9 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public class BasicInfoAndEmploymentDto: DoctorBasicInfoCommand
|
public class BasicInfoAndEmploymentDto: DoctorBasicInfoCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public string HospitalName { get; set; } = string.Empty;
|
||||||
|
|
||||||
//部门
|
//部门
|
||||||
public Guid? DepartmentId { get; set; }
|
public Guid? DepartmentId { get; set; }
|
||||||
public string DepartmentOther { get; set; } = string.Empty;
|
public string DepartmentOther { get; set; } = string.Empty;
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
}
|
}
|
||||||
public class PostgraduateCommand
|
public class PostgraduateCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
public Guid? Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
public Guid DoctorId { get; set; }
|
public Guid DoctorId { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,24 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//---current phone or email number already existed
|
//---current phone or email number already existed
|
||||||
var verifyPair = new KeyValuePair<Expression<Func<Doctor, bool>>, string>(verifyExp, _localizer["Doctor_DupPhoneOrEmail"]);
|
var verifyPair = new KeyValuePair<Expression<Func<Doctor, bool>>, string>(verifyExp, _localizer["Doctor_DupPhoneOrEmail"]);
|
||||||
|
|
||||||
|
if (indto.HospitalName != string.Empty)
|
||||||
|
{
|
||||||
|
var hospital = await _hospitalRepository.Where(x => x.HospitalName == indto.HospitalName && x.SiteId == null).FirstOrDefaultAsync();
|
||||||
|
if (hospital != null)
|
||||||
|
{
|
||||||
|
indto.HospitalId = hospital.Id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var newHospital = await _hospitalRepository.AddAsync(new Hospital()
|
||||||
|
{
|
||||||
|
HospitalName = indto.HospitalName,
|
||||||
|
IsConfirm = false,
|
||||||
|
}, true);
|
||||||
|
indto.HospitalId = newHospital.Id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (indto.Id == Guid.Empty || indto.Id == null)
|
if (indto.Id == Guid.Empty || indto.Id == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||||
public class EducationService(IRepository<Postgraduate> _postgraduateRepository,
|
public class EducationService(IRepository<Postgraduate> _postgraduateRepository,
|
||||||
|
IRepository<Hospital> _hospitalRepository,
|
||||||
IRepository<Education> _educationRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IEducationService
|
IRepository<Education> _educationRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IEducationService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -88,7 +89,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <summary> 添加/更新医生继续学习经历</summary>
|
/// <summary> 添加/更新医生继续学习经历</summary>
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdatePostgraduateInfo(PostgraduateCommand postgraduateViewModel)
|
public async Task<IResponseOutput> AddOrUpdatePostgraduateInfo(PostgraduateCommand inDto)
|
||||||
{
|
{
|
||||||
#region 封装前
|
#region 封装前
|
||||||
|
|
||||||
|
@ -109,8 +110,24 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
//}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
if (inDto.Hospital != string.Empty)
|
||||||
var entity = await _postgraduateRepository.InsertOrUpdateAsync(postgraduateViewModel, true);
|
{
|
||||||
|
var hospital = await _hospitalRepository.Where(x => x.HospitalName == inDto.Hospital && x.SiteId == null).FirstOrDefaultAsync();
|
||||||
|
if (hospital != null)
|
||||||
|
{
|
||||||
|
inDto.HospitalId = hospital.Id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var newHospital = await _hospitalRepository.AddAsync(new Hospital()
|
||||||
|
{
|
||||||
|
HospitalName = inDto.Hospital,
|
||||||
|
IsConfirm = false,
|
||||||
|
}, true);
|
||||||
|
inDto.HospitalId = newHospital.Id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var entity = await _postgraduateRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
return ResponseOutput.Ok(entity.Id);
|
return ResponseOutput.Ok(entity.Id);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue