代码修改
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user