Merge branch 'Test.Study' of http://192.168.3.69:3000/XCKJ/irc-netcore-api into Test.Study
commit
3313c0223d
|
@ -440,7 +440,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
|
|
||||||
#region 废弃
|
#region 废弃
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///// <summary>
|
///// <summary>
|
||||||
///// 上传临床数据 多文件
|
///// 上传临床数据 多文件
|
||||||
|
@ -674,78 +674,79 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//public class UploadNoneDicomFileCommand
|
|
||||||
//{
|
|
||||||
// public Guid TrialId { get; set; }
|
|
||||||
// public Guid SubjectVisitId { get; set; }
|
|
||||||
// public Guid NoneDicomStudyId { get; set; }
|
|
||||||
// public Guid StudyMonitorId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
// public List<OSSFileDTO> UploadedFileList { get; set; } = new List<OSSFileDTO>();
|
|
||||||
|
|
||||||
|
|
||||||
// public class OSSFileDTO
|
|
||||||
// {
|
|
||||||
// public string FilePath { get; set; }
|
|
||||||
// public string FileName { get; set; }
|
|
||||||
// public int FileFize { get; set; }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// 上传非Dicom 文件 支持压缩包 多文件上传
|
|
||||||
///// </summary>
|
|
||||||
///// <param name="_noneDicomStudyRepository"></param>
|
|
||||||
///// <returns></returns>
|
|
||||||
////[DisableRequestSizeLimit]
|
|
||||||
//[HttpPost("NoneDicomStudy/UploadNoneDicomFile")]
|
|
||||||
//[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
|
||||||
////[Authorize(Policy = IRaCISPolicy.CRC)]
|
|
||||||
//public async Task<IResponseOutput> UploadNoneDicomFile(UploadNoneDicomFileCommand incommand,
|
|
||||||
// [FromServices] IRepository<NoneDicomStudy> _noneDicomStudyRepository, [FromServices] IRepository<StudyMonitor> _studyMonitorRepository)
|
|
||||||
//{
|
|
||||||
|
|
||||||
// var subjectVisitId = incommand.SubjectVisitId;
|
|
||||||
// var studyMonitorId = incommand.StudyMonitorId;
|
|
||||||
// var noneDicomStudyId = incommand.NoneDicomStudyId;
|
|
||||||
|
|
||||||
|
|
||||||
// await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);
|
|
||||||
|
|
||||||
// var sv = (await _repository.Where<SubjectVisit>(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefaultAsync()).IfNullThrowConvertException();
|
|
||||||
|
|
||||||
// var studyMonitor = await _studyMonitorRepository.FirstOrDefaultAsync(t => t.Id == studyMonitorId);
|
|
||||||
|
|
||||||
// studyMonitor.UploadFinishedTime = DateTime.Now;
|
|
||||||
|
|
||||||
// foreach (var item in incommand.UploadedFileList)
|
|
||||||
// {
|
|
||||||
// await _repository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId });
|
|
||||||
|
|
||||||
// }
|
|
||||||
// var uploadFinishedTime = DateTime.Now;
|
|
||||||
|
|
||||||
// var noneDicomStudy = await _noneDicomStudyRepository.FirstOrDefaultAsync((t => t.Id == noneDicomStudyId));
|
|
||||||
|
|
||||||
// noneDicomStudy.FileCount = noneDicomStudy.FileCount + incommand.UploadedFileList.Count;
|
|
||||||
|
|
||||||
// studyMonitor.FileCount = incommand.UploadedFileList.Count;
|
|
||||||
// studyMonitor.FileSize = incommand.UploadedFileList.Sum(t => t.FileFize);
|
|
||||||
// studyMonitor.IsDicom = false;
|
|
||||||
// studyMonitor.IsDicomReUpload = false;
|
|
||||||
// studyMonitor.StudyId = noneDicomStudyId;
|
|
||||||
// studyMonitor.StudyCode = noneDicomStudy.StudyCode;
|
|
||||||
// studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
|
||||||
// studyMonitor.IP = _userInfo.IP;
|
|
||||||
|
|
||||||
// await _repository.SaveChangesAsync();
|
|
||||||
|
|
||||||
// return ResponseOutput.Ok();
|
|
||||||
//}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public class UploadNoneDicomFileCommand
|
||||||
|
{
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
public Guid SubjectVisitId { get; set; }
|
||||||
|
public Guid NoneDicomStudyId { get; set; }
|
||||||
|
public Guid StudyMonitorId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public List<OSSFileDTO> UploadedFileList { get; set; } = new List<OSSFileDTO>();
|
||||||
|
|
||||||
|
|
||||||
|
public class OSSFileDTO
|
||||||
|
{
|
||||||
|
public string FilePath { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public int FileFize { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传非Dicom 文件 支持压缩包 多文件上传
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="_noneDicomStudyRepository"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
//[DisableRequestSizeLimit]
|
||||||
|
[HttpPost("NoneDicomStudy/UploadNoneDicomFile")]
|
||||||
|
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
|
//[Authorize(Policy = IRaCISPolicy.CRC)]
|
||||||
|
public async Task<IResponseOutput> UploadNoneDicomFile(UploadNoneDicomFileCommand incommand,
|
||||||
|
[FromServices] IRepository<NoneDicomStudy> _noneDicomStudyRepository, [FromServices] IRepository<StudyMonitor> _studyMonitorRepository)
|
||||||
|
{
|
||||||
|
|
||||||
|
var subjectVisitId = incommand.SubjectVisitId;
|
||||||
|
var studyMonitorId = incommand.StudyMonitorId;
|
||||||
|
var noneDicomStudyId = incommand.NoneDicomStudyId;
|
||||||
|
|
||||||
|
|
||||||
|
await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);
|
||||||
|
|
||||||
|
var sv = (await _repository.Where<SubjectVisit>(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefaultAsync()).IfNullThrowConvertException();
|
||||||
|
|
||||||
|
var studyMonitor = await _studyMonitorRepository.FirstOrDefaultAsync(t => t.Id == studyMonitorId);
|
||||||
|
|
||||||
|
studyMonitor.UploadFinishedTime = DateTime.Now;
|
||||||
|
|
||||||
|
foreach (var item in incommand.UploadedFileList)
|
||||||
|
{
|
||||||
|
await _repository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId });
|
||||||
|
|
||||||
|
}
|
||||||
|
var uploadFinishedTime = DateTime.Now;
|
||||||
|
|
||||||
|
var noneDicomStudy = await _noneDicomStudyRepository.FirstOrDefaultAsync((t => t.Id == noneDicomStudyId));
|
||||||
|
|
||||||
|
noneDicomStudy.FileCount = noneDicomStudy.FileCount + incommand.UploadedFileList.Count;
|
||||||
|
|
||||||
|
studyMonitor.FileCount = incommand.UploadedFileList.Count;
|
||||||
|
studyMonitor.FileSize = incommand.UploadedFileList.Sum(t => t.FileFize);
|
||||||
|
studyMonitor.IsDicom = false;
|
||||||
|
studyMonitor.IsDicomReUpload = false;
|
||||||
|
studyMonitor.StudyId = noneDicomStudyId;
|
||||||
|
studyMonitor.StudyCode = noneDicomStudy.StudyCode;
|
||||||
|
studyMonitor.ArchiveFinishedTime = DateTime.Now;
|
||||||
|
studyMonitor.IP = _userInfo.IP;
|
||||||
|
|
||||||
|
await _repository.SaveChangesAsync();
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 一致性核查 excel上传 支持三种格式
|
/// 一致性核查 excel上传 支持三种格式
|
||||||
|
|
|
@ -120,7 +120,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task SendTrialImageQCTaskEmailAsync(Guid trialId)
|
public async Task SendTrialImageQCTaskEmailAsync(Guid trialId)
|
||||||
{
|
{
|
||||||
var trialInfo = _repository.Where<Trial>(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstOrDefault();
|
var trialInfo = await _repository.Where<Trial>(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
||||||
|
|
||||||
//找到 该项目的IQC 用户Id
|
//找到 该项目的IQC 用户Id
|
||||||
var userList = await _repository.Where<TrialUser>(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
var userList = await _repository.Where<TrialUser>(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
||||||
|
@ -333,7 +333,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
if(onlyToUserId!=null)
|
if(onlyToUserId!=null)
|
||||||
{
|
{
|
||||||
copyUserList.Where(t=>t.UserId == onlyToUserId).ToList();
|
toUserList= toUserList.Where(t=>t.UserId == onlyToUserId).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toUserList.Count() == 0)
|
if (toUserList.Count() == 0)
|
||||||
|
|
|
@ -690,7 +690,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
var userLogQueryable =
|
var userLogQueryable =
|
||||||
_userLogRepository
|
_userLogRepository
|
||||||
.WhereIf(inQuery.TrialId != null, t => t.LoginUser.UserTrials.Any(c => c.TrialId == inQuery.TrialId && c.UserId == t.CreateUserId))
|
.WhereIf(inQuery.TrialId != null, t => t.LoginUser.UserTrials.Any(c => c.TrialId == inQuery.TrialId && c.UserId == t.LoginUserId))
|
||||||
.WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType)
|
.WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType)
|
||||||
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
|
.WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate)
|
||||||
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
|
.WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate)
|
||||||
|
|
|
@ -260,7 +260,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
var currentLatest = dbEntityList.OrderByDescending(t => t.CreateTime).FirstOrDefault();
|
var currentLatest = dbEntityList.OrderByDescending(t => t.CreateTime).FirstOrDefault();
|
||||||
|
|
||||||
if (currentLatest.Email != userInfo.EmailOrPhone)
|
if (currentLatest!.Email != userInfo.EmailOrPhone)
|
||||||
{
|
{
|
||||||
//---该中心下已经有其他用户已填写的调研表,您不被允许继续填写
|
//---该中心下已经有其他用户已填写的调研表,您不被允许继续填写
|
||||||
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_AlreadyFilledByOtherUsers"]);
|
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_AlreadyFilledByOtherUsers"]);
|
||||||
|
|
|
@ -46,25 +46,34 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IResponseOutput> InternationazitionInit()
|
public async Task<IResponseOutput> GetMemoryStoreData()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
var rows = await MiniExcel.QueryAsync<InternationalizationAddOrEdit>(@"C:\Users\Administrator\Desktop\Export\vue.xlsx");
|
|
||||||
|
|
||||||
foreach (var row in rows)
|
return ResponseOutput.Ok(new { StaticData.En_US_Dic , StaticData.Zh_CN_Dic });
|
||||||
{
|
|
||||||
await _repository.InsertOrUpdateAsync<Internationalization, InternationalizationAddOrEdit>(row);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
await _repository.SaveChangesAsync();
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//[AllowAnonymous]
|
||||||
|
//public async Task<IResponseOutput> InternationazitionInit()
|
||||||
|
//{
|
||||||
|
|
||||||
|
|
||||||
|
// var rows = await MiniExcel.QueryAsync<InternationalizationAddOrEdit>(@"C:\Users\Administrator\Desktop\Export\vue.xlsx");
|
||||||
|
|
||||||
|
// foreach (var row in rows)
|
||||||
|
// {
|
||||||
|
// await _repository.InsertOrUpdateAsync<Internationalization, InternationalizationAddOrEdit>(row);
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// await _repository.SaveChangesAsync();
|
||||||
|
|
||||||
|
// return ResponseOutput.Ok();
|
||||||
|
//}
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<string> Get()
|
public async Task<string> Get()
|
||||||
|
|
|
@ -2526,6 +2526,37 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region PI 审核
|
||||||
|
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(PIAudit)))
|
||||||
|
{
|
||||||
|
var type = GetEntityAuditOpt(item);
|
||||||
|
|
||||||
|
var entity = item.Entity as PIAudit;
|
||||||
|
|
||||||
|
await InsertInspection<PIAudit>(item.Entity as PIAudit, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
ObjectRelationParentId = entity.VisitTaskId,
|
||||||
|
IsDistinctionInterface=true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SubjectVisitClinicalDialog)))
|
||||||
|
{
|
||||||
|
var type = GetEntityAuditOpt(item);
|
||||||
|
|
||||||
|
var entity = item.Entity as SubjectVisitClinicalDialog;
|
||||||
|
|
||||||
|
await InsertInspection<SubjectVisitClinicalDialog>(item.Entity as SubjectVisitClinicalDialog, type, x => new InspectionConvertDTO()
|
||||||
|
{
|
||||||
|
ObjectRelationParentId = entity.SubjectVisitId,
|
||||||
|
IsDistinctionInterface = false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
//任务
|
//任务
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitTask)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitTask)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue