Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
9775d3b93f
|
@ -467,6 +467,43 @@
|
|||
系统模板文档配置表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.TrialUserListExport(IRaCIS.Application.Contracts.TrialMaintenanceExportQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUser})">
|
||||
<summary>
|
||||
项目参与人员导出
|
||||
</summary>
|
||||
<param name="param"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_dictionaryService"></param>
|
||||
<param name="_trialRepository"></param>
|
||||
<param name="_trialUseRepository"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.TrialSiteUserListExport(IRaCIS.Core.Application.Contracts.DTO.SiteCRCExportQueryDTO,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteUser})">
|
||||
<summary>
|
||||
Site用户列表导出
|
||||
</summary>
|
||||
<param name="param"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_dictionaryService"></param>
|
||||
<param name="_trialRepository"></param>
|
||||
<param name="_trialSiteUserRepository"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.TrialSiteUserSummaryListExport(IRaCIS.Core.Application.Contracts.TrialSiteUserSurveyExportQueryDto,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteSurvey},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteUserSurvey},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Application.Interfaces.IDictionaryService)">
|
||||
<summary>
|
||||
Site用户汇总表导出
|
||||
</summary>
|
||||
<param name="queryParam"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_trialSiteSurveyRepository"></param>
|
||||
<param name="_trialSiteUserSurveyRepository"></param>
|
||||
<param name="_trialRepository"></param>
|
||||
<param name="_dictionaryService"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.CRCVisitList_Export(IRaCIS.Core.Application.Contracts.CRCVisitSearchDTO,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
影像上传列表 只导出已上传状态的访视记录
|
||||
|
@ -9476,26 +9513,6 @@
|
|||
<summary> 指定资源Id,渲染Dicom序列的Jpeg预览图像 </summary>
|
||||
<param name="seriesId"> Dicom序列的Id </param>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialMaintenanceService.TrialSiteUserListExport(IRaCIS.Core.Application.Contracts.DTO.SiteCRCExportQueryDTO,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument})">
|
||||
<summary>
|
||||
Site用户列表导出
|
||||
</summary>
|
||||
<param name="param"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialMaintenanceService.TrialSiteUserSummaryListExport(IRaCIS.Core.Application.Contracts.TrialSiteUserSurveyExportQueryDto,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteSurvey},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteUserSurvey})">
|
||||
<summary>
|
||||
Site用户汇总表导出
|
||||
</summary>
|
||||
<param name="queryParam"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_trialSiteSurveyRepository"></param>
|
||||
<param name="_trialSiteUserSurveyRepository"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialMaintenanceService.GetSiteCRCList(IRaCIS.Core.Application.Contracts.DTO.SiteCrcQueryDTO)">
|
||||
<summary>Pannel 进去 SiteTab </summary>
|
||||
</member>
|
||||
|
@ -11773,15 +11790,6 @@
|
|||
<member name="M:IRaCIS.Application.Services.StatisticsService.GetLatestWorkLoadList(System.Int32)">
|
||||
<summary> 最新工作量 (已确定的)[New] </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Application.Services.TrialMaintenanceService.TrialUserListExport(IRaCIS.Application.Contracts.TrialMaintenanceExportQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument})">
|
||||
<summary>
|
||||
项目参与人员导出
|
||||
</summary>
|
||||
<param name="param"></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页面 获取项目参与人员列表
|
||||
|
|
|
@ -4,6 +4,7 @@ using DocumentFormat.OpenXml.Spreadsheet;
|
|||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts.DTO;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
@ -29,9 +30,167 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
public class ExcelExportService : BaseService
|
||||
{
|
||||
|
||||
|
||||
#region 后续需要移动过来
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 项目参与人员导出
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <param name="_trialRepository"></param>
|
||||
/// <param name="_trialUseRepository"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> TrialUserListExport(TrialMaintenanceExportQuery param,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<Trial> _trialRepository,
|
||||
[FromServices] IRepository<TrialUser> _trialUseRepository
|
||||
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == param.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.List = await _trialUseRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
.WhereIf(param.UserTypeId != null, t => t.User.UserTypeId == param.UserTypeId)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.UserName), t => t.User.UserName.Contains(param.UserName))
|
||||
|
||||
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName),
|
||||
t => t.User.OrganizationName.Contains(param.OrganizationName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.UserRealName),
|
||||
t => (t.User.FullName).Contains(param.UserRealName))
|
||||
.ProjectTo<TrialMaintenanceDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialMaintenanceDTO));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Site用户列表导出
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <param name="_trialRepository"></param>
|
||||
/// <param name="_trialSiteUserRepository"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> TrialSiteUserListExport(SiteCRCExportQueryDTO param,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<Trial> _trialRepository,
|
||||
[FromServices] IRepository<TrialSiteUser> _trialSiteUserRepository
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == param.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.List = await _trialSiteUserRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.Site.SiteName.Contains(param.SiteName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName),
|
||||
t => t.TrialSite.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode),
|
||||
t => t.TrialSite.TrialSiteCode.Contains(param.TrialSiteCode))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator,
|
||||
t => t.UserId == _userInfo.Id)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.UserKeyInfo), t => (t.User.FullName).Contains(param.UserKeyInfo)
|
||||
|| t.User.UserName.Contains(param.UserKeyInfo) || t.User.EMail.Contains(param.UserKeyInfo))
|
||||
|
||||
.ProjectTo<SiteUserExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SiteUserExportDTO));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Site用户汇总表导出
|
||||
/// </summary>
|
||||
/// <param name="queryParam"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_trialSiteSurveyRepository"></param>
|
||||
/// <param name="_trialSiteUserSurveyRepository"></param>
|
||||
/// <param name="_trialRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> TrialSiteUserSummaryListExport(TrialSiteUserSurveyExportQueryDto queryParam,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||
[FromServices] IRepository<TrialSiteUserSurvey> _trialSiteUserSurveyRepository,
|
||||
[FromServices] IRepository<Trial> _trialRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService
|
||||
)
|
||||
{
|
||||
|
||||
var data = (await _trialRepository.Where(t => t.Id == queryParam.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
var groupSelectIdQuery =
|
||||
_trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
||||
.WhereIf(queryParam.SiteId != null, t => t.SiteId == queryParam.SiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
||||
.GroupBy(t => t.SiteId)
|
||||
.Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
||||
|
||||
|
||||
var query = _trialSiteUserSurveyRepository
|
||||
.Where(t => groupSelectIdQuery.Contains(t.TrialSiteSurveyId))
|
||||
.WhereIf(queryParam.UserTypeId != null, t => t.UserTypeId == queryParam.UserTypeId)
|
||||
.WhereIf(queryParam.IsGenerateAccount != null, t => t.IsGenerateAccount == queryParam.IsGenerateAccount)
|
||||
.WhereIf(queryParam.TrialRoleNameId != null, t => t.TrialRoleNameId == queryParam.TrialRoleNameId)
|
||||
.WhereIf(queryParam.State != null && queryParam.State != TrialSiteUserStateEnum.OverTime, t => t.InviteState == queryParam.State)
|
||||
.WhereIf(queryParam.State != null && queryParam.State == TrialSiteUserStateEnum.OverTime, t => t.InviteState == TrialSiteUserStateEnum.HasSend && t.ExpireTime < DateTime.Now)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.UserName), t => (t.LastName + " / " + t.FirstName).Contains(queryParam.UserName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.OrganizationName), t => t.OrganizationName.Contains(queryParam.OrganizationName))
|
||||
.ProjectTo<TrialSiteUserSummaryDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
data.List = await query.ToListAsync();
|
||||
|
||||
|
||||
|
||||
var exportInfo = data;
|
||||
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserSummary_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialSiteUserSummaryDto));
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 导表查询
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 影像上传列表 只导出已上传状态的访视记录
|
||||
/// </summary>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// 生成时间 2021-12-23 13:21:04
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
@ -24,13 +25,14 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public DateTime? ExpireTime { get; set; }
|
||||
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool? IsJoin { get; set; }
|
||||
|
||||
public DateTime? ConfirmTime { get; set; }
|
||||
|
||||
public string RejectReason { get; set; } = string.Empty;
|
||||
|
||||
|
||||
[DictionaryTranslateAttribute("researchUserState")]
|
||||
public TrialSiteUserStateEnum State
|
||||
{
|
||||
get
|
||||
|
@ -89,6 +91,8 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
public string LastName { get; set; } = string.Empty;
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool IsGenerateAccount { get; set; }
|
||||
public Guid TrialRoleNameId { get; set; }
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ using Magicodes.ExporterAndImporter.Core;
|
|||
using MiniExcelLibs.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
|
||||
namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
|
@ -17,6 +18,8 @@ namespace IRaCIS.Application.Contracts
|
|||
[JsonIgnore]
|
||||
public string State => IsDeleted ? "退出" : "加入";
|
||||
|
||||
|
||||
[DictionaryTranslateAttribute("IsUserExitTrial")]
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
[ExcelFormat("yyyy-MM-dd hh:mm:ss")]
|
||||
|
@ -53,14 +56,16 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public class TrialMaintenanceDTO : UserTrialCommand
|
||||
{
|
||||
[JsonIgnore]
|
||||
public int No { get; set; }
|
||||
//[JsonIgnore]
|
||||
//public int No { get; set; }
|
||||
//For MiniExcel ExcelFormat
|
||||
public string State => IsDeleted ? "退出" : "加入";
|
||||
|
||||
|
||||
[ValueMapping(text: "退出", true)]
|
||||
[ValueMapping(text: "加入", false)]
|
||||
|
||||
[DictionaryTranslateAttribute("IsUserExitTrial")]
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
[ExporterHeader(Format = "yyyy-mm-DD hh:mm:ss")]
|
||||
|
@ -135,8 +140,6 @@ namespace IRaCIS.Application.Contracts
|
|||
}
|
||||
public class SiteUserExportDTO : UserTrialDTO
|
||||
{
|
||||
[JsonIgnore]
|
||||
public int No { get; set; }
|
||||
|
||||
public string TrialSiteCode { get; set; } = String.Empty;
|
||||
public string TrialSiteAliasName { get; set; } = String.Empty;
|
||||
|
@ -151,17 +154,18 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public class TrialSiteUserSummaryDto: TrialSiteUserSurveyView
|
||||
{
|
||||
[JsonIgnore]
|
||||
public int No { get; set; }
|
||||
|
||||
|
||||
public string TrialSiteCode { get; set; } = String.Empty;
|
||||
public string TrialSiteAliasName { get; set; } = String.Empty;
|
||||
|
||||
public string UserRealName => LastName + " / " + FirstName;
|
||||
|
||||
public string IsGenerateAccountStr => IsGenerateAccount ? "是" : "否";
|
||||
|
||||
public string StateStr => State.GetDescription();
|
||||
//public string IsGenerateAccountStr => IsGenerateAccount ? "是" : "否";
|
||||
|
||||
|
||||
//public string StateStr => State.GetDescription();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ using IRaCIS.Core.Application.Service;
|
|||
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -17,45 +18,49 @@ namespace IRaCIS.Application.Services
|
|||
private readonly IRepository<TrialUser> _trialUseRepository;
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
|
||||
|
||||
public TrialMaintenanceService(IRepository<TrialUser> trialUseRepository, IRepository<Trial> trialRepository)
|
||||
{
|
||||
_trialUseRepository = trialUseRepository;
|
||||
_trialRepository = trialRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目参与人员导出
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> TrialUserListExport(TrialMaintenanceExportQuery param, [FromServices] IRepository<CommonDocument> _commonDocumentRepository)
|
||||
{
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == param.TrialId).IgnoreQueryFilters().ProjectTo<TrialUserExportDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
#region 移动废弃
|
||||
|
||||
exportInfo.TrialUserList = await _trialUseRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
.WhereIf(param.UserTypeId != null, t => t.User.UserTypeId == param.UserTypeId)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.UserName), t => t.User.UserName.Contains(param.UserName))
|
||||
///// <summary>
|
||||
///// 项目参与人员导出
|
||||
///// </summary>
|
||||
///// <param name="param"></param>
|
||||
///// <param name="_commonDocumentRepository"></param>
|
||||
///// <returns></returns>
|
||||
///// <exception cref="Exception"></exception>
|
||||
//[HttpPost]
|
||||
//[AllowAnonymous]
|
||||
//public async Task<IActionResult> TrialUserListExport(TrialMaintenanceExportQuery param, [FromServices] IRepository<CommonDocument> _commonDocumentRepository, [FromServices] IDictionaryService _dictionaryService)
|
||||
//{
|
||||
|
||||
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName),
|
||||
t => t.User.OrganizationName.Contains(param.OrganizationName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.UserRealName),
|
||||
t => (t.User.FullName).Contains(param.UserRealName))
|
||||
.ProjectTo<TrialMaintenanceDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
// var exportInfo = (await _trialRepository.Where(t => t.Id == param.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
var no = 1;
|
||||
exportInfo.TrialUserList.ForEach(t => t.No = no++);
|
||||
// exportInfo.List = await _trialUseRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
// .WhereIf(param.UserTypeId != null, t => t.User.UserTypeId == param.UserTypeId)
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.UserName), t => t.User.UserName.Contains(param.UserName))
|
||||
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
// .WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName),
|
||||
// t => t.User.OrganizationName.Contains(param.OrganizationName))
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.UserRealName),
|
||||
// t => (t.User.FullName).Contains(param.UserRealName))
|
||||
// .ProjectTo<TrialMaintenanceDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment);
|
||||
|
||||
}
|
||||
// exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
|
||||
// return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialMaintenanceDTO));
|
||||
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ using IRaCIS.Core.Application.Interfaces;
|
|||
using IRaCIS.Core.Application.Service;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
|
||||
namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
|
@ -29,95 +30,92 @@ namespace IRaCIS.Core.Application.Services
|
|||
}
|
||||
|
||||
|
||||
#region 导出列表
|
||||
#region 移动废弃
|
||||
|
||||
/// <summary>
|
||||
/// Site用户列表导出
|
||||
/// </summary>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> TrialSiteUserListExport(SiteCRCExportQueryDTO param, [FromServices] IRepository<CommonDocument> _commonDocumentRepository)
|
||||
{
|
||||
///// <summary>
|
||||
///// Site用户列表导出
|
||||
///// </summary>
|
||||
///// <param name="param"></param>
|
||||
///// <param name="_commonDocumentRepository"></param>
|
||||
///// <returns></returns>
|
||||
///// <exception cref="Exception"></exception>
|
||||
//[HttpPost]
|
||||
//[AllowAnonymous]
|
||||
//public async Task<IActionResult> TrialSiteUserListExport(SiteCRCExportQueryDTO param, [FromServices] IRepository<CommonDocument> _commonDocumentRepository, [FromServices] IDictionaryService _dictionaryService)
|
||||
//{
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == param.TrialId).IgnoreQueryFilters().ProjectTo<TrialSiteUserExportDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
// var exportInfo = (await _trialRepository.Where(t => t.Id == param.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.TrialSiteUserList = await _trialSiteUserRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.Site.SiteName.Contains(param.SiteName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName),
|
||||
t => t.TrialSite.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode),
|
||||
t => t.TrialSite.TrialSiteCode.Contains(param.TrialSiteCode))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator,
|
||||
t => t.UserId == _userInfo.Id)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.UserKeyInfo), t => (t.User.FullName).Contains(param.UserKeyInfo)
|
||||
|| t.User.UserName.Contains(param.UserKeyInfo) || t.User.EMail.Contains(param.UserKeyInfo))
|
||||
// exportInfo.List = await _trialSiteUserRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
// .WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.Site.SiteName.Contains(param.SiteName))
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName),
|
||||
// t => t.TrialSite.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode),
|
||||
// t => t.TrialSite.TrialSiteCode.Contains(param.TrialSiteCode))
|
||||
// .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator,
|
||||
// t => t.UserId == _userInfo.Id)
|
||||
// .WhereIf(!string.IsNullOrWhiteSpace(param.UserKeyInfo), t => (t.User.FullName).Contains(param.UserKeyInfo)
|
||||
// || t.User.UserName.Contains(param.UserKeyInfo) || t.User.EMail.Contains(param.UserKeyInfo))
|
||||
|
||||
.ProjectTo<SiteUserExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
// .ProjectTo<SiteUserExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var no = 1;
|
||||
exportInfo.TrialSiteUserList.ForEach(t => t.No = no++);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment);
|
||||
// exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
// return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment,_dictionaryService,typeof(SiteUserExportDTO));
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Site用户汇总表导出
|
||||
/// </summary>
|
||||
/// <param name="queryParam"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_trialSiteSurveyRepository"></param>
|
||||
/// <param name="_trialSiteUserSurveyRepository"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> TrialSiteUserSummaryListExport(TrialSiteUserSurveyExportQueryDto queryParam,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||
[FromServices] IRepository<TrialSiteUserSurvey> _trialSiteUserSurveyRepository
|
||||
)
|
||||
{
|
||||
///// <summary>
|
||||
///// Site用户汇总表导出
|
||||
///// </summary>
|
||||
///// <param name="queryParam"></param>
|
||||
///// <param name="_commonDocumentRepository"></param>
|
||||
///// <param name="_trialSiteSurveyRepository"></param>
|
||||
///// <param name="_trialSiteUserSurveyRepository"></param>
|
||||
///// <param name="_dictionaryService"></param>
|
||||
///// <returns></returns>
|
||||
///// <exception cref="Exception"></exception>
|
||||
//[HttpPost]
|
||||
//[AllowAnonymous]
|
||||
//public async Task<IActionResult> TrialSiteUserSummaryListExport(TrialSiteUserSurveyExportQueryDto queryParam,
|
||||
// [FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
// [FromServices] IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||
// [FromServices] IRepository<TrialSiteUserSurvey> _trialSiteUserSurveyRepository
|
||||
// , [FromServices] IDictionaryService _dictionaryService
|
||||
//)
|
||||
//{
|
||||
|
||||
var data = (await _trialRepository.Where(t => t.Id == queryParam.TrialId).IgnoreQueryFilters().ProjectTo<TrialSiteUserSummaryExportDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
// var data = (await _trialRepository.Where(t => t.Id == queryParam.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
var groupSelectIdQuery =
|
||||
_trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
||||
.WhereIf(queryParam.SiteId != null, t => t.SiteId == queryParam.SiteId)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
||||
.GroupBy(t => t.SiteId)
|
||||
.Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
||||
// var groupSelectIdQuery =
|
||||
// _trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
||||
// .WhereIf(queryParam.SiteId != null, t => t.SiteId == queryParam.SiteId)
|
||||
// .WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
||||
// .GroupBy(t => t.SiteId)
|
||||
// .Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
||||
|
||||
|
||||
var query = _trialSiteUserSurveyRepository
|
||||
.Where(t => groupSelectIdQuery.Contains(t.TrialSiteSurveyId))
|
||||
.WhereIf(queryParam.UserTypeId != null, t => t.UserTypeId == queryParam.UserTypeId)
|
||||
.WhereIf(queryParam.IsGenerateAccount != null, t => t.IsGenerateAccount == queryParam.IsGenerateAccount)
|
||||
.WhereIf(queryParam.TrialRoleNameId != null, t => t.TrialRoleNameId == queryParam.TrialRoleNameId)
|
||||
.WhereIf(queryParam.State != null && queryParam.State != TrialSiteUserStateEnum.OverTime, t => t.InviteState == queryParam.State)
|
||||
.WhereIf(queryParam.State != null && queryParam.State == TrialSiteUserStateEnum.OverTime, t => t.InviteState == TrialSiteUserStateEnum.HasSend && t.ExpireTime < DateTime.Now)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.UserName), t => (t.LastName + " / " + t.FirstName).Contains(queryParam.UserName))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryParam.OrganizationName), t => t.OrganizationName.Contains(queryParam.OrganizationName))
|
||||
.ProjectTo<TrialSiteUserSummaryDto>(_mapper.ConfigurationProvider);
|
||||
// var query = _trialSiteUserSurveyRepository
|
||||
// .Where(t => groupSelectIdQuery.Contains(t.TrialSiteSurveyId))
|
||||
// .WhereIf(queryParam.UserTypeId != null, t => t.UserTypeId == queryParam.UserTypeId)
|
||||
// .WhereIf(queryParam.IsGenerateAccount != null, t => t.IsGenerateAccount == queryParam.IsGenerateAccount)
|
||||
// .WhereIf(queryParam.TrialRoleNameId != null, t => t.TrialRoleNameId == queryParam.TrialRoleNameId)
|
||||
// .WhereIf(queryParam.State != null && queryParam.State != TrialSiteUserStateEnum.OverTime, t => t.InviteState == queryParam.State)
|
||||
// .WhereIf(queryParam.State != null && queryParam.State == TrialSiteUserStateEnum.OverTime, t => t.InviteState == TrialSiteUserStateEnum.HasSend && t.ExpireTime < DateTime.Now)
|
||||
// .WhereIf(!string.IsNullOrEmpty(queryParam.UserName), t => (t.LastName + " / " + t.FirstName).Contains(queryParam.UserName))
|
||||
// .WhereIf(!string.IsNullOrEmpty(queryParam.OrganizationName), t => t.OrganizationName.Contains(queryParam.OrganizationName))
|
||||
// .ProjectTo<TrialSiteUserSummaryDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
data.TrialSiteUserList = await query.ToListAsync();
|
||||
// data.List = await query.ToListAsync();
|
||||
|
||||
|
||||
|
||||
var exportInfo = data;
|
||||
// var exportInfo = data;
|
||||
|
||||
//处理翻译
|
||||
var no = 1;
|
||||
exportInfo.TrialSiteUserList.ForEach(t => t.No = no++);
|
||||
exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserSummary_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment);
|
||||
// exportInfo.IsEn_US = _userInfo.IsEn_Us;
|
||||
// return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserSummary_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment,_dictionaryService,typeof(TrialSiteUserSummaryDto));
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
update FrontAuditConfig set Identification='' where Identification is NULL
|
||||
|
||||
--新增字段
|
||||
|
||||
ALTER TABLE [dbo].[Trial] ADD [AttendedReviewerTypes] varchar(255) COLLATE Chinese_PRC_CI_AS DEFAULT '' NOT NULL
|
||||
GO
|
||||
|
||||
ALTER TABLE [dbo].[Trial] ADD [DeclarationTypes] varchar(255) COLLATE Chinese_PRC_CI_AS DEFAULT '' NOT NULL
|
||||
GO
|
||||
|
||||
|
||||
--维护sql
|
||||
UPDATE Trial SET AttendedReviewerTypes = '|' + CAST(AttendedReviewerType AS VARCHAR(10)) + '|'
|
||||
|
||||
update Trial set DeclarationTypes ='|' + (select Code from Dictionary where Id= Trial.DeclarationTypeId) + '|'
|
||||
|
||||
|
||||
--验证sql
|
||||
select DISTINCT AttendedReviewerType ,AttendedReviewerTypes, DeclarationTypeId, Dictionary.Code,DeclarationTypes,Dictionary.[Value] from Trial inner join Dictionary on Trial.DeclarationTypeId=Dictionary.Id
|
||||
|
||||
|
Loading…
Reference in New Issue