Merge branch 'Test_IRC_Net10' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net10
continuous-integration/drone/push Build is running Details

Test_IRC_Net10
he 2026-08-13 15:16:53 +08:00
commit 7ca498c47f
3 changed files with 108 additions and 58 deletions

View File

@ -269,9 +269,45 @@ public class SiteSurverRejectedEventConsumer(
if (context.Message.IsHaveSPMOrCPM) if (context.Message.IsHaveSPMOrCPM)
{ {
//PM 驳回到SPM ////PM 驳回到SPM
if (siteSurveyInfo.State == TrialSiteSurveyEnum.CRCSubmitted) //if (siteSurveyInfo.State == TrialSiteSurveyEnum.CRCSubmitted)
//{
// var sPMOrCPMList = _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialUser.IsDeleted == false)
// .Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM)
// .Select(t => new { t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum, t.UserRole.IdentityUser.UserWorkLanguage }).ToList();
// var lan_SPMOrCPMList = sPMOrCPMList.Where(t => t.UserWorkLanguage == workLanguage);
// foreach (var user in lan_SPMOrCPMList)
// {
// messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
// }
// toUserName = string.Join('、', lan_SPMOrCPMList.Select(t => t.FullName));
//}
////SPM 驳回到CRC
//else if (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit)
//{
// //使用中心国家语言 一致才发送
// if ((siteInfo.Country == StaticData.SiteCountry.US && isEn_US) || (siteInfo.Country == StaticData.SiteCountry.CN && isEn_US == false))
// {
// messageToSend.To.Add(new MailboxAddress(toUserName, siteSurveyInfo.Email));
// }
//}
// PM 驳回到CRC
if (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit)
{ {
//使用中心国家语言 一致才发送
if ((siteInfo.Country == StaticData.SiteCountry.US && isEn_US) || (siteInfo.Country == StaticData.SiteCountry.CN && isEn_US == false))
{
messageToSend.To.Add(new MailboxAddress(toUserName, siteSurveyInfo.Email));
}
var sPMOrCPMList = _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialUser.IsDeleted == false) var sPMOrCPMList = _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialUser.IsDeleted == false)
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM) .Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM)
@ -281,24 +317,10 @@ public class SiteSurverRejectedEventConsumer(
foreach (var user in lan_SPMOrCPMList) foreach (var user in lan_SPMOrCPMList)
{ {
messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail)); messageToSend.Cc.Add(new MailboxAddress(user.FullName, user.EMail));
}
toUserName = string.Join('、', lan_SPMOrCPMList.Select(t => t.FullName));
}
//SPM 驳回到CRC
else if (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit)
{
//使用中心国家语言 一致才发送
if ((siteInfo.Country == StaticData.SiteCountry.US && isEn_US) || (siteInfo.Country == StaticData.SiteCountry.CN && isEn_US == false))
{
messageToSend.To.Add(new MailboxAddress(toUserName, siteSurveyInfo.Email));
} }
} }
} }
else else
{ {
@ -312,6 +334,11 @@ public class SiteSurverRejectedEventConsumer(
} }
} }
Uri uri = new Uri(_systemEmailConfig.SiteUrl);
// 获取 Scheme + Host不包含路径
string baseUrl = uri.GetLeftPart(UriPartial.Authority);
//发件地址 //发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail)); messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
@ -330,7 +357,7 @@ public class SiteSurverRejectedEventConsumer(
siteInfo.TrialSiteCode, //中心编号 siteInfo.TrialSiteCode, //中心编号
siteInfo.TrialSiteAliasName,//中心名称 siteInfo.TrialSiteAliasName,//中心名称
siteSurveyInfo.LatestBackReason, //驳回原因 siteSurveyInfo.LatestBackReason, //驳回原因
_systemEmailConfig.SiteUrl, //链接 $"{baseUrl}/researchLogin?trialId={trialId}", //链接
(siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none") (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none")
); );

View File

@ -162,17 +162,20 @@ namespace IRaCIS.Core.Application.Service.Common
var fields = new List<(string FieldName, int excelIndex)>() var fields = new List<(string FieldName, int excelIndex)>()
{ {
("Parameters", 5), ("AverageEngravingCycle", 7),
("ManufacturerType", 6), ("IsConfirmImagingTechnologist", 8),
("ScannerType", 7), ("EfficacyEvaluatorType", 9),
("MagneticFieldStrengthType", 8), ("IsFollowStudyParameters", 10),
("BodyCoilChannelCount", 9), ("NotFollowReson", 10),
("HasDedicatedPdfFatQuantificationSequence", 10),
("PdfFatQuantificationSequenceType", 11),
("OtherSequenceSpecification", 11), ("IsRoutineMRIPDEE", 11),
("HasT2R2Correction", 12), ("MRIPDFFScanTime", 12),
("CanFullyExportPdfParameterMapsAndRawDicom", 13), ("MRIPDFFLeadTime", 13),
("Note", 14), ("MRIPDFFOther", 14),
("AssignFixedTechnologists", 15),
("ISStrictManualBurnFlag", 16),
("NotStrictManualBurnFlagReason",16)
}; };
@ -191,7 +194,7 @@ namespace IRaCIS.Core.Application.Service.Common
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteSurvey_Info_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SiteSurveyEquipmentDto)); return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteSurvey_Info_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SiteSurveyEquipmentDto), removeExcelIndexList: columnsToDelete);
} }

