代码修改
This commit is contained in:
@@ -1139,7 +1139,7 @@
|
||||
<param name="indto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.DoctorService.UpdateGneralSituation(IRaCIS.Application.Contracts.UpdateGneralSituationDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.DoctorService.AddOrUpdateGneralSituation(IRaCIS.Application.Contracts.SummarizeInfoDto)">
|
||||
<summary>
|
||||
修改概述
|
||||
</summary>
|
||||
@@ -17226,16 +17226,41 @@
|
||||
银行手机号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.UpdateGneralSituationDto.Summarize">
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.DoctorId">
|
||||
<summary>
|
||||
医生Id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.Summarize">
|
||||
<summary>
|
||||
概述
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.UpdateGneralSituationDto.SummarizeEn">
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.SummarizeEn">
|
||||
<summary>
|
||||
概述
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.IsMain">
|
||||
<summary>
|
||||
是否是主模板
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.Indication">
|
||||
<summary>
|
||||
适应症
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.IndicationEn">
|
||||
<summary>
|
||||
适应症
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.TrialId">
|
||||
<summary>
|
||||
项目Id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.EmploymentInfo.WorkPartTime">
|
||||
<summary>
|
||||
工作兼职
|
||||
|
||||
@@ -368,11 +368,15 @@ namespace IRaCIS.Application.Contracts
|
||||
public Guid? TrialId { get; set; }
|
||||
}
|
||||
|
||||
public class UpdateGneralSituationDto
|
||||
public class SummarizeInfoDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 医生Id
|
||||
/// </summary>
|
||||
public Guid DoctorId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 概述
|
||||
@@ -383,6 +387,31 @@ namespace IRaCIS.Application.Contracts
|
||||
/// 概述
|
||||
/// </summary>
|
||||
public string SummarizeEn { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 是否是主模板
|
||||
/// </summary>
|
||||
public bool IsMain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 适应症
|
||||
/// </summary>
|
||||
public string Indication { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 适应症
|
||||
/// </summary>
|
||||
public string IndicationEn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目Id
|
||||
/// </summary>
|
||||
public Guid? TrialId { get; set; }
|
||||
}
|
||||
|
||||
public class UpdateGneralSituationDto
|
||||
{
|
||||
public List<SummarizeInfoDto> SummarizeList { get; set; }
|
||||
}
|
||||
|
||||
public class BasicInfoAndEmploymentDto: DoctorBasicInfoCommand
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using IRaCIS.Application.Contracts;
|
||||
using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.MassTransit.Consumer;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using MassTransit;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MimeKit;
|
||||
@@ -13,7 +15,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class DoctorService(IRepository<Doctor> _doctorRepository,
|
||||
IRepository<DoctorDictionary> _doctorDictionaryRepository,
|
||||
IRepository<DoctorSummarize> _doctorSummarizeRepository,
|
||||
IRepository<Enroll> _enrollRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<Attachment> _attachmentRepository,
|
||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||
IRepository<DoctorCriterionFile> _doctorCriterionFileRepository,
|
||||
@@ -218,29 +222,27 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<bool> UpdateGneralSituation(UpdateGneralSituationDto inDto)
|
||||
public async Task<DoctorSummarize> AddOrUpdateGneralSituation(SummarizeInfoDto inDto)
|
||||
{
|
||||
if (inDto.TrialId != null)
|
||||
{
|
||||
await _doctorRepository.UpdatePartialFromQueryAsync(x => x.DoctorId == inDto.Id&&x.TrialId==inDto.TrialId.Value, x => new Doctor()
|
||||
var systemCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == null).CountAsync();
|
||||
if (systemCount == 0)
|
||||
{
|
||||
Summarize = inDto.Summarize,
|
||||
SummarizeEn = inDto.SummarizeEn,
|
||||
});
|
||||
|
||||
var trialinfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).FirstNotNullAsync();
|
||||
var dictionery = await _dictionaryRepository.Where(x => x.Parent.Code == "Indication" && x.Code == trialinfo.IndicationEnum.ToString()).FirstNotNullAsync();
|
||||
inDto.IndicationEn = dictionery.Value;
|
||||
inDto.Indication = dictionery.ValueCN;
|
||||
var system= inDto.Clone();
|
||||
system.TrialId = null;
|
||||
system.IsMain = true;
|
||||
await _doctorSummarizeRepository.InsertOrUpdateAsync(system, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await _doctorRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new Doctor()
|
||||
{
|
||||
Summarize = inDto.Summarize,
|
||||
SummarizeEn = inDto.SummarizeEn,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var success= await _doctorRepository.SaveChangesAsync();
|
||||
return success;
|
||||
|
||||
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(inDto, true);
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
||||
@@ -249,10 +251,10 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<UpdateGneralSituationDto?> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
|
||||
public async Task<UpdateGneralSituationDto> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
|
||||
{
|
||||
var doctorBasicInfo = (await _doctorRepository.Where(t => t.Id == inDto.DoctorId)
|
||||
.ProjectTo<UpdateGneralSituationDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
var result = await _doctorSummarizeRepository.Where(t => t.Id == inDto.DoctorId && t.TrialId == inDto.TrialId)
|
||||
.ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
if (inDto.TrialId != null)
|
||||
{
|
||||
var doctorInfo = await trialExperienceService.GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
|
||||
@@ -261,15 +263,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
DoctorId = inDto.DoctorId,
|
||||
});
|
||||
|
||||
doctorBasicInfo = new UpdateGneralSituationDto()
|
||||
{
|
||||
Summarize = doctorInfo.Summarize,
|
||||
SummarizeEn = doctorInfo.SummarizeEn,
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
return doctorBasicInfo;
|
||||
|
||||
return new UpdateGneralSituationDto() {
|
||||
SummarizeList= result
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
public class TrialExperienceService(IRepository<TrialExperience> _trialExperienceRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<DoctorSummarize> _doctorSummarizeRepository,
|
||||
IRepository<TrialExperienceCriteria> _trialExperienceCriteriaRepository,
|
||||
IRepository<Attachment> _attachmentRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialExperienceService
|
||||
{
|
||||
@@ -85,10 +86,25 @@ namespace IRaCIS.Core.Application.Service
|
||||
TrialId = inDto.TrialId,
|
||||
OtherClinicalExperience = systemInfoDcotor.OtherClinicalExperience,
|
||||
OtherClinicalExperienceCN = systemInfoDcotor.OtherClinicalExperienceCN,
|
||||
Summarize = systemInfoDcotor.Summarize,
|
||||
SummarizeEn = systemInfoDcotor.SummarizeEn,
|
||||
};
|
||||
|
||||
///没有就加
|
||||
var summarizeCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId).CountAsync();
|
||||
if (summarizeCount == 0)
|
||||
{
|
||||
var main = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.IsMain && x.TrialId == null).ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
if (main != null)
|
||||
{
|
||||
main.Id=null;
|
||||
main.TrialId = inDto.TrialId;
|
||||
main.IsMain = false;
|
||||
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(main, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
doctorInfo = await _doctorRepository.AddAsync(doctor, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
CreateMap<Doctor, PaymentModeDto>();
|
||||
|
||||
CreateMap<DoctorSummarize, SummarizeInfoDto>();
|
||||
CreateMap<SummarizeInfoDto, DoctorSummarize>();
|
||||
|
||||
CreateMap<PaymentModeDto, Doctor>();
|
||||
|
||||
CreateMap<Doctor, TrialExperienceModel>();
|
||||
|
||||
Reference in New Issue
Block a user