修改
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
he 2025-06-03 11:45:57 +08:00
parent 0a5a36adb3
commit e44478dafe
2 changed files with 99 additions and 21 deletions

View File

@ -349,6 +349,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
public class GetDataInspectionOutDto : DataInspection public class GetDataInspectionOutDto : DataInspection
{ {
public bool IsShow { get; set; }
public string TrialReadingCriterionName { get; set; } public string TrialReadingCriterionName { get; set; }
public string BlindName { get; set; } public string BlindName { get; set; }
@ -420,7 +421,42 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
public bool isAbandon { get; set; } public bool isAbandon { get; set; }
} }
public class GetTrialShowInspectionOutDto
{
public Guid FrontAuditConfigId { get; set; }
public Guid? ParentId { get; set; }
public int Sort { get; set; }
public string Description { get; set; }
public string DescriptionCN { get; set; }
public bool IsShow { get; set; }
public List<GetTrialShowInspectionOutDto> Children { get; set; }
}
public class SetTrialShowInspection
{
public Guid TrialId { get; set; }
public List<TrialShowInspection> TrialShowInspectionList { get; set; }
}
public class TrialShowInspection
{
public Guid FrontAuditConfigId { get; set; }
public bool IsShow { get; set; }
}
public class GetTrialShowInspectionInDto
{
public Guid TrialId { get; set; }
}
public class GetDataInspectionDto : PageInput public class GetDataInspectionDto : PageInput
{ {

View File

@ -1,8 +1,10 @@
using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Service.Inspection.DTO; using IRaCIS.Core.Application.Service.Inspection.DTO;
using IRaCIS.Core.Application.Service.Inspection.Interface; using IRaCIS.Core.Application.Service.Inspection.Interface;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure;
using Microsoft.AspNetCore.Mvc;
using Panda.DynamicWebApi.Attributes; using Panda.DynamicWebApi.Attributes;
@ -13,6 +15,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
IRepository<Dictionary> _dictionaryRepository, IRepository<Dictionary> _dictionaryRepository,
IRepository<TrialSign> _trialSignRepository, IRepository<TrialSign> _trialSignRepository,
IRepository<IdentityUser> _identityUserRepository, IRepository<IdentityUser> _identityUserRepository,
IRepository<TrialAuditShow> _trialAuditShowRepository,
IRepository<UserRole> _userRoleRepository, IRepository<UserRole> _userRoleRepository,
IRepository<TrialSite> _trialSiteRepository, IRepository<TrialSite> _trialSiteRepository,
IRepository<Trial> _trialRepository, IRepository<Trial> _trialRepository,
@ -23,7 +26,63 @@ namespace IRaCIS.Core.Application.Service.Inspection
IRepository<FrontAuditConfig> _frontAuditConfigRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IInspectionService IRepository<FrontAuditConfig> _frontAuditConfigRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IInspectionService
{ {
/// <summary>
/// 设置项目稽查配置
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> SetTrialShowInspection(SetTrialShowInspection inDto)
{
await _trialAuditShowRepository.BatchDeleteNoTrackingAsync(x => x.TrialId == inDto.TrialId);
List<TrialAuditShow> trialAuditShows = inDto.TrialShowInspectionList.Select(x => new TrialAuditShow()
{
FrontAuditConfigId = x.FrontAuditConfigId,
TrialId = inDto.TrialId,
IsShow = x.IsShow,
}).ToList();
await _trialAuditShowRepository.AddRangeAsync(trialAuditShows);
await _trialAuditShowRepository.SaveChangesAsync();
return ResponseOutput.Ok();
}
/// <summary>
/// 获取项目稽查显示信息
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<GetTrialShowInspectionOutDto>> GetTrialShowInspection(GetTrialShowInspectionInDto inDto)
{
var query = from data in _frontAuditConfigRepository.Where(x => x.IsEnable && x.ConfigType == "M")
join trialdata in _trialAuditShowRepository.Where(x => x.TrialId == inDto.TrialId) on data.Id equals trialdata.FrontAuditConfigId into trialdatatemp
from lefttrialdata in trialdatatemp.DefaultIfEmpty()
select new GetTrialShowInspectionOutDto()
{
Description = data.Description,
DescriptionCN = data.DescriptionCN,
FrontAuditConfigId = data.Id,
ParentId= data.ParentId,
Sort=data.Sort,
IsShow = lefttrialdata != null ? lefttrialdata.IsShow : data.IsDefaultChoice
};
var frontAuditList =await query.ToListAsync();
var result= frontAuditList.Where(x=>x.ParentId==null).OrderBy(x=>x.Sort).ToList();
result.ForEach(x =>
{
x.Children = frontAuditList.Where(y => y.ParentId == x.FrontAuditConfigId).OrderBy(x => x.Sort).ToList();
});
return result;
}
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionList(GetDataInspectionDto inQuery) public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionList(GetDataInspectionDto inQuery)
@ -61,26 +120,6 @@ namespace IRaCIS.Core.Application.Service.Inspection
join visttask in _visitTaskRepository.Where().IgnoreQueryFilters() on data.VisitTaskId equals visttask.Id into visttasktemp join visttask in _visitTaskRepository.Where().IgnoreQueryFilters() on data.VisitTaskId equals visttask.Id into visttasktemp
from leftvisttask in visttasktemp.DefaultIfEmpty() from leftvisttask in visttasktemp.DefaultIfEmpty()
//join trialCriterion in _repository.GetQueryable<ReadingQuestionCriterionTrial>().IgnoreQueryFilters() on data.TrialReadingCriterionId equals trialCriterion.Id into criterion
//from leftCriterion in criterion.DefaultIfEmpty()
//join moduleTyped in _dictionaryRepository.Where().Where(x => x.Code == "ModuleType") on 1 equals 1
//join moduleTypec in _dictionaryRepository.Where() on new { ParentId = moduleTyped.Id, ModuleType = data.ModuleType } equals new { ParentId = moduleTypec.ParentId.Value, ModuleType = moduleTypec.Value } into moduleTypectemp
//join childrenTyped in _dictionaryRepository.Where().Where(x => x.Code == "ChildrenType") on 1 equals 1
//join childrenTypec in _dictionaryRepository.Where() on new { ParentId = childrenTyped.Id, ModuleType = data.ChildrenType } equals new { ParentId = childrenTypec.ParentId.Value, ModuleType = childrenTypec.Value } into childrenTypectemp
//from leftchildrenTypec in childrenTypectemp.DefaultIfEmpty()
//join ObjectTyped in _dictionaryRepository.Where().Where(x => x.Code == "ObjectType") on 1 equals 1
//join ObjectTypec in _dictionaryRepository.Where() on new { ParentId = ObjectTyped.Id, ModuleType = data.ObjectType } equals new { ParentId = ObjectTypec.ParentId.Value, ModuleType = ObjectTypec.Value } into objectTypetemp
//from leftObjectType in objectTypetemp.DefaultIfEmpty()
//join OptTyped in _dictionaryRepository.Where().Where(x => x.Code == "OptType") on 1 equals 1
//join OptTypec in _dictionaryRepository.Where() 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 _trialSignRepository.Where().IgnoreQueryFilters() on data.SignId equals trialSign.Id into trialSigntemp join trialSign in _trialSignRepository.Where().IgnoreQueryFilters() on data.SignId equals trialSign.Id into trialSigntemp
from lefttrialSign in trialSigntemp.DefaultIfEmpty() from lefttrialSign in trialSigntemp.DefaultIfEmpty()
join leftfrontAuditConfig in _frontAuditConfigRepository.Where().Where(x => x.ConfigType == "M" && x.Identification != null && x.IsEnable == true) on join leftfrontAuditConfig in _frontAuditConfigRepository.Where().Where(x => x.ConfigType == "M" && x.Identification != null && x.IsEnable == true) on
@ -91,9 +130,11 @@ namespace IRaCIS.Core.Application.Service.Inspection
from leftmoduleTypec in moduleTypectemp.DefaultIfEmpty() from leftmoduleTypec in moduleTypectemp.DefaultIfEmpty()
join OptTypec in _dictionaryRepository.Where() on new { ModuleType = leftfrontAuditConfig.OptTypeId!.Value } equals new { ModuleType = OptTypec.Id } into optTypetemp join OptTypec in _dictionaryRepository.Where() on new { ModuleType = leftfrontAuditConfig.OptTypeId!.Value } equals new { ModuleType = OptTypec.Id } into optTypetemp
from leftOptType in optTypetemp.DefaultIfEmpty() from leftOptType in optTypetemp.DefaultIfEmpty()
join trialShow in _trialAuditShowRepository.Where(x => x.TrialId == inQuery.TrialId) on leftfrontAuditConfig.Id equals trialShow.FrontAuditConfigId into trialShowtemp
from lefttrialShow in trialShowtemp.DefaultIfEmpty()
select new GetDataInspectionOutDto() select new GetDataInspectionOutDto()
{ {
IsShow = lefttrialShow != null ? lefttrialShow.IsShow : leftfrontAuditConfig.IsDefaultChoice,
CreateTime = data.CreateTime, CreateTime = data.CreateTime,
CreateUserId = data.CreateUserId, CreateUserId = data.CreateUserId,
ModuleTypeId = leftmoduleTypec.Id, ModuleTypeId = leftmoduleTypec.Id,
@ -167,6 +208,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
query = query.WhereIf(inQuery.TrialSiteId != null, x => x.TrialSiteId == inQuery.TrialSiteId) query = query.WhereIf(inQuery.TrialSiteId != null, x => x.TrialSiteId == inQuery.TrialSiteId)
//.Where(x => (x.TrialId == dto.TrialId) || (x.TrialId == null && x.CreateTime >= trialData.CreateTime && x.CreateTime <= trialData.TrialFinishTime)) //.Where(x => (x.TrialId == dto.TrialId) || (x.TrialId == null && x.CreateTime >= trialData.CreateTime && x.CreateTime <= trialData.TrialFinishTime))
.Where(x => x.TrialId == inQuery.TrialId) .Where(x => x.TrialId == inQuery.TrialId)
.Where(x => x.IsShow)
#region 废弃 #region 废弃
// .WhereIf(dto.BatchId != null && dto.ObjectRelationParentId == null && dto.GeneralId == null, x => x.BatchId == dto.BatchId) // .WhereIf(dto.BatchId != null && dto.ObjectRelationParentId == null && dto.GeneralId == null, x => x.BatchId == dto.BatchId)