字典处理
This commit is contained in:
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using Castle.Core.Internal;
|
||||
using IRaCIS.Core.Infra.EFCore.Dto;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
@@ -26,6 +27,17 @@ namespace IRaCIS.Core.Application.Service
|
||||
_frontAuditConfigRepository = frontAuditConfigRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 翻译稽查数据
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<string>> SetDictionaryValue(SetDictionaryValueDto dto)
|
||||
{
|
||||
return await _frontAuditConfigRepository.SetDictionaryValue(dto);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取子数据
|
||||
/// </summary>
|
||||
|
||||
@@ -430,8 +430,8 @@ namespace IRaCIS.Core.Application.Services
|
||||
SiteId = dicomStudy.SiteId,
|
||||
TrialId = dicomStudy.TrialId,
|
||||
SubjectId = dicomStudy.SubjectId,
|
||||
IsDeleted=false,
|
||||
IsReading=false,
|
||||
IsDeleted=true,
|
||||
IsReading= true,
|
||||
SubjectVisitId = dicomStudy.SubjectVisitId,
|
||||
|
||||
InstanceCount = 0
|
||||
|
||||
@@ -363,6 +363,11 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
||||
|
||||
public decimal? VisitNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 父标识
|
||||
/// </summary>
|
||||
public string ParentIdentification { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Service.Inspection.DTO;
|
||||
using IRaCIS.Core.Application.Service.Inspection.Interface;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore.Dto;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
@@ -29,6 +30,9 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||
this._dataInspectionRepository = dataInspectionRepository;
|
||||
this._frontAuditConfigRepository = frontAuditConfigRepository;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionData(GetDataInspectionDto dto)
|
||||
{
|
||||
//_repository.GetQueryable.GetQueryable < DataInspection >
|
||||
@@ -84,7 +88,8 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||
} into frontAuditConfigtemp
|
||||
from leftfrontAuditConfig in frontAuditConfigtemp.DefaultIfEmpty()
|
||||
|
||||
|
||||
|
||||
|
||||
join moduleTypec in _repository.GetQueryable<Dictionary>() on new { ModuleType = leftfrontAuditConfig.ModuleTypeId } equals new { ModuleType = moduleTypec.Id.ToString() } into moduleTypectemp
|
||||
from leftmoduleTypec in moduleTypectemp.DefaultIfEmpty()
|
||||
|
||||
@@ -134,7 +139,8 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||
ModuleTypeName= leftmoduleTypec.ValueCN,
|
||||
SignText= lefttrialSign.SignText,
|
||||
Identification= leftfrontAuditConfig.Identification,
|
||||
OptType= leftOptType.Value,
|
||||
ParentIdentification = leftparent.Identification,
|
||||
OptType = leftOptType.Value,
|
||||
VisitNum=leftsubjectVisit.VisitNum,
|
||||
IsFrontAdd=data.IsFrontAdd
|
||||
|
||||
@@ -292,7 +298,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||
{
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
await SetEnum(addDto);
|
||||
//await SetEnum(addDto);
|
||||
var add = _mapper.Map<DataInspection>(addDto);
|
||||
await SetInspectionNameValue(add);
|
||||
Guid? parentId = null;
|
||||
@@ -395,114 +401,113 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理枚举
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
///// <summary>
|
||||
///// 处理枚举
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//public async Task SetEnum(DataInspectionAddDTO Data)
|
||||
//{
|
||||
// //Data.JsonDetail= await _dataInspectionRepository.SetEnum(Data.TrialId.Value, Data.Identification, Data.JsonDetail);
|
||||
// #region 枚举
|
||||
// //try
|
||||
// //{
|
||||
// // var JsonData = JsonConvert.DeserializeObject<IDictionary<string, object>>(Data.JsonDetail);
|
||||
// // foreach (var item in Data.EnumList)
|
||||
// // {
|
||||
// // if (!JsonData.ContainsKey(item.Key))
|
||||
// // {
|
||||
// // continue;
|
||||
// // }
|
||||
// // var value = JsonData[item.Key];
|
||||
// // if (value.GetType() == typeof(JArray))
|
||||
// // {
|
||||
// // JArray arrays = (JArray)value;
|
||||
// // if (item.Type.ToLower() == "id".ToLower())
|
||||
// // {
|
||||
// // List<Guid> guids = new List<Guid>();
|
||||
// // arrays.ForEach(x =>
|
||||
// // {
|
||||
// // guids.Add(Guid.Parse(x.ToString()));
|
||||
// // });
|
||||
// // JsonData[item.Key] = string.Join(',', await _repository.GetQueryable<Dictionary>().Where(x => guids.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync());
|
||||
// // }
|
||||
// // else if (item.Type.ToLower() == "ChildGroup".ToLower())
|
||||
// // {
|
||||
// // List<string> guids = new List<string>();
|
||||
// // arrays.ForEach(x =>
|
||||
// // {
|
||||
// // guids.Add(x.ToString());
|
||||
// // });
|
||||
// // JsonData[item.Key] = string.Join(',', await
|
||||
// // _repository.GetQueryable<Dictionary>().Where(x => x.Code == item.Code).GroupJoin(
|
||||
// // _repository.GetQueryable<Dictionary>().Where(x => guids.Contains(x.ChildGroup)), a => a.Id, b => b.ParentId, (a, b) => new
|
||||
// // {
|
||||
// // parent = b
|
||||
// // }).SelectMany(a => a.parent, (m, n) => new
|
||||
// // {
|
||||
// // value = n.ValueCN
|
||||
// // }).Select(x => x.value).ToListAsync()
|
||||
// // );
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // List<string> guids =new List<string>();
|
||||
// // arrays.ForEach(x =>
|
||||
// // {
|
||||
// // guids.Add(x.ToString());
|
||||
// // });
|
||||
// // JsonData[item.Key] = string.Join(',', await
|
||||
// // _repository.GetQueryable<Dictionary>().Where(x => x.Code == item.Code).GroupJoin(
|
||||
// // _repository.GetQueryable<Dictionary>().Where(x=>guids.Contains(x.Code)), a => a.Id, b => b.ParentId, (a, b) => new
|
||||
// // {
|
||||
// // parent = b
|
||||
// // }).SelectMany(a => a.parent, (m, n) => new
|
||||
// // {
|
||||
// // value = n.ValueCN
|
||||
// // }).Select(x => x.value).ToListAsync()
|
||||
// // );
|
||||
// // }
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // if (item.Type.ToLower() == "id".ToLower())
|
||||
// // {
|
||||
// // Guid guid = Guid.Parse(value.ToString());
|
||||
// // JsonData[item.Key] = await _repository.GetQueryable<Dictionary>().Where(x => guid == x.Id).Select(x => x.ValueCN).FirstOrDefaultAsync();
|
||||
// // }
|
||||
// // else if (item.Type.ToLower() == "ChildGroup".ToLower())
|
||||
// // {
|
||||
// // JsonData[item.Key] = await _repository.GetQueryable<Dictionary>().Where(x => x.Code == item.Code).Join(_repository.GetQueryable<Dictionary>().Where(x => x.ChildGroup == value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new
|
||||
// // {
|
||||
// // value = b.ValueCN
|
||||
// // }).Select(x => x.value).FirstOrDefaultAsync();
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // JsonData[item.Key] = await _repository.GetQueryable<Dictionary>().Where(x=>x.Code==item.Code).Join(_repository.GetQueryable<Dictionary>().Where(x=>x.Code== value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new
|
||||
// // {
|
||||
// // value=b.ValueCN
|
||||
// // }).Select(x=>x.value).FirstOrDefaultAsync();
|
||||
|
||||
public async Task SetEnum(DataInspectionAddDTO Data)
|
||||
{
|
||||
Data.JsonDetail= await _dataInspectionRepository.SetEnum(Data.TrialId.Value, Data.Identification, Data.JsonDetail);
|
||||
#region 枚举
|
||||
//try
|
||||
//{
|
||||
// var JsonData = JsonConvert.DeserializeObject<IDictionary<string, object>>(Data.JsonDetail);
|
||||
// foreach (var item in Data.EnumList)
|
||||
// {
|
||||
// if (!JsonData.ContainsKey(item.Key))
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
// var value = JsonData[item.Key];
|
||||
// if (value.GetType() == typeof(JArray))
|
||||
// {
|
||||
// JArray arrays = (JArray)value;
|
||||
// if (item.Type.ToLower() == "id".ToLower())
|
||||
// {
|
||||
// List<Guid> guids = new List<Guid>();
|
||||
// arrays.ForEach(x =>
|
||||
// {
|
||||
// guids.Add(Guid.Parse(x.ToString()));
|
||||
// });
|
||||
// JsonData[item.Key] = string.Join(',', await _repository.GetQueryable<Dictionary>().Where(x => guids.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync());
|
||||
// }
|
||||
// else if (item.Type.ToLower() == "ChildGroup".ToLower())
|
||||
// {
|
||||
// List<string> guids = new List<string>();
|
||||
// arrays.ForEach(x =>
|
||||
// {
|
||||
// guids.Add(x.ToString());
|
||||
// });
|
||||
// JsonData[item.Key] = string.Join(',', await
|
||||
// _repository.GetQueryable<Dictionary>().Where(x => x.Code == item.Code).GroupJoin(
|
||||
// _repository.GetQueryable<Dictionary>().Where(x => guids.Contains(x.ChildGroup)), a => a.Id, b => b.ParentId, (a, b) => new
|
||||
// {
|
||||
// parent = b
|
||||
// }).SelectMany(a => a.parent, (m, n) => new
|
||||
// {
|
||||
// value = n.ValueCN
|
||||
// }).Select(x => x.value).ToListAsync()
|
||||
// );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// List<string> guids =new List<string>();
|
||||
// arrays.ForEach(x =>
|
||||
// {
|
||||
// guids.Add(x.ToString());
|
||||
// });
|
||||
// JsonData[item.Key] = string.Join(',', await
|
||||
// _repository.GetQueryable<Dictionary>().Where(x => x.Code == item.Code).GroupJoin(
|
||||
// _repository.GetQueryable<Dictionary>().Where(x=>guids.Contains(x.Code)), a => a.Id, b => b.ParentId, (a, b) => new
|
||||
// {
|
||||
// parent = b
|
||||
// }).SelectMany(a => a.parent, (m, n) => new
|
||||
// {
|
||||
// value = n.ValueCN
|
||||
// }).Select(x => x.value).ToListAsync()
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (item.Type.ToLower() == "id".ToLower())
|
||||
// {
|
||||
// Guid guid = Guid.Parse(value.ToString());
|
||||
// JsonData[item.Key] = await _repository.GetQueryable<Dictionary>().Where(x => guid == x.Id).Select(x => x.ValueCN).FirstOrDefaultAsync();
|
||||
// }
|
||||
// else if (item.Type.ToLower() == "ChildGroup".ToLower())
|
||||
// {
|
||||
// JsonData[item.Key] = await _repository.GetQueryable<Dictionary>().Where(x => x.Code == item.Code).Join(_repository.GetQueryable<Dictionary>().Where(x => x.ChildGroup == value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new
|
||||
// {
|
||||
// value = b.ValueCN
|
||||
// }).Select(x => x.value).FirstOrDefaultAsync();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// JsonData[item.Key] = await _repository.GetQueryable<Dictionary>().Where(x=>x.Code==item.Code).Join(_repository.GetQueryable<Dictionary>().Where(x=>x.Code== value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new
|
||||
// {
|
||||
// value=b.ValueCN
|
||||
// }).Select(x=>x.value).FirstOrDefaultAsync();
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // }
|
||||
// // }
|
||||
// // }
|
||||
|
||||
|
||||
|
||||
// Data.JsonDetail = JsonConvert.SerializeObject(JsonData);
|
||||
// // Data.JsonDetail = JsonConvert.SerializeObject(JsonData);
|
||||
|
||||
//}
|
||||
//catch (Exception)
|
||||
//{
|
||||
// //}
|
||||
// //catch (Exception)
|
||||
// //{
|
||||
|
||||
// throw new BusinessValidationFailedException("Json 对象枚举异常");
|
||||
//}
|
||||
// // throw new BusinessValidationFailedException("Json 对象枚举异常");
|
||||
// //}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
// #endregion
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user