View File

@ -3,7 +3,9 @@
// 生成时间 2021-12-23 13:20:59 // 生成时间 2021-12-23 13:20:59
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//-------------------------------------------------------------------- //--------------------------------------------------------------------
using DocumentFormat.OpenXml.Office2013.Excel;
using DocumentFormat.OpenXml.Spreadsheet; using DocumentFormat.OpenXml.Spreadsheet;
using DocumentFormat.OpenXml.Vml;
using IRaCIS.Application.Contracts; using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Auth; using IRaCIS.Core.Application.Auth;
using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Helper;
@ -496,40 +498,47 @@ namespace IRaCIS.Core.Application.Contracts
} }
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM) else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
{ {
var isTrialSPMJoin = await _trialRepository.AnyAsync(t => t.Id == trialSiteSubmitBackCommand.TrialId && t.IsSPMJoinSiteSurvey); // var isTrialSPMJoin = await _trialRepository.AnyAsync(t => t.Id == trialSiteSubmitBackCommand.TrialId && t.IsSPMJoinSiteSurvey);
var hasSPMOrCPM = await _trialRepository.Where(t => t.Id == trialSiteSubmitBackCommand.TrialId).AnyAsync(t => t.TrialIdentityUserList.SelectMany(t => t.TrialUserRoleList).Any(t => // var hasSPMOrCPM = await _trialRepository.Where(t => t.Id == trialSiteSubmitBackCommand.TrialId).AnyAsync(t => t.TrialIdentityUserList.SelectMany(t => t.TrialUserRoleList).Any(t =>
t.UserRole.IdentityUser.Status == UserStateEnum.Enable //t.UserRole.IdentityUser.Status == UserStateEnum.Enable
&& t.UserRole.IsUserRoleDisabled == false //&& t.UserRole.IsUserRoleDisabled == false
&& (t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM)) //&& (t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM))
); //);
var isSPMjoin = isTrialSPMJoin && hasSPMOrCPM; // var isSPMjoin = isTrialSPMJoin && hasSPMOrCPM;
if (isSPMjoin) // if (isSPMjoin)
{ // {
survey.State = TrialSiteSurveyEnum.CRCSubmitted; // survey.State = TrialSiteSurveyEnum.CRCSubmitted;
survey.ReviewerUserId = null; // survey.ReviewerUserId = null;
survey.ReviewerTime = null; // survey.ReviewerTime = null;
} // }
else // else
{ // {
survey.State = TrialSiteSurveyEnum.ToSubmit; // survey.State = TrialSiteSurveyEnum.ToSubmit;
survey.PreliminaryUserId = null; // survey.PreliminaryUserId = null;
survey.ReviewerUserId = null; // survey.ReviewerUserId = null;
survey.PreliminaryTime = null; // survey.PreliminaryTime = null;
survey.ReviewerTime = null; // survey.ReviewerTime = null;
} // }
survey.State = TrialSiteSurveyEnum.ToSubmit;
survey.PreliminaryUserId = null;
survey.ReviewerUserId = null;
survey.PreliminaryTime = null;
survey.ReviewerTime = null;
} }
var info = await GetSiteSurveyInfo(trialSiteSurveyId, trialId); var info = await GetSiteSurveyInfo(trialSiteSurveyId, trialId);
await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = _userInfo.FullName, UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Reject, Reason = survey.LatestBackReason, Json = info.ToJsonStr() }); await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = $"{_userInfo.FullName} ({_userInfo.UserName})", UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Reject, Reason = survey.LatestBackReason, Json = info.ToJsonStr() });
await _trialSiteSurveyRepository.SaveChangesAsync(); await _trialSiteSurveyRepository.SaveChangesAsync();
@ -556,6 +565,10 @@ namespace IRaCIS.Core.Application.Contracts
survey.IsDeleted = true; survey.IsDeleted = true;
var info = await GetSiteSurveyInfo(trialSiteSurveyId, survey.TrialId);
await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = $"{_userInfo.FullName} ({_userInfo.UserName})", UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Over, Json = info.ToJsonStr() });
await _trialSiteSurveyRepository.SaveChangesAsync(); await _trialSiteSurveyRepository.SaveChangesAsync();
return ResponseOutput.Ok(); return ResponseOutput.Ok();
@ -688,7 +701,8 @@ namespace IRaCIS.Core.Application.Contracts
} }
//更新调研表日志 - 老的调研表 //更新调研表日志 - 老的调研表
//currentLatest.SiteSurveyLogList.Add(new SiteSurveyLog() { Name = userInfo.ReplaceUserEmailOrPhone, OptType = SiteSurveyOptTyp.Over }); var info1 = await GetSiteSurveyInfo(currentLatest.Id, currentLatest.TrialId);
currentLatest.SiteSurveyLogList.Add(new SiteSurveyLog() { Name = userInfo.ReplaceUserEmailOrPhone, OptType = SiteSurveyOptTyp.Over, Json = info1.ToJsonStr() });
var copy = currentLatest.Clone(); var copy = currentLatest.Clone();
@ -701,6 +715,11 @@ namespace IRaCIS.Core.Application.Contracts
copy.Id = Guid.Empty; copy.Id = Guid.Empty;
copy.CreateTime = DateTime.Now; copy.CreateTime = DateTime.Now;
copy.PreliminaryUserId = null;
copy.ReviewerUserId = null;
copy.PreliminaryTime = null;
copy.ReviewerTime = null;
if (userInfo.ReplaceUserEmailOrPhone != userInfo.EmailOrPhone) if (userInfo.ReplaceUserEmailOrPhone != userInfo.EmailOrPhone)
{ {
copy.UserName = String.Empty; copy.UserName = String.Empty;
@ -709,7 +728,8 @@ namespace IRaCIS.Core.Application.Contracts
//更新调研表日志 //更新调研表日志
var info = await GetSiteSurveyInfo(currentLatest.Id, currentLatest.TrialId); var info = await GetSiteSurveyInfo(currentLatest.Id, currentLatest.TrialId);
copy.SiteSurveyLogList.Add(new SiteSurveyLog() { Name = userInfo.ReplaceUserEmailOrPhone, OptType = SiteSurveyOptTyp.Update, OriginTrialSiteSurveyId = currentLatest.Id, Json = info.ToJsonStr() }); copy.SiteSurveyLogList.ForEach(t => { t.Id = Guid.Empty; });
copy.SiteSurveyLogList.Add(new SiteSurveyLog() { Name = userInfo.EmailOrPhone, OptType = SiteSurveyOptTyp.Update, OriginTrialSiteSurveyId = currentLatest.Id, Json = info.ToJsonStr() });
} }
@ -923,7 +943,7 @@ namespace IRaCIS.Core.Application.Contracts
var info = await GetSiteSurveyInfo(trialSiteSurveyId, trialId); var info = await GetSiteSurveyInfo(trialSiteSurveyId, trialId);
await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = _userInfo.FullName, UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Approved, Json = info.ToJsonStr() }); await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = $"{_userInfo.FullName} ({_userInfo.UserName})", UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Approved, Json = info.ToJsonStr() });
} }
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM) else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
@ -941,7 +961,7 @@ namespace IRaCIS.Core.Application.Contracts
//审批调研表日志 //审批调研表日志
var info = await GetSiteSurveyInfo(trialSiteSurveyId, trialId); var info = await GetSiteSurveyInfo(trialSiteSurveyId, trialId);
await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = _userInfo.FullName, UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Approved, Json = info.ToJsonStr() }); await _siteSurveyLogRepository.AddAsync(new SiteSurveyLog() { TrialSiteSurveyId = trialSiteSurveyId, Name = $"{_userInfo.FullName} ({_userInfo.UserName})", UserType = (UserTypeEnum)_userInfo.UserTypeEnumInt, OptType = SiteSurveyOptTyp.Approved, Json = info.ToJsonStr() });
} }
@ -1458,7 +1478,7 @@ namespace IRaCIS.Core.Application.Contracts
{ {
return _siteSurveyLogRepository.Where(t => t.TrialSiteSurveyId == inQuery.TrialSiteSurveyId) return _siteSurveyLogRepository.Where(t => t.TrialSiteSurveyId == inQuery.TrialSiteSurveyId)
.WhereIf(inQuery.Id != null, t => t.Id == inQuery.Id) .WhereIf(inQuery.Id != null, t => t.Id == inQuery.Id)
.ProjectTo<SiteSurveyLogDTO>(_mapper.ConfigurationProvider).OrderBy(t=>t.CreateTime).ToList(); .ProjectTo<SiteSurveyLogDTO>(_mapper.ConfigurationProvider).OrderBy(t => t.CreateTime).ToList();
} }
/// <summary> /// <summary>