diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs index d0a568ab3..7fcf38234 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs @@ -167,6 +167,8 @@ namespace IRaCIS.Application.Contracts public class EditPasswordCommand { + public string NewUserName { get; set; } = string.Empty; + public string NewPassWord { get; set; } = string.Empty; public string OldPassWord { get; set; } = string.Empty; } diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index d63e13222..14d9943bc 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -156,7 +156,7 @@ namespace IRaCIS.Application.Services - + /// /// 发送验证码 邮箱或者手机号 @@ -255,6 +255,7 @@ namespace IRaCIS.Application.Services /// /// [HttpPost] + public async Task SetNewPassword(ResetPasswordCommand resetPwdModel) { if (resetPwdModel.IsReviewer) @@ -520,6 +521,23 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task ModifyPassword(EditPasswordCommand editPwModel) { + + + if( !string.IsNullOrEmpty(editPwModel.NewUserName)) + { + if (await _userRepository.AnyAsync(t => t.UserName == editPwModel.NewUserName && t.Id != _userInfo.Id)) + { + return ResponseOutput.NotOk("UserId already exists"); + } + + var success = await _userRepository.UpdateFromQueryAsync(t => t.Id == _userInfo.Id, u => new User() + { + UserName = editPwModel.NewUserName, + }); + + } + + //验证旧密码OK if (await _userRepository.FirstOrDefaultAsync(t => t.Id == _userInfo.Id && t.Password == editPwModel.OldPassWord) != null) { var success = await _userRepository.UpdateFromQueryAsync(t => t.Id == _userInfo.Id, u => new User() @@ -531,10 +549,12 @@ namespace IRaCIS.Application.Services return ResponseOutput.Result(success); } + //医生密码 if (await _doctorRepository.AnyAsync(t => t.Id == _userInfo.Id && t.Password == editPwModel.OldPassWord)) { var success = await _doctorRepository.UpdateFromQueryAsync(t => t.Id == _userInfo.Id, u => new Doctor() { + Password = editPwModel.NewPassWord }); diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs index e23ac4719..c75dc068f 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs @@ -250,6 +250,10 @@ namespace IRaCIS.Core.Application.Contracts public TrialSiteSurveyEnum? State { get; set; } public bool? IsAbandon { get; set; } + + public DateTime? UpdateTimeBegin { get; set; } + + public DateTime? UpdateTimeEnd { get; set; } } public class CopyTrialSiteSurveyDTO diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 503873396..78cad6049 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -369,6 +369,9 @@ namespace IRaCIS.Core.Application.Contracts .WhereIf(surveyQueryDTO.IsAbandon != null, t => t.IsAbandon == surveyQueryDTO.IsAbandon) .WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.UserKeyInfo), t => t.UserName.Contains(surveyQueryDTO.UserKeyInfo) || t.Phone.Contains(surveyQueryDTO.UserKeyInfo) || t.Email.Contains(surveyQueryDTO.UserKeyInfo)) .WhereIf(surveyQueryDTO.State != null, t => t.State == surveyQueryDTO.State) + .WhereIf(surveyQueryDTO.UpdateTimeBegin != null, t => t.UpdateTime >= surveyQueryDTO.UpdateTimeBegin) + .WhereIf(surveyQueryDTO.UpdateTimeEnd != null, t => t.UpdateTime <= surveyQueryDTO.UpdateTimeEnd) + .ProjectTo(_mapper.ConfigurationProvider); return await trialSiteSurveyQueryable.ToPagedListAsync(surveyQueryDTO.PageIndex, surveyQueryDTO.PageSize, surveyQueryDTO.SortField, surveyQueryDTO.Asc);