diff --git a/IRaCIS.Core.Application/BusinessFilter/TrialResourceFilter.cs b/IRaCIS.Core.Application/BusinessFilter/TrialResourceFilter.cs index 9c21757e4..3d204a825 100644 --- a/IRaCIS.Core.Application/BusinessFilter/TrialResourceFilter.cs +++ b/IRaCIS.Core.Application/BusinessFilter/TrialResourceFilter.cs @@ -115,13 +115,25 @@ namespace IRaCIS.Core.Application.Filter if (trialIdIndex > -1) { + // (?<="trialId" *: *").*?(?=",) + //使用正则 [0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12} var matchResult = Regex.Match(contentFromBody.Substring(trialIdIndex), @"[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}"); if (matchResult.Success) { - trialIdStr = matchResult.Value; + //有可能匹配错误 "trialId":"","documentId":"b8180000-3e2c-0016-9fe0-08da33f96236" 从缓存里面验证下 + var cacheResultDic = _provider.GetAll(new[] { matchResult.Value }); + + var trialStatusStr = cacheResultDic[matchResult.Value].Value; + + if (!string.IsNullOrWhiteSpace(trialStatusStr)) + { + trialIdStr = matchResult.Value; + } + + } else { @@ -136,7 +148,7 @@ namespace IRaCIS.Core.Application.Filter } //通过path 或者body 找到trialId 了 - if (trialIdStr != string.Empty) + if ( !string.IsNullOrWhiteSpace(trialIdStr)) { //如果没缓存数据,可能定时任务没执行或者缓存丢失 在此重新缓存 @@ -170,6 +182,7 @@ namespace IRaCIS.Core.Application.Filter } } + //添加项目 签名系统文档的时候 不做拦截 但是更新项目 签名项目文档的时候需要拦截 else if (_trialOptList.Any(t => t == TrialOpt.AddOrUpdateTrial ||t ==TrialOpt.SignSystemDocNoTrialId)) { await next.Invoke();