@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user