diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index ccfe69ac8..70199c8e7 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -552,12 +552,12 @@ namespace IRaCIS.Core.Application.Service saveItem.UserCode = AppSettings.GetCodeStr(saveItem.Code, nameof(IdentityUser)); - //if (saveItem.IsZhiZhun) - //{ - // var organizationName = _userInfo.IsEn_Us ? _systemEmailConfig.OrganizationName : _systemEmailConfig.OrganizationNameCN; + if (saveItem.IsZhiZhun) + { + //var organizationName = _userInfo.IsEn_Us ? _systemEmailConfig.OrganizationName : _systemEmailConfig.OrganizationNameCN; - // saveItem.OrganizationName = organizationName; - //} + saveItem.OrganizationName = hospitalInfo.HospitalName; + } //saveItem.Password = MD5Helper.Md5(IRCEmailPasswordHelper.GenerateRandomPassword(10)); @@ -622,7 +622,7 @@ namespace IRaCIS.Core.Application.Service public async Task UpdateUser(UserCommand model) { - + var hospitalInfo = await _fusionCache.GetOrSetAsync(CacheKeys.Hospital, _ => CacheHelper.GetHospitalCode(_hirHospitalRepository), TimeSpan.FromDays(7)); await VerifyUserNameAsync(model.Id, model.UserName); @@ -647,10 +647,10 @@ namespace IRaCIS.Core.Application.Service _mapper.Map(model, user); - //if (user.IsZhiZhun) - //{ - // user.OrganizationName = _userInfo.IsEn_Us ? _systemEmailConfig.OrganizationName : _systemEmailConfig.OrganizationNameCN; - //} + if (user.IsZhiZhun) + { + user.OrganizationName = hospitalInfo.HospitalName; + } await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.UserRoleId, OptUserId = model.Id, OptType = UserOptType.UpdateUser }); diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index f66f885dd..51f0055be 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -1659,9 +1659,9 @@ namespace IRaCIS.Application.Services //} //await _subjectRepository.DeleteAsync(subject); - await _subjectVisitRepository.DeleteFromQueryAsync(t => t.SubjectId == subjectId, true); + await _subjectVisitRepository.SoftDeleteFromQueryAsync(t => t.SubjectId == subjectId, true); - await _subjectRepository.DeleteFromQueryAsync(t => t.Id == subjectId); + await _subjectRepository.SoftDeleteFromQueryAsync(t => t.Id == subjectId); }