按照 subject visit studyCode 三个维度进行分组的查询列表
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
50f2a6a8b0
commit
49375ec5a9
|
|
@ -107,7 +107,7 @@ public class FileSyncWorker(IServiceScopeFactory _scopeFactory, ILogger<FileSync
|
|||
await oss.SyncFileAsync(file.Path.TrimStart('/'), file.UploadRegion == "CN" ? ObjectStoreUse.AliyunOSS : ObjectStoreUse.AWS, file.UploadRegion == "CN" ? ObjectStoreUse.AWS : ObjectStoreUse.AliyunOSS);
|
||||
|
||||
file.IsSync = true;
|
||||
file.SyncFinishedTime = DateTime.UtcNow;
|
||||
file.SyncFinishedTime = DateTime.Now;
|
||||
|
||||
log.JobState = jobState.SUCCESS;
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ public class FileSyncWorker(IServiceScopeFactory _scopeFactory, ILogger<FileSync
|
|||
log.Msg = ex.Message[..300];
|
||||
}
|
||||
|
||||
log.EndTime = DateTime.UtcNow;
|
||||
log.EndTime = DateTime.Now;
|
||||
|
||||
await _uploadFileSyncRecordRepository.SaveChangesAsync(stoppingToken);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1556,16 +1556,23 @@
|
|||
<param name="_attachmentrepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FileUploadRecordService.GetSubjectUploadRecordList(IRaCIS.Core.Application.ViewModel.SubjectFileUploadRecordQuery)">
|
||||
<summary>
|
||||
按照 subject visit studyCode 三个维度进行分组的查询列表 (subject相关)
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FileUploadRecordService.GetFileUploadRecordList(IRaCIS.Core.Application.ViewModel.FileUploadRecordQuery)">
|
||||
<summary>
|
||||
上传记录表--里面包含待同步任务
|
||||
上传记录表--里面包含待同步任务 DataFileType= 0 :代表系统文件 1:Subject相关 2:项目相关,但是和subject 没关系
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FileUploadRecordService.GetUploadFileSyncRecordList(IRaCIS.Core.Application.ViewModel.UploadFileSyncRecordQuery)">
|
||||
<summary>
|
||||
任务具体执行记录表 (需要同步的才可以点击)
|
||||
任务具体执行记录表
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
|
|
@ -1582,6 +1589,12 @@
|
|||
<param name="ct"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.FileSyncQueue.Snapshot">
|
||||
<summary>
|
||||
获取队列任务Id
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.SyncQueueUseChannel.Enqueue(System.Guid,System.Int32)">
|
||||
<summary>
|
||||
入队任务
|
||||
|
|
@ -17086,17 +17099,17 @@
|
|||
</member>
|
||||
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Question">
|
||||
<summary>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
质疑
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:IRaCIS.Core.Application.ViewModel.AccessToDialogueEnum.Consistency">
|
||||
<summary>
|
||||
һ<EFBFBD><EFBFBD><EFBFBD>Ժ˲<EFBFBD>
|
||||
一致性核查
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.ViewModel.CopyFrontAuditConfigItemDto">
|
||||
<summary>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
复制
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.ViewModel.SystemNoticeView">
|
||||
|
|
|
|||
|
|
@ -9,6 +9,31 @@ using IRaCIS.Core.Domain.Share;
|
|||
using System.Collections.Generic;
|
||||
namespace IRaCIS.Core.Application.ViewModel;
|
||||
|
||||
public class SubjectFileUploadRecordView
|
||||
{
|
||||
public string? SubjectCode { get; set; }
|
||||
|
||||
public string? VisitName { get; set; }
|
||||
|
||||
public string StudyCode { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
public Guid? SubjectVisitId { get; set; }
|
||||
|
||||
public int FileCount { get; set; }
|
||||
|
||||
|
||||
public string? UploadRegion { get; set; }
|
||||
public string? TargetRegion { get; set; }
|
||||
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
public DateTime? SyncFinishedTime { get; set; }
|
||||
|
||||
public bool IsSync { get; set; }
|
||||
}
|
||||
|
||||
public class FileUploadRecordView : FileUploadRecordAddOrEdit
|
||||
{
|
||||
|
||||
|
|
@ -22,6 +47,11 @@ public class FileUploadRecordView : FileUploadRecordAddOrEdit
|
|||
[Comment("同步结束时间-最后一个任务的时间")]
|
||||
public DateTime? SyncFinishedTime { get; set; }
|
||||
|
||||
|
||||
public string? SubjectCode { get; set; }
|
||||
|
||||
public string? VisitName { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -65,16 +95,40 @@ public class FileUploadRecordAddOrEdit
|
|||
public string TargetRegion { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class SubjectFileUploadRecordQuery : PageInput
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public string? SubjectCode { get; set; }
|
||||
|
||||
public string? VisitName { get; set; }
|
||||
|
||||
public string? StudyCode { get; set; }
|
||||
|
||||
public string? UploadRegion { get; set; }
|
||||
public string? TargetRegion { get; set; }
|
||||
|
||||
public bool? IsSync { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class FileUploadRecordQuery : PageInput
|
||||
{
|
||||
public BatchDataType? BatchDataType { get; set; }
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
public bool? IsSystermFile { get; set; }
|
||||
public int? DataFileType { get; set; }
|
||||
|
||||
public string StudyCode { get; set; }
|
||||
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
public Guid? SubjectVisitId { get; set; }
|
||||
|
||||
|
||||
|
||||
public string? FileMarkId { get; set; }
|
||||
|
||||
|
|
@ -115,6 +169,7 @@ public class FileUploadRecordQuery : PageInput
|
|||
|
||||
public class UploadFileSyncRecordView
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
|
@ -125,13 +180,40 @@ public class UploadFileSyncRecordView
|
|||
|
||||
|
||||
public string Msg { get; set; }
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
|
||||
public Guid? FileUploadRecordId { get; set; }
|
||||
public string? FileName { get; set; }
|
||||
|
||||
public string? FileType { get; set; }
|
||||
|
||||
public string? Path { get; set; }
|
||||
|
||||
|
||||
public string StudyCode { get; set; }
|
||||
|
||||
public string? SubjectCode { get; set; }
|
||||
|
||||
public string? VisitName { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class UploadFileSyncRecordQuery:PageInput
|
||||
public class UploadFileSyncRecordQuery : PageInput
|
||||
{
|
||||
|
||||
public Guid? FileUploadRecordId { get; set; }
|
||||
|
||||
|
||||
public jobState? JobState { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
public class BatchAddSyncFileCommand
|
||||
{
|
||||
public List<Guid> FileUploadRecordIdList { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,10 +31,55 @@ public class FileUploadRecordService(IRepository<FileUploadRecord> _fileUploadRe
|
|||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 按照 subject visit studyCode 三个维度进行分组的查询列表 (subject相关)
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SubjectFileUploadRecordView>> GetSubjectUploadRecordList(SubjectFileUploadRecordQuery inQuery)
|
||||
{
|
||||
|
||||
var query = _fileUploadRecordRepository.Where(t => t.TrialId == inQuery.TrialId && t.SubjectId != null)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.VisitName), t => t.SubjectVisit.VisitName.Contains(inQuery.VisitName))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.UploadRegion), t => t.UploadRegion == inQuery.UploadRegion)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TargetRegion), t => t.TargetRegion == inQuery.TargetRegion)
|
||||
.WhereIf(inQuery.IsSync != null, t => t.IsSync == inQuery.IsSync)
|
||||
.GroupBy(t => new { t.StudyCode, SubjectCode = t.Subject.Code, t.SubjectVisit.VisitName, t.SubjectId, t.SubjectVisitId })
|
||||
.Select(g => new SubjectFileUploadRecordView()
|
||||
{
|
||||
SubjectCode = g.Key.SubjectCode,
|
||||
VisitName = g.Key.VisitName,
|
||||
StudyCode = g.Key.StudyCode,
|
||||
SubjectId = g.Key.SubjectId,
|
||||
SubjectVisitId = g.Key.SubjectVisitId,
|
||||
|
||||
FileCount = g.Count(),
|
||||
|
||||
CreateTime = g.Max(t => t.CreateTime),
|
||||
|
||||
SyncFinishedTime = g.Max(t => t.SyncFinishedTime),
|
||||
|
||||
UploadRegion = g.First().UploadRegion,
|
||||
|
||||
TargetRegion = g.First().TargetRegion,
|
||||
|
||||
IsSync = !g.Any(t => t.IsSync == false)
|
||||
|
||||
});
|
||||
|
||||
|
||||
var pageList = await query.ToPagedListAsync(inQuery);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 上传记录表--里面包含待同步任务
|
||||
/// 上传记录表--里面包含待同步任务 DataFileType= 0 :代表系统文件 1:Subject相关 2:项目相关,但是和subject 没关系
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
|
|
@ -46,14 +91,26 @@ public class FileUploadRecordService(IRepository<FileUploadRecord> _fileUploadRe
|
|||
.WhereIf(inQuery.BatchDataType != null, t => t.BatchDataType == inQuery.BatchDataType)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.FileName), t => t.FileName.Contains(inQuery.FileName))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.FileType), t => t.FileType.Contains(inQuery.FileType))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
||||
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.IsSystermFile == true, t => t.TrialId == null)
|
||||
|
||||
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectVisitId == inQuery.SubjectVisitId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
||||
|
||||
.WhereIf(inQuery.DataFileType == 1 && inQuery.SubjectId != null && inQuery.SubjectVisitId == null, t => t.SubjectVisitId == null)
|
||||
.WhereIf(inQuery.DataFileType == 1 && inQuery.SubjectVisitId != null && inQuery.StudyCode.IsNullOrEmpty(), t => t.StudyCode == "")
|
||||
|
||||
.WhereIf(inQuery.DataFileType == 0, t => t.TrialId == null)
|
||||
.WhereIf(inQuery.DataFileType == 1, t => t.SubjectId != null)
|
||||
.WhereIf(inQuery.DataFileType == 2, t => t.SubjectId == null)
|
||||
|
||||
.WhereIf(inQuery.IsNeedSync != null, t => t.IsNeedSync == inQuery.IsNeedSync)
|
||||
|
||||
.WhereIf(inQuery.IsSync != null, t => t.IsSync == inQuery.IsSync)
|
||||
.WhereIf(inQuery.Priority != null, t => t.Priority == inQuery.Priority)
|
||||
.WhereIf(inQuery.BatchDataType != null, t => t.BatchDataType == inQuery.BatchDataType)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.UploadRegion), t => t.UploadRegion.Contains(inQuery.UploadRegion))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TargetRegion), t => t.TargetRegion.Contains(inQuery.TargetRegion))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.UploadRegion), t => t.UploadRegion == inQuery.UploadRegion)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TargetRegion), t => t.TargetRegion == inQuery.TargetRegion)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.UploadBatchId), t => t.UploadBatchId.Contains(inQuery.UploadBatchId))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Path), t => t.Path.Contains(inQuery.Path))
|
||||
.WhereIf(inQuery.UploadStartTime != null, t => t.CreateTime >= inQuery.UploadStartTime)
|
||||
|
|
@ -69,7 +126,7 @@ public class FileUploadRecordService(IRepository<FileUploadRecord> _fileUploadRe
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 任务具体执行记录表 (需要同步的才可以点击)
|
||||
/// 任务具体执行记录表
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
|
|
@ -79,7 +136,7 @@ public class FileUploadRecordService(IRepository<FileUploadRecord> _fileUploadRe
|
|||
|
||||
var fileUploadRecordQueryable = _uploadFileSyncRecordRepository
|
||||
|
||||
.WhereIf(inQuery.FileUploadRecordId != null, t => t.FileUploadRecordId >= inQuery.FileUploadRecordId)
|
||||
.WhereIf(inQuery.FileUploadRecordId != null, t => t.FileUploadRecordId == inQuery.FileUploadRecordId)
|
||||
|
||||
|
||||
.ProjectTo<UploadFileSyncRecordView>(_mapper.ConfigurationProvider);
|
||||
|
|
@ -90,6 +147,16 @@ public class FileUploadRecordService(IRepository<FileUploadRecord> _fileUploadRe
|
|||
}
|
||||
|
||||
|
||||
public async Task<IResponseOutput> BatchAddSyncFileTask(BatchAddSyncFileCommand inComand)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -143,7 +210,9 @@ public class FileUploadRecordService(IRepository<FileUploadRecord> _fileUploadRe
|
|||
}
|
||||
else
|
||||
{
|
||||
addOrEditFileUploadRecord.TargetRegion = "";
|
||||
addOrEditFileUploadRecord.IsNeedSync = false;
|
||||
|
||||
//addOrEditFileUploadRecord.TargetRegion = "";
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -218,6 +287,20 @@ public class FileSyncQueue
|
|||
return _queue.Dequeue();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取队列任务Id
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Guid[] Snapshot()
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
return _queue.UnorderedItems
|
||||
.Select(x => x.Element)
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 这里不用 SyncQueueUseChannel 和调度器 SyncScheduler
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<EmailLog, GetEmailInfoOutDto>()
|
||||
.ForMember(t => t.RecipientList, u => u.MapFrom(c => c.EmailRecipientLogList))
|
||||
.ForMember(t => t.AttachmentList, u => u.MapFrom(c => c.AttachmentList));
|
||||
.ForMember(t => t.AttachmentList, u => u.MapFrom(c => c.AttachmentList));
|
||||
|
||||
CreateMap<EmailLog, EmailLogAddOrEdit>().ReverseMap();
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(t => t.EmailNoticeUserList, u => u.MapFrom(c => c.EmailNoticeUserTypeList));
|
||||
|
||||
CreateMap<EmailNoticeConfig, EmailNoticeConfigExportDto>();
|
||||
|
||||
|
||||
|
||||
CreateMap<Dictionary, DicView>()
|
||||
.ForMember(t => t.ParentCode, u => u.MapFrom(c => c.Parent.Code));
|
||||
|
|
@ -89,14 +89,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<Internationalization, InternationalizationAddOrEdit>().ReverseMap();
|
||||
|
||||
CreateMap<InternationalizationAddOrEdit, IRCGlobalInfoDTO>();
|
||||
|
||||
|
||||
|
||||
CreateMap<Internationalization, BatchInternationalizationDto>().ReverseMap();
|
||||
|
||||
CreateMap<Internationalization, IRCGlobalInfoDTO>();
|
||||
|
||||
CreateMap<EventStoreRecord, EventStoreRecordView>();
|
||||
|
||||
|
||||
CreateMap<BatchAddInternationalizationDto, InternationalizationAddOrEdit>();
|
||||
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode));
|
||||
|
||||
|
||||
CreateMap<TumorExportBaseModel , TU_Export>();
|
||||
CreateMap<TumorExportBaseModel, TU_Export>();
|
||||
CreateMap<TumorExportBaseModel, TR_Export>();
|
||||
CreateMap<TumorExportBaseModel, RS_Export>();
|
||||
CreateMap<TumorExportBaseModel, CO_Export>();
|
||||
|
|
@ -125,12 +125,20 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<IVUS_OCTBaseDto, OctExportDto>();
|
||||
|
||||
|
||||
CreateMap<FileUploadRecord, FileUploadRecordView>();
|
||||
CreateMap<FileUploadRecord, FileUploadRecordView>()
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.Subject.Code))
|
||||
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName));
|
||||
CreateMap<FileUploadRecord, FileUploadRecordAddOrEdit>().ReverseMap();
|
||||
|
||||
|
||||
CreateMap<UploadFileSyncRecord, UploadFileSyncRecordView>();
|
||||
|
||||
CreateMap<UploadFileSyncRecord, UploadFileSyncRecordView>()
|
||||
.ForMember(d => d.FileName, u => u.MapFrom(s => s.FileUploadRecord.FileName))
|
||||
.ForMember(d => d.FileType, u => u.MapFrom(s => s.FileUploadRecord.FileType))
|
||||
.ForMember(d => d.Path, u => u.MapFrom(s => s.FileUploadRecord.Path))
|
||||
.ForMember(d => d.StudyCode, u => u.MapFrom(s => s.FileUploadRecord.StudyCode))
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(s => s.FileUploadRecord.Subject.Code))
|
||||
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.FileUploadRecord.SubjectVisit.VisitName));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue