Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is running
Details
continuous-integration/drone/push Build is running
Details
commit
943dbb28a6
|
|
@ -34,10 +34,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IRepository<TrialDictionary> _trialDictionaryRepository,
|
IRepository<TrialDictionary> _trialDictionaryRepository,
|
||||||
IRepository<TrialBodyPart> _trialBodyPartRepository,
|
IRepository<TrialBodyPart> _trialBodyPartRepository,
|
||||||
IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig,
|
IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig,
|
||||||
|
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig,
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, ITrialService
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, ITrialService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||||
|
|
||||||
public bool TrialExpeditedChange { get; set; } = false;
|
public bool TrialExpeditedChange { get; set; } = false;
|
||||||
|
|
||||||
|
|
@ -113,9 +114,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
List<int> pm = new List<int>() { (int)UserTypeEnum.ProjectManager };
|
List<int> pm = new List<int>() { (int)UserTypeEnum.ProjectManager };
|
||||||
|
|
||||||
// QA EA
|
// QA EA
|
||||||
List<int> qAEq= new List<int>() { (int)UserTypeEnum.QA, (int)UserTypeEnum.EA };
|
List<int> qAEq = new List<int>() { (int)UserTypeEnum.QA, (int)UserTypeEnum.EA };
|
||||||
|
|
||||||
List<int> other = new List<int>() { };
|
List<int> other = new List<int>() { };
|
||||||
|
|
||||||
other.AddRange(sap);
|
other.AddRange(sap);
|
||||||
other.AddRange(pm);
|
other.AddRange(pm);
|
||||||
|
|
@ -125,24 +126,24 @@ namespace IRaCIS.Core.Application.Service
|
||||||
return await _trialRepository.AsQueryable()
|
return await _trialRepository.AsQueryable()
|
||||||
|
|
||||||
//SuperAdmin Admin OP
|
//SuperAdmin Admin OP
|
||||||
.WhereIf(sap.Contains(_userInfo.UserTypeEnumInt),x=> trialState.Contains(x.TrialStatusStr))
|
.WhereIf(sap.Contains(_userInfo.UserTypeEnumInt), x => trialState.Contains(x.TrialStatusStr))
|
||||||
|
|
||||||
// pm
|
// pm
|
||||||
.WhereIf(pm.Contains(_userInfo.UserTypeEnumInt),t=> t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
.WhereIf(pm.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
||||||
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
||||||
&& t.IsDeleted == false)
|
&& t.IsDeleted == false)
|
||||||
|
|
||||||
|
|
||||||
// QA EA
|
// QA EA
|
||||||
.WhereIf(qAEq.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
.WhereIf(qAEq.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
||||||
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
||||||
&& t.IsDeleted == false && trialState.Contains(t.TrialStatusStr))
|
&& t.IsDeleted == false && trialState.Contains(t.TrialStatusStr))
|
||||||
|
|
||||||
|
|
||||||
// other
|
// other
|
||||||
.WhereIf(!other.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
.WhereIf(!other.Contains(_userInfo.UserTypeEnumInt), t => t.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.IsDeleted == false
|
||||||
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
&& t.TrialUserRoleList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false))
|
||||||
&& t.IsDeleted == false&& t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
&& t.IsDeleted == false && t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||||
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -330,6 +331,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
trial.UpdateTime = DateTime.Now;
|
trial.UpdateTime = DateTime.Now;
|
||||||
|
|
||||||
|
#region 邮件默认值
|
||||||
|
trial.EmailAuthorizationCode = _systemEmailConfig.AuthorizationCode;
|
||||||
|
trial.EmailFromEmail = _systemEmailConfig.FromEmail;
|
||||||
|
trial.EmailFromName = $"{_systemEmailConfig.FromName}-{trial.TrialCode}";
|
||||||
|
trial.EmailSMTPServerAddress = _systemEmailConfig.Host;
|
||||||
|
trial.EmailSMTPServerPort = _systemEmailConfig.Port;
|
||||||
|
#endregion
|
||||||
|
|
||||||
var success = await _trialRepository.SaveChangesAsync();
|
var success = await _trialRepository.SaveChangesAsync();
|
||||||
|
|
||||||
//维护CRO Sponsor
|
//维护CRO Sponsor
|
||||||
|
|
@ -479,7 +488,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task DeleteOSSFolder()
|
public async Task DeleteOSSFolder()
|
||||||
{
|
{
|
||||||
List<Guid> trialids = await _trialRepository.Select(x => x.Id).ToListAsync();
|
List<Guid> trialids = await _trialRepository.Select(x => x.Id).ToListAsync();
|
||||||
List<string> path= _oSSService.GetRootFolderNames();
|
List<string> path = _oSSService.GetRootFolderNames();
|
||||||
foreach (var item in path)
|
foreach (var item in path)
|
||||||
{
|
{
|
||||||
if (Guid.TryParse(item, out Guid folderId) && !trialids.Contains(folderId))
|
if (Guid.TryParse(item, out Guid folderId) && !trialids.Contains(folderId))
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ public class TrialStatService(
|
||||||
IRepository<SystemDocument> _systemDocumentRepository,
|
IRepository<SystemDocument> _systemDocumentRepository,
|
||||||
IRepository<SystemNotice> _systemNoticeRepository,
|
IRepository<SystemNotice> _systemNoticeRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
IRepository<Dictionary> _dictionaryRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
||||||
{
|
{
|
||||||
|
|
@ -144,6 +145,7 @@ public class TrialStatService(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var query = _visitTaskRepository.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
var query = _visitTaskRepository.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.Where(t => t.TrialId == inQuery.TrialId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
.Where(t => t.TrialId == inQuery.TrialId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
||||||
|
|
||||||
|
|
@ -179,6 +181,8 @@ public class TrialStatService(
|
||||||
|
|
||||||
var list = await query.ToListAsync();
|
var list = await query.ToListAsync();
|
||||||
|
|
||||||
|
var dicName = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == trialReadingCriterionId).SelectMany(t => t.ReadingQuestionTrialList.Where(t => t.QuestionType == questionType))
|
||||||
|
.Select(t => t.DictionaryCode).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
if (criterion.IsArbitrationReading)
|
if (criterion.IsArbitrationReading)
|
||||||
|
|
@ -197,8 +201,9 @@ public class TrialStatService(
|
||||||
list = DealJudgeMark(criterion.ArbitrationRule, criterion.IsGlobalReading, list);
|
list = DealJudgeMark(criterion.ArbitrationRule, criterion.IsGlobalReading, list);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//判断subject的逻辑需要确认,这么多次访视任务,有的符合,有的不符合,准则是什么?
|
//判断subject的逻辑需要确认,这么多次访视任务,有的符合,有的不符合,准则是什么?
|
||||||
return list.GroupBy(t => t.OverallTumorEvaluation).Select(g => new EfficacyEvaluationStatViewModel()
|
var resultList = list.GroupBy(t => t.OverallTumorEvaluation).Select(g => new EfficacyEvaluationStatViewModel()
|
||||||
{
|
{
|
||||||
DictionaryCode = g.FirstOrDefault()?.DictionaryCode,
|
DictionaryCode = g.FirstOrDefault()?.DictionaryCode,
|
||||||
OverallTumorEvaluation = g.Key,
|
OverallTumorEvaluation = g.Key,
|
||||||
|
|
@ -206,6 +211,26 @@ public class TrialStatService(
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
// 先把 resultList 转成内存字典
|
||||||
|
var resultDict = resultList.ToDictionary(r => r.OverallTumorEvaluation, r => r.SubjectCount);
|
||||||
|
|
||||||
|
// 查询字典表,先把数据拉出来到内存,再合并
|
||||||
|
var dicList = _dictionaryRepository
|
||||||
|
.Where(t => t.Parent.Code == dicName)
|
||||||
|
.Select(t => new
|
||||||
|
{
|
||||||
|
t.Code
|
||||||
|
})
|
||||||
|
.ToList()
|
||||||
|
.Select(t => new EfficacyEvaluationStatViewModel
|
||||||
|
{
|
||||||
|
DictionaryCode = dicName,
|
||||||
|
OverallTumorEvaluation = t.Code,
|
||||||
|
SubjectCount = resultDict.ContainsKey(t.Code) ? resultDict[t.Code] : 0
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
return dicList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue