Merge branch 'Test.Study' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test.Study
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
92008fe6ba
|
@ -26,6 +26,7 @@ using IRaCIS.Application.Services.BackGroundJob;
|
|||
using Magicodes.ExporterAndImporter.Core.Extension;
|
||||
using Hangfire;
|
||||
using MassTransit;
|
||||
using static IRaCIS.Core.Domain.Models.ReadingQuestionTrial;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
|
@ -226,6 +227,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
public async Task<IResponseOutput<PageOutput<PIReaingTaskView>>> GetPIReadingAuditList(VisitTaskQuery queryVisitTask)
|
||||
{
|
||||
|
||||
CriterionType? criterionType = _trialReadingCriterionRepository.Where(t => t.Id == queryVisitTask.TrialReadingCriterionId).Select(t=>t.CriterionType).FirstOrDefault();
|
||||
|
||||
var visitTaskQueryable = GetReadingTaskQueryable(queryVisitTask)
|
||||
.ProjectTo<PIReaingTaskView>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
@ -236,7 +239,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
var trialTaskConfig = _trialRepository.Where(t => t.Id == queryVisitTask.TrialId).ProjectTo<TrialUrgentConfig>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
|
||||
var questionList = _readingQuestionTrialRepository.Where(t => t.TrialId == queryVisitTask.TrialId && t.ReadingQuestionCriterionTrialId == queryVisitTask.TrialReadingCriterionId)
|
||||
.Where(t => t.IsJudgeQuestion == true)
|
||||
//.Where(t => t.IsJudgeQuestion == true)
|
||||
.WhereIf(criterionType!=null&& criterionType!=CriterionType.SelfDefine,t=>t.IsJudgeQuestion==true)
|
||||
.WhereIf(criterionType != null && criterionType == CriterionType.SelfDefine, t => t.AssessmentResultEnum == AssessmentResultType.AssessmentResult)
|
||||
.Select(t => new { QuestionId = t.Id, QuestionName = _userInfo.IsEn_Us ? t.QuestionEnName : t.QuestionName ,t.DictionaryCode}).ToList();
|
||||
|
||||
trialTaskConfig!.OtherObj = questionList;
|
||||
|
|
|
@ -4,6 +4,7 @@ using IRaCIS.Core.Application.Contracts;
|
|||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using static IRaCIS.Core.Domain.Models.ReadingQuestionTrial;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
@ -83,7 +84,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<VisitTask, ReadingTaskView>().IncludeBase<VisitTask, VisitTaskView>()
|
||||
.ForMember(t=>t.PIReadingResultList,u=>u.MapFrom(c=>c.ReadingTaskQuestionAnswerList
|
||||
.Where(t=>t.ReadingQuestionTrial.IsJudgeQuestion==true ).Select(d=>new PIReadingResult() { QuestionId= d.ReadingQuestionTrialId,Answer=d.Answer})));
|
||||
.Where(t=> t.ReadingQuestionCriterionTrial.CriterionType==CriterionType.SelfDefine? t.ReadingQuestionTrial.AssessmentResultEnum == AssessmentResultType.AssessmentResult: t.ReadingQuestionTrial.IsJudgeQuestion==true)
|
||||
.Select(d=>new PIReadingResult() { QuestionId= d.ReadingQuestionTrialId,Answer=d.Answer})));
|
||||
|
||||
CreateMap<VisitTask, PIReaingTaskView>().IncludeBase<VisitTask, ReadingTaskView>()
|
||||
.ForMember(o => o.FirstAuditUserName, t => t.MapFrom(u => u.FirstAuditUser.UserName))
|
||||
|
|
|
@ -3,7 +3,7 @@ using IRaCIS.Core.Infrastructure.Extention;
|
|||
|
||||
namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
public class SiteDTO: SiteCommand
|
||||
public class SiteDTO : SiteCommand
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -35,6 +35,9 @@ namespace IRaCIS.Application.Contracts
|
|||
{
|
||||
public Guid Id { get; set; }
|
||||
public string SiteName { get; set; } = String.Empty;
|
||||
|
||||
public string SiteNameCN { get; set; } = String.Empty;
|
||||
|
||||
public string City { get; set; } = String.Empty;
|
||||
|
||||
public string Province { get; set; } = string.Empty;
|
||||
|
|
|
@ -3,18 +3,20 @@ using IRaCIS.Application.Contracts;
|
|||
using IRaCIS.Core.Infra.EFCore;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.Data.Sqlite;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
[ ApiExplorerSettings(GroupName = "Institution")]
|
||||
[ApiExplorerSettings(GroupName = "Institution")]
|
||||
public class HospitalService : BaseService, IHospitalService
|
||||
{
|
||||
private readonly IRepository<Hospital> _hospitalRepository;
|
||||
private readonly IRepository<Site> _siteRepository;
|
||||
|
||||
public HospitalService(IRepository<Hospital> hospitalRepository )
|
||||
public HospitalService(IRepository<Hospital> hospitalRepository, IRepository<Site> siteRepository)
|
||||
{
|
||||
_hospitalRepository = hospitalRepository;
|
||||
|
||||
_siteRepository = siteRepository;
|
||||
}
|
||||
|
||||
/// <summary> 获取所有医院列表 </summary>
|
||||
|
@ -37,13 +39,24 @@ namespace IRaCIS.Application.Services
|
|||
var exp1 = new EntityVerifyExp<Hospital>()
|
||||
{
|
||||
VerifyExp = x => x.SiteId == hospitalCommand.SiteId && hospitalCommand.SiteId != null,
|
||||
//---已经存在同名的医院,请确认。
|
||||
//---当前中心已经添加到其他医院了。
|
||||
VerifyMsg = _localizer["Hospital_SiteAdded"]
|
||||
};
|
||||
|
||||
|
||||
var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp,exp1);
|
||||
var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp, exp1);
|
||||
|
||||
//手动解绑医院与site的关系
|
||||
if (hospitalCommand.SiteId == null && hospital.SiteId != null)
|
||||
{
|
||||
await _siteRepository.BatchUpdateNoTrackingAsync(t => t.Id == hospital.SiteId, u => new Site() { HospitalId = null });
|
||||
}
|
||||
|
||||
//手动绑
|
||||
if (hospitalCommand.SiteId != null)
|
||||
{
|
||||
await _siteRepository.BatchUpdateNoTrackingAsync(t => t.Id == hospitalCommand.SiteId, u => new Site() { HospitalId = hospital.Id });
|
||||
}
|
||||
return ResponseOutput.Ok(hospital.Id.ToString());
|
||||
|
||||
}
|
||||
|
@ -55,11 +68,6 @@ namespace IRaCIS.Application.Services
|
|||
public async Task<IResponseOutput> DeleteHospital(Guid hospitalId)
|
||||
{
|
||||
|
||||
//if (_userRepository.Find().Any(t => t.OrganizationId == hospitalId))
|
||||
//{
|
||||
// return ResponseOutput.NotOk("该医院下存在用户,暂时无法删除。");
|
||||
//}
|
||||
|
||||
var success = await _hospitalRepository.BatchDeleteNoTrackingAsync(x => x.Id == hospitalId);
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
|
@ -67,12 +75,12 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
/// <summary> 分页获取医院列表 </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<HospitalDTO>> GetHospitalPageList(HospitalQueryDTO hospitalSearchModel)
|
||||
public async Task<PageOutput<HospitalDTO>> GetHospitalPageList(HospitalQueryDTO hospitalSearchModel)
|
||||
{
|
||||
|
||||
var hospitalQueryable =
|
||||
_hospitalRepository
|
||||
.WhereIf(hospitalSearchModel.HospitalName!=null, t => t.HospitalName.Contains(hospitalSearchModel.HospitalName!) || t.HospitalNameCN.Contains(hospitalSearchModel.HospitalName!))
|
||||
.WhereIf(hospitalSearchModel.HospitalName != null, t => t.HospitalName.Contains(hospitalSearchModel.HospitalName!) || t.HospitalNameCN.Contains(hospitalSearchModel.HospitalName!))
|
||||
.WhereIf(hospitalSearchModel.City != null, t => t.City.Contains(hospitalSearchModel.City!) || t.HospitalNameCN.Contains(hospitalSearchModel.City!))
|
||||
.WhereIf(hospitalSearchModel.Province != null, t => t.Province.Contains(hospitalSearchModel.Province!) || t.HospitalNameCN.Contains(hospitalSearchModel.Province!))
|
||||
.ProjectTo<HospitalDTO>(_mapper.ConfigurationProvider);
|
||||
|
|
|
@ -4,6 +4,7 @@ using IRaCIS.Core.Infra.EFCore;
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Medallion.Threading;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
|
@ -13,12 +14,14 @@ namespace IRaCIS.Application.Services
|
|||
private readonly IRepository<Site> _siteRepository;
|
||||
private readonly IRepository<TrialSiteUser> _trialSiteUserRepository;
|
||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||
private readonly IRepository<Hospital> _hospitalRepository;
|
||||
|
||||
public SiteService(IRepository<Site> siteRepository, IRepository<TrialSiteUser> trialSiteUserRepository, IDistributedLockProvider distributedLockProvider)
|
||||
public SiteService(IRepository<Site> siteRepository, IRepository<TrialSiteUser> trialSiteUserRepository, IDistributedLockProvider distributedLockProvider, IRepository<Hospital> hospitalRepository)
|
||||
{
|
||||
_siteRepository = siteRepository;
|
||||
_trialSiteUserRepository = trialSiteUserRepository;
|
||||
_distributedLockProvider = distributedLockProvider;
|
||||
_hospitalRepository = hospitalRepository;
|
||||
}
|
||||
|
||||
/// <summary> 分页获取研究中心列表 </summary>
|
||||
|
@ -32,7 +35,7 @@ namespace IRaCIS.Application.Services
|
|||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.City), t => t.City.Contains(searchModel.City))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Country), t => t.Country.Contains(searchModel.Country))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(searchModel.Province), t => t.Province.Contains(searchModel.Province))
|
||||
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||
.ProjectTo<SiteSelectDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
|
||||
return await siteQueryable.ToPagedListAsync(searchModel.PageIndex, searchModel.PageSize, string.IsNullOrWhiteSpace(searchModel.SortField) ? "SiteName" : searchModel.SortField, searchModel.Asc);
|
||||
|
@ -72,6 +75,18 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var site = await _siteRepository.InsertOrUpdateAsync(siteCommand, true, exp);
|
||||
|
||||
//手动解绑医院与site的关系
|
||||
if (siteCommand.HospitalId == null && site.HospitalId != null)
|
||||
{
|
||||
await _hospitalRepository.BatchUpdateNoTrackingAsync(t => t.Id == site.HospitalId, u => new Hospital() { SiteId = null });
|
||||
}
|
||||
|
||||
//手动绑
|
||||
if (siteCommand.HospitalId != null)
|
||||
{
|
||||
await _hospitalRepository.BatchUpdateNoTrackingAsync(t => t.Id == siteCommand.HospitalId, u => new Hospital() { SiteId = site.Id });
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(site.Id.ToString());
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static IRaCIS.Core.Domain.Models.ReadingQuestionTrial;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
|
@ -1044,7 +1045,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public List<string> RelevanceValueList { get; set; }
|
||||
public List<CalculateInfo> CalculateQuestionList { get; set; }
|
||||
|
||||
}
|
||||
public AssessmentResultType AssessmentResultEnum { get; set; }
|
||||
}
|
||||
|
||||
public class ReadingQuestionSystemView
|
||||
{
|
||||
|
@ -1984,7 +1986,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public List<string> ParentTriggerValueList { get; set; }
|
||||
public List<string> RelevanceValueList { get; set; }
|
||||
|
||||
}
|
||||
public AssessmentResultType AssessmentResultEnum { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class GetSystemCriterionSelectDto
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
[JsonIgnore]
|
||||
public List<TrialEmailNoticeUser> TrialEmailNoticeUserList { get; set; } = new List<TrialEmailNoticeUser>();
|
||||
|
||||
[JsonIgnore]
|
||||
public List<TrialEmailBlackUser> TrialEmailBlackUserList { get; set; } = new List<TrialEmailBlackUser>();
|
||||
|
||||
|
||||
|
|
|
@ -266,7 +266,11 @@ namespace IRaCIS.Core.Domain.Models
|
|||
/// </summary>
|
||||
public Guid? GroupId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
|
||||
|
||||
public AssessmentResultType AssessmentResultEnum { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("GroupId")]
|
||||
public ReadingQuestionTrial GroupInfo { get; set; }
|
||||
|
||||
|
@ -290,7 +294,17 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public List<ReadingTableQuestionTrial> ReadingTableQuestionTrialList { get; set; }
|
||||
|
||||
|
||||
[NotMapped]
|
||||
public enum AssessmentResultType
|
||||
{
|
||||
//没有特殊标记
|
||||
None=0,
|
||||
|
||||
//评估结果
|
||||
AssessmentResult = 1,
|
||||
}
|
||||
|
||||
|
||||
[NotMapped]
|
||||
public List<string> ParentTriggerValueList
|
||||
{
|
||||
get
|
||||
|
|
|
@ -74,7 +74,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public ReadingQuestionTrial ReadingQuestionTrial { get; set; }
|
||||
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("ReadingQuestionCriterionTrialId")]
|
||||
public ReadingQuestionCriterionTrial ReadingQuestionCriterionTrial { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue