添加查询参数

Uat_Study
he 2022-04-13 14:31:41 +08:00
parent 6944ca3049
commit b643ae1c18
5 changed files with 81 additions and 55 deletions

View File

@ -219,7 +219,6 @@ namespace IRaCIS.Core.API.Controllers
[UnitOfWork] [UnitOfWork]
public async Task<IResponseOutput> DeletePreviousHistory(DataInspectionDto<IDDto> opt) public async Task<IResponseOutput> DeletePreviousHistory(DataInspectionDto<IDDto> opt)
{ {
var fun = _clinicalDataService.DeletePreviousHistory; var fun = _clinicalDataService.DeletePreviousHistory;
return await _inspectionService.Enforcement(opt.OptCommand.Id, opt.AuditInfo, opt.SignInfo, fun); return await _inspectionService.Enforcement(opt.OptCommand.Id, opt.AuditInfo, opt.SignInfo, fun);
} }
@ -308,8 +307,6 @@ namespace IRaCIS.Core.API.Controllers
} }
/// <summary> /// <summary>
/// 删除访视计划对象 /// 删除访视计划对象
/// </summary> /// </summary>

View File

@ -100,6 +100,9 @@ namespace IRaCIS.Core.Application.ViewModel
public string Identification { get; set; } public string Identification { get; set; }
} }
public class CopyOtherToThisItem public class CopyOtherToThisItem
{ {
public List<Guid?> DataSource { get; set; }=new List<Guid?>(){ }; public List<Guid?> DataSource { get; set; }=new List<Guid?>(){ };
@ -107,6 +110,11 @@ namespace IRaCIS.Core.Application.ViewModel
public Guid AddItem { get; set; } public Guid AddItem { get; set; }
} }
public class GetDescriptionByModuleTypeDto
{
public string ModuleType { get; set; } = string.Empty;
}
///<summary>FrontAuditConfigQuery 列表查询参数模型</summary> ///<summary>FrontAuditConfigQuery 列表查询参数模型</summary>
public class FrontAuditConfigQuery public class FrontAuditConfigQuery
{ {

View File

@ -110,13 +110,20 @@ namespace IRaCIS.Core.Application.Service
await _repository.SaveChangesAsync(); await _repository.SaveChangesAsync();
return ResponseOutput.Ok(); return ResponseOutput.Ok();
} }
/// <summary>
/// 获取Description
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<string>> GetDescriptionByModuleType(GetDescriptionByModuleTypeDto dto)
{
var result= await _frontAuditConfigRepository.Where(x=>x.ModuleTypeId== dto.ModuleType&&x.Description!=null &&x.Description!=string.Empty).Select(x=>x.Description).Distinct().ToListAsync();
return result;
}
/// <summary> /// <summary>
/// 获取列表 /// 获取列表

View File

@ -257,7 +257,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
public string SignText { get; set; } = string.Empty; public string SignText { get; set; } = string.Empty;
//public string OptType { get; set; } = string.Empty; public decimal? VisitNum { get; set; }
} }
@ -265,14 +265,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
public class GetDataInspectionDto : PageInput public class GetDataInspectionDto : PageInput
{ {
/// <summary>
/// 功能模块
/// </summary>
public string ModuleType { get; set; } = string.Empty;
/// <summary>
/// 盲态访视名
/// </summary>
public string BlindName { get; set; } = string.Empty;
/// <summary> /// <summary>
/// 项目iD /// 项目iD
@ -287,38 +280,53 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
/// <summary> /// <summary>
/// 受试者 /// 受试者
/// </summary> /// </summary>
public Guid? SubjectId { get; set; } public string SubjectInfo { get; set; } = string.Empty;
/// <summary> /// <summary>
/// 访视 ///
/// </summary> /// </summary>
public Guid? SubjectVisitId { get; set; } public decimal? VisitPlanInfo { get; set; }
/// <summary> /// <summary>
/// 操作类型 /// 开始时间
/// </summary> /// </summary>
public string OptType { get; set; } = string.Empty; public DateTime? StartTime { get; set; }
/// <summary>
/// 子类
/// </summary>
public string ChildrenType { get; set; } = string.Empty;
/// <summary> /// <summary>
/// 修改原因 /// 结束时间
/// </summary> /// </summary>
public DateTime? EndTime { get; set; }
public string Reason { get; set; } = string.Empty;
/// <summary>
/// 功能模块
/// </summary>
public string ModuleType { get; set; } = string.Empty;
/// <summary>
/// Description
/// </summary>
public string Description { get; set; } = string.Empty;
/// <summary>
/// 操作人名称模糊查询
/// </summary>
public string OpByUserName { get; set; } = string.Empty;
/// <summary>
/// 阅读片人
/// </summary>
public string ReaderUser { get; set; } = string.Empty;
/// <summary> /// <summary>
/// 是否有签名 /// 是否有签名
/// </summary> /// </summary>
public bool? IsSign { get; set; } public bool? IsSign { get; set; }
/// <summary>
/// 对象名称
/// </summary>
public string ObjectType { get; set; } = string.Empty;
} }
public class InspectionBase public class InspectionBase

