From b8d9cf1630e7ce8fc1b0d5929f0b02ef4790da9e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 18 Aug 2025 14:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E9=A2=98=E7=BB=84=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 15 +++++++++++++++ .../Service/Visit/HospitalGroupService.cs | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) 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);