修改
continuous-integration/drone/push Build is passing

This commit is contained in:
he
2024-12-20 13:29:45 +08:00
parent 6e34bc3c17
commit 460575d959
7 changed files with 18323 additions and 2 deletions
@@ -637,6 +637,8 @@ namespace IRaCIS.Application.Contracts
public class EmploymentInfo
{
public Guid Id { get; set; }
public string HospitalName { get; set; } = string.Empty;
//部门
public Guid? DepartmentId { get; set; }
public string DepartmentOther { get; set; } = string.Empty;
@@ -17,6 +17,7 @@ namespace IRaCIS.Core.Application.Service
IRepository<DoctorDictionary> _doctorDictionaryRepository,
IRepository<DoctorSummarize> _doctorSummarizeRepository,
IRepository<Enroll> _enrollRepository,
IRepository<Hospital> _hospitalRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<Attachment> _attachmentRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
@@ -581,7 +582,7 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<IResponseOutput> UpdateEmploymentInfo(EmploymentCommand doctorWorkInfoModel)
public async Task<IResponseOutput> UpdateEmploymentInfo(EmploymentCommand inDto)
{
#region
//var success = _doctorRepository.Update(d => d.Id == doctorWorkInfoModel.Id, u => new Doctor()
@@ -611,8 +612,25 @@ namespace IRaCIS.Core.Application.Service
//var success = _doctorRepository.SaveChanges();
#endregion
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;
}
}
var entity = await _doctorRepository.InsertOrUpdateAsync(doctorWorkInfoModel, true);
var entity = await _doctorRepository.InsertOrUpdateAsync(inDto, true);
return ResponseOutput.Ok();