Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
1f04bdb57a
|
@ -57,9 +57,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UpdateConfig": {
|
"IRaCISImageStore": {
|
||||||
"test": "123456",
|
"SwitchingMode": "RemainingDiskCapacity",
|
||||||
"test1": "12345678"
|
"SwitchingRatio": 80,
|
||||||
|
"NotificationEmail": "872297557@qq.com"
|
||||||
},
|
},
|
||||||
"IRaCISBasicConfig": {
|
"IRaCISBasicConfig": {
|
||||||
"DoctorCodePrefix": "RE",
|
"DoctorCodePrefix": "RE",
|
||||||
|
|
|
@ -16,6 +16,7 @@ using System.Text.Json.Nodes;
|
||||||
using System.Text.Encodings.Web;
|
using System.Text.Encodings.Web;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.Common
|
namespace IRaCIS.Core.Application.Service.Common
|
||||||
{
|
{
|
||||||
|
@ -44,136 +45,95 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public string GetBestStoreDisk()
|
public string GetBestStoreDisk()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var json = File.ReadAllText("appsettings.json");
|
||||||
|
|
||||||
|
JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load });
|
||||||
|
|
||||||
|
int switchingRatio = 80;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
switchingRatio = (int)jsonObject["IRaCISImageStore"]["SwitchingRatio"];
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw new BusinessValidationFailedException("解析Json文件配置出现问题");
|
||||||
|
}
|
||||||
|
|
||||||
//默认存储的路径
|
//默认存储的路径
|
||||||
var defaultStoreRootFolder = Path.Combine((Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))).IfNullThrowException().FullName, StaticData.Folder.IRaCISDataFolder);
|
var defaultStoreRootFolder = Path.Combine((Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))).IfNullThrowException().FullName, StaticData.Folder.IRaCISDataFolder);
|
||||||
|
|
||||||
|
|
||||||
|
DriveInfo defaultDrive = new DriveInfo(Path.GetPathRoot(defaultStoreRootFolder));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var drives = DriveInfo.GetDrives().Where(t => !t.Name.Contains("C") && !t.Name.Contains("c"))
|
var drives = DriveInfo.GetDrives().Where(t => !t.Name.Contains("C") && !t.Name.Contains("c"))
|
||||||
.Where(d => d.DriveType == DriveType.Fixed && d.IsReady)
|
.Where(d => d.DriveType == DriveType.Fixed && d.IsReady)
|
||||||
|
//剩余空间最多的
|
||||||
.OrderByDescending(d => d.AvailableFreeSpace)
|
.OrderByDescending(d => d.AvailableFreeSpace)
|
||||||
|
|
||||||
|
//存储空间相同,则按照按照总空间从大到小排序
|
||||||
.ThenByDescending(d => d.TotalSize - d.TotalFreeSpace);
|
.ThenByDescending(d => d.TotalSize - d.TotalFreeSpace);
|
||||||
|
|
||||||
var bestDrive = drives.FirstOrDefault();
|
var bestDrive = drives.FirstOrDefault();
|
||||||
var bestStoreRootFolder = string.Empty;
|
var bestStoreRootFolder = string.Empty;
|
||||||
|
|
||||||
//仅仅只有C 盘
|
//仅仅只有C 盘
|
||||||
if (bestDrive == null)
|
if (bestDrive == null || ((double)(defaultDrive.TotalSize - defaultDrive.TotalFreeSpace) / defaultDrive.TotalSize) * 100 < switchingRatio)
|
||||||
{
|
{
|
||||||
bestStoreRootFolder = defaultStoreRootFolder;
|
bestStoreRootFolder = defaultStoreRootFolder;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bestStoreRootFolder = drives.FirstOrDefault()?.Name + _hostEnvironment.EnvironmentName;
|
bestStoreRootFolder = Path.Combine(drives.FirstOrDefault()?.Name, _hostEnvironment.EnvironmentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
DriveInfo drive = new DriveInfo(Path.GetPathRoot(defaultStoreRootFolder));
|
|
||||||
|
//找到最优驱动器
|
||||||
|
DriveInfo drive = new DriveInfo(Path.GetPathRoot(bestStoreRootFolder));
|
||||||
|
|
||||||
//最优盘符使用率超过百分之80
|
//最优盘符使用率超过百分之80
|
||||||
if (((double)(drive.TotalSize - drive.TotalFreeSpace) / drive.TotalSize) * 100 > 80)
|
if (((double)(drive.TotalSize - drive.TotalFreeSpace) / drive.TotalSize) * 100 > switchingRatio)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Directory.Exists(bestStoreRootFolder))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(bestStoreRootFolder);
|
||||||
|
}
|
||||||
|
|
||||||
return bestStoreRootFolder;
|
return bestStoreRootFolder;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public class GeneralRule
|
||||||
|
{
|
||||||
|
public string Endpoint { get; set; }
|
||||||
|
public string Period { get; set; }
|
||||||
|
public int Limit { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void UpdateAppSettings(string key, string newValue)
|
public void UpdateAppSettings(string key, string newValue)
|
||||||
{
|
{
|
||||||
|
|
||||||
#region NewtonSoftJson
|
|
||||||
//// 读取 JSON 文件
|
|
||||||
//string jsonFilePath = "appsettings.json";
|
|
||||||
//string jsonString = File.ReadAllText(jsonFilePath);
|
|
||||||
|
|
||||||
//// 解析 JSON 文件
|
|
||||||
//var jObject = JsonConvert.DeserializeObject<JObject>(jsonString);
|
|
||||||
|
|
||||||
//// 更新或添加配置项
|
|
||||||
//jObject[key] = newValue;
|
|
||||||
|
|
||||||
//// 将更新后的 JSON 字符串写入文件
|
|
||||||
//using var streamWriter = new StreamWriter(jsonFilePath);
|
|
||||||
//using var jsonTextWriter = new JsonTextWriter(streamWriter);
|
|
||||||
//jsonTextWriter.Formatting = Formatting.Indented;
|
|
||||||
//jObject.WriteTo(jsonTextWriter);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region test
|
|
||||||
//var json = File.ReadAllText("appsettings.json");
|
|
||||||
//var jObject = JToken.Parse(json, new JsonLoadSettings { CommentHandling = CommentHandling.Load,DuplicatePropertyNameHandling=DuplicatePropertyNameHandling.Ignore });
|
|
||||||
|
|
||||||
//// Update or add the property
|
|
||||||
//jObject[key] = newValue;
|
|
||||||
|
|
||||||
//// Preserve comments
|
|
||||||
//var settings = new JsonSerializerSettings
|
|
||||||
//{
|
|
||||||
// PreserveReferencesHandling = PreserveReferencesHandling.Objects,
|
|
||||||
// Formatting = Formatting.Indented,
|
|
||||||
// StringEscapeHandling = StringEscapeHandling.Default,
|
|
||||||
|
|
||||||
//};
|
|
||||||
//var updatedJson = JsonConvert.SerializeObject(jObject, settings);
|
|
||||||
//File.WriteAllText("appsettings.json", updatedJson);
|
|
||||||
|
|
||||||
|
|
||||||
|
List<GeneralRule> generalRules = new List<GeneralRule>()
|
||||||
//var json = File.ReadAllText("appsettings.json");
|
{
|
||||||
//var jToken = JToken.Parse(json);
|
new GeneralRule() { Endpoint = "*", Period = "1s", Limit = 3 },
|
||||||
|
new GeneralRule() { Endpoint = "*", Period = "15m", Limit = 100 },
|
||||||
//// Update or add the property
|
new GeneralRule() { Endpoint = "*", Period = "12h", Limit = 1000 },
|
||||||
//jToken[key] = newValue;
|
new GeneralRule() { Endpoint = "*", Period = "7d", Limit = 10000 }
|
||||||
|
};
|
||||||
//// Preserve comments
|
|
||||||
//var settings = new JsonSerializerSettings
|
|
||||||
//{
|
|
||||||
// TypeNameHandling = TypeNameHandling.All,
|
|
||||||
// PreserveReferencesHandling = PreserveReferencesHandling.Objects,
|
|
||||||
// Formatting = Formatting.Indented,
|
|
||||||
// StringEscapeHandling = StringEscapeHandling.Default
|
|
||||||
//};
|
|
||||||
//var updatedJson = JsonConvert.SerializeObject(jToken, settings);
|
|
||||||
//File.WriteAllText("appsettings.json", updatedJson);
|
|
||||||
|
|
||||||
|
|
||||||
//string json = @"{
|
|
||||||
// // This is a comment
|
|
||||||
// ""Name"": ""John Smith"",
|
|
||||||
// ""Age"": 30,
|
|
||||||
// ""Address"": {
|
|
||||||
// // This is another comment
|
|
||||||
// ""Street"": ""123 Main St"",
|
|
||||||
// ""City"": ""Anytown"",
|
|
||||||
// ""State"": ""CA"",
|
|
||||||
// ""Zip"": ""12345""
|
|
||||||
// }
|
|
||||||
//}";
|
|
||||||
|
|
||||||
//// 使用 Json.NET 库解析 JSON 字符串
|
|
||||||
//JObject jObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load });
|
|
||||||
|
|
||||||
//// 修改属性
|
|
||||||
//jObject["Name"] = "Jane Smith";
|
|
||||||
|
|
||||||
//// 将修改后的 JObject 对象序列化为 JSON 字符串并保留注释
|
|
||||||
//string newJson = jObject.ToString(Newtonsoft.Json.Formatting.Indented);
|
|
||||||
|
|
||||||
//// 打印修改后的 JSON 字符串
|
|
||||||
//Console.WriteLine(newJson);
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
// 读取 Json 文件
|
// 读取 Json 文件
|
||||||
string jsonFilePath = "appsettings.json";
|
string jsonFilePath = "appsettings.json";
|
||||||
|
@ -181,37 +141,17 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
var json = File.ReadAllText("appsettings.json");
|
var json = File.ReadAllText("appsettings.json");
|
||||||
|
|
||||||
JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load });
|
JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load });
|
||||||
// 获取 UpdateConfig 属性所在的节点
|
|
||||||
JToken updateConfigNode = jsonObject.SelectToken("UpdateConfig");
|
|
||||||
|
|
||||||
JProperty updateConfigProperty = (JProperty)updateConfigNode.Parent;
|
|
||||||
JObject updateConfigParent = (JObject)updateConfigProperty.Value;
|
|
||||||
|
|
||||||
// 向 updateConfigParent 添加或者属性
|
// 操作UpdateConfig对象
|
||||||
updateConfigParent[key] = newValue;
|
jsonObject["UpdateConfig"][key] = newValue;
|
||||||
|
|
||||||
|
jsonObject["UpdateConfig"]["testArray"] = JArray.FromObject(generalRules);
|
||||||
|
|
||||||
// 将更改保存回 Json 文件
|
// 将更改保存回 Json 文件
|
||||||
File.WriteAllText(jsonFilePath, jsonObject.ToString());
|
File.WriteAllText(jsonFilePath, jsonObject.ToString());
|
||||||
|
|
||||||
//using (var reader = new JsonTextReader(new StringReader(json)))
|
|
||||||
//using (var writer = new JsonTextWriter(new StreamWriter("appsettings.json")))
|
|
||||||
//{
|
|
||||||
// while (reader.Read())
|
|
||||||
// {
|
|
||||||
// if (reader.TokenType == JsonToken.PropertyName && (string)reader.Value == key)
|
|
||||||
// {
|
|
||||||
// // Write the updated property value
|
|
||||||
// writer.WritePropertyName(key);
|
|
||||||
// writer.WriteValue(newValue);
|
|
||||||
// reader.Read();
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Write all other tokens
|
|
||||||
// writer.WriteToken(reader.TokenType, reader.Value);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -425,8 +425,10 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? ReadingInfoSignTime { get; set; }
|
public DateTime? ReadingInfoSignTime { get; set; }
|
||||||
|
|
||||||
public bool IsSign {
|
public bool IsSign
|
||||||
get {
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
return this.ReadingInfoSignTime != null;
|
return this.ReadingInfoSignTime != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -479,6 +481,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public bool IsAutoCreate { get; set; }
|
public bool IsAutoCreate { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public List<TrialCriterionAdditionalAssessmentType> TrialCriterionAdditionalAssessmentTypeList { get; set; } = new List<TrialCriterionAdditionalAssessmentType>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -935,6 +940,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsOncologyReading { get; set; }
|
public bool IsOncologyReading { get; set; }
|
||||||
|
|
||||||
|
public List<AddOrUpdateTrialCriterionAdditional> TrialCriterionAdditionalAssessmentTypeList { get; set; }=new List<AddOrUpdateTrialCriterionAdditional>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SignConfirmDTO
|
public class SignConfirmDTO
|
||||||
|
|
|
@ -19,6 +19,7 @@ using static IRaCIS.Core.Domain.Share.StaticData;
|
||||||
using IRaCIS.Core.Application.Service;
|
using IRaCIS.Core.Application.Service;
|
||||||
using DocumentFormat.OpenXml.Office.CustomUI;
|
using DocumentFormat.OpenXml.Office.CustomUI;
|
||||||
using IRaCIS.Core.Application.Service;
|
using IRaCIS.Core.Application.Service;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application
|
namespace IRaCIS.Core.Application
|
||||||
{
|
{
|
||||||
|
@ -181,8 +182,6 @@ namespace IRaCIS.Core.Application
|
||||||
public async Task<GetTrialReadingInfoOutDto> GetCriterionReadingInfo(GetTrialReadingInfoInDto inDto)
|
public async Task<GetTrialReadingInfoOutDto> GetCriterionReadingInfo(GetTrialReadingInfoInDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GetTrialReadingInfoOutDto trialInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).ProjectTo<GetTrialReadingInfoOutDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
GetTrialReadingInfoOutDto trialInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).ProjectTo<GetTrialReadingInfoOutDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||||
|
|
||||||
if (trialInfo.ReadingTool == null)
|
if (trialInfo.ReadingTool == null)
|
||||||
|
@ -190,6 +189,9 @@ namespace IRaCIS.Core.Application
|
||||||
trialInfo.ReadingTool = ReadingTool.Dicom;
|
trialInfo.ReadingTool = ReadingTool.Dicom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trialInfo.TrialCriterionAdditionalAssessmentTypeList = await _trialCriterionAdditionalAssessmentTypeRepository.Where(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
return trialInfo;
|
return trialInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,6 +211,28 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
if (trialCriterion.SynchronizeOriginalTime == null)
|
if (trialCriterion.SynchronizeOriginalTime == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//同步附加评估类型
|
||||||
|
|
||||||
|
if (!await _trialCriterionAdditionalAssessmentTypeRepository.AnyAsync(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||||
|
{
|
||||||
|
AdditionalAssessment additional = new AdditionalAssessment();
|
||||||
|
var addList = additional.GetSystemDefeaultAdditionalAssessmentList(trialCriterion.CriterionType);
|
||||||
|
|
||||||
|
foreach (var addItem in addList)
|
||||||
|
{
|
||||||
|
await _trialCriterionAdditionalAssessmentTypeRepository.AddAsync(new TrialCriterionAdditionalAssessmentType()
|
||||||
|
{
|
||||||
|
CriterionType = trialCriterion.CriterionType,
|
||||||
|
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
|
||||||
|
AdditionalAssessmentType = addItem.AdditionalAssessmentType
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 同步器官
|
// 同步器官
|
||||||
await _iOrganInfoService.SynchronizeSystemOrganToTrial(new SynchronizeSystemOrganToTrialInDto()
|
await _iOrganInfoService.SynchronizeSystemOrganToTrial(new SynchronizeSystemOrganToTrialInDto()
|
||||||
{
|
{
|
||||||
|
@ -576,26 +600,70 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//判断是否存在附加评估,存在,就将标准对应的附加评估选项加进去
|
//判断是否存在附加评估
|
||||||
if (inDto.IsAdditionalAssessment)
|
if (inDto.IsAdditionalAssessment)
|
||||||
{
|
{
|
||||||
if (!await _trialCriterionAdditionalAssessmentTypeRepository.AnyAsync(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
#region 存在,就将标准对应的附加评估选项加进去--废弃 修改到同步标准的地方去了,不管存在附加评估与否,都增加附加评估类型
|
||||||
{
|
//if (!await _trialCriterionAdditionalAssessmentTypeRepository.AnyAsync(t => t.TrialReadingCriterionId == inDto.TrialReadingCriterionId))
|
||||||
AdditionalAssessment additional = new AdditionalAssessment();
|
//{
|
||||||
var addList = additional.GetSystemDefeaultAdditionalAssessmentList(inDto.CriterionType);
|
// AdditionalAssessment additional = new AdditionalAssessment();
|
||||||
|
// var addList = additional.GetSystemDefeaultAdditionalAssessmentList(inDto.CriterionType);
|
||||||
|
|
||||||
foreach (var addItem in addList)
|
// foreach (var addItem in addList)
|
||||||
|
// {
|
||||||
|
// await _trialCriterionAdditionalAssessmentTypeRepository.AddAsync(new TrialCriterionAdditionalAssessmentType()
|
||||||
|
// {
|
||||||
|
// CriterionType = inDto.CriterionType,
|
||||||
|
// TrialReadingCriterionId = inDto.TrialReadingCriterionId,
|
||||||
|
// AdditionalAssessmentType = addItem.AdditionalAssessmentType
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
if (inDto.TrialCriterionAdditionalAssessmentTypeList.All(t => t.IsSelected != true))
|
||||||
{
|
{
|
||||||
await _trialCriterionAdditionalAssessmentTypeRepository.AddAsync(new TrialCriterionAdditionalAssessmentType()
|
throw new BusinessValidationFailedException("选择了附加评估,必须勾选附加评估类型");
|
||||||
|
}
|
||||||
|
|
||||||
|
var trialId = _readingQuestionTrialRepository.Where(t => t.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).Select(t => t.TrialId).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
|
if (inDto.TrialCriterionAdditionalAssessmentTypeList.Count != 0)
|
||||||
{
|
{
|
||||||
CriterionType = inDto.CriterionType,
|
foreach (var updateItem in inDto.TrialCriterionAdditionalAssessmentTypeList)
|
||||||
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
|
{
|
||||||
AdditionalAssessmentType = addItem.AdditionalAssessmentType
|
if (updateItem.IsSelected == true)
|
||||||
});
|
{
|
||||||
|
//添加默认问题
|
||||||
|
AdditionalAssessment additional = new AdditionalAssessment();
|
||||||
|
var addTypeList = additional.GetSystemDefeaultAdditionalAssessmentList(updateItem.CriterionType, updateItem.AdditionalAssessmentType);
|
||||||
|
|
||||||
|
foreach (var addType in addTypeList)
|
||||||
|
{
|
||||||
|
foreach (var question in addType.AdditionalQuestionList)
|
||||||
|
{
|
||||||
|
question.ReadingQuestionCriterionTrialId = updateItem.TrialReadingCriterionId;
|
||||||
|
question.TrialId = trialId;
|
||||||
|
|
||||||
|
await _readingQuestionTrialRepository.AddAsync(question);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
//删除附加问题
|
||||||
|
|
||||||
|
await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(t => t.ReadingQuestionCriterionTrialId == updateItem.TrialReadingCriterionId && t.IsAdditional == true);
|
||||||
|
}
|
||||||
|
|
||||||
|
await _trialCriterionAdditionalAssessmentTypeRepository.UpdatePartialFromQueryAsync(updateItem.Id, t => new TrialCriterionAdditionalAssessmentType() { IsSelected = updateItem.IsSelected });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
//删除附加问题
|
//删除附加问题
|
||||||
await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(t => t.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId && t.IsAdditional == true);
|
await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(t => t.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId && t.IsAdditional == true);
|
||||||
|
@ -612,6 +680,7 @@ namespace IRaCIS.Core.Application
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="trialReadingCriterionId"></param>
|
/// <param name="trialReadingCriterionId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[Obsolete]
|
||||||
public async Task<List<TrialCriterionAdditionalAssessmentType>> GetTrialCriterionAdditionalAssessmentOptionList(Guid trialReadingCriterionId)
|
public async Task<List<TrialCriterionAdditionalAssessmentType>> GetTrialCriterionAdditionalAssessmentOptionList(Guid trialReadingCriterionId)
|
||||||
{
|
{
|
||||||
return await _trialCriterionAdditionalAssessmentTypeRepository.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).ToListAsync();
|
return await _trialCriterionAdditionalAssessmentTypeRepository.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).ToListAsync();
|
||||||
|
@ -623,6 +692,7 @@ namespace IRaCIS.Core.Application
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="updateList"></param>
|
/// <param name="updateList"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[Obsolete]
|
||||||
public async Task<IResponseOutput> SetTrialCriterionAdditionalAssessment(List<AddOrUpdateTrialCriterionAdditional> updateList)
|
public async Task<IResponseOutput> SetTrialCriterionAdditionalAssessment(List<AddOrUpdateTrialCriterionAdditional> updateList)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -632,6 +702,7 @@ namespace IRaCIS.Core.Application
|
||||||
}
|
}
|
||||||
|
|
||||||
var trialId = _readingQuestionTrialRepository.Where(t => t.ReadingQuestionCriterionTrialId == updateList.First().TrialReadingCriterionId).Select(t => t.TrialId).FirstOrDefault();
|
var trialId = _readingQuestionTrialRepository.Where(t => t.ReadingQuestionCriterionTrialId == updateList.First().TrialReadingCriterionId).Select(t => t.TrialId).FirstOrDefault();
|
||||||
|
|
||||||
foreach (var updateItem in updateList)
|
foreach (var updateItem in updateList)
|
||||||
{
|
{
|
||||||
if (updateItem.IsSelected == true)
|
if (updateItem.IsSelected == true)
|
||||||
|
|
Loading…
Reference in New Issue