View File

@ -43,24 +43,26 @@ namespace IRaCIS.Core.Application.Service.Inspection
join user in _repository.GetQueryable<User>() on data.CreateUserId equals user.Id into usertemp join user in _repository.GetQueryable<User>() on data.CreateUserId equals user.Id into usertemp
from leftuser in usertemp.DefaultIfEmpty() from leftuser in usertemp.DefaultIfEmpty()
//join moduleTyped in _repository.GetQueryable<Dictionary>().Where(x => x.Code == "ModuleType") on 1 equals 1
//join moduleTypec in _repository.GetQueryable<Dictionary>() on new { ParentId = moduleTyped.Id, ModuleType = data.ModuleType } equals new { ParentId = moduleTypec.ParentId.Value, ModuleType = moduleTypec.Value } into moduleTypectemp
//join childrenTyped in _repository.GetQueryable<Dictionary>().Where(x => x.Code == "ChildrenType") on 1 equals 1 //join moduleTyped in _repository.GetQueryable<Dictionary>().Where(x => x.Code == "ModuleType") on 1 equals 1
//join childrenTypec in _repository.GetQueryable<Dictionary>() on new { ParentId = childrenTyped.Id, ModuleType = data.ChildrenType } equals new { ParentId = childrenTypec.ParentId.Value, ModuleType = childrenTypec.Value } into childrenTypectemp //join moduleTypec in _repository.GetQueryable<Dictionary>() on new { ParentId = moduleTyped.Id, ModuleType = data.ModuleType } equals new { ParentId = moduleTypec.ParentId.Value, ModuleType = moduleTypec.Value } into moduleTypectemp
//from leftchildrenTypec in childrenTypectemp.DefaultIfEmpty()
//join ObjectTyped in _repository.GetQueryable<Dictionary>().Where(x => x.Code == "ObjectType") on 1 equals 1 //join childrenTyped in _repository.GetQueryable<Dictionary>().Where(x => x.Code == "ChildrenType") on 1 equals 1
//join ObjectTypec in _repository.GetQueryable<Dictionary>() on new { ParentId = ObjectTyped.Id, ModuleType = data.ObjectType } equals new { ParentId = ObjectTypec.ParentId.Value, ModuleType = ObjectTypec.Value } into objectTypetemp //join childrenTypec in _repository.GetQueryable<Dictionary>() on new { ParentId = childrenTyped.Id, ModuleType = data.ChildrenType } equals new { ParentId = childrenTypec.ParentId.Value, ModuleType = childrenTypec.Value } into childrenTypectemp
//from leftObjectType in objectTypetemp.DefaultIfEmpty() //from leftchildrenTypec in childrenTypectemp.DefaultIfEmpty()
//join OptTyped in _repository.GetQueryable<Dictionary>().Where(x => x.Code == "OptType") on 1 equals 1 //join ObjectTyped in _repository.GetQueryable<Dictionary>().Where(x => x.Code == "ObjectType") on 1 equals 1
//join OptTypec in _repository.GetQueryable<Dictionary>() on new { ParentId = OptTyped.Id, ModuleType = data.OptType } equals new { ParentId = OptTypec.ParentId.Value, ModuleType = OptTypec.Value } into optTypetemp //join ObjectTypec in _repository.GetQueryable<Dictionary>() on new { ParentId = ObjectTyped.Id, ModuleType = data.ObjectType } equals new { ParentId = ObjectTypec.ParentId.Value, ModuleType = ObjectTypec.Value } into objectTypetemp
//from leftOptType in optTypetemp.DefaultIfEmpty() //from leftObjectType in objectTypetemp.DefaultIfEmpty()
//join OptTyped in _repository.GetQueryable<Dictionary>().Where(x => x.Code == "OptType") on 1 equals 1
//join OptTypec in _repository.GetQueryable<Dictionary>() on new { ParentId = OptTyped.Id, ModuleType = data.OptType } equals new { ParentId = OptTypec.ParentId.Value, ModuleType = OptTypec.Value } into optTypetemp
//from leftOptType in optTypetemp.DefaultIfEmpty()
join trialSign in _repository.GetQueryable<TrialSign>() on data.SignId equals trialSign.Id into trialSigntemp join trialSign in _repository.GetQueryable<TrialSign>() on data.SignId equals trialSign.Id into trialSigntemp
@ -112,6 +114,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
ParentJson = leftparent.JsonDetail, ParentJson = leftparent.JsonDetail,
VisitName = data.SubjectVisitName, VisitName = data.SubjectVisitName,
CreateUser = leftuser.UserName, CreateUser = leftuser.UserName,
UserFirstName = leftuser.FirstName, UserFirstName = leftuser.FirstName,
UserLastName = leftuser.LastName, UserLastName = leftuser.LastName,
//SubjectCode=leftsubject.Code, //SubjectCode=leftsubject.Code,
@ -128,22 +131,25 @@ namespace IRaCIS.Core.Application.Service.Inspection
SignText= lefttrialSign.SignText, SignText= lefttrialSign.SignText,
Identification= leftfrontAuditConfig.Identification, Identification= leftfrontAuditConfig.Identification,
OptType= leftOptType.Value, OptType= leftOptType.Value,
VisitNum=leftsubjectVisit.VisitNum,
}; };
query = query.WhereIf(!dto.BlindName.IsNullOrEmpty(), x => x.BlindName == dto.BlindName) query = query.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId)
.WhereIf(dto.IsSign != null, x => x.IsSign == dto.IsSign) .WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId)
.WhereIf(!dto.ObjectType.IsNullOrEmpty(), x => x.ObjectType == dto.ObjectType) .WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
.WhereIf(!dto.ChildrenType.IsNullOrEmpty(), x => x.ChildrenType == dto.ChildrenType) .WhereIf(dto.VisitPlanInfo != null, x => x.VisitNum == dto.VisitPlanInfo)
.WhereIf(!dto.ModuleType.IsNullOrEmpty(), x => x.ModuleType == dto.ModuleType) .WhereIf(dto.StartTime != null, x => x.CreateTime >= dto.StartTime)
.WhereIf(!dto.OptType.IsNullOrEmpty(), x => x.OptType == dto.OptType) .WhereIf(dto.EndTime != null, x => x.CreateTime <= dto.EndTime)
.WhereIf(!dto.Reason.IsNullOrEmpty(), x => x.Reason == dto.Reason) .WhereIf(!dto.ModuleType.IsNullOrEmpty(), x => x.ModuleType == dto.ModuleType)
.WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId) .WhereIf(!dto.Description.IsNullOrEmpty(), x => x.Description == dto.Description)
.WhereIf(dto.SubjectId != null, x => x.SubjectId == dto.SubjectId) .WhereIf(!dto.OpByUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(dto.OpByUserName))
.WhereIf(dto.SubjectVisitId != null, x => x.SubjectVisitId == dto.SubjectVisitId) //.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
.WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId); .WhereIf(dto.IsSign != null, x => x.IsSign == dto.IsSign);
#endregion #endregion
dto.Asc = false; dto.Asc = false;
return await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, "CreateTime", dto.Asc); return await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, "CreateTime", dto.Asc);