diff --git a/IRaCIS.Core.API/Program.cs b/IRaCIS.Core.API/Program.cs index 2405bb310..8675aa1e6 100644 --- a/IRaCIS.Core.API/Program.cs +++ b/IRaCIS.Core.API/Program.cs @@ -38,25 +38,10 @@ namespace IRaCIS.Core.API }) .Build(); - #region Id Generate long类型 - - - //// 创建 IdGeneratorOptions 对象,请在构造函数中输入 WorkerId: - //var options = new IdGeneratorOptions(1); - ////options.WorkerIdBitLength = 10; - - //YitIdHelper.SetIdGenerator(options); - - //var newId = YitIdHelper.NextId(); - - #endregion NewId.SetProcessIdProvider(new CurrentProcessIdProvider()); - for (int i= 0; i < 10;i++ ) - { - Console.WriteLine(NewId.NextGuid()); - } + //// Serilog diff --git a/IRaCIS.Core.API/appsettings.Development.json b/IRaCIS.Core.API/appsettings.Development.json index f70f66e4c..73669f49d 100644 --- a/IRaCIS.Core.API/appsettings.Development.json +++ b/IRaCIS.Core.API/appsettings.Development.json @@ -11,20 +11,12 @@ //,"hang": "Server=ZHOU;Database=IRaCIS;User ID=sa;Password=sa123456;", }, - "HttpReports": { - "Transport": { - "CollectorAddress": "http://123.56.181.144:6099/", - "DeferSecond": 10, - "DeferThreshold": 100 - }, - "Server": "http://localhost:6100/", - "Service": "IRaCIS", - "Switch": true, - //"RequestFilter": [ "/api/health/*", "/HttpReports*" ], - "WithRequest": true, - "WithResponse": true, - "WithCookie": false, - "WithHeader": true + "BasicSystemConfig": { + + "OpenUserComplexPassword": false, + + "OpenSignDocumentBeforeWork": false } + } diff --git a/IRaCIS.Core.API/appsettings.Production.json b/IRaCIS.Core.API/appsettings.Production.json index 3c92491b3..4a7ceba33 100644 --- a/IRaCIS.Core.API/appsettings.Production.json +++ b/IRaCIS.Core.API/appsettings.Production.json @@ -11,20 +11,12 @@ "RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true", "Remote8099": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_Test;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true" }, - "HttpReports": { - "Transport": { - "CollectorAddress": "http://123.56.181.144:6099/", - "DeferSecond": 10, - "DeferThreshold": 100 - }, - "Server": "http://123.56.181.144:8060/", - "Service": "IRaCIS_8060", - "Switch": true, - //"RequestFilter": [ "/api/health/*", "/HttpReports*" ], - "WithRequest": true, - "WithResponse": true, - "WithCookie": false, - "WithHeader": true + "BasicSystemConfig": { + + "OpenUserComplexPassword": true, + + "OpenSignDocumentBeforeWork": true } + } diff --git a/IRaCIS.Core.API/appsettings.Staging.json b/IRaCIS.Core.API/appsettings.Staging.json index ad3c2814a..c6b1dd4ec 100644 --- a/IRaCIS.Core.API/appsettings.Staging.json +++ b/IRaCIS.Core.API/appsettings.Staging.json @@ -9,19 +9,10 @@ "ConnectionStrings": { "RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true" }, - "HttpReports": { - "Transport": { - "CollectorAddress": "http://123.56.181.144:6099/", - "DeferSecond": 10, - "DeferThreshold": 100 - }, - "Server": "http://192.168.1.2:8000/", - "Service": "IRaCIS_1.2_8000", - "Switch": true, - //"RequestFilter": [ "/api/health/*", "/HttpReports*" ], - "WithRequest": true, - "WithResponse": true, - "WithCookie": false, - "WithHeader": true + "BasicSystemConfig": { + + "OpenUserComplexPassword": false, + + "OpenSignDocumentBeforeWork": false } } diff --git a/IRaCIS.Core.Application/Helper/ExcelExportHelper.cs b/IRaCIS.Core.Application/Helper/ExcelExportHelper.cs index f7363fab2..6941b73a5 100644 --- a/IRaCIS.Core.Application/Helper/ExcelExportHelper.cs +++ b/IRaCIS.Core.Application/Helper/ExcelExportHelper.cs @@ -13,7 +13,7 @@ public static class ExcelExportHelper if (doc == null) { - throw new Exception("褰撳墠code 娌℃壘鍒板搴旂殑瀵煎嚭妯℃澘鏂囦欢"); + throw new Exception("褰撳墠code 娌℃壘鍒板搴旂殑瀵煎嚭妯℃澘鏂囦欢,璇锋牳瀵规槸鍚︿慨鏀逛簡閰嶇疆鏁版嵁"); } var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))?.FullName; diff --git a/IRaCIS.Core.Application/Helper/ImageResize.cs b/IRaCIS.Core.Application/Helper/ImageResize.cs index a864f0786..147ff0bc5 100644 --- a/IRaCIS.Core.Application/Helper/ImageResize.cs +++ b/IRaCIS.Core.Application/Helper/ImageResize.cs @@ -7,7 +7,7 @@ namespace IRaCIS.Core.Application.Helper; public static class ImageResizeHelper { - + // 閲囩敤ImageSharp缁勪欢 璺ㄥ钩鍙帮紝涓嶄緷璧杦indows 骞冲彴鍥惧儚澶勭悊缁勪欢锛岃繖閲屽ぇ鍧(net 6 涓嬶紝涔嬪墠鐢变簬Dicom澶勭悊鏈鏂扮粍浠 渚濊禆浜嗚繖涓簱鐨勪竴涓棫鐗堟湰锛屽鑷寸缉鐣ュ浘bug锛屽崟鐙崌绾т緷璧栫粍浠舵墠瑙e喅) public static void ResizeSave(string filePath, string? fileStorePath) { @@ -16,7 +16,6 @@ public static class ImageResizeHelper using (var image = SixLabors.ImageSharp.Image.Load(filePath)) { - image.Mutate(x => x.Resize(500, 500)); image.Save(fileStorePath); diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 8ca78e239..028e99f18 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -142,6 +142,12 @@ namespace IRaCIS.Application.Services [HttpGet] public async Task InitSetUserNameAndPwd (Guid userId, string newUserName,string newPWd) { + + //姝e垯 鑷冲皯8涓瓧绗︼紝鑷冲皯1涓ぇ鍐欏瓧姣嶏紝1涓皬鍐欏瓧姣嶏紝1涓暟瀛楀拰1涓壒娈婂瓧绗︼細 + //^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,} + + + await _userRepository.UpdatePartialFromQueryAsync(userId, u => new User() { UserName = newUserName, diff --git a/IRaCIS.Core.Application/Service/QC/Interface/ITrialQCQuestionConfigureService.cs b/IRaCIS.Core.Application/Service/QC/Interface/ITrialQCQuestionConfigureService.cs index dc6258bf0..47e64f614 100644 --- a/IRaCIS.Core.Application/Service/QC/Interface/ITrialQCQuestionConfigureService.cs +++ b/IRaCIS.Core.Application/Service/QC/Interface/ITrialQCQuestionConfigureService.cs @@ -11,7 +11,7 @@ namespace IRaCIS.Core.Application.Contracts { Task AddOrUpdateTrialQCQuestionConfigure(TrialQCQuestionAddOrEdit addOrEditTrialQCQuestionConfigure); Task BatchAddTrialQCQuestionConfigure(List batchList, Guid trialId); - Task DeleteTrialQCQuestionConfigure(Guid trialQCQuestionConfigureId); + Task DeleteTrialQCQuestionConfigure(Guid trialQCQuestionConfigureId, Guid trialId); //Task> GetTrialQCQuestionConfigureList(TrialQCQuestionQuery queryTrialQCQuestionConfigure); } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs index ce1ba0230..4bc56471c 100644 --- a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs @@ -5,6 +5,7 @@ //-------------------------------------------------------------------- using IRaCIS.Core.Infra.EFCore; +using IRaCIS.Core.Infrastructure; using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Contracts @@ -39,9 +40,14 @@ namespace IRaCIS.Core.Application.Contracts var signInfo = await _repository.Where(t => t.Id == queryTrialQCQuestionConfigure.TrialId) - .Select(trial => new {trial.QCProcessEnum, trial.QCQuestionConfirmedTime, trial.QCQuestionConfirmedUserId, - RealName = trial.QCQuestionConfirmedUser.FullName, trial.QCQuestionConfirmedUser.UserName, - IsHaveQCQuestion= isHaveQCQuestion + .Select(trial => new + { + trial.QCProcessEnum, + trial.QCQuestionConfirmedTime, + trial.QCQuestionConfirmedUserId, + RealName = trial.QCQuestionConfirmedUser.FullName, + trial.QCQuestionConfirmedUser.UserName, + IsHaveQCQuestion = isHaveQCQuestion }).FirstOrDefaultAsync(); return (list, signInfo!); @@ -100,6 +106,15 @@ namespace IRaCIS.Core.Application.Contracts return ids; } + + public async Task VerifyIsQCConfirmedAsync(Guid trialId) + { + if (!await _repository.AnyAsync(t => t.Id == trialId && t.QCQuestionConfirmedUserId == null)) + { + throw new BusinessValidationFailedException("QC宸茬‘璁わ紝涓嶅厑璁告搷浣"); + } + } + /// /// 鎵归噺娣诲姞 QC 闂 /// @@ -109,10 +124,8 @@ namespace IRaCIS.Core.Application.Contracts [HttpPost("{trialId:guid}")] public async Task BatchAddTrialQCQuestionConfigure(List batchList, Guid trialId) { - if (!await _repository.AnyAsync(t => t.Id == trialId && t.QCQuestionConfirmedUserId == null)) - { - return ResponseOutput.NotOk("QC宸茬‘璁わ紝涓嶅厑璁告搷浣"); - } + + await VerifyIsQCConfirmedAsync(trialId); var batchConfigList = _mapper.Map>(batchList); batchConfigList.ForEach(t => t.TrialId = trialId); @@ -127,10 +140,7 @@ namespace IRaCIS.Core.Application.Contracts public async Task AddOrUpdateTrialQCQuestionConfigure(TrialQCQuestionAddOrEdit addOrEditTrialQCQuestionConfigure) { - if (!await _repository.AnyAsync(t => t.Id == addOrEditTrialQCQuestionConfigure.TrialId && t.QCQuestionConfirmedUserId == null)) - { - return ResponseOutput.NotOk("QC宸茬‘璁わ紝涓嶅厑璁告搷浣"); - } + await VerifyIsQCConfirmedAsync(addOrEditTrialQCQuestionConfigure.TrialId); var entity = await _trialQcQuestionRepository.InsertOrUpdateAsync(addOrEditTrialQCQuestionConfigure, true); @@ -138,26 +148,23 @@ namespace IRaCIS.Core.Application.Contracts } - [HttpDelete("{trialQCQuestionConfigureId:guid}")] - public async Task DeleteTrialQCQuestionConfigure(Guid trialQCQuestionConfigureId) + [HttpDelete("{trialId:guid}/{trialQCQuestionConfigureId:guid}")] + public async Task DeleteTrialQCQuestionConfigure(Guid trialQCQuestionConfigureId, Guid trialId) { + await VerifyIsQCConfirmedAsync(trialId); if (await _trialQcQuestionRepository.AnyAsync(t => t.ParentId == trialQCQuestionConfigureId)) { return ResponseOutput.NotOk("璇峰厛娓呴櫎瀛愰棶棰 鍐嶅垹闄ょ埗闂"); } - if (!await _trialQcQuestionRepository.AnyAsync(t => t.Id == trialQCQuestionConfigureId && t.Trial.QCQuestionConfirmedUserId == null)) - { - return ResponseOutput.NotOk("QC宸茬‘璁わ紝涓嶅厑璁告搷浣"); - } if (await _repository.AnyAsync(t => t.TrialQCQuestionConfigureId == trialQCQuestionConfigureId)) { return ResponseOutput.NotOk("宸叉湁QC瀹℃牳璁板綍锛屼笉鍏佽鍒犻櫎璇ラ棶棰橀」"); } - var success = await _trialQcQuestionRepository.DeleteFromQueryAsync(t => t.Id == trialQCQuestionConfigureId,true); + var success = await _trialQcQuestionRepository.DeleteFromQueryAsync(t => t.Id == trialQCQuestionConfigureId, true); return ResponseOutput.Result(true); }