面板基础统计预提交
parent
1eaeb315a2
commit
2fc57f7041
|
@ -1062,7 +1062,7 @@
|
|||
Site用户列表导出
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<param name="isAllSiteUser">isAllSiteUser true : site用户列表,false :Site调研汇总表</param>
|
||||
<param name="isSiteUserNotAll">isAllSiteUser true : site用户列表,false :Site调研汇总表</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
|
@ -2076,7 +2076,7 @@
|
|||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.UserService.AnonymousSendVerificationCode(System.String)">
|
||||
<summary>
|
||||
重置密码发邮件 (未登陆修改) 发送成功,返回用户账户Id
|
||||
重置密码发邮件 (未登陆修改)
|
||||
</summary>
|
||||
<param name="email"></param>
|
||||
<returns></returns>
|
||||
|
@ -2188,6 +2188,15 @@
|
|||
<member name="M:IRaCIS.Application.Services.StatisticsService.GetLatestWorkLoadList(System.Int32)">
|
||||
<summary> 最新工作量 (已确定的)[New] </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.TrialMaintenanceService.TrialUserListExport(System.Guid,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument})">
|
||||
<summary>
|
||||
项目参与人员导出
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.TrialMaintenanceService.GetMaintenanceUserList(IRaCIS.Application.Contracts.TrialMaintenanceQuery)">
|
||||
<summary>
|
||||
Setting页面 获取项目参与人员列表
|
||||
|
@ -2232,14 +2241,6 @@
|
|||
<param name="trialAddModel"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.TrialService.UpdateTrialStatus(System.Guid,System.String)">
|
||||
<summary>
|
||||
手动更新项目状态
|
||||
</summary>
|
||||
<param name="trialId">项目Id</param>
|
||||
<param name="statusStr">状态值</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.TrialService.DeleteTrial(System.Guid)">
|
||||
<summary> 删除临床项目 </summary>
|
||||
<param name="trialId">临床试验项目Id</param>
|
||||
|
|
|
@ -175,7 +175,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// 重置密码发邮件 (未登陆修改) 发送成功,返回用户账户Id
|
||||
/// 重置密码发邮件 (未登陆修改)
|
||||
/// </summary>
|
||||
/// <param name="email"></param>
|
||||
/// <returns></returns>
|
||||
|
|
|
@ -608,10 +608,32 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
}
|
||||
else if (fileName.EndsWith(".csv"))
|
||||
{
|
||||
#region 临时方案 MiniExcel读取 然后保存为xlsx 再用 Magicodes验证数据
|
||||
|
||||
//因为csv 需要加配置文件 不然都是null
|
||||
etcCheckList = MiniExcel.Query<CheckViewModel>(filePath, null, configuration: config).ToList();
|
||||
etcCheckList = MiniExcel.Query<CheckViewModel>(filePath, null, configuration: config).ToList();
|
||||
|
||||
var csVToXlsxPath = Path.Combine(uploadFolderPath, DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss") + Path.GetFileNameWithoutExtension(fileName) + ".xlsx");
|
||||
|
||||
await MiniExcel.SaveAsAsync(csVToXlsxPath, etcCheckList, excelType: ExcelType.XLSX);
|
||||
|
||||
|
||||
var Importer = new ExcelImporter();
|
||||
|
||||
var import = await Importer.Import<CheckViewModel>(File.OpenRead(csVToXlsxPath));
|
||||
|
||||
if (import.Exception != null) return ResponseOutput.NotOk(import.Exception.ToString());
|
||||
|
||||
if (import.RowErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.RowErrors));
|
||||
|
||||
if (import.TemplateErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.TemplateErrors));
|
||||
|
||||
etcCheckList = import.Data.ToList();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 导入组件有问题
|
||||
//var Importer = new CsvImporter();
|
||||
|
||||
//var import = await Importer.Import<CheckViewModel>(File.OpenRead(filePath));
|
||||
|
@ -623,6 +645,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
//if (import.TemplateErrors.Count > 0) return ResponseOutput.NotOk(JsonConvert.SerializeObject(import.TemplateErrors));
|
||||
|
||||
//etcCheckList = import.Data.ToList();
|
||||
#endregion
|
||||
|
||||
}
|
||||
//ExcelReaderFactory 需要自己验证数据 并且从固定列取数据
|
||||
else
|
||||
|
@ -1725,7 +1749,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
var info = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).ProjectTo<DicomTrialSiteSubjectInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
var targetPath ="/IMPORT-IMAGES/"+info.TrialCode + "_" + info.SubjectCode + "_" + info.VisitName;
|
||||
var targetPath = "/IMPORT-IMAGES/" + info.TrialCode + "_" + info.SubjectCode + "_" + info.VisitName;
|
||||
|
||||
var path = _dicomFileStoreHelper.GetSubjectVisitPath(info.TrialId, info.SiteId, info.SubjectId, info.SubjectVisitId);
|
||||
|
||||
|
@ -1755,14 +1779,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
foreach (var studyFolder in studyFolders)
|
||||
{
|
||||
if (!session.FileExists(Path.Combine(targetPath,studyFolder.Name)))
|
||||
if (!session.FileExists(Path.Combine(targetPath, studyFolder.Name)))
|
||||
{
|
||||
session.CreateDirectory(targetPath);
|
||||
}
|
||||
|
||||
foreach (var file in studyFolder.GetFiles())
|
||||
{
|
||||
if (file.Extension.Contains("dcm",StringComparison.OrdinalIgnoreCase))
|
||||
if (file.Extension.Contains("dcm", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
string remoteFilePath =
|
||||
RemotePath.TranslateLocalPathToRemote(file.FullName, studyFolder.FullName, targetPath);
|
||||
|
@ -1779,20 +1803,20 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
|
||||
|
||||
await _subjectVisitRepository.UpdateFromQueryAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
await _subjectVisitRepository.UpdateFromQueryAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.Forwarded });
|
||||
|
|
|
@ -47,7 +47,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
|
||||
CreateMap<QANotice, QANoticeDTO>();
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@ using IRaCIS.Application.Services;
|
|||
using IRaCIS.Core.Application.Auth;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using MailKit.Security;
|
||||
using MimeKit;
|
||||
|
||||
|
@ -585,7 +583,6 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 驳回
|
||||
/// </summary>
|
||||
|
@ -643,8 +640,6 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public async Task<IResponseOutput> SendInviteEmail(InviteEmailCommand inviteEmailCommand)
|
||||
{
|
||||
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
using System;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
|
||||
public class PersonalStataDTO
|
||||
{
|
||||
// 项目数量(排除 废除的)
|
||||
public int? TrialCount { get; set; }
|
||||
|
||||
//废除的
|
||||
public int? DeletedCount { get; set; }
|
||||
|
||||
//项目数量 (包括废除的)
|
||||
public int? TotalTrialCount => TrialCount + DeletedCount;
|
||||
|
||||
|
||||
//总共需要签署项目文档的数量 (排除掉废除的 + 废除的但是签署了)
|
||||
public int? TotalNeedSignTrialDocCount { get; set; }
|
||||
|
||||
|
||||
//已签署的项目文档总数
|
||||
public int? HaveSignedTrialDocCount { get; set; }
|
||||
|
||||
//现在需要签署的项目文档总数
|
||||
public int? WaitSignTrialDocCount => TotalNeedSignTrialDocCount - HaveSignedTrialDocCount;
|
||||
|
||||
|
||||
|
||||
|
||||
public int? TotalNeedSignSystemDocCount { get; set; }
|
||||
|
||||
public int? HaveSignedSystemDocCount { get; set; }
|
||||
|
||||
public int? WaitSignSystemDocCount => TotalNeedSignSystemDocCount - HaveSignedSystemDocCount;
|
||||
|
||||
|
||||
|
||||
//现在需要签署的总数(项目待签署 +系统待签署)
|
||||
public int? WaitSignDocCount => TotalNeedSignTrialDocCount + TotalNeedSignSystemDocCount;
|
||||
}
|
||||
|
||||
public class TrialSiteSurveyStatQuery : PageInput
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class TrialSiteSurveyStat:TrialSelectDTO
|
||||
{
|
||||
public int? ApprovalRequiredCount { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class DocSignStat : TrialSelectDTO
|
||||
{
|
||||
public int? WaitSignCount { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
using System;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
|
||||
public class QANoticeDTO
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid StudyId { get; set; }
|
||||
|
||||
public string StudyStatusStr { get; set; } = string.Empty;
|
||||
|
||||
public string Message { get; set; } = string.Empty;
|
||||
|
||||
public DateTime SendTime { get; set; }
|
||||
|
||||
public DateTime? DealTime { get; set; }
|
||||
|
||||
|
||||
public string FromUser { get; set; } = string.Empty;
|
||||
|
||||
public string FromUserType { get; set; } = string.Empty;
|
||||
|
||||
public NoticeType NoticeTypeEnum { get; set; }
|
||||
|
||||
public bool NeedDeal { get; set; }
|
||||
|
||||
public bool IsMessageReceiver { get; set; } = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -19,14 +19,14 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
[ExcelFormat("yyyy-mm-dd hh:mm:ss")]
|
||||
[ExcelFormat("yyyy-MM-dd hh:mm:ss")]
|
||||
public DateTime? DeletedTime { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
public string Phone { get; set; } = String.Empty;
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
[ExcelFormat("yyyy-mm-dd hh:mm:ss")]
|
||||
[ExcelFormat("yyyy-MM-dd hh:mm:ss")]
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
|
||||
|
@ -54,22 +54,22 @@ namespace IRaCIS.Application.Contracts
|
|||
public bool IsDeleted { get; set; }
|
||||
|
||||
[ExporterHeader(Format = "yyyy-mm-DD hh:mm:ss")]
|
||||
[ExcelFormat("yyyy-mm-dd hh:mm:ss")]
|
||||
[ExcelFormat("yyyy-MM-dd hh:mm:ss")]
|
||||
public DateTime? DeletedTime { get; set; }
|
||||
|
||||
|
||||
[ExporterHeader(Format = "yyyy-mm-DD")]
|
||||
[ExcelFormat("yyyy-mm-dd")]
|
||||
[ExcelFormat("yyyy-MM-dd")]
|
||||
public DateTime? RemoveTime { get; set; }
|
||||
|
||||
|
||||
[ExporterHeader(Format = "yyyy-mm-DD")]
|
||||
[ExcelFormat("yyyy-mm-DD")]
|
||||
[ExcelFormat("yyyy-MM-dd")]
|
||||
public DateTime? JoinTime { get; set; }
|
||||
|
||||
|
||||
[ExporterHeader(Format = "yyyy-mm-DD hh:mm:ss")]
|
||||
[ExcelFormat("yyyy-mm-DD hh:mm:ss")]
|
||||
[ExcelFormat("yyyy-MM-dd hh:mm:ss")]
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ namespace IRaCIS.Application.Interfaces
|
|||
bool TrialExpeditedChange { get; set; }
|
||||
|
||||
Task<IResponseOutput> AddOrUpdateTrial(TrialCommand trialAddModel);
|
||||
Task<IResponseOutput> UpdateTrialStatus(Guid trialId, string statusStr);
|
||||
|
||||
Task<IResponseOutput> ConfirmTrialVisitPlan(Guid trialId, bool confirmOrCancel = true);
|
||||
Task<IResponseOutput> DeleteTrial(Guid trialId);
|
||||
|
|
|
@ -0,0 +1,94 @@
|
|||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IRaCIS.Core.Application
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class PersonalWorkstation : BaseService
|
||||
{
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IRepository<TrialUser> _trialUserRepository;
|
||||
private readonly IRepository<TrialDocument> _trialDocumentRepository;
|
||||
private readonly IRepository<SystemDocument> _systemDocumentRepository;
|
||||
|
||||
public PersonalWorkstation(IRepository<Trial> trialRepository, IRepository<TrialUser> trialUserRepository, IRepository<TrialDocument> trialDocumentRepository,IRepository<SystemDocument> systemDocumentRepository)
|
||||
{
|
||||
_trialRepository = trialRepository;
|
||||
_trialUserRepository = trialUserRepository;
|
||||
_trialDocumentRepository = trialDocumentRepository;
|
||||
_systemDocumentRepository = systemDocumentRepository;
|
||||
}
|
||||
|
||||
|
||||
public async Task<PersonalStataDTO> GetBasicStat()
|
||||
{
|
||||
|
||||
|
||||
return new PersonalStataDTO()
|
||||
{
|
||||
//正参与的数量
|
||||
TrialCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
|
||||
? await _trialRepository.CountAsync()
|
||||
: await _trialUserRepository.Where(t => t.UserId == _userInfo.Id).CountAsync(),
|
||||
|
||||
DeletedCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
|
||||
? await _trialRepository.AsQueryable(true).CountAsync(t => t.IsDeleted)
|
||||
: await _trialUserRepository.AsQueryable(true).Where(t => t.UserId == _userInfo.Id && t.IsDeleted)
|
||||
.CountAsync(),
|
||||
|
||||
|
||||
TotalNeedSignTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
|
||||
? 0
|
||||
: await _trialDocumentRepository
|
||||
.Where(t => t.IsAbandon == false || (t.IsAbandon == true &&
|
||||
t.TrialDocConfirmedUserList.Any(t =>
|
||||
t.ConfirmUserId == _userInfo.Id)))
|
||||
.SelectMany(t => t.NeedConfirmedUserTypeList)
|
||||
.CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId),
|
||||
|
||||
HaveSignedTrialDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
|
||||
? 0
|
||||
: await _trialDocumentRepository
|
||||
.Where(t => t.NeedConfirmedUserTypeList.Any(
|
||||
t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.SelectMany(t => t.TrialDocConfirmedUserList)
|
||||
.CountAsync(t => t.ConfirmUserId == _userInfo.Id),
|
||||
|
||||
TotalNeedSignSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
|
||||
? 0
|
||||
: await _systemDocumentRepository
|
||||
.Where(t => t.IsAbandon == false || (t.IsAbandon == true && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
||||
.SelectMany(t => t.NeedConfirmedUserTypeList)
|
||||
.CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId),
|
||||
|
||||
|
||||
HaveSignedSystemDocCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
|
||||
? 0
|
||||
: await _systemDocumentRepository
|
||||
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.SelectMany(t => t.SystemDocConfirmedUserList)
|
||||
.CountAsync(t => t.ConfirmUserId == _userInfo.Id),
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async Task<PageOutput<TrialSiteSurveyStat>> GetSiteSurveyApprovalList(TrialSiteSurveyStatQuery query)
|
||||
{
|
||||
|
||||
return await _trialRepository.ProjectTo<TrialSiteSurveyStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id })
|
||||
.ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField, query.Asc);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -26,7 +26,13 @@ namespace IRaCIS.Application.Services
|
|||
_trialRepository = trialRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 项目参与人员导出
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> TrialUserListExport(Guid trialId, [FromServices] IRepository<CommonDocument> _commonDocumentRepository)
|
||||
|
@ -87,6 +93,8 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Setting页面 获取项目参与人员列表
|
||||
/// </summary>
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace IRaCIS.Application.Services
|
|||
[HttpGet("{projectId:guid}")]
|
||||
public async Task<TrialDetailDTO> GetTrialInfoAndLockState(Guid projectId)
|
||||
{
|
||||
return await _trialRepository.Where(o => o.Id == projectId).IgnoreQueryFilters().ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||
return (await _trialRepository.Where(o => o.Id == projectId).IgnoreQueryFilters().ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
}
|
||||
|
||||
|
@ -119,15 +119,6 @@ namespace IRaCIS.Application.Services
|
|||
return trial.Expedited;
|
||||
}
|
||||
|
||||
[HttpPut("{trialId:guid}/{isAbandon:bool}")]
|
||||
public async Task<IResponseOutput> AbandonTrial(Guid trialId, bool isAbandon)
|
||||
{
|
||||
|
||||
await _trialRepository.UpdateFromQueryAsync(t => t.Id == trialId, u => new Trial() { IsDeleted = isAbandon });
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
@ -244,108 +235,6 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#region MyRegion
|
||||
///// <summary>
|
||||
///// 添加项目
|
||||
///// </summary>
|
||||
///// <param name="trialAddModel"></param>
|
||||
///// <returns></returns>
|
||||
//[NonDynamicMethod]
|
||||
//public virtual async Task<IResponseOutput> AddOrUpdateTrial(TrialCommand trialAddModel)
|
||||
//{
|
||||
|
||||
// if (trialAddModel.Id == Guid.Empty || trialAddModel.Id == null)
|
||||
// {
|
||||
// if (await _repository.AnyAsync<Trial>(u => u.TrialCode == trialAddModel.TrialCode))
|
||||
// {
|
||||
// return ResponseOutput.NotOk("Same Trial ID already exists.");
|
||||
// }
|
||||
|
||||
// var currentYearMaxCodeNext = await _repository.Where<Trial>(t => t.CreateTime.Year == DateTime.Now.Year).Select(t => t.Code).DefaultIfEmpty().MaxAsync() + 1;
|
||||
|
||||
// //var test = _trialRepository.Where(t => t.CreateTime.Year == DateTime.Now.Year + 1).Select(t => t.Code).DefaultIfEmpty(1).ToList();
|
||||
|
||||
// var trial = _mapper.Map<Trial>(trialAddModel);
|
||||
// var yearStr = DateTime.Now.Year.ToString();
|
||||
|
||||
// trial.Code = currentYearMaxCodeNext;
|
||||
// trial.TrialCode = (trial.TrialType == 1 ? yearStr.Substring(yearStr.Length - 2) : "T0") + trial.TrialCode + currentYearMaxCodeNext.ToString("D3");
|
||||
|
||||
|
||||
// //多选信息
|
||||
// trialAddModel.ModalityIds.ForEach(modalityId => trial.TrialDicList.Add(new TrialDictionary() { DictionaryId = modalityId, KeyName = StaticData.Modality, TrialId = trial.Id }));
|
||||
// trialAddModel.CriterionIds.ForEach(criterionId => trial.TrialDicList.Add(new TrialDictionary() { DictionaryId = criterionId, KeyName = StaticData.Criterion, TrialId = trial.Id }));
|
||||
|
||||
// //添加项目后 项目状态变更为申请下载简历
|
||||
// trial.TrialStatus = (int)TrialEnrollStatus.ChooseDoctor;
|
||||
// trial.TrialStatusStr = StaticData.TrialOngoing;
|
||||
|
||||
// //状态变更详细表
|
||||
// trial.ClinicalTrialProjectDetails.Add(new TrialStatusDetail() { TrialId = trial.Id, TrialStatus = (int)TrialEnrollStatus.ChooseDoctor });
|
||||
|
||||
// trial = await _repository.AddAsync(trial);
|
||||
// //如果是PM, 则需要将该人员添加到 运维人员表
|
||||
|
||||
|
||||
// //添加运维人员PM
|
||||
// await _repository.AddAsync(new TrialUser() { TrialId = trial.Id, UserId = _userInfo.Id });
|
||||
|
||||
// // 添加扩展信息表记录
|
||||
// await _repository.AddAsync(new TrialPaymentPrice() { TrialId = trial.Id });
|
||||
|
||||
// //添加访视
|
||||
// await _repository.AddAsync(new VisitStage { TrialId = trial.Id, VisitNum = 0, BlindName = "B" + 0.ToString("D3"), VisitDay = 1, VisitName = "Baseline", IsBaseLine = true });
|
||||
// await _repository.AddAsync(new VisitStage { TrialId = trial.Id, VisitNum = 1, BlindName = "B" + 10.ToString("D3"), VisitDay = 30, VisitName = "Visit 1" });
|
||||
|
||||
|
||||
// var success = await _repository.SaveChangesAsync();
|
||||
|
||||
// return ResponseOutput.Result(success, new { Id = trial.Id, TrialCode = trial.TrialCode });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var updateModel = trialAddModel;
|
||||
// // 判断项目Id 是否已经存在
|
||||
// if (await _repository.AnyAsync<Trial>(u => u.TrialCode == updateModel.TrialCode && u.Id != updateModel.Id))
|
||||
// {
|
||||
// return ResponseOutput.NotOk("Same Trial ID already exists.");
|
||||
|
||||
// }
|
||||
|
||||
// var trial = await _repository.FirstOrDefaultAsync<Trial>(t => t.Id == updateModel.Id);
|
||||
|
||||
|
||||
// //删除中间表 Title对应的记录
|
||||
// await _repository.DeleteFromQueryAsync<TrialDictionary>(t => t.TrialId == updateModel.Id);
|
||||
|
||||
// //重新插入新的 Title记录
|
||||
// updateModel.ModalityIds.ForEach(async modalityId => await _repository.AddAsync(new TrialDictionary() { TrialId = updateModel.Id.Value, KeyName = StaticData.Modality, DictionaryId = modalityId }));
|
||||
|
||||
// updateModel.CriterionIds.ForEach(async criterionId => await _repository.AddAsync(new TrialDictionary() { TrialId = updateModel.Id.Value, KeyName = StaticData.Criterion, DictionaryId = criterionId }));
|
||||
|
||||
// if (updateModel.Expedited != trial.Expedited && updateModel.Expedited != null)
|
||||
// {
|
||||
// TrialExpeditedChange = true;
|
||||
// await TrialExpeditedStatusChange(trial.Id, trial.Expedited, (int)updateModel.Expedited);
|
||||
// }
|
||||
// _mapper.Map(updateModel, trial);
|
||||
|
||||
// var success = await _repository.SaveChangesAsync();
|
||||
|
||||
// return ResponseOutput.Result(success);
|
||||
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO: 需要优化,嵌套两层 switch case ?
|
||||
[NonDynamicMethod]
|
||||
private async Task TrialExpeditedStatusChange(Guid trialId, int oldState, int newState)
|
||||
|
@ -445,44 +334,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 手动更新项目状态
|
||||
/// </summary>
|
||||
/// <param name="trialId">项目Id</param>
|
||||
/// <param name="statusStr">状态值</param>
|
||||
/// <returns></returns>
|
||||
|
||||
[HttpPost("{trialId:guid}/{statusStr}")]
|
||||
[TypeFilter(typeof(TrialResourceFilter))]
|
||||
public virtual async Task<IResponseOutput> UpdateTrialStatus(Guid trialId, string statusStr)
|
||||
{
|
||||
//Paused、 添加工总量 算医生读片中
|
||||
if (statusStr.Contains(StaticData.TrialCompleted) || statusStr.Contains(StaticData.TrialStopped))
|
||||
{
|
||||
await _repository.UpdateFromQueryAsync<Enroll>(u => u.TrialId == trialId, e => new Enroll
|
||||
{
|
||||
EnrollStatus = (int)EnrollStatus.Finished
|
||||
});
|
||||
}
|
||||
|
||||
if (statusStr.Contains(StaticData.TrialCompleted))
|
||||
{
|
||||
await _trialRepository.UpdateFromQueryAsync(u => u.Id == trialId, s => new Trial { TrialFinishedTime = DateTime.UtcNow.AddHours(8) });
|
||||
}
|
||||
|
||||
//if (statusStr.Contains(StaticData.TrialOngoing) || statusStr.Contains(StaticData.TrialPaused))
|
||||
//{
|
||||
// _enrollRepository.Update(u => u.TrialId == trialId, e => new Enroll
|
||||
// {
|
||||
// EnrollStatus = (int)EnrollStatus.DoctorReading
|
||||
// });
|
||||
//}
|
||||
|
||||
|
||||
await _provider.SetAsync(trialId.ToString(), statusStr, TimeSpan.FromDays(7));
|
||||
return ResponseOutput.Result(await _repository.UpdateFromQueryAsync<Trial>(u => u.Id == trialId, s => new Trial { TrialStatusStr = statusStr }));
|
||||
|
||||
}
|
||||
|
||||
/// <summary> 删除临床项目 </summary>
|
||||
/// <param name="trialId">临床试验项目Id</param>
|
||||
|
@ -556,6 +408,8 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目Id 获取医生Id,用于出发计算费用
|
||||
/// </summary>
|
||||
|
|
|
@ -33,19 +33,19 @@ namespace IRaCIS.Core.Application.Services
|
|||
/// Site用户列表导出
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="isAllSiteUser">isAllSiteUser true : site用户列表,false :Site调研汇总表</param>
|
||||
/// <param name="isSiteUserNotAll">isAllSiteUser true : site用户列表,false :Site调研汇总表</param>
|
||||
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpGet, Route("{trialId:guid}/{isSiteUserNotAll:bool}")]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> TrialSiteUserListExport(Guid trialId, bool isAllSiteUser,
|
||||
public async Task<IActionResult> TrialSiteUserListExport(Guid trialId, bool isSiteUserNotAll,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||
[FromServices] IRepository<TrialSiteUserSurvey> _trialSiteUserSurveyRepository
|
||||
)
|
||||
{
|
||||
var code = isAllSiteUser ? "TrialSiteUserSummary_Export" : "TrialSiteUserList_Export";
|
||||
var code = isSiteUserNotAll ? "TrialSiteUserList_Export":"TrialSiteUserSummary_Export";
|
||||
|
||||
var doc = _commonDocumentRepository.AsQueryable(true).FirstOrDefault(t => t.Code == code);
|
||||
|
||||
|
@ -65,7 +65,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
object exportInfo = default;
|
||||
|
||||
if (isAllSiteUser == false)
|
||||
if (isSiteUserNotAll)
|
||||
{
|
||||
exportInfo = await _trialRepository.Where(t => t.Id == trialId).IgnoreQueryFilters().ProjectTo<TrialSiteUserExportDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
|
@ -112,6 +112,9 @@ namespace IRaCIS.Core.Application.Services
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>Pannel 进去 SiteTab </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SiteStatDTO>> GetSiteCRCList(SiteCrcQueryDTO param)
|
||||
|
|
|
@ -213,10 +213,23 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<User, SiteUserExportDTO>();
|
||||
|
||||
|
||||
|
||||
|
||||
CreateMap<Trial, TrialSiteUserSummaryExportDto>();
|
||||
|
||||
CreateMap<TrialSiteUserSurvey, TrialSiteUserSummaryDto>()
|
||||
.ForMember(t => t.TrialRoleName, u => u.MapFrom(d => d.TrialRoleName.Value))
|
||||
.ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName)); ;
|
||||
|
||||
.ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName));
|
||||
|
||||
|
||||
CreateMap<Trial, TrialSiteSurveyStat>()
|
||||
.ForMember(t=>t.ApprovalRequiredCount,u=>
|
||||
u.MapFrom( c => userTypeEnumInt == (int)UserTypeEnum.SuperAdmin|| userTypeEnumInt == (int)UserTypeEnum.APM ?
|
||||
c.TrialSiteSurveyList.Where(t=> t.State==TrialSiteSurveyEnum.SPMApproved).Count()
|
||||
: c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count())
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ namespace IRaCIS.Core.Domain.Models
|
|||
TrialDicList = new List<TrialDictionary>();
|
||||
}
|
||||
|
||||
|
||||
public List<TrialSiteSurvey> TrialSiteSurveyList { get; set; }
|
||||
public List<TrialDocument> TrialDocumentList { get; set; }
|
||||
public List<Enroll> EnrollList { get; set; }
|
||||
public List<Workload> WorkloadList { get; set; }
|
||||
|
|
Loading…
Reference in New Issue