diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.csproj b/IRaCIS.Core.API/IRaCIS.Core.API.csproj index 8bdddbe5f..5a7be3fe9 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.csproj +++ b/IRaCIS.Core.API/IRaCIS.Core.API.csproj @@ -71,6 +71,7 @@ + diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index 50cb855b4..40ffb2743 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -28,6 +28,7 @@ using FellowOakDicom.Network; using IRaCIS.Core.Application.Service.ImageAndDoc; using IP2Region.Net.Abstractions; using IP2Region.Net.XDB; +using IRaCIS.Core.Application.BusinessFilter; #region 获取环境变量 @@ -104,11 +105,9 @@ builder.Services.AddControllers(options => options.Filters.Add(); options.Filters.Add(); options.Filters.Add(); + options.Filters.Add(10); + options.Filters.Add(); - if (_configuration.GetSection("BasicSystemConfig").GetValue("OpenLoginLimit")) - { - options.Filters.Add(); - } }) .AddNewtonsoftJsonSetup(builder.Services); // NewtonsoftJson 序列化 处理 @@ -117,6 +116,8 @@ builder.Services.AddOptions().Configure(_configuration.Ge builder.Services.AddOptions().Configure(_configuration.GetSection("BasicSystemConfig")); builder.Services.AddOptions().Configure(_configuration.GetSection("AliyunOSS")); builder.Services.AddOptions().Configure(_configuration.GetSection("ObjectStoreService")); +builder.Services.AddOptions().Configure(_configuration.GetSection("EncrypteResponseConfig")); + //动态WebApi + UnifiedApiResultFilter 省掉控制器代码 @@ -297,7 +298,7 @@ try - var server = DicomServerFactory.Create(11112,userState: app.Services); + var server = DicomServerFactory.Create(11112, userState: app.Services); app.Run(); diff --git a/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs index 00b718e2c..e2dc37494 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/hangfireSetup.cs @@ -3,6 +3,7 @@ using Hangfire.SqlServer; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System; +using System.Runtime.InteropServices; namespace IRaCIS.Core.API { @@ -14,19 +15,29 @@ namespace IRaCIS.Core.API services.AddHangfire(hangFireConfig => { - - //hangFireConfig.UseInMemoryStorage(); - - //指定存储介质 - hangFireConfig.UseSqlServerStorage(hangFireConnStr, new SqlServerStorageOptions() + //本地window 调试 使用内存,服务器部署使用数据库,防止服务器任务调度到本地 + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - SchemaName = "dbo", - CommandBatchMaxTimeout = TimeSpan.FromMinutes(5), - SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5), - QueuePollInterval = TimeSpan.Zero, - UseRecommendedIsolationLevel = true, - DisableGlobalLocks = true - }); + hangFireConfig.UseInMemoryStorage(); + + } + else + { + //指定存储介质 + hangFireConfig.UseSqlServerStorage(hangFireConnStr, new SqlServerStorageOptions() + { + SchemaName = "dbo", + CommandBatchMaxTimeout = TimeSpan.FromMinutes(5), + SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5), + QueuePollInterval = TimeSpan.Zero, + UseRecommendedIsolationLevel = true, + DisableGlobalLocks = true + }); + } + + + + //hangFireConfig.UseTagsWithSql(); //nuget引入Hangfire.Tags.SqlServer //.UseHangfireHttpJob(); diff --git a/IRaCIS.Core.API/appsettings.json b/IRaCIS.Core.API/appsettings.json index b6d0f4125..59dd671c2 100644 --- a/IRaCIS.Core.API/appsettings.json +++ b/IRaCIS.Core.API/appsettings.json @@ -92,5 +92,12 @@ "DefaultPassword": "123456", "DefaultInternalOrganizationName": "ExtImaging", "ImageShareExpireDays": 10 + }, + + "EncrypteResponseConfig": { + "IsEnable": true, + "ApiPathList": [ + "/test/get" + ] } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/BusinessFilter/EncreptApiResultFilter.cs b/IRaCIS.Core.Application/BusinessFilter/EncreptApiResultFilter.cs new file mode 100644 index 000000000..fd58ae885 --- /dev/null +++ b/IRaCIS.Core.Application/BusinessFilter/EncreptApiResultFilter.cs @@ -0,0 +1,71 @@ +using IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.Extensions.Options; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IRaCIS.Core.Application.BusinessFilter +{ + public class EncreptApiResultFilter : IAsyncResultFilter + { + + private readonly IOptionsMonitor _encreptResponseMonitor; + + public EncreptApiResultFilter(IOptionsMonitor encreptResponseMonitor) + { + _encreptResponseMonitor = encreptResponseMonitor; + } + + public async Task OnResultExecutionAsync(ResultExecutingContext context, ResultExecutionDelegate next) + { + + if(_encreptResponseMonitor.CurrentValue.IsEnable) + { + + if (context.Result is ObjectResult objectResult) + { + var statusCode = objectResult.StatusCode ?? context.HttpContext.Response.StatusCode; + + var objectValue = objectResult.Value; + + + if (objectValue is IResponseOutput) + { + var responseOutput = objectValue as IResponseOutput; + + var path = context.HttpContext?.Request.Path.Value?.ToLower(); + + + if(!string.IsNullOrEmpty(path) && path.Length>5 && _encreptResponseMonitor.CurrentValue.ApiPathList.Contains(path.ToLower())) + { + + if(responseOutput.IsSuccess) + { + responseOutput.Code = ApiResponseCodeEnum.ResultEncrepted; + responseOutput.Data = JsonConvert.SerializeObject(Convert.ToBase64String(Encoding.UTF8.GetBytes(responseOutput.Data.ToString()))); + + objectResult.Value = responseOutput; + } + + } + + } + + + + } + } + + + + + await next.Invoke(); + + } + } +} diff --git a/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs b/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs index a41c659b1..9e5fdf591 100644 --- a/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs +++ b/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs @@ -8,8 +8,9 @@ namespace IRaCIS.Application.Services.BusinessFilter /// 统一返回前端数据包装,之前在控制器包装,现在修改为动态Api 在ResultFilter这里包装,减少重复冗余代码 /// by zhouhang 2021.09.12 周末 /// - public class UnifiedApiResultFilter : Attribute, IAsyncResultFilter - { + public class UnifiedApiResultFilter : Attribute, IAsyncResultFilter + { + /// /// 异步版本 /// @@ -26,15 +27,6 @@ namespace IRaCIS.Application.Services.BusinessFilter //是200 并且没有包装 那么包装结果 if (statusCode == 200 && !(objectResult.Value is IResponseOutput)) { - //if (objectResult.Value == null) - //{ - // var apiResponse = ResponseOutput.DBNotExist(); - - // objectResult.Value = apiResponse; - // objectResult.DeclaredType = apiResponse.GetType(); - //} - //else - //{ var type = objectResult.Value?.GetType(); @@ -64,8 +56,6 @@ namespace IRaCIS.Application.Services.BusinessFilter objectResult.DeclaredType = apiResponse.GetType(); } - - //} } //如果不是200 是IResponseOutput 不处理 diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index 190d0446a..e34361d6f 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -190,7 +190,7 @@ namespace IRaCIS.Application.Services messageToSend = await GetEmailSubejctAndHtmlInfoAndBuildAsync(mfaType == UserMFAType.Login ? EmailBusinessScenario.MFALogin : EmailBusinessScenario.MFAUnlock, messageToSend, emailConfigFunc); - var sucessHandle = GetEmailSuccessHandle(userId, verificationCode); + var sucessHandle = GetEmailSuccessHandle(userId, verificationCode, emailAddress); await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle); @@ -229,7 +229,7 @@ namespace IRaCIS.Application.Services messageToSend = await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.UserResetEmail, messageToSend, emailConfigFunc); - var sucessHandle = GetEmailSuccessHandle(userId, verificationCode); + var sucessHandle = GetEmailSuccessHandle(userId, verificationCode, emailAddress); await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle); @@ -269,7 +269,7 @@ namespace IRaCIS.Application.Services messageToSend = await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.UnloginUseEmailResetPassword, messageToSend, emailConfigFunc); ////此时不知道用户 - var sucessHandle = GetEmailSuccessHandle(Guid.Empty, verificationCode); + var sucessHandle = GetEmailSuccessHandle(Guid.Empty, verificationCode, emailAddress); await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle); @@ -355,7 +355,7 @@ namespace IRaCIS.Application.Services messageToSend = await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.SiteSurveyLogin, messageToSend, emailConfigFunc); //此时不知道用户 - var sucessHandle = GetEmailSuccessHandle(Guid.Empty, verificationCode); + var sucessHandle = GetEmailSuccessHandle(Guid.Empty, verificationCode, emailAddress); await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle); diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs index c95598753..155bc42ad 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs @@ -79,6 +79,10 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO public int InstanceNumber { get; set; } + public Guid? StudyId { get; set; } + + public Guid? SeriesId { get; set; } + [JsonIgnore] public int ShowOrder { get; set; } [JsonIgnore] diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs new file mode 100644 index 000000000..5635af438 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs @@ -0,0 +1,97 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2024-07-30 10:39:12 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- +using System; +using IRaCIS.Core.Domain.Share; +using System.Collections.Generic; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +namespace IRaCIS.Core.Application.ViewModel +{ + /// UserFeedBackView 列表视图模型 + public class UserFeedBackView : UserFeedBackAddOrEdit + { + public string TrialCode { get; set; } + + public string ExperimentName { get; set; } + + public string SubjectCode { get; set; } + + public string TrialSiteCode { get; set; } + + public string SubjectVisitName { get; set; } + + + public string FeedBackUserName { get; set; } + + public string FeedBackFullName { get; set; } + + + public DateTime CreateTime { get; set; } + public DateTime UpdateTime { get; set; } + + public UserTypeEnum UserTypeEnum { get; set; } + } + + ///UserFeedBackQuery 列表查询参数模型 + public class UserFeedBackQuery : PageInput + { + + public string? TrialKeyInfo { get; set; } + + public string? SubejctAndVisitKeyInfo { get; set; } + + public UserTypeEnum? UserTypeEnum { get; set; } + + public string FeedBackKeyInfo { get; set; } + + public string? QuestionDescription { get; set; } + + public int? QuestionType { get; set; } + + public int? State { get; set; } + + public string? TrialSiteCode { get; set; } + + public DateTime? BeginCreatime { get; set; } + + public DateTime? EndCreatime { get; set; } + + + + } + + /// UserFeedBackAddOrEdit 列表查询参数模型 + public class UserFeedBackAddOrEdit + { + public Guid? Id { get; set; } + public Guid? SubjectId { get; set; } + public Guid? SubjectVisitId { get; set; } + public int QuestionType { get; set; } + public string QuestionDescription { get; set; } + + public int State { get; set; } + public Guid? TrialSiteId { get; set; } + + [NotDefault] + public Guid TrialId { get; set; } + + public List ScreenshotList { get; set; } + + [JsonIgnore] + public string ScreenshotListStr { get; set; } + } + + + public class BatchUpdateCommand + { + public List IdList { get; set; } + + public int State { get; set; } + } + +} + + diff --git a/IRaCIS.Core.Application/Service/Management/Interface/IUserFeedBackService.cs b/IRaCIS.Core.Application/Service/Management/Interface/IUserFeedBackService.cs new file mode 100644 index 000000000..6fa7976a3 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Management/Interface/IUserFeedBackService.cs @@ -0,0 +1,24 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2024-07-30 10:39:05 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- + +using IRaCIS.Core.Application.ViewModel; +namespace IRaCIS.Core.Application.Interfaces +{ + /// + /// IUserFeedBackService + /// + public interface IUserFeedBackService + { + + Task> GetUserFeedBackList(UserFeedBackQuery inQuery); + + Task AddOrUpdateUserFeedBack(UserFeedBackAddOrEdit addOrEditUserFeedBack); + + Task DeleteUserFeedBack(Guid userFeedBackId); + + + } +} diff --git a/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs new file mode 100644 index 000000000..e21a818fe --- /dev/null +++ b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs @@ -0,0 +1,89 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2024-07-30 10:39:09 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- + +using IRaCIS.Core.Domain.Models; +using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.ViewModel; +using Newtonsoft.Json; +namespace IRaCIS.Core.Application.Service +{ + /// + /// UserFeedBackService + /// + [ApiExplorerSettings(GroupName = "Management")] + public class UserFeedBackService : BaseService, IUserFeedBackService + { + + private readonly IRepository _userFeedBackRepository; + + public UserFeedBackService(IRepository userFeedBackRepository) + { + _userFeedBackRepository = userFeedBackRepository; + } + + [HttpPost] + public async Task> GetUserFeedBackList(UserFeedBackQuery inQuery) + { + + var userFeedBackQueryable = _userFeedBackRepository + .WhereIf(inQuery.State != null, t => t.State == inQuery.State) + .WhereIf(inQuery.QuestionType != null, t => t.QuestionType == inQuery.QuestionType) + .WhereIf(inQuery.BeginCreatime != null, t => t.CreateTime >= inQuery.BeginCreatime) + + .WhereIf(inQuery.EndCreatime != null, t => t.CreateTime == inQuery.EndCreatime) + .WhereIf(inQuery.UserTypeEnum != null, t => t.CreateUser.UserTypeEnum == inQuery.UserTypeEnum) + .WhereIf(!string.IsNullOrEmpty(inQuery.QuestionDescription), t => t.QuestionDescription.Contains(inQuery.QuestionDescription) ) + .WhereIf(!string.IsNullOrEmpty(inQuery.TrialKeyInfo), t => t.Trial.ExperimentName.Contains(inQuery.TrialKeyInfo) || t.Trial.TrialCode.Contains(inQuery.TrialKeyInfo)) + .WhereIf(!string.IsNullOrEmpty(inQuery.SubejctAndVisitKeyInfo), t => t.Subject.Code.Contains(inQuery.SubejctAndVisitKeyInfo) || t.SubjectVisit.VisitName.Contains(inQuery.SubejctAndVisitKeyInfo)) + .WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode) ) + + .ProjectTo(_mapper.ConfigurationProvider); + + var pageList = await userFeedBackQueryable + + .ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(UserFeedBackView.Id) : inQuery.SortField, + inQuery.Asc); + + return pageList; + } + + + public async Task AddOrUpdateUserFeedBack(UserFeedBackAddOrEdit addOrEditUserFeedBack) + { + addOrEditUserFeedBack.ScreenshotListStr = JsonConvert.SerializeObject(addOrEditUserFeedBack.ScreenshotList); + + + var entity = await _userFeedBackRepository.InsertOrUpdateAsync(addOrEditUserFeedBack, true); + + return ResponseOutput.Ok(entity.Id.ToString()); + + } + + /// + /// 批量更新状态 + /// + /// + /// + [HttpPut] + public async Task BatchUpdateFeedBackState(BatchUpdateCommand batchUpdateCommand) + { + await _userFeedBackRepository.BatchUpdateNoTrackingAsync(t => batchUpdateCommand.IdList.Contains(t.Id), u => new UserFeedBack() { State = batchUpdateCommand.State }); + + return ResponseOutput.Ok(); + } + + + [HttpDelete("{userFeedBackId:guid}")] + public async Task DeleteUserFeedBack(Guid userFeedBackId) + { + var success = await _userFeedBackRepository.DeleteFromQueryAsync(t => t.Id == userFeedBackId, true); + return ResponseOutput.Ok(); + } + + + } +} diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 151b5c907..f103313cf 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -208,6 +208,11 @@ namespace IRaCIS.Application.Services return ResponseOutput.NotOk(_localizer["User_VerificationCodeExpired"]); } + else if (verificationRecord.EmailOrPhone.Trim() != newEmail.Trim()) + { + //发送验证嘛的和提交的邮箱不一致 + return ResponseOutput.NotOk(_localizer["User_VerificationEmailNotSameWithBefore"]); + } else //验证码正确 并且 没有超时 { @@ -684,7 +689,7 @@ namespace IRaCIS.Application.Services [AllowAnonymous] public async Task VerifyMFACodeAsync(Guid userId, string Code) { - var verificationRecord = await _repository.GetQueryable().OrderByDescending(x => x.ExpirationTime).Where(t => t.UserId == userId && t.Code == Code && t.CodeType == VerifyType.Email).FirstOrDefaultAsync(); + var verificationRecord = await _verificationCodeRepository.Where(t => t.UserId == userId && t.Code == Code && t.CodeType == VerifyType.Email).OrderByDescending(x => x.ExpirationTime).FirstOrDefaultAsync(); VerifyEmialGetDoctorInfoOutDto result = new VerifyEmialGetDoctorInfoOutDto(); //检查数据库是否存在该验证码 @@ -707,6 +712,10 @@ namespace IRaCIS.Application.Services } else //验证码正确 并且 没有超时 { + + + //删除验证码历史记录 + await _verificationCodeRepository.BatchDeleteNoTrackingAsync(t => t.Id == verificationRecord.Id); await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = userId, OptUserId = userId, OptType = UserOptType.MFALogin }, true); } diff --git a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs index 744c906a8..5619e7127 100644 --- a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs @@ -125,6 +125,18 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.OptUserName, c => c.MapFrom(t => t.OptUser.UserName)) .ForMember(d => d.OptUserTypeEnum, c => c.MapFrom(t => t.OptUser.UserTypeEnum)) ; + + + CreateMap() + .ForMember(d => d.ExperimentName, c => c.MapFrom(t => t.Trial.ExperimentName)) + .ForMember(d => d.TrialCode, c => c.MapFrom(t => t.Trial.TrialCode)) + .ForMember(d => d.SubjectCode, c => c.MapFrom(t => t.Subject.Code)) + .ForMember(d => d.TrialSiteCode, c => c.MapFrom(t => t.TrialSite.TrialSiteCode)) + .ForMember(d => d.SubjectVisitName, c => c.MapFrom(t => t.SubjectVisit.VisitName)) + .ForMember(d => d.FeedBackUserName, c => c.MapFrom(t => t.CreateUser.UserName)) + .ForMember(d => d.FeedBackFullName, c => c.MapFrom(t => t.CreateUser.FullName)) + .ForMember(d => d.UserTypeEnum, c => c.MapFrom(t => t.CreateUser.UserTypeEnum)); + CreateMap().ReverseMap(); } } diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 9ff013fac..2665746ff 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -117,6 +117,10 @@ namespace IRaCIS.Core.Application.Contracts } else //验证码正确 并且 没有超时 { + + //删除验证码历史记录 + await _repository.BatchDeleteAsync(t => t.Id == verificationRecord.Id); + var dockerInfo = await _repository.Where(t => t.EMail == inDto.EmailOrPhone || t.Phone == inDto.EmailOrPhone).FirstOrDefaultAsync(); if (dockerInfo != null) @@ -192,6 +196,9 @@ namespace IRaCIS.Core.Application.Contracts } else { + //删除验证码历史记录 + await _repository.BatchDeleteAsync(t => t.Id == verifyRecord.Id); + //验证码正确 不处理 } diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 3f8ab4aec..071d8bf8b 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -637,7 +637,8 @@ namespace IRaCIS.Core.Application.Services HtmlPath = k.HtmlPath, Path = k.Path, InstanceNumber = k.InstanceNumber, - + StudyId= k.StudyId, + SeriesId= k.SeriesId, }).ToListAsync(); item.InstanceInfoList.ForEach(x => diff --git a/IRaCIS.Core.Domain/Management/UserFeedBack.cs b/IRaCIS.Core.Domain/Management/UserFeedBack.cs new file mode 100644 index 000000000..d9ec5f7bb --- /dev/null +++ b/IRaCIS.Core.Domain/Management/UserFeedBack.cs @@ -0,0 +1,77 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2024-07-30 10:39:01 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Collections.Generic; +namespace IRaCIS.Core.Domain.Models +{ + /// + ///UserFeedBack + /// + [Table("UserFeedBack")] + public class UserFeedBack : Entity, IAuditUpdate, IAuditAdd + { + [JsonIgnore] + public Trial Trial { get; set; } + [JsonIgnore] + public Subject Subject { get; set; } + [JsonIgnore] + public SubjectVisit SubjectVisit { get; set; } + [JsonIgnore] + public TrialSite TrialSite { get; set; } + [JsonIgnore] + public User CreateUser { get; set; } + + public Guid? SubjectId { get; set; } + + + public Guid? SubjectVisitId { get; set; } + + + public int QuestionType { get; set; } + + public string QuestionDescription { get; set; } + + + public Guid CreateUserId { get; set; } + + + public DateTime CreateTime { get; set; } + + + public Guid UpdateUserId { get; set; } + + + public DateTime UpdateTime { get; set; } + + + public int State { get; set; } + + + public Guid? TrialSiteId { get; set; } + + + public Guid TrialId { get; set; } + + public string ScreenshotListStr { get; set; } + + // + [NotMapped] + public List ScreenshotList => JsonConvert.DeserializeObject>(ScreenshotListStr); + + + + //public class ScreenshotInfo + //{ + // public string Path { get; set; } + + // public string Name { get; set; } + //} + + } + } diff --git a/IRaCIS.Core.Domain/_Config/_AppSettings.cs b/IRaCIS.Core.Domain/_Config/_AppSettings.cs index 80aed90e8..a4833050b 100644 --- a/IRaCIS.Core.Domain/_Config/_AppSettings.cs +++ b/IRaCIS.Core.Domain/_Config/_AppSettings.cs @@ -1,6 +1,7 @@ using IRaCIS.Core.Domain.Models; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration.Json; +using System.Collections.Generic; namespace IRaCIS.Core.Domain.Share { @@ -19,7 +20,7 @@ namespace IRaCIS.Core.Domain.Share public int LoginMaxFailCount { get; set; } - public int LoginFailLockMinutes { get; set; } + public int LoginFailLockMinutes { get; set; } public int AutoLoginOutMinutes { get; set; } @@ -39,9 +40,9 @@ namespace IRaCIS.Core.Domain.Share public class SystemEmailSendConfig { - public int Port { get; set; } + public int Port { get; set; } - public string Host { get; set; } + public string Host { get; set; } public string FromEmail { get; set; } @@ -66,6 +67,13 @@ namespace IRaCIS.Core.Domain.Share } + public class EncreptResponseOption + { + public bool IsEnable { get; set; } + + public List ApiPathList { get; set; } + } + /// /// 项目基础配置规则 @@ -89,7 +97,7 @@ namespace IRaCIS.Core.Domain.Share public static string SystemSiteCodePrefix { get; set; } - public static string BlindTaskPrefix { get; set; } + public static string BlindTaskPrefix { get; set; } /// /// 用户默认密码 @@ -104,7 +112,7 @@ namespace IRaCIS.Core.Domain.Share { Path = "appsettings.json", ReloadOnChange = true - }) + }) .Build(); DoctorCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("DoctorCodePrefix"); @@ -112,7 +120,7 @@ namespace IRaCIS.Core.Domain.Share QCChallengeCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("QCChallengeCodePrefix"); NoneDicomStudyCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("NoneDicomStudyCodePrefix"); DicomStudyCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("DicomStudyCodePrefix"); - DefaultPassword= configuration.GetSection("IRaCISBasicConfig").GetValue("DefaultPassword"); + DefaultPassword = configuration.GetSection("IRaCISBasicConfig").GetValue("DefaultPassword"); SystemSiteCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("SystemSiteCodePrefix"); DefaultInternalOrganizationName = configuration.GetSection("IRaCISBasicConfig").GetValue("DefaultInternalOrganizationName"); @@ -125,7 +133,7 @@ namespace IRaCIS.Core.Domain.Share //获取实体编码字符串 - public static string GetCodeStr(int codeInt ,string typeStr) + public static string GetCodeStr(int codeInt, string typeStr) { switch (typeStr) { @@ -139,7 +147,7 @@ namespace IRaCIS.Core.Domain.Share case nameof(QCChallenge): - return QCChallengeCodePrefix+ codeInt.ToString("D5"); + return QCChallengeCodePrefix + codeInt.ToString("D5"); case nameof(NoneDicomStudy): @@ -164,5 +172,5 @@ namespace IRaCIS.Core.Domain.Share } - + } \ No newline at end of file diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index f4dcffdd9..f81edd5f5 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -495,6 +495,8 @@ namespace IRaCIS.Core.Infra.EFCore public virtual DbSet SCPImageUpload { get; set; } + public virtual DbSet UserFeedBack { get; set; } + public override async Task SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken()) { diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs index 459ea65fb..a2d88b1c8 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ApiResponseCodeEnum.cs @@ -54,7 +54,9 @@ namespace IRaCIS.Core.Infrastructure.Extention NoToken = 10, //带了Token,但是没有相应权限(该用户类型不能做) - HaveTokenNotAccess = 11 + HaveTokenNotAccess = 11, + + ResultEncrepted=12 } diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/IResponseOutput.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/IResponseOutput.cs index 9c713a8a0..13b15698a 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/IResponseOutput.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/IResponseOutput.cs @@ -27,7 +27,7 @@ /// /// 返回数据 /// - T Data { get; } + T Data { get; set; } } //public interface IResponseOutput : IResponseOutput diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ResponseOutput.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ResponseOutput.cs index af255eeb2..74325db91 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ResponseOutput.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ResponseOutput.cs @@ -25,7 +25,7 @@ namespace IRaCIS.Core.Infrastructure.Extention /// 数据 兼顾以前 Json序列化的时候返回属性名为“Result” /// [JsonProperty("Result")] - public T Data { get; private set; } + public T Data { get; set; } [JsonProperty("OtherInfo")] diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude index 8790fcb50..d33e52c37 100644 --- a/IRaCIS.Core.Test/DbHelper.ttinclude +++ b/IRaCIS.Core.Test/DbHelper.ttinclude @@ -4,7 +4,7 @@ public static readonly string ConnectionString = "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true"; public static readonly string DbDatabase = "Test_IRC"; //表名称用字符串,拼接 - public static readonly string TableName = "TrialSiteDicomAE"; + public static readonly string TableName = "UserFeedBack"; //具体文件里面 例如service 可以配置是否分页 } #>