diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index b65c6ec47..0c1e9ffbf 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -426,6 +426,7 @@ namespace IRaCIS.Core.Application.Service var success = await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == _userInfo.IdentityUserId, u => new IdentityUser() { Password = editPwModel.NewPassWord, + CheckCode=editPwModel.CheckCode, LastChangePassWordTime = DateTime.Now, IsFirstAdd = false }); @@ -1011,6 +1012,20 @@ namespace IRaCIS.Core.Application.Service return list; } + [HttpPut("{newCheckCode}")] + public async Task SetNewCheckCode(string newCheckCode) + { + var user = await _userRoleRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == _userInfo.UserRoleId); + + await _userRoleRepository.UpdatePartialFromQueryAsync(t => t.EMail == user.EMail, u => new UserRole() + { + CheckCode = newCheckCode + }); + + await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.UserRoleId, OptUserId = _userInfo.UserRoleId, OptType = UserOptType.ModifyCheckCode }, true); + return ResponseOutput.Ok(); + } + #region 多账号修改 /// diff --git a/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs b/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs index 0753d5dad..90e5a4e01 100644 --- a/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs +++ b/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs @@ -91,7 +91,7 @@ public class HospitalGroupService(IRepository _hospitalGroupRepos var addEntity = _mapper.Map(addOrEditHospitalGroup); - addEntity.IdentityUserList = addOrEditHospitalGroup.IdentityUserIdList.Select(t => new HospitalGroupIdentityUser() { IdentityUserId = t }).ToList(); + addEntity.IdentityUserList = addOrEditHospitalGroup.IdentityUserIdList.Select(t => new HospitalGroupIdentityUser() { IdentityUserId = t, IsManager = true }).ToList(); var newEntity = await _hospitalGroupRepository.AddAsync(addEntity, true, verifyExp1); @@ -105,7 +105,7 @@ public class HospitalGroupService(IRepository _hospitalGroupRepos //_mapper.Map(addOrEditHospitalGroup, find); - var adminUserList = addOrEditHospitalGroup.IdentityUserIdList.Select(t => new HospitalGroupIdentityUser() { IdentityUserId = t, HospitalGroupId = (Guid)addOrEditHospitalGroup.Id }).ToList(); + var adminUserList = addOrEditHospitalGroup.IdentityUserIdList.Select(t => new HospitalGroupIdentityUser() { IdentityUserId = t, HospitalGroupId = (Guid)addOrEditHospitalGroup.Id, IsManager = true }).ToList(); await _hospitalGroupIdentityUserRepository.AddRangeAsync(adminUserList); var entity = await _hospitalGroupRepository.UpdateFromDTOAsync(addOrEditHospitalGroup, false, false, verifyExp1);