修改项目部位
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
9d0c3d3fc5
commit
facd9e0e5f
|
@ -20,6 +20,7 @@ using IRaCIS.Core.Application.Service;
|
|||
using DocumentFormat.OpenXml.Office.CustomUI;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using SixLabors.ImageSharp.Formats.Tiff.Compression.Decompressors;
|
||||
|
||||
namespace IRaCIS.Core.Application
|
||||
{
|
||||
|
@ -946,10 +947,13 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
|
||||
|
||||
trialConfig.Modalitys = $"|{String.Join('|', trialConfig.ModalityList)}|";
|
||||
trialConfig.Modalitys = $"{String.Join('|', trialConfig.ModalityList)}";
|
||||
_mapper.Map(trialConfig, trialInfo);
|
||||
trialInfo.UpdateTime = DateTime.Now;
|
||||
|
||||
|
||||
await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialConfig.TrialId && t.IsSigned == false, u => new ReadingQuestionCriterionTrial() { CriterionModalitys = trialConfig.Modalitys });
|
||||
|
||||
return ResponseOutput.Ok(await _repository.SaveChangesAsync());
|
||||
}
|
||||
|
||||
|
@ -1034,6 +1038,7 @@ namespace IRaCIS.Core.Application
|
|||
if (trialConfig.TrialCriterionIds.Contains(item.Id))
|
||||
{
|
||||
item.IsConfirm = true;
|
||||
item.CriterionModalitys = trialInfo.Modalitys;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1310,7 +1315,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
public async Task<IResponseOutput<List<TrialBodyPartView>>> GetTrialBodyPartList(Guid trialId)
|
||||
{
|
||||
var list = await _trialRepository.Where(t => t.Id == trialId).SelectMany(t => t.TrialBodyPartList).Select(t=>new TrialBodyPartView() { Code=t.Code,Name=_userInfo.IsEn_Us?t.Name:t.NameCN}).ToListAsync();
|
||||
var list = await _trialRepository.Where(t => t.Id == trialId).SelectMany(t => t.TrialBodyPartList).Select(t => new TrialBodyPartView() { Code = t.Code, Name = _userInfo.IsEn_Us ? t.Name : t.NameCN }).ToListAsync();
|
||||
|
||||
return ResponseOutput.Ok(list);
|
||||
}
|
||||
|
@ -1318,10 +1323,24 @@ namespace IRaCIS.Core.Application
|
|||
public async Task<IResponseOutput> AddOrUpdateTrialBodyPart(AddOrUpdateTrialBodyPartCommand incommand)
|
||||
{
|
||||
|
||||
var codeList = await _repository.Where<TrialBodyPart>(t => t.TrialId == incommand.TrialId).Select(t => t.Code).ToListAsync();
|
||||
|
||||
|
||||
var newString = incommand.Code;
|
||||
// 检查字符串是否在集合中存在,如果存在,则在后面加上一个数字
|
||||
int count = 1;
|
||||
while (codeList.Contains(newString))
|
||||
{
|
||||
newString = $"{newString}{count}";
|
||||
count++;
|
||||
}
|
||||
|
||||
incommand.Code = newString;
|
||||
|
||||
var exp = new EntityVerifyExp<TrialBodyPart>()
|
||||
{
|
||||
VerifyExp = t => (t.Name.Equals(incommand.Name) || t.NameCN.Equals(incommand.NameCN)),
|
||||
|
||||
VerifyExp = t => (_userInfo.IsEn_Us ? t.Name.Equals(incommand.Name) : t.NameCN.Equals(incommand.NameCN)) && t.TrialId == incommand.TrialId,
|
||||
|
||||
VerifyMsg = _localizer["TrialBodyPart_DupName"]
|
||||
};
|
||||
|
||||
|
@ -1329,7 +1348,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
|
||||
return ResponseOutput.Ok(cro.Id.ToString(),ApiResponseCodeEnum.NeedTips);
|
||||
return ResponseOutput.Ok(cro.Id.ToString(), ApiResponseCodeEnum.NeedTips);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue